|
35 | 35 | * both, and the matrix's verdict is the EFFECTIVE one — refused at authoring |
36 | 36 | * means the module cannot be written, whatever the registry would have done. |
37 | 37 | * |
38 | | - * ## ⚠️ The authoring gate throws a BARE `Error` — there is no ADR-0112 envelope |
| 38 | + * ## ✅ The authoring gate carries an ADR-0112 envelope (#14552) |
39 | 39 | * |
40 | | - * `defineStack` aggregates its cross-reference errors into `new Error(...)`. |
41 | | - * There is no `code` and no `status` to assert, so these rows assert the |
42 | | - * message — which IS the contract here, since the message is the only thing |
43 | | - * that distinguishes one refusal from another — and then assert the ABSENCE of |
44 | | - * the envelope explicitly, in one place, so the gap is pinned rather than |
45 | | - * merely unmentioned. Same shape of gap as #14367 (`registerObject`'s bare |
46 | | - * `Error`), one door over. |
| 40 | + * `defineStack` aggregates its cross-reference errors and — since #14552 — |
| 41 | + * raises them as `StackCrossReferenceError`: `code: |
| 42 | + * 'STACK_CROSS_REFERENCE_INVALID'`, `status: 422`, one entry per finding in |
| 43 | + * `issues`, with the message text byte-for-byte unchanged. The rows below |
| 44 | + * still assert the MESSAGE, because the message is what distinguishes one item |
| 45 | + * class from another (the code names the rule FAMILY — there is one raise site |
| 46 | + * for all of them, and a single refusal can carry findings from several |
| 47 | + * classes at once). `ENVELOPE PRESENCE` then asserts the envelope itself, in |
| 48 | + * one place. Repaired the same way as #14367 (`registerObject`'s bare `Error`) |
| 49 | + * and #14474 (`NamespaceConflictError`), one door over. |
47 | 50 | * |
48 | | - * ⛔ If `ENVELOPE ABSENCE` below goes red, an envelope has ARRIVED. That is an |
49 | | - * improvement: update this pin and the #14122 §4 matrix row. Do not delete the |
50 | | - * assertion to make it green. |
| 51 | + * ⛔ If `ENVELOPE PRESENCE` below goes red, the envelope has been REMOVED or |
| 52 | + * its code renamed — a regression, not a cleanup. Restore it rather than |
| 53 | + * relaxing the assertion; five message-substring pins in this tree read the |
| 54 | + * prose it fences, and the #14122 §4 matrix row records the envelope as |
| 55 | + * present. |
51 | 56 | * |
52 | 57 | * ## This file measures. It does not prescribe. |
53 | 58 | * |
@@ -248,14 +253,17 @@ describe('#14122 §4 continuity — the method reproduces an already-measured ru |
248 | 253 | expect(authoringVerdict(hookItem, true)).toBeUndefined(); |
249 | 254 | }); |
250 | 255 |
|
251 | | - it('ENVELOPE ABSENCE — the authoring gate carries no ADR-0112 `code` / `status`', () => { |
| 256 | + it('ENVELOPE PRESENCE — the authoring gate carries the ADR-0112 `code` / `status` (#14552)', () => { |
252 | 257 | // Pinned once, here, rather than repeated on every refusing row. See the |
253 | | - // file header: red here means an envelope ARRIVED (good) — update the pin |
254 | | - // and the §4 matrix, do not delete the assertion. |
| 258 | + // file header: red here means the envelope was REMOVED or renamed — a |
| 259 | + // regression. Restore it, do not relax the assertion. |
255 | 260 | const refused = authoringVerdict(hookItem); |
256 | 261 | expect(refused).toBeInstanceOf(Error); |
257 | | - expect(refused?.code).toBeUndefined(); |
258 | | - expect(refused?.status).toBeUndefined(); |
| 262 | + expect(refused?.code).toBe('STACK_CROSS_REFERENCE_INVALID'); |
| 263 | + expect(refused?.status).toBe(422); |
| 264 | + // The message text is unchanged by the envelope — this pin fences both |
| 265 | + // halves at once, which is what makes it a regression detector for the |
| 266 | + // five message-substring pins elsewhere in the tree. |
259 | 267 | expect(refused?.message).toContain('defineStack cross-reference validation failed'); |
260 | 268 | }); |
261 | 269 | }); |
|
0 commit comments