Skip to content

Commit 3f03af7

Browse files
committed
no-mistakes(document): docs(#228): reconcile stale error-code ledger note in ADR-0044
1 parent 3c1d4bc commit 3f03af7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎spec/decisions/ADR-0044-payload-record-naming-cross-package-collision.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ This ADR extends, rather than introduces, house doctrine: ADR-0041/0042 already
4545

4646
- **Non-colliding common case: byte-identical output, all ports.** No consumer sees any change unless their own metadata actually contains a same-short-name collision reachable from one payload artifact.
4747
- **A newly-introduced collision is a visible, compile-time rename**, not a silent behavior change — the qualified name propagates to the declaration, the file/module (where applicable), and every reference in one coordinated regen.
48-
- **Error code `ERR_PAYLOAD_NAME_COLLISION`** joins the payload/template build-time-error family (peer of `ERR_VAR_NOT_ON_PAYLOAD`). Stage 1 (TS + C#) declares it **locally** in each port's payload-codegen module rather than immediately in the shared cross-port error-code ledger (`packages/metadata/src/errors.ts` `ERROR_CODES` / `fixtures/conformance/ERROR-CODES.json`): that ledger is coverage-checked per port (TS asserts full bidirectional agreement; Python asserts its `ErrorCode` enum is a superset of the corpus), and registering the code before every port implements the corresponding fix would turn ports that haven't shipped it yet red for a codegen path they don't run. The code moves into the shared ledger, mirrored per port, once the Java/Kotlin/Python follow-up lands alongside its implementation.
48+
- **Error code `ERR_PAYLOAD_NAME_COLLISION`** joins the payload/template build-time-error family (peer of `ERR_VAR_NOT_ON_PAYLOAD`). Stage 1 (TS + C#) declares it **locally** in each port's payload-codegen module rather than immediately in the shared cross-port error-code ledger (`packages/metadata/src/errors.ts` `ERROR_CODES` / `fixtures/conformance/ERROR-CODES.json`): that ledger is coverage-checked per port (TS asserts full bidirectional agreement; Python asserts its `ErrorCode` enum is a superset of the corpus), and registering the code before every port implements the corresponding fix would turn ports that haven't shipped it yet red for a codegen path they don't run. That promotion landed in 0.19.3 with the Java/Kotlin/Python payload-record follow-up: the code now lives in the shared cross-port error-code ledger — `fixtures/conformance/ERROR-CODES.json` plus TypeScript `errors.ts`, Python `errors.py`, and Java `ErrorCode.java` (the registries that gate against the corpus) — with C# and Kotlin retaining a port-local constant of the same value, so #228's shared TS/Python collision-naming modules source it from the ledger rather than redeclaring it.
4949
- **Corpus contract strengthened, not weakened.** `fixtures/template-output-render-conformance/xpkg-collision/README.md` now states plainly: a port's conformance runner must construct its render-time payload from **generator-emitted** types — never hand-author or otherwise reconcile the payload record. The corpus's render-output pins (`"Alpha=AA Beta=BB"`) are untouched: the render engine and the build-time verify field-tree resolve against **metadata**, never against record names, so this ADR does not touch them.
5050
- **Stage 1 (this decision):** the TS reference implementation (`codegen-ts/src/payload-codegen.ts`) and the C# port (`MetaObjects.Codegen/PayloadCodegen.cs`, fixing #219's wrong-node resolution as part of the same pass) ship together. **Stage 2/3 (tracked separately, not in this change):** Python, then Java + Kotlin (the heavier lift — per-output-package closure plumbing plus #220's new collision-conformance suite), followed by a coordinated bug-fix release across all four package registries.
5151
- **Follow-up, explicitly out of scope here:** #219's own note that the C# port's `CSharpNaming.StripPkg` + bare-short-name-match convention recurs in roughly seven other C# generators (routes, entity, M:N navigation, output-parser, DbContext, reverse-finders, package-binding-resolver) — the same disease, a different blast radius (entity/route naming rather than payload naming), deserving its own audit and ruling. **Update (#228):** the *output-parser* member of that list — the extract/output-parser tier's own collision-scoped payload naming, plus the package-blind build-time `@payloadRef`/`@responseRef` resolvers it shares with the render-helper, output-prompt, and (JVM) `meta:verify` template-drift generators — is now fixed, cross-port (all five ports, not scoped to C#). The other six C#-specific generators in that list (routes, entity, M:N navigation, DbContext, reverse-finders, package-binding-resolver) remain open, tracked separately.

0 commit comments

Comments
 (0)