Skip to content

fix(ship): a cleared remote gate for HEAD's exact tree satisfies a lane whose inventory refuses that tree (GST-1688) - #4098

Merged
capy-ai[bot] merged 4 commits into
mainfrom
capy/gst-1688-remote-gate-stands-in
Nov 6, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
capy/gst-1688-remote-gate-stands-in

Conversation

@garrytan

@garrytan garrytan commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 4098,
  "head": "746121d663387a7180f51d4c5d8a944f525d99a1",
  "version": "1.97.0.0",
  "base": "main",
  "ci_carried": [
    {
      "lane": "test",
      "run": 42312911924,
      "attempt": 1,
      "tree": "6c390c1d6afed2fd4eb26cfff59c69f7d3ab26b4"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "6c390c1d6afed2fd4eb26cfff59c69f7d3ab26b4",
  "product_patch_id": "0bc102ec03e49063dd22449511007386e715d978",
  "gstack_version": "1.97.0.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 154,
    "rules": "70895942bb8a8ee2",
    "base": "e325b6d160179488f848f3d1f86c0df985baad87",
    "registry": "e325b6d160179488f848f3d1f86c0df985baad87",
    "gate_scan": {
      "tagged": 0,
      "head": "746121d663387a7180f51d4c5d8a944f525d99a1"
    },
    "reasons": [
      "runtime=154"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @6c390c1d6afe (8 checks, current for 746121d66338)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42312911924/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=6c390c1d6afe tests=36089 skipped=69 runs=42312911924/1 profiles=ci-reuse/free-tests heads=746121d66338 verified=2026-11-06T23:42:34.508Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CONTRIBUTING.md"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 2,
    "deferred": 0,
    "noted": 2,
    "fixed": 4,
    "scope": "frozen",
    "fix_checks": 2,
    "rounds": 3,
    "unrecorded": 1,
    "ledgers_read": 7,
    "unbound": 7,
    "dispatches": {
      "specialist": 3,
      "red-team": 1
    }
  }
}

What changed

A cleared pregate.json/remote_gate receipt for HEAD's exact tree now satisfies a /ship lane whose ship_lanes_from inventory refuses that tree. accept and finish print CI_CARRY: remote_gate label=<lane> receipt=… naming the substitution, and the ledger records the lane as source=remote_gate. A CI run whose tree.json lists no files now says to dispatch a fresh full run.

Why

gbrain's inventory refuses any tree that changes its CI-reuse files, so accept stopped with inventory_failed even after gstack-pregate --remote cleared the identical tree, and every such PR needed --no-lanes-approved plus a manual approval (GBRA-345). The Captain ruled on GST-1688 that a verified remote_gate receipt for the exact same tree satisfies the mapped lanes, and that the tree check never loosens.

Blast radius

The change touches record-ci, carryLane, accept and finish, and it runs only on a path that used to stop. The stand-in refuses unless the tree matches, base and policy name origin/<base>@, verify passes, the receipt reports tests above 0 without a stamp-only substitution, and the clear is under 24h old; 13 tests in test/ship-accept-remote-gate-lanes.test.ts exercise each refusal through the real bins (script ran).

Approvals

Approved: yes (record r-1427d4aa574f). The full approval record stays private: this repository is public or its visibility is unknown.

Summary

Lanes that gbrain's inventory refuses on purpose now carry from the remote gate that already cleared the same tree, instead of stopping for a manual approval. Commit 746121d also added two refusals the changelog fragment does not mention: base and policy must both name origin/<base>@, and a clear older than 24h never stands in.

Test Coverage

Coverage audit before the review fixes: 11 of 16 changed paths had a strong test. The review fixes added negative controls for a stamp-only substitution, 0 tests, a clear with no time, a look-alike stderr line, a finish case, and the base, policy and 24h refusals.
Tests ran: test 1621 (files), carried from CI run 42312911924/1

Pre-Landing Review

Step 9: 3 issues, 3 auto-fixed (lib/ci-carry.ts look-alike record line; stand-in refusal tests; finish test). Step 11: native adversarial and outside voice (openai/gpt-6.1-sol, completed). OV2 and native Low 4 fixed in 746121d under grant a-f2e343299dec; the granted fix-check found nothing blocking.
REVIEW_LOOP: passes=1 blocking_found=2 deferred=0 noted=2 fixed=4 scope=frozen
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)

