Skip to content

v1.91.245.0 fix(ship-queue): ready counts the latest run per check name and hints the dispatch route on a conflicting PR - #3460

Merged
capy-ai[bot] merged 10 commits into
mainfrom
capy/ready-ci-rollup-and-docs
Oct 26, 2026
Merged

capy-ai[bot] merged 10 commits into
mainfrom
capy/ready-ci-rollup-and-docs

Conversation

@garrytan

@garrytan garrytan commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3460,
  "head": "e3f351020804374fdff19ed9f589a9f61a67c773",
  "version": "1.91.237.0",
  "base": "main",
  "gate": {
    "remote-free-tier": {
      "pass": 9177,
      "fail": 0,
      "skip": 0
    },
    "focused": {
      "pass": 289,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "pregate": "requires-remote cleared @37e8f1246c23 (1 checks, current for e3f351020804)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/40300595421",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/40300599805",
    "pregate.json/remote_gate: remote-gate tree=37e8f1246c23 tests=9177"
  ],
  "issues": {
    "fixes": [],
    "refs": [
      3439
    ],
    "flakes": []
  }
}

What changed

Three follow-ups from GSTA-101's files, first stacked on #3451 and now based on main (v1.91.237.0 merged in after #3438 and #3451 landed):

  1. gstack-ship-queue ready counts CI the way GitHub's rollup does. ciAtHead counted every check run on the commit, so a superseded run (gbrain saw a cancelled contributor-gate beside three later passes on the same head) read as failed=1 while GitHub showed 0 failed. The new latestRunPerName (lib/ship-queue.ts) keeps the newest run per check, keyed by the reporting app's id plus the check name (latest completed_at, then highest id; a run still in progress is newest). Two apps reporting one name stay separate, a run with no name or no readable completed_at counts on its own (fail closed), and commit-status contexts still count one each.
  2. docs/ship-policy.md follows v1.91.238.0 fix(ship): gate-diff base in single-branch clones, gstack-post release versions and receipt ids, evidence tests_ran, restamp duplicate headings and stamp prompt (GSTA-102) #3439. The stamp-at-merge row's next: description now quotes the train wording gstack-restamp prints since v1.91.238.0 fix(ship): gate-diff base in single-branch clones, gstack-post release versions and receipt ids, evidence tests_ran, restamp duplicate headings and stamp prompt (GSTA-102) #3439 (commit and push only the stamp diff above (FILES), with no edit of your own), and the restamp changelog stage describes CHANGELOG_DUPLICATE_HEADING as only a duplicate the PR introduces, measured against the base's CHANGELOG at origin/<base> and the fork point.
  3. The CHANGELOG-only-conflict READY procedure is recorded and hinted. docs/ship-policy.md "Lane: report ready" says what GStack Minder has been applying: a conflicting PR has no merge ref so no pull_request CI runs; dispatch free-tests.yml and windows-free-tests.yml on the branch, clear the pregate lanes with the run URLs, rerun ready; --screen refuses on such a PR for want of a merge ref (QUEUE_SCREEN_STALE_REF, <remote> has no refs/pull/<n>/merge) and its merge-the-base advice does not apply, so the lane READYs with --no-screen after its own paid cases ran focused. ready itself prints a ci-hint: line on a conflicting PR (gh pr view also reads mergeable, headRefName and isCrossRepository): the dispatch procedure with --ref <branch> when there is no CI at the head (a branch name outside ^[\w.][\w./-]*$ prints as the literal <branch>), a coordinator-decides hint when the head is on a fork, and "were not pull_request runs (dispatched on the branch, or push-triggered), and they count" when the runs are green. Every hint ends in (advisory) and nothing parses it; no hint without a conflict or while runs are red or pending.

Why

GStack Minder asked for the three as one PR after the first two rule-22 ships. The rollup fix matters because a READY that reads red on a head GitHub calls green blocks a lane for no reason; matching the rollup's rule is the smallest change that agrees with what the lane sees on GitHub, and keying on app id as well as name keeps two apps' same-named checks from hiding each other. The hint matters because the CHANGELOG-only conflict is the normal state of every READY PR once main stamps (rule 14 says never merge main), so the route to green CI belongs on the command's own output, not in a chat thread.

