plan: one registry for every code, or the guard is a coin toss #1658

Merged
jaylouisw merged 1 commit from plan/1116-1210 into main 2026-11-16 12:14:40 +00:00
Owner

Forward plan only, no code. docs/plans/error-code-registry.md.

Why now: #1654 is open and its symptom is already gone from main � #1647 took the fixture from 2202 to 2203 specs, seed 65 moved, #1655 moved it again. Measured on abbab2e8: validation.RULES holds 24 codes; the cabling path (validation.js, media.js, optical.js, topology.js, link.js) emits 56, so 32 are unregistered; engine/ as a whole emits 84. E_BIDI_MISMATCH (engine/optical.js:225) is one of the 32.

The three guards that claim this ground all miss it: test/validation.test.js:370 is titled "RULES documents every code the engine can emit" but only shape-checks the table against a hardcoded 16-name list; docs/PHYSICAL_LAYER.md:181-196 tabulates those same 16 of 24; test/property-validator.test.js:125 gates on RULES and exempts E_PORT_IN_USE by name.

The plan is eight steps, each one PR: an inventory script, the 32 registrations, a completeness test that reads the sources, the property gate pointed at the same list, flip to a gate, generate the doc table, the runtime-code family (labelled needs-Jay), and decoupling the property test sample from the catalogue size so #1654 cannot recur on someone else's device PR.

Closes #1654.

Forward plan only, no code. `docs/plans/error-code-registry.md`. **Why now:** #1654 is open and its symptom is already gone from main � #1647 took the fixture from 2202 to 2203 specs, seed 65 moved, #1655 moved it again. Measured on `abbab2e8`: `validation.RULES` holds 24 codes; the cabling path (`validation.js`, `media.js`, `optical.js`, `topology.js`, `link.js`) emits 56, so 32 are unregistered; `engine/` as a whole emits 84. `E_BIDI_MISMATCH` (`engine/optical.js:225`) is one of the 32. The three guards that claim this ground all miss it: `test/validation.test.js:370` is titled "RULES documents every code the engine can emit" but only shape-checks the table against a hardcoded 16-name list; `docs/PHYSICAL_LAYER.md:181-196` tabulates those same 16 of 24; `test/property-validator.test.js:125` gates on `RULES` and exempts `E_PORT_IN_USE` by name. The plan is eight steps, each one PR: an inventory script, the 32 registrations, a completeness test that reads the sources, the property gate pointed at the same list, flip to a gate, generate the doc table, the runtime-code family (labelled needs-Jay), and decoupling the property test sample from the catalogue size so #1654 cannot recur on someone else's device PR. Closes #1654.
plan: one registry for every code, or the guard is a coin toss
All checks were successful
CI / Classify the change (pull_request) Successful in 13s
PR rebase / Rebase onto main and arm auto-merge (pull_request) Successful in 16s
CI / Server smoke test (pull_request) Successful in 27s
CI / Docker build (pull_request) Successful in 34s
CI / Test (Node 18) (pull_request) Successful in 1m32s
CI / Test (Node 20) (pull_request) Successful in 1m35s
CI / Test (Node 22) (pull_request) Successful in 1m45s
f25e2582f3
#1654's symptom left main when a device spec shifted the property test's
seeded draw; the cause is that RULES holds 24 of the 56 codes the cabling
path emits, and the test named 'RULES documents every code the engine can
emit' never reads a source file. Plan covers the inventory script, the
missing registrations, a real completeness guard, the doc table, and the
catalogue-coupled sample.
jaylouisw scheduled this pull request to auto merge when all checks succeed 2026-11-16 12:14:31 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jaylouisw/packetforge!1658
No description provided.