Repository navigation
test(harness): fail-closed lifecycle for bounded probe runner - #2682
Conversation
macOS bash 3.2 reports -c input as line 0, modern GNU bash as line 1. Compare diagnostic shape with line number normalized.
…gression A long -c ARG0 stamped on every report line could evict the structural payload out of the 1 KiB diagnostic budget. Truncate the shell name to 64 chars first so 'syntax error ...' always survives; renumber the threat entry to TM-DOS-136 (main already owns 135 via #2674); add a bounded-child regression exercising the exact finding shape (multiline token x long ARG0) at two scales.
The 64-char cut mangled long script paths (breaking the oracle's path
replacement and hiding which script failed). Widen to 256 chars with a
16-char tail: realistic paths print verbatim with attribution suffixes
(': eval') intact, while a kilobyte-scale ARG0 still cannot evict the
structural payload out of the 1 KiB total. The total stays the enforced
bound.
The scaled multiline-token x long-ARG0 regression now asserts the whole harness contract at both scales (200/2000 lines x 8 KiB ARG0): no watchdog timeout, raw child exit 2, no output-cap overshoot, finished reader threads, and effective stack=4096/cpu=10 caps read back from the launcher. Shape and 1 KiB assertions unchanged.
run_command_bounded cleanup per lifecycle review: truncate retention before extending (retention never passes the 8192 cap); retry Interrupted, fail closed with partial bytes on real reader errors (new read_error field, never relabeled as EOF); exact-cap EOF is not excess; reap inside a finite 5s grace, never an unbounded wait; timed_out retained as recorded; drain 2s + reap 5s graces documented against the execution deadline. Consumer regression gains !read_error and the corrected 8192-byte cap text. Bounded selftests: exact-cap, cap+1, Interrupted/error scripted pipes, timeout kill+reap, overflow flag.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
bashkit | 1221b7f | Commit Preview URL Branch Preview URL |
Oct 11 2026, 09:00 AM |
|
Review of exact candidate 1221b7f against the full post-merge lifecycle review (6106968187). The cap-before-copy, exact-cap EOF distinction, Interrupted retry, real-read-error flag and bounded try_wait reaping address the prior concrete implementation defects. The documented execution deadline plus 2-second drain and 5-second reap grace is honest; keep that distinction in the evidence. Remaining proof required before declaring the lifecycle review resolved:
These are test-harness lifecycle/proof requirements, not a request to reopen any independently closed product finding. Keep the current branch and additive history; no force-push, test weakening, duplicate PR or CI waiver. Read full issue comments, formal reviews and inline threads. The skipped macOS misconfiguration case remains partial local evidence, not a full-gate waiver. Final proof still needs green required checks for the final head, actual squash merge SHA/ancestry, exact-merged producers and successful assertion exits with durable file logs. |
…#2683) ## What changed Test-only, one file: threat_model_tests.rs. Closes the lifecycle review on #2682 without touching #2681 distinct run_bounded_probe helper: - Bounded join gate: readers join only after all channel receipts (a receipt proves its thread finished every blocking call; sending is the last act before return). Missing receipts skip the join and fail incomplete; panicking readers fail visibly via join error. std offers no timed join; the gate plus elapsed-total assertions are the documented termination proof. - Reap extracted into a poll seam (reap_with_grace) with deterministic verdict unit tests: immediate, delayed, never-exits (bounded 50ms), and poll-error cases. - Timeout/overflow selftests run under the shared fail-closed launcher (new run_raw_bounded) so the effective stack=4096/cpu=10 bounds are applied and read back, with elapsed-total bounds (2s+2s+5s budget). - Existing bounded_helper_flags_retained_pipes reused and strengthened: elapsed proof (returns without waiting for the 30s sleeper), read_error distinction, outer-deadline documentation. ## Before / After Before: unconditional join past the grace; reap untestable without OS fakery; selftests bypassed the launcher; no elapsed proofs. After: threat_model 220 passed (only pre-existing macOS nesting abort skipped, identical on unmodified code); error 14, partial_parse 11 green; fmt plus clippy -D warnings clean. ## Risk - Test-only change. No production code touched. ## Checklist - [x] Tests added or updated - [x] Backward compatibility considered (internal test harness)
What changed
Test-only, one file: threat_model_tests.rs (+211/-33). Reworks the shared run_command_bounded lifecycle per the review on #2680:
Does not touch #2681 distinct run_bounded_probe helper.
Before / After
Before: reader errors read as clean EOF; retention could exceed the cap by a chunk; kill-path wait() unbounded; no lifecycle selftests.
After: threat_model 219 passed (only pre-existing macOS nesting abort skipped, identical on unmodified code); error 14, partial_parse 11 green; fmt plus clippy -D warnings clean.
Risk
Checklist