Approvals

Date Ask Words Covers Pending
2026-10-26 GStack Minder (crew rule 8): three follow-ups as one PR stacked on #3451: latest run per check name in ciAtHead with a cancelled-older-run fixture; reword ship-policy lines 471 and 520 to #3439's behaviour; record the CHANGELOG-only READY procedure and have ready print the hint "Make it take the latest run per check name (by completed_at, then id), matching GitHub's rollup, and keep commit statuses as they are" this PR none

Gate edits

This strengthens. One test file changed, nothing weakened (gstack-gate-diff hunks eb07e8515c35 and 23349061c2ba, both listed, no tags):

  • test/gstack-ship-queue.test.ts: three new tests. Two runs of one check name where the older is cancelled read green in either order; a newer failure reads red; a newer in-progress or queued run reads pending; equal completed_at falls back to the id; unnamed and undated runs stay separate; two apps with one name stay separate; a null conclusion reads red; a commit status never collapses with a check run of the same name. A conflicting PR with no CI refuses with the dispatch hint naming the branch; with green dispatched runs it READYs with the "counts" hint; a fork head and an odd or dash-led branch name get the safe hint; no hint without a conflict or while runs are red or pending. Three of the four original cases fail without the lib change (stash proof: 1 pass / 3 fail). The conflict fixture's PR body carries a ship receipt (shippedBody), because main's v1.91.236.0 feat(ship-queue): require a current /ship receipt before READY, train build and train merge #3438 makes ready refuse a bodyless PR with QUEUE_RECEIPT_MISSING before CI is judged; train 11 caught that at the prefix f008280 and this is the one-line repair.

Summary

Four commits plus the main merge on capy/ready-ci-rollup-and-docs (4 files vs main, +162/−10): lib/ship-queue.ts (latestRunPerName, conflictHint, ciAtHead returning {line, green, none}, the wider gh pr view read), docs/ship-policy.md, CHANGELOG.md [Unreleased] (10 inserted lines, nothing removed), test/gstack-ship-queue.test.ts.

Test Coverage

