Use this checklist when adding or changing .gwdk syntax, compiler metadata,
diagnostics, generated output, or editor behavior. Keep each change scoped to one
language contract.
Required Path
- Update the source contract first:
docs/language/for public syntax or semantics.docs/reference/diagnostic-codes.mdfor new or changed diagnostic codes.docs/compiler/generated-output.mdfor generated artifact shape changes.
- Update the AST and parser:
internal/gwdkastfor source nodes and spans.internal/parserfor parsing and lowering intointernal/gwdkir.- Parser goldens under
internal/parser/testdata/golden/when the AST contract changes.
- Update IR and invariants:
internal/gwdkirtype fields.gwdkir.CheckInvariantsfor closed enums, ordering, and cross-slice references.internal/gwdkanalysislowering and ordering.gowdk inspect irgoldens when the public debug shape changes.
- Update validation and diagnostics:
internal/compilerfor semantic checks.internal/diagnostics/registry.gofor every emitted diagnostic code.- Source spans should target the smallest useful declaration or token.
- Update generated-output consumers when needed:
internal/buildgenfor SPA/build-output, CSS/assets, SSR artifacts, and build reports.internal/appgenfor generated Go adapters, route registrations, action, API, fragment, contract, guard, rate-limit, SSR, and backend output.- Generated Go must use Go AST/printer/format as described in
docs/engineering/generated-code-policy.md.
- Update language tooling:
internal/langfor formatting, manifest/site-map JSON, completions, and diagnostics output.internal/lspandeditors/vscodewhen editor features need the new syntax.
- Add focused tests:
- Parser/AST:
go test ./internal/parser. - Diagnostics/validation:
go test ./internal/compiler ./internal/diagnostics. - Generated output:
go test ./internal/buildgen ./internal/appgen. - LSP/editor:
go test ./internal/lspplus editor checks when touched. - CLI report changes: update
cmd/gowdk/testdata/*_goldenand rungo test ./cmd/gowdk.
- Parser/AST:
- Add a conformance corpus case:
- Accepted syntax: an
accept/file underinternal/lang/testdata/conformance/that exercises it. - A rejection or new diagnostic: a
reject/file with a leading// expect: <code>directive. Seedocs/language/conformance.md.
- Accepted syntax: an
Guardrails
- Do not add
@metadata syntax back as canonical public syntax. - Dynamic SPA routes still require
paths {}unless a page uses request-time SSR. - Actions, APIs, and fragments remain endpoint metadata, not page render modes.
- Generated JavaScript is enhancement only; it must not own routing truth, auth, server validation, business logic, server state, or cache policy.
- Public generated-output shape changes need docs and deterministic tests in the same change.
Minimum Handoff
Before handing off, state:
- The syntax or behavior changed.
- The AST/IR fields and diagnostics touched.
- The generated files, JSON shapes, or reports affected.
- The docs and examples updated.
- The exact verification commands run.