Skip to content

Large repos can raise the review-plan time limit for every /ship step (GST-3398) - #4632

Merged
capy-ai[bot] merged 1 commit into
mainfrom
review-plan-timeout-everywhere
Nov 21, 2026
Merged

capy-ai[bot] merged 1 commit into
mainfrom
review-plan-timeout-everywhere

Conversation

@garrytan

@garrytan garrytan commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

GSTACK_REVIEW_PLAN_TIMEOUT_MS now raises the review-plan time limit in every place /ship runs the plan, not just two of them.
Why: on a 301,669-file repository the plan takes 255 to 316 s on a 2-core machine; the plan and the review pass read the variable, but render and preflight still cut it off at 180 s.
Nothing to do unless your repository is large; then set the variable (docs/troubleshooting.md#review-plan-stopped).

What changed

With GSTACK_REVIEW_PLAN_TIMEOUT_MS=1, render used to ignore the limit and finish; now it stops at the limit like the review pass does

With GSTACK_REVIEW_PLAN_TIMEOUT_MS=1, render used to ignore the limit and finish; now it stops at the limit like the review pass does.

Before/after as text: With GSTACK_REVIEW_PLAN_TIMEOUT_MS=1, render used to ignore the limit and finish; now it stops at the limit like the review pass does
--- Before · before.txt · captured output
+++ After · after.txt · captured output
 $ GSTACK_REVIEW_PLAN_TIMEOUT_MS=1 gstack-review-dispatch render --role outside-voice --base main ...
+gstack-review-dispatch render: gstack-review-plan did not finish inside the pass (reason=timeout after timeout_ms, reason=signal when something killed it, reason=spawn when it could not start), so the review stopped before any reader ran: gstack-review-dispatch pass writes no manifest, and a plan run by itself prints no plan (step="gstack-review-plan --base main --json" reason=timeout timeout_ms=1 signal=SIGTERM); fix: … (REVIEW_PLAN_STOPPED)
+BRIEF_RENDER_FAILED: gstack-review-plan --base main --json did not finish, so the base policy's review selection is unknown and no brief is rendered without it
+exit=1
-BRIEF: reader=outside-voice sha256=d54fec8eb844af700cd43e5fccea7d3048992a9a1419e8776902fac5bf76fd40 bytes=4587 file=<fixture>/b-one/outside-voice.prompt.md
-exit=0
 

A large repository that raised the limit still had /ship cut off at 180 seconds, because gstack-review-dispatch render (which runs the plan when the base policy has review_exclude_paths) and gstack-ship-preflight passed a fixed 180,000 ms to gstack-review-plan. Both now read the limit through reviewPlanTimeoutMs() in lib/review-collect.ts, the parser the plan and gstack-review-dispatch pass already used. A whole number of at least 1 ms sets it, a fraction rounds down, and an empty, zero, negative or non-numeric value keeps 180,000 ms. Render and pass now share one plan runner, so a render that runs out of time prints the same REVIEW_PLAN_STOPPED line instead of exited SIGTERM. docs/troubleshooting.md documents the variable and which commands read it.

Why

harness-evals#548 stopped twice at timeout_ms=180000 even though the variable was set. Large repositories can now raise one limit and have every /ship step honor it.

Blast radius

Only the two callers that launch gstack-review-plan change, and the default stays 180 s, so repositories that never set the variable behave exactly as before. A whole-tree read found no other hard-coded plan timeout (bin/gstack-review-dispatch and lib/ship-preflight.ts read; render and preflight walked at limits of 1 ms, 600,000 ms and unset in a fixture repository).

Test Coverage

All new code paths have test coverage. One path is weakly covered: preflight's use of the shared limit has only a source check; a fixture probe in Exploratory QA exercised it.
Tests: 1851 → 1851 (+0 new; the PR's own tests were written before this run)
Coverage: 83% value-weighted (100% including 1 weakly covered path)
Test value: 0 tests written, 0 rejected by the authoring gate, 0 existing tests extended, 1 path weakly covered (weak = ★, gate-failing or unrated).
Tests ran: targeted 34
Tests ran: test 1732

Pre-Landing Review

No blocking issues. Four review passes (a batched specialist read, a red-team read, a native adversarial read and a second-model review) found three items below the blocking floor, listed under Review notes; none was fixed in this PR. The second-model review returned clean.

Review notes

Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.

  • INFORMATIONAL sf-6650a61b0584 security finding, details recorded privately
  • INFORMATIONAL lib/ship-preflight.ts:195 Preflight runs gstack-review-plan without GSTACK_REVIEW_PLAN_BOUNDED=1 under the same limit as the plan's own wrapper, so on timeout the wrapper is killed and the inner plan keeps running; RUNTIME_LINES prints unknown with no stop line. Same behaviour on main.
  • INFORMATIONAL lib/review-collect.ts:152 reviewPlanTimeoutMs accepts values of 2^31 ms or more, which Bun's spawnSync wraps to a short timeout.
Exploratory QA

Functional smoke on an owned two-commit fixture repository, 5 probes, all pass: render finishes with the variable unset; stops with REVIEW_PLAN_STOPPED timeout_ms=1 and writes no diff at 1 ms; finishes at 600,000 ms; preflight prints RUNTIME_LINES: unknown at 1 ms and a count when unset. Not measured: plan speed on a large repository.

Eval Results

No prompt-related files changed — evals skipped.

Review bot comments

No review bot comments.

Scope Drift

Scope Check: CLEAN
Intent: make render and preflight honor GSTACK_REVIEW_PLAN_TIMEOUT_MS like the plan and pass do.
Delivered: both callers read the shared parser, render prints the shared stop line, with tests and docs.

Verification Results

No plan verification items (bug fix, no plan file).

TODOS

No TODO items completed in this PR.

Documentation

Status: current. Documentation already matches this change, so no edits were needed.

Scope: commit 24fe6ae against base 6263e0e (8 files: bin/gstack-review-dispatch, lib/review-collect.ts, lib/ship-preflight.ts, two docs, one changelog fragment, two tests). Nothing was staged, unstaged or untracked.

Documentation health

  • docs/troubleshooting.md: current. The REVIEW_PLAN_STOPPED entry covers render and preflight, the variable's parsing (checked against reviewPlanTimeoutMs) and guidance for large repositories.
  • docs/review-policy.md: current. It names render beside pass.
  • changelog.d/review-plan-timeout-everywhere.md: current and consistent with the code.

Coverage debt: GSTACK_REVIEW_PLAN_TIMEOUT_MS has reference and how-to docs in troubleshooting.md but no tutorial (minor). No critical gaps.

Diagram drift: none.

Tests
  • bun test test/review-dispatch-plan-timeout.test.ts test/review-collect.test.ts: 34 pass
  • bun run test: carried from CI run 44951373692 (1732 files, green)
Agent notes

Issue GST-3398, from HARN-108 via HARN-1 (harness-evals#548 stopped twice at timeout_ms=180000). Whole-tree grep for the limit: the only hard-coded plan timeouts were bin/gstack-review-dispatch:363 (render) and lib/ship-preflight.ts:194; the other 180_000 literals bound unrelated commands. Scaling the limit by repository size is out of scope here.

Refs GST-3398

Approvals

No approvals recorded for branch review-plan-timeout-everywhere.
Plan: exempt: bug fix GST-3398 (kind fix; failing-first test shown on main)
Plan check: exempt bug fix

Pre-Landing Review: 3 issues — 0 auto-fixed, 0 asked (0 fixed, 0 skipped), 0 deferred, 3 noted
Gate edits: none detected (4 listed, 3 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: openai/gpt-6.1-sol (host subagent) completed, VERDICT: CLEAN

Open in Capy

{
  "schema_version": 1,
  "pr": 4632,
  "head": "24fe6ae9a8c6abf2d79f2fa323790a11bd9cc3ce",
  "version": "1.102.1.0",
  "base": "main",
  "gate": {
    "targeted": {
      "pass": 34,
      "fail": 0,
      "skip": 0
    },
    "test": {
      "pass": 1732,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "test",
      "run": 44951373692,
      "attempt": 1,
      "tree": "1aef03ca270cc2ebf3ff3b32dc05a4ebe4dcf005"
    }
  ],
  "calls": 22,
  "session_kind": "unattended",
  "run": "ship-4632",
  "head_tree": "1aef03ca270cc2ebf3ff3b32dc05a4ebe4dcf005",
  "product_patch_id": "a8e469e4aac04524d64403e6c5eca32db5ac65a4",
  "gstack_version": "1.102.1.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 41,
    "rules": "85b3923b1a978e41",
    "base": "6263e0ef33fc5827a7642fc5c8b2757affed7fbc",
    "registry": "6263e0ef33fc5827a7642fc5c8b2757affed7fbc",
    "gate_scan": {
      "tagged": 0,
      "head": "24fe6ae9a8c6abf2d79f2fa323790a11bd9cc3ce"
    },
    "reasons": [
      "gate-class",
      "runtime=41"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @1aef03ca270c (8 checks, current for 24fe6ae9a8c6)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44951373692/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44951373664/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=1aef03ca270c tests=38696 skipped=65 runs=44951373692/1 profiles=ci-reuse/free-tests heads=24fe6ae9a8c6 verified=2026-11-21T21:48:38.214Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, CLAUDE.md, AGENTS.md, CONTRIBUTING.md against commit 24fe6ae (base 6263e0ef)"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 3,
    "fixed": 0,
    "scope": "frozen",
    "rounds": 1,
    "ledgers_read": 6,
    "unbound": 1,
    "dispatches": {
      "specialist": 1,
      "red-team": 1
    }
  },
  "gate_dispositions": []
}

…ep (GST-3398)

gstack-review-dispatch render and gstack-ship-preflight ran gstack-review-plan under a fixed 180 s while the plan and the pass read GSTACK_REVIEW_PLAN_TIMEOUT_MS; every caller now reads it through reviewPlanTimeoutMs.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@capy-ai
capy-ai Bot merged commit c8641cc into main Nov 21, 2026
61 of 62 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