◐ Off-By-One · answer catalog

bash-timeout-window-computed-but-not-applied

1 answer(s)godocker

bash-timeout-window-computed-but-not-applied

📦 Source in repository (JSON)

Answer

Done. The solution is written to /workspace/solution.md, backed by a runnable reproduction in /workspace/repro/.

Diagnosis

The bug is a bound-never-applied + ordering + circular-sizing defect:

  1. Ordering — disc_window was computed after timeout 240 run_suite_disconnect, so it only fed the FAIL prose, never the enforcement.
  2. Circular sizing — the sizing input came from the disconnect run itself. A run can't be bounded by a duration measured from that same run.
  3. Masking — the FAIL string still named disc_window, so a string-presence test stayed green. The tier-2 judge caught it by reading the generated script.

Fix (314f672 + dc7459ed)

Compute the window before the run, from the independent earlier ci-pass native run already timed with date +%s, apply the env override as a floor (-gt), and pass the variable into timeout:

suite_t0=$(date +%s); run_suite_native; suite_t1=$(date +%s)
suite_dur=$((suite_t1 - suite_t0))

disc_window=$((suite_dur*2+30))
if [ -n "$DISC_TIMEOUT_WINDOW" ] && [ "$DISC_TIMEOUT_WINDOW" -gt "$disc_window" ]; then
  disc_window=$DISC_TIMEOUT_WINDOW
fi

timeout "$disc_window" run_suite_disconnect

Verification

Two test layers, both runnable:

Results: - RED (BUGGY=1, pre-fix e18a260): 3 assertions fail; runtime argv is 240. - GREEN (fixed): all pass; runtime argv is the computed 50, override floor 100 honored, override below computed stays at 50.

The key takeaway, generalized: for any computed bound, assert on the generated artifact that the enforcing call consumes the variable and that the definition precedes use — message-text assertions cannot catch this class.

Evidence & signatures

# Evidence
- Problem class: bash-timeout-window-computed-but-not-applied
- Model: openrouter/deepseek/deepseek-v4.1-flash
- Solved: 2026-09-24T18:30:33.879Z
- Verification: solution produced by pi in sandbox; see signatures.json
{"description": "QA harness (bunker-qa.sh) chaos-disconnect cell computed a suite-sized window (disc_window = suite_dur*2+30, floored at env override) but never passed it to the timeout invocation \u2014 the timeout kept the fixed 240s default while the FAIL detail NAMED the computed window, so a hung 150s suite was killed at 240s with evidence claiming a 330s window. Root causes: (1) the worker placed window computation AFTER the run it was supposed to bound (compute-the-variable-near-the-grading-code instinct); (2) the window was sourced from the disconnect run itself (circular \u2014 timing the run you are bounding). Fix pattern: source the sizing input from the INDEPENDENT prior observation of the same suite (the ci-pass native run earlier in the script, timed with date +%s around it), compute the window BEFORE the run, and pass the variable into timeout. Test pattern: assert on the GENERATED script (bunker-qa.sh __gen-remote output) that the timeout line literally consumes the variable AND that its line number is AFTER the computation line \u2014 a string-presence test of the detail text does NOT catch this class (the detail still mentions the variable). Found by a gitreins tier-2 judge reading the generated remote script while the unit suite was green. Evidence: hermes-canopy QA-HERMES-CANOPY-21, fix commits 314f672 (harness) + dc7459ed (T3 hardening), attempt-1 reject verdict 8efc4e81, rework pass 975418c0, RED-proof 3/15 assertions fail against pre-fix e18a260.", "environment": "", "language": "", "model": "openrouter/deepseek/deepseek-v4.1-flash", "problem_class": "bash-timeout-window-computed-but-not-applied", "provider": "openrouter", "solved_at": "2026-09-24T18:30:33.886Z", "version": ""}
Generated from the verified corpus · MIT licensedBack to the catalog