Skip to content

runaway: warm-wait check-ins are not empty wakes (GST-1597) - #4069

Merged
capy-ai[bot] merged 4 commits into
mainfrom
gst-1597-runaway-warm-wait
Nov 6, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
gst-1597-runaway-warm-wait

Conversation

@garrytan

@garrytan garrytan commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 4069,
  "head": "f3b5a26d07adf889563661c5fd7dc0c359a9f796",
  "version": "1.96.0.0",
  "base": "main",
  "gate": {
    "runaway": {
      "pass": 18,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "333488c5da29d86e80a13a8a57b0f0622cf1a8f5",
  "product_patch_id": "9c5242b86743f73be712657fa941bfe1dafe01fe",
  "gstack_version": "1.96.0.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 49,
    "rules": "70895942bb8a8ee2",
    "base": "673a336bc447061c445a53ff44f50486556053a0",
    "registry": "673a336bc447061c445a53ff44f50486556053a0",
    "gate_scan": {
      "tagged": 0,
      "head": "f3b5a26d07adf889563661c5fd7dc0c359a9f796"
    },
    "reasons": [
      "runtime=49"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @333488c5da29 (7 checks, current for f3b5a26d07ad)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42225442567/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/42224479159/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=333488c5da29 tests=35909 skipped=111 runs=42225442567/1 profiles=ci-reuse/free-tests heads=f3b5a26d07ad verified=2026-11-06T13:31:48.272Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "updated",
    "scope": "docs/ (137 candidate docs) plus README.md, runaway-stopper/SKILL.md.tmpl and the changelog.d fragment; base origin/main 37f81cf19d21"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 4,
    "deferred": 1,
    "noted": 2,
    "fixed": 2,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 3,
    "ledgers_read": 3,
    "dispatches": {
      "specialist": 1,
      "red-team": 1
    }
  },
  "carry": {
    "from": "09b27407119926c2746a0e188239574e6663b022",
    "reason": "scoped re-check by anthropic/claude-opus-5-5 (range-diff 75 lines) + test-only change + release metadata + regenerated outputs",
    "product_patch_id": "9c5242b86743f73be712657fa941bfe1dafe01fe",
    "changed_paths": [
      "metadata:changelog.d/gst-1597-runaway-warm-wait.md",
      "product:docs/captain.md",
      "product:lib/runaway.ts",
      "generated:runaway-stopper/SKILL.md",
      "product:runaway-stopper/SKILL.md.tmpl",
      "test:test/runaway.test.ts"
    ],
    "merge_commits": 0,
    "range_diff": "1:  dba47ee = 1:  dba47ee runaway: warm-wait check-ins are not empty wakes (GST-1597)\n2:  059f3a4 = 2:  059f3a4 fix: pre-landing review fixes\n3:  09b2740 = 3:  09b2740 docs: note the warm-wait exclusion in the /runaway-stopper summary; rewrap captain.md (GST-1597 docs audit)\n-:  ------- > 4:  f3b5a26 runaway: keep wait input in the skill collector; 240 s timers chain only on the run's operations; status reads keep the warm window (GST-1597)",
    "covers": [
      "pre-landing review",
      "adversarial review",
      "gate integrity",
      "documentation audit"
    ],
    "reruns": [
      "CI at head (gstack-ship-queue ready requires it); test and helper code changed since the reviewed head runs there unreviewed"
    ],
    "ancestry": "linear",
    "trees": [
      "285a15110387cb4e5887c6e4c9e9bb241f6646a2"
    ]
  }
}
{"head":"09b27407119926c2746a0e188239574e6663b022","version":"1.96.0.0","gstack_version":"1.96.0.0","review_loop":{"passes":2,"blocking_found":4,"deferred":1,"noted":2,"fixed":2,"scope":"frozen","fix_checks":1,"rounds":3,"ledgers_read":3,"dispatches":{"specialist":1,"red-team":1}},"depth":"light"}

What changed

gstack-runaway scan no 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 scan counted 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 emptyWakes in lib/runaway.ts, which only assess calls, and to the --help text. 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 keep input today (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 --help text, 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 raise FLAG: 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: stop because 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:

  • runaway-stopper/SKILL.md.tmpl:50 (outside voice, Blocks: yes; deferred, unfiled): the /runaway-stopper collector projects transcript items to source, tool, createdAt, calls and state only. It drops input, so waitArgs always 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 keep input for wait items in that projection, then run gen:skill-docs.
  • lib/runaway.ts:81 (outside voice 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.
  • lib/runaway.ts:80 (outside voice 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.
  • lib/runaway.ts:88 (native adversarial, Low): an inbound message answered only by a re-wait on the same operation is left out, because close() never looks at what opened the turn.
  • lib/runaway.ts:57 (native adversarial, Low): waitArgs parses only a string input or input.text JSON. Any other recorded shape turns the exclusion off without a message, which fails toward over-counting.
  • Docs debt (docs audit): runaway-stopper/SKILL.md.tmpl and README.md still describe the empty-wake limit without the exclusion.

Exploratory QA

Functional CLI smoke on bin/gstack-runaway scan at 059f3a4 (2 probes, report-only, verdict pass): a compliant warm-wait lane printed empty_wake=0%/20 with verdict OK, and a single operation re-waited every 240 s for 4 hours printed FLAG: WARN empty_wake 100% of 40 turns > 25%. Both ran on synthetic transcripts that include input, 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.ts and test/runaway.test.ts, which make gstack-runaway scan leave 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.md Warm waits entry already described the new behavior, and I rewrapped its overlong lines. I added a short note to the docs/skills.md /runaway-stopper Detect bullet that warm-wait check-ins are left out of the 25% empty-wake rate. The CLI usage text in lib/runaway.ts already carries the same note.

Debt: runaway-stopper/SKILL.md.tmpl and README.md still describe the empty-wake limit without the exclusion. This is minor, and the template change needs a gen:skill-docs regeneration 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 0
  • Failing-first: the new chain assertion failed at dba47ee (empty_wake=88%/8, no WARN) and passes at 059f3a4
  • CI free-tests run 42222183035/1 green at 09b2740 (35907 tests, carried by gstack-ci-carry)

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>
@trunk-io

trunk-io Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 6, 2026 12:42
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>
@capy-ai
capy-ai Bot merged commit ff65fb0 into main Nov 6, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant