Repository navigation
v1.93.35.0 fix: pregate no longer kills a quiet test suite that is busy working (GST-1095) - #3899
Merged
Merged
Conversation
…095) The stall timer looked only at log growth, so a parallel check.sh that prints nothing for 9 minutes while working ended PREGATE_STALLED (FOUN-63). supervise now samples the process group's CPU time each second and treats growth of at least a tenth of wall time as liveness. An idle hang still stalls; a hang that burns CPU is left to --timeout. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… skips one sample; ps -S on BSDs (review pass 1) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ng (fix-check) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Before (origin/main): a silent CPU-busy run ends stalled and a busy lane test ends PREGATE_STALLED. After: both pass, and the idle-hang, deadline and SIGTERM controls still pass.
Before/after as text: Before (origin/main): a silent CPU-busy run ends stalled and a busy lane test ends PREGATE_STALLED. After: both pass, and the idle-hang, deadline and SIGTERM controls still pass.
Why
Founderstar's review audit for FOUN-63 says it plainly: "the second ended PREGATE_STALLED because check.sh is silent for >300 s". A parallel suite that prints nothing for nine minutes while working was killed as hung. Now pregate counts CPU activity as a sign of life, so a busy quiet suite runs to the end, and an idle hang is still killed at the stall timeout.
Blast radius
The change lives in
lib/pregate/supervise.ts, which runs the pregate lanes check, the guards andgstack-checks. The remote gate passesstallMs: 0and is untouched. A run is now killed as stalled only when both signals are quiet, so the change can only keep alive a run main would have killed. A hang that keeps burning CPU now ends at--timeoutinstead, and that is stillincomplete, never a pass (walked failure path, plus the new deadline test). No threshold or config key changed, andbin/gstack-pregateandlib/pregate/context.ts(open #3852) are not touched.Approvals
Source: gstack-approvals record for gst-1095-pregate-cpu-liveness (display only; not an approval citation).
Summary
"pregate's 300 s stall timeout kills quiet long suites" (GST-1095, from FOUN-63). The stall timer looked only at log growth. supervise now also samples the process group's CPU time each second (
/procon Linux,ps -Son macOS and BSDs). A group whose CPU time grew by at least a tenth of wall time counts as alive. Windows reads no CPU time and keeps log growth alone. The PREGATE_STALLED detail, the guard line, the result-code summary and the docs now say what was measured.Red proof on main (f1cbdbb), before the fix: both new tests fail there.
supervisereturnsstalledfor a silent CPU-bound command, andgstack-pregate --stall-timeout 2records{"code":"PREGATE_STALLED","detail":"no test output for 2 s; process group killed; last file started: test/busy.test.js"}for a busy node:test file. Logs:handoffs/GST-1095/red-on-main-unit.txtandred-on-main-e2e.txtin the GStack Minder drive.Negative controls kept: an idle hang (
sleep 1000, a bun test blocked inAtomics.wait, a node test blocked forever) still endsstalled/PREGATE_STALLED. A busy run that never ends endstimeoutat the deadline. A group that ignores SIGTERM is still SIGKILLed.Security read: no network calls, environment reads, permission changes, workflow, setup or install edits, and no new dependencies. The one new subprocess is
ps -A -S -o pgid=,time=on non-Linux POSIX, with a 15 s timeout, and it only reads process CPU times.Refs: GST-1095, FOUN-63 (Founderstar review audit 2026-11-02).
Test Coverage
Tests: 16 → 18 (+2 new) in
test/pregate-supervise.test.tsCoverage: 70% value-weighted (70% including 0 weakly covered paths)
Test value: 2 tests written, 0 rejected by the authoring gate, 0 existing tests extended, 0 paths weakly covered.
Regression proof: fails at main f1cbdbb · passes after fix (both new tests).
Tests ran: supervise 18
Pre-Landing Review
Gate-class review at full depth (gstack-review-plan
REVIEW_CLASS: gate). Pass 1 ran specialists (testing, security, state-machines) plus a red team and found 3 informational items, all fixed. The fix-check (round 2) found 3 informational items: 2 fixed, 1 noted. Step 11 ran a native adversarial voice (4 informational) and a GPT-6.1 Sol outside voice (2 items it marked blocking). Both of those only fall back to the behavior main already has, so they are below the blocking floor and recorded as notes. A last fix-check on the frozen tree rebound the review records and found 1 informational item (noted).REVIEW_LOOP: passes=1 blocking_found=4 deferred=0 noted=2 fixed=5 scope=frozen unrecorded=4 ledgers_read=3 fix_checks=2 dispatches=4
The 4 counted as blocking are Step 11 voice findings that the collector labeled CRITICAL: the two the GPT-6.1 Sol outside voice marked "Blocks: yes", plus two from the native voice. My lead judgment is that all 4 sit below the blocking floor, because none fails a test, breaks production or loses data, and each one falls back to the behavior main already has. They are listed under Review notes below, and the judge tool keeps their original label.
Gate edits: none detected (GATE_SCAN tagged=0 at every pass)
Outside review: GPT-6.1 Sol (certified configuration), completed, 2 findings, both judged below the floor.
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
lib/pregate/supervise.ts:222a silent hang that keeps using CPU (or keeps an idle helper awake) now runs to --timeout instead of the stall timeout; still incomplete, never passlib/pregate/supervise.ts:224after a failed CPU read (BSD only) the next sample compares about 2 s of CPU against a 1 s thresholdlib/checks.ts:269gstack-checks stalled detail and bin/gstack-pregate --stall-timeout help still say 'no output' onlylib/pregate/supervise.ts:100CPU outside the process group (setsid children, daemons) is not seen; same as before the changelib/pregate/supervise.ts:221a fractional --stall-timeout under 1 s fires before the first CPU sample; falls back to pre-change log-growth behaviorlib/pregate/supervise.ts:95short-lived double-forked workers reaped by init lose their CPU before a sample; such launchers still stall on log growth, as beforebin/gstack-pregate:82the--stall-timeouthelp text still says "no output". It is not edited here because open v1.93.33.0 wave(review): #3705 #3744 #3745 #3764 #3765 #3795 #3852 owns that file.Eval Results
No prompt-related files changed, so evals were skipped.
Verification Results
Remote pregate (Ubicloud us-east-a2, owner gsta212) on tree 5de5d18f7426: 16511 tests, 0 failed, $0.10. The VM was destroyed afterward (
UBICLOUD: left=0). The macOS and Windows lanes are cleared from this PR's CI runs.TODOS
No TODO items completed in this PR.
Documentation
Scope: Audit of the gst-1095 change (pregate stall detection now needs both no log output and low process-group CPU use). I read the committed diff against main, the working tree,
docs/pregate.md,docs/troubleshooting.md, thePREGATE_STALLEDentry inlib/result-codes.ts, the config help text and the changelog fragment. I grepped every other doc and template for stall wording; hits were unrelated (codex, captain, TODOS).Result: Current. The branch already updates the
stall_timeout_srow, the supervision section and thePREGATE_STALLEDtroubleshooting entry. These match the code: the one-tenth-CPU threshold, the 1 s sampling,/procon Linux,ps -Son macOS and BSDs, Windows using log growth alone, and a CPU-bound hang left to--timeout. The result-code summary and the config help text match too. No README, CONTRIBUTING or TESTING_INTERNALS page describes the stall behavior, so none is stale.Debt: None found.
Test plan
bun test test/pregate-supervise.test.ts: 18 pass, 0 fail (lane receipt FRESH, tests_ran=18)bun run typecheck: cleangstack-pregate --stage tests --remote: 16511 tests, 0 failed on tree 5de5d18f7426🤖 Generated with Claude Code