All new code paths have test coverage (Step 7's coverage diagram did not run in this unattended lane).
Tests ran: focused test/gstack-ship-queue.test.ts (22), test/parity-baseline-integrity.test.ts, test/spawnsync-timeout-tripwire.test.ts, test/module-size-ratchet.test.ts, test/troubleshooting-anchors.test.ts, test/changelog-merge-damage.test.ts, test/restamp-gate-ahead-changelog.test.ts: 289 pass, 0 fail at e3f3510
Tests ran: remote free tier (9177 tests, 0 failed, tree 37e8f1246c23) plus dispatched Free Tests and Windows Free Tests at the head — see the receipt

Pre-Landing Review

Four review cycles, each a specialist pass (testing, maintainability, security) beside an adversarial pass, recorded against their start tokens. Cycle 1 found a CRITICAL (the per-name key collapsed two apps' same-named checks; fixed by keying on app id), a branch-name shell-injection risk in the hint (fixed with the ^[\w.][\w./-]*$ allow-list), the loss of undated runs (now standalone) and advisory wording (fixed). Cycle 2 found a dash-led branch name (allow-list tightened), an overclaiming green hint (reworded) and an empty ### Tests heading (filled). Cycle 3 found only the docs naming a result code this branch does not define (reworded at 56bf2aa). Cycle 4 at 56bf2aa: both passes NO FINDINGS. Cycle 5 at e3f3510 (after the main merge and the shippedBody repair): both passes NO FINDINGS, converged. One accepted design point: two workflows of one app that share a job name collapse to the later run, which is the re-run case this fix exists for; gstack's job names are unique.
Gate edits: 2 listed, 2 read, 0 findings — 0 kept, 0 restored, 0 open (gstack-gate-diff tags none; the test file's hunks are described under Gate edits above).
Outside review: Codex unavailable (codex_reviews unset, codex not installed) — listed as missing coverage.

Exploratory QA

Surfaces: gstack-ship-queue ready against the gh shim with superseded, re-run, in-progress, same-timestamp, unnamed and undated check runs, two apps sharing a name, a same-named commit status, and a conflicting PR with no, green, red and pending dispatched runs, on a fork, and with odd branch names. Every reproducer lives in the test file. Live case: this PR's own head went CHANGELOG-only-conflicting when main stamped #3439, so ready on it exercised the real ci-hint: path with dispatched runs (see the READY block in the thread).

Design Review

No frontend files changed — design review skipped.

Eval Results

No prompt-related files changed — evals skipped.

Greptile Review

No Greptile comments.

Verification Results

Reviews: 5 cycles, final pair at e3f3510 clean, completed and converged (review via ship), binding verified and current.
Pregate: local PREGATE: requires-remote exit 0 on tree 37e8f1246c23; remote gate cleared the free tier (9177 tests, 0 failed, $0.06); the macos-named-regressions and windows-free-shard lanes cleared from Free Tests 40300595421 and Windows Free Tests 40300599805, dispatched on the branch because main stamped #3439 after this head was pushed and GitHub stopped running pull_request CI on it, which is the procedure this PR documents.

TODOS

No TODO items completed in this PR.

Documentation

Scope. The /document-release read-only audit ran three times: ship-20261026T065615Z-b321deb4c (b321deb), ship-20261026T070223Z-56bf2aac5 (56bf2aa) and ship-20261026T092152Z-e3f351020 at this head, after the main merge. Each checked docs/ship-policy.md's "Lane: report ready" paragraphs, the stamp-at-merge row, the restamp changelog stage and the CHANGELOG [Unreleased] entry against lib/ship-queue.ts and lib/ship-queue-train-ready.ts; test/troubleshooting-anchors.test.ts passes (237).

Result. Current at e3f3510. The first audit's blocker (a result code this branch did not define) went away with the main merge: main's #3438 defines QUEUE_SCREEN_STALE_REF and prints <remote> has no refs/pull/<n>/merge (lib/ship-queue-train-ready.ts:121), which is what the paragraph now names. The ready rollup, ci-hint: variants, branch allow-list and gh pr view fields all match the code.

Debt. The second audit's remaining point, the next: row and the restamp changelog stage describing #3439's behaviour before #3439 merged, closed when #3439 landed on main as v1.91.238.0 during this ship (main's bin/gstack-restamp prints with no edit of your own). No open debt.

Issues

Refs #3439

Test plan

  • bun run typecheck: zero errors
  • bun run typecheck:test: 819 known diagnostics, none new
  • bun test test/gstack-ship-queue.test.ts test/parity-baseline-integrity.test.ts test/spawnsync-timeout-tripwire.test.ts test/module-size-ratchet.test.ts test/troubleshooting-anchors.test.ts test/changelog-merge-damage.test.ts test/restamp-gate-ahead-changelog.test.ts: 289 pass, 0 fail at e3f3510
  • gstack-pregate run --allow-repo-commands + gstack-pregate --stage tests --remote --spend-cap 2 --timeout 2700 --allow-repo-commands: 9177 tests, 0 failed on tree 37e8f1246c23 ($0.06)
  • Free Tests 40300595421 and Windows Free Tests 40300599805 dispatched on the branch at e3f3510: green; push-triggered Workflow Lint, Skill Docs Freshness, Version Gate and Quality gate green (no pull_request runs: the head conflicts with main on CHANGELOG.md only, rule 14)

🤖 Generated with Claude Code

garrytan and others added 9 commits October 26, 2026 04:26
…s not a stamp

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…tputs it must rewrite, prune the staging worktree

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…tput from a file, never follow a VERSION symlink

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…, read a bounded log

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… the dispatch route on a conflicting PR; ship-policy follows #3439

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…s standalone, quote the hint branch; restore the full CHANGELOG

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…en hint, restore the CHANGELOG tests bullet

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…n a conflicting PR

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…he conflict fixture carries a ship receipt, the --screen refusal is named as main prints it

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot changed the base branch from capy/version-gate-regenerated-release-output to main October 26, 2026 09:20
@trunk-io

trunk-io Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title fix(ship-queue): ready counts the latest run per check name and hints the dispatch route on a conflicting PR v1.91.245.0 fix(ship-queue): ready counts the latest run per check name and hints the dispatch route on a conflicting PR Oct 26, 2026
@capy-ai
capy-ai Bot merged commit 6154b6e into main Oct 26, 2026
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