Follow-up from #298 and PR #300.
Problem
#298 published the per-construct stability table (docs/language/stability.md)
and a guard test that checks every metadata keyword and supported g: directive
is mentioned in the doc. The tiers themselves (stable/partial/planned/
deprecated) live only in prose, so nothing asserts a construct's tier is correct,
and top-level blocks and endpoint forms are not cross-checked. The diagnostics
registry already models Stability in code (internal/diagnostics/registry.go);
the language constructs do not.
Relevant code:
docs/language/stability.md: the prose table
internal/lang/stability_doc_test.go: presence-only guard
internal/diagnostics/registry.go: the Stability precedent
lang.MetadataKeywords, view.SupportedDirectiveNames
Scope
Add a code-level construct stability registry (construct name -> tier), covering
blocks, metadata keywords, g: directives, and endpoint forms. Generate or
verify docs/language/stability.md from it so the doc cannot disagree with the
registry, and expose tiers through tooling (for example gowdk explain or a
docs command). Extend the guard to assert tiers, not just presence.
Acceptance Criteria
- A code registry assigns a tier to every block, keyword, directive, and
endpoint form.
- The published table is verified against (or generated from) the registry.
- Planned/deprecated constructs link to the diagnostic code emitted on use.
- A test fails when a registry construct is missing from the table or its tier
disagrees.
Verification
go test ./internal/lang ./internal/diagnostics ./internal/view
Follow-up from #298 and PR #300.
Problem
#298 published the per-construct stability table (
docs/language/stability.md)and a guard test that checks every metadata keyword and supported
g:directiveis mentioned in the doc. The tiers themselves (stable/partial/planned/
deprecated) live only in prose, so nothing asserts a construct's tier is correct,
and top-level blocks and endpoint forms are not cross-checked. The diagnostics
registry already models
Stabilityin code (internal/diagnostics/registry.go);the language constructs do not.
Relevant code:
docs/language/stability.md: the prose tableinternal/lang/stability_doc_test.go: presence-only guardinternal/diagnostics/registry.go: theStabilityprecedentlang.MetadataKeywords,view.SupportedDirectiveNamesScope
Add a code-level construct stability registry (construct name -> tier), covering
blocks, metadata keywords,
g:directives, and endpoint forms. Generate orverify
docs/language/stability.mdfrom it so the doc cannot disagree with theregistry, and expose tiers through tooling (for example
gowdk explainor adocs command). Extend the guard to assert tiers, not just presence.
Acceptance Criteria
endpoint form.
disagrees.
Verification
go test ./internal/lang ./internal/diagnostics ./internal/view