Skip to content

ship accept: record-ci bound from base ci_record_timeout_s; say when the final pregate ran tests here (GST-1606) - #4065

Merged
capy-ai[bot] merged 4 commits into
mainfrom
capy/gst-1606-record-ci-timeout
Nov 6, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
capy/gst-1606-record-ci-timeout

Conversation

@garrytan

@garrytan garrytan commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

accept stopped every gstack-evidence record-ci at a fixed 600 s. harness-evals #271's record-ci needs about 745 s, so that lane ran record-ci and the rest of accept by hand. The same run's final pregate found no run profile for this OS and ran 3,666 tests locally with no reason given.

Configurable record-ci bound. A new .gstack/ship-policy.json key, ci_record_timeout_s (an integer, at least 60, default 600, needs min_gstack_version), sets the bound. accept reads it from the base branch only and clamps a value over 3600 to 3600. Before carrying lanes it prints CI_RECORD_TIMEOUT: <n>s (default | origin/<base> ci_record_timeout_s | … <value> is over the 3600s ceiling).

No-carry pregate line. When the final pregate's tests stage gets no CI carry, accept now prints one line: CI_CARRY: none (<reason>); the final pregate's tests stage ran here instead: tests <verdict> in <n>s (docs/pregate.md#accept-local-tests). An accepted carry keeps its plain line. docs/pregate.md#accept-local-tests explains the usual cause: a run profile without os still carries ship_lanes_from lanes, but not the tests stage.

Tests: test/ship-accept-record-timeout.test.ts (written failing-first) covers a base value that is honored, a value over the ceiling that is clamped, a head-only value that is ignored, validation, the no-carry line, and the accepted line staying unchanged.

Fixes GST-1606.

Open in Capy

{
  "schema_version": 1,
  "pr": 4065,
  "head": "e73a96241178831280e30138626915b572dc0349",
  "version": "1.96.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1606,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 42216383838,
      "attempt": 1,
      "tree": "a0b2190012bb09ba32b95a2744e1afa4d86e31ca"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "a0b2190012bb09ba32b95a2744e1afa4d86e31ca",
  "product_patch_id": "89b0276d374e9d071d68665b703498a9f8d7ddc9",
  "gstack_version": "1.96.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 59,
    "rules": "70895942bb8a8ee2",
    "base": "937b360fedcd8f2c3f2483090e93628767ca99e2",
    "registry": "937b360fedcd8f2c3f2483090e93628767ca99e2",
    "gate_scan": {
      "tagged": 0,
      "head": "e73a96241178831280e30138626915b572dc0349"
    },
    "reasons": [
      "gate-class",
      "runtime=59"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @a0b2190012bb (7 checks, current for e73a96241178)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42216383838/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/42215531969/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=a0b2190012bb tests=35900 skipped=92 runs=42216383838/1 profiles=ci-reuse/free-tests heads=e73a96241178 verified=2026-11-06T12:24:26.757Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md, CONTRIBUTING.md against f7015fa..e73a962"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 1,
    "deferred": 0,
    "noted": 1,
    "fixed": 1,
    "scope": "frozen",
    "rounds": 2,
    "est_input_tokens": 18057,
    "ledgers_read": 3,
    "dispatches": {
      "specialist-batched": 2,
      "red-team": 2
    }
  }
}

What changed

accept now bounds each gstack-evidence record-ci by the base ship policy's new ci_record_timeout_s key and prints the bound it used. When the final pregate's tests stage gets no CI carry, accept prints one CI_CARRY: none (...) line saying the tests ran here, with their verdict and time.

Image: unavailable. gstack-pr-shots refused both doc sections (PR_SHOTS_INPUT_REFUSED: dotted version strings such as 1.91.73.0 match the scanner's pii.ip_public rule), so this is the text version.

Text before/after

Before: accept stopped every record-ci at a fixed 600 s, and a final pregate that ran the tests stage locally printed no reason.

After, with ci_record_timeout_s: 900 on the base:

CI_RECORD_TIMEOUT: 900s (origin/main ci_record_timeout_s)

After, with a value over the ceiling: CI_RECORD_TIMEOUT: 3600s (origin/main ci_record_timeout_s 7200 is over the 3600s ceiling). Unset: CI_RECORD_TIMEOUT: 600s (default).

After, when the tests stage was not carried:

CI_CARRY: none (no_profile: ...); the final pregate's tests stage ran here instead: tests <verdict> in <n>s (docs/pregate.md#accept-local-tests)

Why

On harness-evals #271 the CI run took about 745 s, so accept's fixed 600 s cap killed record-ci and the lane had to finish accept by hand. The same run's final pregate then ran 3,666 tests locally with no line saying why. Now a repository raises the bound on its base branch, and accept says when and why the tests ran here.

Blast radius

The key is read only from origin/<base>, and validatePolicy rejects anything that is not an integer of at least 60. An invalid base policy falls back to DEFAULT_POLICY, so a bad value can't reach spawnSync: I read this at lib/ship-policy.ts:650-651, and the QA probe exercised the validator and the clamp. finish and preflight still call carryLane with the default 600 s, so only accept behavior changes; the review notes below list that.

Approvals

No approvals recorded for branch capy/gst-1606-record-ci-timeout.

Summary

accept stopped every record-ci at 600 s, which is too short for a repository whose CI runs longer, and the final pregate's local test run gave no reason. A base-only ci_record_timeout_s key (default 600, at least 60, clamped to 3600) now sets the bound, accept prints CI_RECORD_TIMEOUT:, and a no-carry tests stage gets one explanatory CI_CARRY: none line. A review fix made the new test's fixture follow the host OS, so its accepted-carry case also holds on macOS.

Test Coverage

The Step 7 audit ran audit-only (no generation allowance, since the unattended run was told not to edit code outside review fixes).

recordCiTimeout(): base 900 ★★★, clamp 7200→3600 ★★★, absent/branch-only → default ★★★; GAP: explicit 600 label
carryLane(timeoutS): GAP: timeoutS*1000 reaching bin() is not asserted (only the printed line)
validatePolicy ci_record_timeout_s: 60/7200 ok; '900', 59, 600.5, null rejected; key without min_gstack_version rejected ★★★
accept CI_CARRY relay: accepted ★★, none + tests line ★★; GAP: none without tests line; GAP: no CI_CARRY + tests fallback text; GAP: clip() truncation
windows-curation entry ★★

Tests: 1731 → 1731 (+0 new)
Coverage: 63% value-weighted (69% 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: free 1606 (files), carried from CI run 42216383838/1 (35,900 tests at tree a0b2190012bb)

Pre-Landing Review

Review plan: class gate at full depth, 4 dispatches, fingerprint 05f58c1c8634a03f, reviewing the whole diff first, with a batched specialist (testing, security, state-machines), Red Team, native adversarial and an outside voice (GPT-6.1 Sol subagent; Codex CLI is not installed).

Pre-Landing Review: 4 issues — 0 auto-fixed, 1 fixed, 2 skipped, 0 deferred, 1 noted (the fixed one is the Step 11 blocker below; the Step 11 Low notes are listed under Review notes). Pass 1's three findings were INFORMATIONAL and below the blocking floor (a finding blocks only if it would fail a test, break production, or lose data or secrets), so the unattended run skipped them under that standing rule and lists them as notes.

Step 11: the outside voice found one blocker. The new test hard-coded a Linux run profile and an ubuntu runner, so its accepted-carry case would fail on macOS (fromRunProfiles matches the profile's os to the host). Fixed in e73a962 (test-only; the profile os, tree.json os and runner follow the host). Native adversarial: 4 Low diagnostics findings, Blocks: no, kept as notes.

Pass 2 (range 240fc0f..e73a962): Pre-Landing Review: No issues found.

REVIEW_LOOP: passes=2 blocking_found=1 deferred=0 noted=1 fixed=1 scope=frozen ledgers_read=3 dispatches=4 est_input_tokens=18057

Gate edits: none detected (1 listed, 0 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)

Outside review: completed (GPT-6.1 Sol subagent standing in for Codex); its one finding was fixed.

Review notes

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

  • INFORMATIONAL lib/ship-release.ts:509 Only accept passes the new bound. finish's and preflight's carryLane keep 600 s, so a repository with a long record-ci spends 600 s in finish before accept carries the lane. spawnSync's timeout also leaves record-ci's grandchild running (pre-existing). (red-team, noted)
  • INFORMATIONAL lib/ship-bin-common.ts:210 CI_RECORD_TIMEOUT: 600s (default) also prints when the base policy is invalid or refused (POLICY_GSTACK_TOO_OLD), which hides a value the base declares. (red-team, skipped under the blocking floor; native adversarial agrees)
  • INFORMATIONAL lib/ship-release.ts:601 No test covers the fallback "the pregate policy declares no run_profiles" text, and that text also prints when autoCarry returned null for another reason (--no-ci-carry, fromRun). (testing specialist, skipped under the blocking floor; native adversarial agrees)
  • Low lib/ship-bin-common.ts:205 A record-ci killed at the bound reports record_failed: <first stderr line>, not a timeout naming ci_record_timeout_s. (native adversarial, noted)

Exploratory QA

Functional surface (CLI), bounded smoke of 300 s. Charters cover accept's CI_RECORD_TIMEOUT/CI_CARRY lines and the key's input rules.

  • 001 green: bun test test/ship-accept-record-timeout.test.ts, all 6 cases green (real bins through the fixture).
  • 002 superseded: the probe script itself was wrong (validatePolicy returns PolicyError[]), so it produced no product observation.
  • 003 green: 59, '900' and 600.5 rejected; 60 and 7200 accepted; 7200 clamps to 3600 with its reason; a null policy and 600 print 600s (default); 900 prints 900s (origin/main ci_record_timeout_s).

Evidence verdict (gstack-qa-evidence materialize): inconclusive, open item "capture 002 superseded". Both required smoke contracts passed on current inputs (001, 003). After the review fix changed the test file, the same file was rerun directly (all 6 cases green), outside the evidence tool. Not run: record-ci actually being stopped at the bound end to end, and the invalid-base-policy label. macOS was not run here; the fix rests on reading fromRunProfiles and parseWorkflow.

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Review bot comments

No review bot comments.

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.

Issues

Refs v1/outside-voice#1
reference v1/outside-voice#1 ← commit e73a962: Review-Finding: v1/outside-voice#1 reader=outside-voice

Verification Results

No plan-specific verification items (no plan file). Automatic QA is above.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. The branch's own docs already describe the GST-1606 change, so no edits were needed.

Scope: base f7015fa..e73a962 (4 commits, 9 files). No staged, unstaged or new files.

Documentation health:

  • docs/ship-policy.md: current. The ci_record_timeout_s row (anchor #ci-record-timeout) matches the code's default (600), minimum (60), clamp (3600) and CI_RECORD_TIMEOUT: lines.
  • docs/pregate.md: current. The CI_RECORD_TIMEOUT: note and the #accept-local-tests section match lib/ship-release.ts.
  • changelog.d/capy-gst-1606-record-ci-timeout.md: current, and both of its anchor links resolve. It was not edited because the parent owns it.
  • CLAUDE.md, README.md, AGENTS.md: no changes needed.

Coverage debt: ci_record_timeout_s and the accept no-carry line have reference and how-to coverage. A worked .gstack/ship-policy.json example is a minor gap.

Diagram drift: none.

Test plan

  • bun run test (lane free): carried from CI run 42216383838/1 at tree a0b2190012bb, 1606 files, 35,900 tests, exit 0
  • bun test test/ship-accept-record-timeout.test.ts test/spawnsync-timeout-tripwire.test.ts: all 9 cases green
  • bun run typecheck:test: 812 known diagnostics, none new
  • Remote lanes cleared: macos-named-regressions (run 42216383838), windows-smoke (run 42215531969)

🤖 Generated with Claude Code

garrytan and others added 3 commits November 6, 2026 11:42
…carry pregate line (GST-1606)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ays when the final pregate ran tests here (GST-1606)

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

trunk-io Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

The accept record-ci timeout test's run profile, tree.json os and workflow runner follow the host, so the accepted-carry case holds on macOS too (fromRunProfiles matches the profile os to the host; a runner for another OS is a platform lane).

Review-Finding: v1/outside-voice#1 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot marked this pull request as ready for review November 6, 2026 12:28
@capy-ai
capy-ai Bot merged commit 37f81cf 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