Repository navigation
runaway: warm-wait check-ins are not empty wakes (GST-1597) - #4069
Merged
Merged
Conversation
lib/runaway.ts counted each 240-second warm-wait check-in (docs/captain.md, #4060) as an empty wake, so /runaway-stopper could flag a lane that follows the rule. A turn whose only call re-issues the wait on the same operation, or a 240-second timer, within 30 minutes of the wait that started the run is now left out of the rate. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
Review-Finding: p1/specialist-batched#1 reader=red-team Review-Finding: p1/specialist-batched#2 reader=testing Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ewrap captain.md (GST-1597 docs audit) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…nly on the run's operations; status reads keep the warm window (GST-1597) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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
gstack-runaway scanno longer counts warm-wait check-ins as empty wakes, and /ship's review fixed a hole in the first version of that rule. A turn whose only call re-issues the wait on the same operation, or a 240-second timer, within 30 minutes of the wait that started the chain is left out of the empty-wake rate. A re-wait past 30 minutes, a different wait, or a turn that also reads status still counts.Why
The crew rule tells a lane to check in every 240 seconds during a short wait so its cache stays warm (docs/captain.md, Warm waits).
gstack-runaway scancounted each of those check-ins as an empty wake, so a lane that followed the rule while waiting on CI could cross the 25% empty-wake warning. The first version of the fix opened a fresh 30-minute window on every re-wait past the window, so a lane that kept polling for hours was counted only once per half hour and was no longer flagged. The fix keeps the chain's start time, so every re-wait past 30 minutes counts.Blast radius
The change is confined to
emptyWakesin lib/runaway.ts, which onlyassesscalls, and to the--helptext. The scanner is read-only and advisory. It prints RUNAWAY and FLAG lines and changes no thread. When a wait's recorded input can't be parsed, the turn counts as before. The /runaway-stopper collector doesn't keepinputtoday (first review note below), so the skill's own scan behaves exactly as on main until that projection is fixed.Approvals
No approvals recorded for this branch. Ship gate: standing approval "/ship before READY" (CREW.md); merge by GStack Minder, never by this lane.
Summary
This PR adds the warm-wait exclusion to
emptyWakes, documents it in docs/captain.md and the--helptext, and adds a regression test. This /ship run added two commits. 059f3a4 is the pre-landing review fix: a re-wait past the window now keeps the chain's start time, and the test gains a 4-hour chain that must raiseFLAG: WARN empty_wake(it failed first at 88%/8 with no WARN). 09b2740 holds the docs audit's edits: one clause in docs/skills.md and a rewrap in docs/captain.md, read clean by a scoped reader.Test Coverage
Coverage: deterministic (each of 2 changed runtime files has a changed test naming it; no audit reader).
Tests: 1 assertion block added by this run to the existing warm-wait test in test/runaway.test.ts (failing first, then passing).
Tests ran: runaway 18
Tests ran: typecheck count unavailable
Pre-Landing Review
Pre-Landing Review: 7 issues (1 CRITICAL fixed, 1 informational fixed; voices: 3 CRITICAL by label, 2 informational) — 2 fixed, 0 asked, 1 deferred, 2 skipped, 2 noted
REVIEW_LOOP: passes=2 blocking_found=4 deferred=1 noted=2 fixed=2 scope=frozen ledgers_read=3 fix_checks=1 dispatches=2
REVIEW_LOOP: passes=2 blocking_found=4 deferred=1 noted=2 fixed=2 scope=frozen ledgers_read=3 fix_checks=1 dispatches=2
Gate edits: none detected (GATE_SCAN tagged=0 at 059f3a4)
Review plan: light depth, runtime_lines=36. Pass 1 (full) ran the batched specialist (testing, security, state-machines, red-team): 1 CRITICAL, 1 informational, both fixed in 059f3a4. Pass 2 (scoped) ran the red team (no findings) and one fix-check (no findings), then Step 11 ran the native adversarial voice and the outside voice. The repeat plan printed
NEXT: stopbecause the voices' findings carry CRITICAL labels. This run's brief allows one fix round, and none of these findings meets the blocking floor ("would fail a test, break production, or lose data or secrets"), so they are listed below as notes for the Captain.Outside review: openai/gpt-6.1-sol (host subagent, reasoning high; outside the certified medium configuration) completed with 3 findings marked
Blocks: yes.Review notes
Below the blocking floor. These are notes, not fixed here:
Blocks: yes; deferred, unfiled): the /runaway-stopper collector projects transcript items to source, tool, createdAt, calls and state only. It dropsinput, sowaitArgsalways returns null on the skill's scan path and the exclusion never fires there. The scanner itself works on full transcripts (unit test and QA probes), but the skill's Detect program still over-counts exactly as on main. A fix is to keepinputforwaititems in that projection, then run gen:skill-docs.Blocks: yes, native adversarial docs: add README and CLAUDE.md #1; two sources): a turn that reads status and then waits on the same operation isn't chained, so it resets the chain start and reopens a 30-minute exemption for the pure re-waits after it. A lane that adds one status read every 28 minutes hides its polling. This can't happen on the skill's path today (note above). A fix is to keep the start time whenever the closing wait names the same operations.Blocks: yes, native adversarial refactor: reorganize codebase into modular structure #2; two sources): a 240-second timer counts as chained even when it names different operations than the last wait, so a different 240 s wait is left out although the changelog says a different wait counts. A fix is to apply the timer clause only when the wait names no operations or the same ones.close()never looks at what opened the turn.waitArgsparses only a string input orinput.textJSON. Any other recorded shape turns the exclusion off without a message, which fails toward over-counting.Exploratory QA
Functional CLI smoke on
bin/gstack-runaway scanat 059f3a4 (2 probes, report-only, verdict pass): a compliant warm-wait lane printedempty_wake=0%/20with verdict OK, and a single operation re-waited every 240 s for 4 hours printedFLAG: WARN empty_wake 100% of 40 turns > 25%. Both ran on synthetic transcripts that includeinput, so they don't exercise the skill's collector.Design Review
No frontend files changed, so design review was skipped.
Eval Results
evals: none affected (no prompts, templates, judges or eval harness changed).
Review bot comments
No review bot comments.
Scope Drift
Scope Check: CLEAN
Intent: stop /runaway-stopper from flagging lanes that follow the warm-wait rule (GST-1597).
Delivered: the warm-wait exclusion in
emptyWakes, its review fix, docs, the regression test and the existing changelog.d fragment.Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches).
Issues
Refs GST-1597
Verification Results
No plan-specific verification items (no plan bound): VERIFY_RESULT=skipped.
Remote pregate
CI_CARRY: accepted ci-carry tree=285a15110387 tests=35907 runs=42222183035/1 profiles=ci-reuse/free-tests heads=09b274071199 verified=2026-11-06T13:01:59.036Z
PREGATE: pass tree=285a15110387 head=09b274071199 checks=7 (27 of 27 selected local test files reused from free-tests run 42222183035/1; finish: verify ok on the stamped tree)
TODOS
No TODO items completed in this PR.
Documentation
Scope: The 13 selected release files (4938-entry index, 137 candidate docs). The code diff is
lib/runaway.tsandtest/runaway.test.ts, which makegstack-runaway scanleave warm-wait check-ins out of the empty-wake rate (GST-1597). I checked every doc that mentions empty wakes or warm waits.Result: The
docs/captain.mdWarm waits entry already described the new behavior, and I rewrapped its overlong lines. I added a short note to thedocs/skills.md/runaway-stopper Detect bullet that warm-wait check-ins are left out of the 25% empty-wake rate. The CLI usage text inlib/runaway.tsalready carries the same note.Debt:
runaway-stopper/SKILL.md.tmplandREADME.mdstill describe the empty-wake limit without the exclusion. This is minor, and the template change needs agen:skill-docsregeneration by the owner. No new public surface, so there is no coverage gap and no diagram drift.Test plan
bun test test/runaway.test.ts: 18 tests ran, exit 0 (at 059f3a4 and on the final tree)bun run typecheck: exit 0empty_wake=88%/8, no WARN) and passes at 059f3a4gstack-ci-carry)