Commit 2bfdcba
committed
test(runtime): the dispatcher envelope check uses the shared predicate (#4090 follow-up)
`domain-handler-registry.test.ts` hand-rolled "no key beside the envelope's own
may hold the payload" for #4038. #4090 extracted that rule into
`envelopeViolations` so it stops having two definitions; this is the caller that
motivated the extraction, now using it.
Leaving the local copy would have recreated the exact failure this line has been
closing — one rule, two places, and only one of them updated next time. It also
was not the same rule: the local set allowed any body whose top-level keys were
success/data/meta, so it passed a success body with NO `data` at all, and one
carrying an `error` alongside `success: true`. The shared predicate rejects both.
Verified the swap is a strict improvement rather than a refactor, by breaking the
producer two ways and checking the suite catches each:
{ success: true, data: link, link } → caught (the old check caught this too)
{ success: true } → caught (the old check PASSED this)
runtime 914 passed. All ten gates in the TypeScript Type Check job pass, plus the
six `check:*` guards.
Note for the next person touching spec: after restarting a branch onto a newer
main, `check:api-surface` and `check:i18n-coverage` both fail against a stale
`packages/spec/dist` — the first reports other people's exports as added/removed,
the second rejects an example config for a chart type the fresh spec allows.
Neither is a real failure; rebuilding spec clears both. They read as "my change
broke something" and are not.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CYbS3kS8xzsHNXFTzp4e2z1 parent dc530b4 commit 2bfdcba
1 file changed
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
391 | 392 | | |
392 | 393 | | |
393 | 394 | | |
394 | | - | |
395 | | - | |
396 | | - | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
397 | 404 | | |
398 | 405 | | |
399 | 406 | | |
| |||
407 | 414 | | |
408 | 415 | | |
409 | 416 | | |
410 | | - | |
411 | | - | |
412 | | - | |
| 417 | + | |
413 | 418 | | |
414 | 419 | | |
415 | 420 | | |
| |||
0 commit comments