|
| 1 | +--- |
| 2 | +"@objectstack/runtime": patch |
| 3 | +--- |
| 4 | + |
| 5 | +fix(tooling): `check:dispatcher-error-vocabulary` reports lowercase codes and the two stamp positions it could not see — a live 403 had been invisible to both vocabulary gates (#9460) |
| 6 | + |
| 7 | +The gate's published bound said it scanned "only SCREAMING_SNAKE literals", and |
| 8 | +handed lowercase to `check:error-code-casing`. Half of that delegation was real |
| 9 | +and half was a hole, and the hole is where `plugin-security`'s live 403 |
| 10 | +`owd_widening_forbidden` sat through two ADR-0112 sweeps: both gates read the |
| 11 | +file, both reported nothing, each leaving it to the other. |
| 12 | + |
| 13 | +**The card's premise was that the scan's patterns are case-sensitive. They are |
| 14 | +not** — the literal shapes already matched `[A-Za-z]`. Two explicit filters |
| 15 | +dropped the value after the match, and the producer was invisible for a |
| 16 | +different reason entirely, so the prescribed one-line widening would not have |
| 17 | +found it. Measured before changing anything: reporting every lowercase stamp |
| 18 | +took the scan from 12 sites to 94, and **all 82 new findings were D6/D6b/D6c |
| 19 | +neighbours or Zod's own issue codes** — it would have called |
| 20 | +`ctx.addIssue({ code: 'custom' })` an unregistered ObjectStack error code. |
| 21 | + |
| 22 | +So lowercase is now reported **except** in the two positions where |
| 23 | +`check:error-code-casing` reads the identical characters (`code: 'x'`, |
| 24 | +`.code = 'x'`). There the delegation is genuine: that gate carries the |
| 25 | +D6/D6b/D6c discrimination this one does not have. Everywhere else — a constant, |
| 26 | +a template, a helper parameter — there is no quoted literal at the stamp site |
| 27 | +for a `code`-anchored pattern to match, that gate is structurally blind, and |
| 28 | +dropping the value reported it to nobody. What is measured is now "outside the |
| 29 | +vocabulary **and** unowned by the gate we delegate lowercase to", never "is it |
| 30 | +SCREAMING_SNAKE". |
| 31 | + |
| 32 | +Three stamp positions the scan could not see, all of them widenings: |
| 33 | + |
| 34 | +- **`codehelper`** — a file declares one factory and throws through it |
| 35 | + everywhere (`postureError(code, message)`, `makeError(status, code, message)`, |
| 36 | + a `constructor(code, message)`). The stamp `(err as any).code = code` knows |
| 37 | + the token `code` but not the value; the call site knows the value and never |
| 38 | + writes the token. Every pattern in **both** gates anchors on that token. The |
| 39 | + join is the parameter, so its **index** names the argument to read — derived, |
| 40 | + never assumed to be zero, because two live helpers put `code` second and a |
| 41 | + first-argument rule reads a number and an English sentence as error codes. |
| 42 | +- **`assignconst`** — `err.code = DENY_CODE`, the assign position's constant |
| 43 | + sibling. #9223 closed exactly this gap for object literals; the assign |
| 44 | + position kept it. |
| 45 | +- **`assign`** with a cast on the left. The old anchor demanded a bare |
| 46 | + identifier where `(err as any).code = 'X'` puts a `)`. |
| 47 | + |
| 48 | +The scan goes from 12 classified sites to 18, and from 0 to 2 codes awaiting a |
| 49 | +ledger entry — the ratchet moving in the direction it exists to move. |
| 50 | +`FLOW_CONVERSION_CONFLICT` (a live 409 from the metadata write path) and |
| 51 | +`owd_widening_forbidden` are recorded as `pending-registration`; four |
| 52 | +`MigrationJournalRefusal` codes are `boot-refusal` (their only consumers are two |
| 53 | +CLI commands, no HTTP boundary). ⛔ No allowlist entry, no narrowed pattern, no |
| 54 | +raised ceiling: **registering or renaming a code stays the `packages/spec` |
| 55 | +lane's call**, and these rows record the measurement rather than prescribing the |
| 56 | +remedy. |
0 commit comments