Review notes

  • OV1 (open note, Captain's ruling): the record cannot say whether the remote gate ran the full suite or only pregate's selection (PREGATE_FILES_FILE); a selected-only gate can stand in for a full-suite lane. Captain ruled it an open note.
  • Native Medium 1: a receipt from gstack-pregate clear --receipt <file> (a hand-written PREGATE_REMOTE file) can stand in for a lane.
  • Native Medium 2: the stand-in row records the lane's command as passed, though the gate ran pregate's selected tests.
  • Native Medium 3: inventory_failed cannot tell a deliberate refusal from a crashed or missing inventory tool.
  • Native Low 5: the record-ci usage text does not mention --remote-gate-stands-in.
  • Fix-check note 1: records made under --policy-from head fail the policy guard, so a PR that changes CI-reuse files and adds a lane cannot use the stand-in.
  • Fix-check note 2: the guards check the origin/<base>@ prefix, not the sha, so a record against an older origin/main can stand in for up to 24h.

Exploratory QA

Functional smoke: the new test file passed (capture 001); a look-alike remote_gate line read as a stand-in before the fix (capture 002) and as the CI carry after it (capture 003).

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Scope Drift

Scope Check: CLEAN

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.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. The docs already describe the GST-1688 remote-gate stand-in accurately; no edits were needed.

Scope: candidate g1688d2, base 0c41ced to head 746121d, with 9 committed files and no staged, unstaged or new files. I checked the new docs/pregate.md section (#ship-lanes-remote-gate) and the changelog.d fragment against lib/remote-gate-stand-in.ts, lib/ship-bin-common.ts, lib/ship-release.ts, lib/ci-carry.ts and bin/gstack-evidence, and searched other docs for record-ci, remote_gate and inventory_failed references.

Documentation health:

  • docs/pregate.md: Current. The stand-in rules (tree, base and policy under origin/, verify, no stamp-only substitution, tests above 0, 24-hour limit), the CI_CARRY and LANE output, ci_carried exclusion and the no_tests rerun advice all match the code.
  • changelog.d/capy-gst-1688-remote-gate-stands-in.md: Current. Consistent with the code; not edited.
  • Other docs (ship-policy.md, troubleshooting.md, recommended-harness.md): Current. No conflicting statements.

Coverage debt: gstack-evidence record-ci --remote-gate-stands-in has a reference entry only, in pregate.md and the bin header, with no how-to. That's a common gap and acceptable for an internal flag. No critical gaps.

Diagram drift: none.

Test plan

  • bun run test: carried from CI run 42312911924/1 at 746121d, tests_ran=1621 files
  • bun test test/ship-accept-remote-gate-lanes.test.ts test/module-size-ratchet.test.ts: 19 pass, 0 fail

…ne whose inventory refuses that tree (GST-1688)

When a ship_lanes_from inventory refuses HEAD's tree (inventory_failed) and
.gstack/tmp/pregate.json verifies for that exact tree with the remote gate's own
report for it, record-ci --remote-gate-stands-in records the lane as
source=remote_gate and accept prints a CI_CARRY: remote_gate line naming the
receipt. A gate for any other tree still stops, with a CARRY_DIAGNOSIS line.
A run whose tree.json lists no files now says to dispatch a fresh full run.

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 22:12
… (bin shebang spawns; run 42302497169)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p2/specialist-batched#1 reader=red-team
Review-Finding: p2/specialist-batched#2 reader=testing
Review-Finding: p2/specialist-batched#3 reader=testing
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ar within 24h (review fix-check)

Review-Finding: p4/outside-voice#2 reader=outside-voice
Review-Finding: p4/adversarial-native#4 reader=adversarial-native
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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