Repository navigation
Commit 3b957f9
test(rest): sandbox crash leak checks match a long unique marker, not the short word boom (#25928)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DGwpW37CMTDznXmHEda2Sn2)_
Fixes #25714
Clause-②: no
Metadata-protocol: none
## What changed
Test-only. The sandbox-crash leak checks matched the short word `boom`
(plus `TypeError`) against the whole serialized response, and the import
job id (base36 timestamp plus random tail) can spell `boom` by chance.
The injected crash now carries a long unique marker, and the leak
pattern matches that marker plus `TypeError` (a lowercase base36 id
cannot spell `TypeError`). The check is no looser: any leak of the
fault's words still fails it; no retry, no skip.
-
`packages/rest/src/rest-write-route-hook-refusal-sentence.ledger.test.ts`:
new `CRASH_WORDS` / `CRASH_LEAK`; `sandboxCrash`, the `sandboxOwnFault`
inner-hook row, and the three former `TypeError-or-boom` patterns (the
CRASHED rows of the two tables and the inner-hook row) use them.
- `packages/rest/src/rest-sandbox-declared-status.test.ts`: same family
(the `mapDataError` crash row); same marker.
Producer check: the real producer is the test sentinel itself (id from
`rest-server.ts` import job creation); no product code changes.
## Verification
- `git grep -n` for the old whole-body short-sentinel pattern in
`packages/rest/src`: no hits (exit 1).
- Both files via vitest at head 0728391: `Test Files 2 passed (2)`,
`Tests 589 passed (589)`.
- Ablation (committed fix first; mutation of `sandboxFaultAnswer` in
`error-response.ts` so the fault's `.message` reaches the body; anchor
hit 1 to 0, blob 77862fd to 25c0c58f; the mutated line read back from
disk; source-resolved, no dist involved): `Tests 46 failed | 543 passed
(589)`, e.g. `Expected: "Internal server error" Received: "hook
'mz_guard' threw: TypeError: __OS_SANDBOX_FAULT_7f3a9c__"`. Restored
with `git checkout HEAD`; `git status --porcelain` empty and the file
blob hash equals the HEAD blob (77862fd).
- `dispatch-gates --ran`: 56 derived, 55 run exit 0, 1 NOT-MEASURED
(`pnpm check:dual-build-cjs-loads` exit 3, PREREQUISITE NOT MET: only
the rest closure is built locally). `check-plugin-teardown-shape
--self-test` first exited 3 on a shallow clone, then 0 after `git fetch
--unshallow`.
- `pnpm lint`: exit 0.
## Acceptance notes
- Both acceptance lines hold (see Verification). Test-only, so
`skip-changeset`, no changeset.
- No out-of-scope findings.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01TFnDdepdwyDJeM2kJ4GtMy
Co-authored-by: Claude <noreply@anthropic.com>1 parent 9407318 commit 3b957f9
2 files changed
Lines changed: 21 additions & 7 deletions
File tree
- packages/rest/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
164 | 168 | | |
165 | 169 | | |
166 | 170 | | |
| |||
175 | 179 | | |
176 | 180 | | |
177 | 181 | | |
178 | | - | |
| 182 | + | |
179 | 183 | | |
180 | 184 | | |
181 | 185 | | |
182 | 186 | | |
183 | | - | |
| 187 | + | |
184 | 188 | | |
185 | 189 | | |
186 | 190 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
77 | 87 | | |
78 | 88 | | |
79 | | - | |
| 89 | + | |
80 | 90 | | |
81 | | - | |
| 91 | + | |
82 | 92 | | |
83 | 93 | | |
84 | 94 | | |
| |||
451 | 461 | | |
452 | 462 | | |
453 | 463 | | |
454 | | - | |
| 464 | + | |
455 | 465 | | |
456 | 466 | | |
457 | 467 | | |
| |||
602 | 612 | | |
603 | 613 | | |
604 | 614 | | |
605 | | - | |
| 615 | + | |
606 | 616 | | |
607 | 617 | | |
608 | 618 | | |
| |||
627 | 637 | | |
628 | 638 | | |
629 | 639 | | |
630 | | - | |
| 640 | + | |
631 | 641 | | |
632 | 642 | | |
633 | 643 | | |
| |||
0 commit comments