Skip to content

v1.94.33.0 fix(ship-queue, hooks): selector reads the checkout under review; one SWITCH_DEFAULT per hook switch; installs are not checks; timed agent deferral (GST-1088 follow-up) - #3933

Merged
capy-ai[bot] merged 6 commits into
mainfrom
capy/gst-1088-lane-a-followup
Nov 3, 2026

Conversation

@garrytan

@garrytan garrytan commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3933,
  "head": "1c5c0efa43cd4a4467cb7cb094dd2d852a431767",
  "version": "1.94.24.0",
  "base": "origin/main",
  "spend_usd": 0.9,
  "session_kind": "unattended",
  "run": "jam_01M6FGN8NNX1Y5JK5GZAMD8J4F",
  "thread": "GSTA-256",
  "head_tree": "37dbf2a4557558be997b2edd3d11b59889194a1e",
  "product_patch_id": "bee7092d7c91d7e9f6f65b4111b83046aea9e5a3",
  "gstack_version": "1.94.6.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 198,
    "rules": "19881e1ecf7ed1ad",
    "base": "1ccab0d8bccba50e69587672fb82ac0574638a65",
    "registry": "1ccab0d8bccba50e69587672fb82ac0574638a65",
    "gate_scan": {
      "tagged": 1,
      "head": "1c5c0efa43cd4a4467cb7cb094dd2d852a431767"
    },
    "reasons": [
      "gate-class",
      "runtime=198"
    ],
    "risk": []
  },
  "pregate": "requires-remote cleared @37dbf2a45575 (7 checks, current for 1c5c0efa43cd)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/41667181056/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41667181056/attempts/1",
    "windows-setup-e2e.yml/windows-setup: https://github.com/garrytan/gstack/actions/runs/41667180907/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/41667180952/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=37dbf2a45575 tests=34960 skipped=112 runs=41667181056/1 profiles=ci-reuse/free-tests heads=1c5c0efa43cd verified=2026-11-03T15:54:48.048Z"
  ],
  "docs": {
    "status": "updated",
    "scope": "docs/skill-routing-and-contracts.md"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 2,
    "deferred": 0,
    "noted": 0,
    "fixed": 5,
    "scope": "frozen",
    "rounds": 2,
    "ledgers_read": 3
  },
  "review_targeted": {
    "classes": [
      "gate"
    ],
    "rules": "c82addff6fb60fa0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "bee7092d7c91d7e9f6f65b4111b83046aea9e5a3",
    "status": "done",
    "findings": 1,
    "raised_by": "targeted"
  },
  "carry": {
    "from": "457195be85e485cc526227f562f88ad1376903df",
    "reason": "base merge + release metadata",
    "product_patch_id": "bee7092d7c91d7e9f6f65b4111b83046aea9e5a3",
    "changed_paths": [
      "product:.github/workflows/windows-scoped-tests.yml",
      "product:.github/workflows/windows-setup-e2e.yml",
      "metadata:CHANGELOG.md",
      "product:CONTRIBUTING.md",
      "metadata:VERSION",
      "metadata:agents-digest/gstack-AGENTS.md",
      "product:bin/gstack-banned-terms",
      "product:bin/gstack-ci-carry",
      "product:bin/gstack-design-detect.ts",
      "product:bin/gstack-diff-scope",
      "product:bin/gstack-docs-candidate",
      "product:bin/gstack-doctor-components.sh",
      "product:bin/gstack-evidence",
      "product:bin/gstack-gate-diff",
      "product:bin/gstack-harness-ledger.sh",
      "product:bin/gstack-lease",
      "product:bin/gstack-pregate",
      "product:bin/gstack-prose-lint",
      "product:bin/gstack-review-plan",
      "product:bin/gstack-ship-receipt",
      "product:bin/gstack-skill-end",
      "product:bin/gstack-skill-start",
      "product:docs/TESTING_INTERNALS.md",
      "product:docs/capy-install.md",
      "product:docs/hosts.md",
      "product:docs/pregate.md",
      "product:docs/review-policy.md",
      "product:docs/ship-policy.md",
      "product:docs/support-tiers.md",
      "product:docs/test-audit-2026-10.md",
      "product:docs/troubleshooting.md",
      "product:gstack/llms.txt",
      "product:investigate/SKILL.md",
      "product:investigate/SKILL.md.tmpl",
      "product:lib/ci-carry.ts",
      "product:lib/gate-diff/git.ts",
      "product:lib/harness-register.ts",
      "product:lib/harness-start-hook.ts",
      "product:lib/headless-artifacts.ts",
      "product:lib/pr-shots.ts",
      "product:lib/pregate/checks/guards.ts",
      "product:lib/pregate/checks/lanes.ts",
      "product:lib/pregate/checks/literals.ts",
      "product:lib/pregate/checks/strays.ts",
      "product:lib/pregate/config.ts",
      "product:lib/pregate/flaky-exception.ts",
      "product:lib/pregate/index.ts",
      "product:lib/pregate/run-check.ts",
      "product:lib/restamp.ts",
      "product:lib/result-codes-release.ts"
    ],
    "merge_commits": 1,
    "range_diff": "1:  afd766600 = 1:  afd766600 fix(ship-queue, hooks): selector reads the checkout under review; config lists the hook switches; installs are not checks; one deferral per running agent set (GST-1088 follow-up)\n2:  365dd613d = 2:  365dd613d feat(hooks): one SWITCH_DEFAULT per hook switch, read by setup, the hooks, gstack-config and gstack-skill-route (GST-1088 follow-up)\n3:  7595189ca = 3:  7595189ca fix(hooks): option values are not the check verb, wrapper chains stay linear, agent stalls are timed, report re-checks deferred runs (GST-1088 follow-up review)\n4:  457195be8 = 4:  457195be8 fix(hooks): tests read SWITCH_DEFAULT instead of assuming off; an unreadable config turns both hooks off whatever the default (GST-1088 follow-up)",
    "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": [
      "5738b77c6a27dee3f25989d865afa863e5ee1419"
    ]
  }
}

What this does

Follow-ups to #3912 (GST-1088 lane A, the opt-in skill routing and contract hooks). Both switches stay off, so nothing changes for anyone who has not turned a hook on.

  • gstack-ship-queue ready no longer misreads a PR's new files as deleted. computePaidCaseSelection (scripts/lib/paid-select.ts) passed the selector the dependency map derived from the installed gstack. When the install is older than the checkout under review, a file the PR adds (here the four hosts/claude/hooks/skill-* files) matched an old needle and was labelled "deleted but still referenced", so ready recommended --screen. It now derives dependencies and reads sources from the checkout under review. Repro: a 54606c5 worktree as the selector root against the 6a370bd checkout; the new test in test/pr-dependencies.test.ts failed first.
  • One default per hook switch. SWITCH_DEFAULT in lib/skill-route.ts is now the only place each switch's default is written (both off). Setup's gate, both hooks, gstack-config get|list|defaults and the new gstack-skill-route --default <switch> all read it, so flipping a default is a one-line PR: line 39 (skill_routing: 'off',) or line 40 (skill_contracts: 'off',). Setup now reads the stored value with gstack-config get --stored and says on via default when the table turned a hook on. An unrecognized value takes the default in the hooks too, as setup already said it did. test/setup-skill-hooks-gate.test.ts copies the readers, flips one table line and checks the diff is that line, then checks that setup registers the hook, gstack-config reports on, the routing hook routes and the Stop hook blocks; config off still wins. gstack-config get <absent key> prints nothing and exits 1, never false (pinned in the same file).
  • A flip changes one line and one pin. No test outside the pins assumes a default: each sets its switch through env or config, or reads the expected result from SWITCH_DEFAULT. Flipping line 39 alone fails exactly one test, pin: skill_routing defaults to off today; flipping line 40 alone fails exactly pin: skill_contracts defaults to off today (both in test/setup-skill-hooks-gate.test.ts). A flip PR changes its table line and its pin.
  • An unreadable config is off. A config.yaml that exists but cannot be read turns both hooks off in setup (with a warning) and in the hooks, whatever the default, because it may hold an off the person set.
  • gstack-config list and defaults show skill_routing and skill_contracts.
  • Installs are not checks. check_after_last_edit counted any command starting with bun, npm, go, make or node, so bun install or node --version after an edit satisfied "ran a test after the last edit". It now needs a test runner, a test or check verb, code through an interpreter, curl to a URL, or a test, check or repro script. Option values are skipped (make -C web test, pnpm --filter app test, xcodebuild -scheme App test), node --test and typecheck scripts count, and wrapper words nest at most three deep, so a long chain stays fast.
  • Running agents. The Stop hook used to allow every stop while Agent dispatches were still running, so a skill that ended with a stuck background agent was never checked. On a final turn it now records the run as deferred and allows the stop until the same agents have been running for 10 minutes (AGENT_STALL_MS) since the stop that first saw them; after that they count as stalled and the contract is checked. A stop on a turn that ends on a question never starts the clock. gstack-skill-contract report re-checks deferred runs against their transcripts, so an abandoned unmet run reads as a miss.
  • Docs: docs/skill-routing-and-contracts.md (where the default lives, what counts as a check, the deferral rule, report re-checks).

#3912 notes not fixed here, and why

  • One-word routing matches. I tried requiring two content words per trigger and rescored the lane B triggers: recall at the 0.66 threshold fell from 2/5 to 1/5 on lane B cc1539c (custom-memory-heap-crash lost) with decoys unchanged at 4/32, and from 1/5 to 0/5 on main. It loses real routes and gains no precision, so it stays as is.
  • A report printed before any edit counts as met. Whether a report must follow the last edit is a product call for the contract schema, not a bug; the schema is frozen in plan-v2 and lane B owns the contracts.
  • remove-source rewrites settings.json holding empty hook arrays. That is core bin/gstack-settings-hook behavior shared by every gstack hook, so it is out of scope for this lane.
  • One Agent prompt naming two specialists satisfies both. The checker errs toward allowing; a false block costs more than a missed specialist.
  • Another Stop hook continued the turn first, so nothing is recorded. stop_hook_active cannot say whose block it was, so recording there would invent outcomes.
  • Bash edits (sed -i, heredocs) are not counted as edits. Parsing shell for writes is unbounded; Edit, Write, MultiEdit and NotebookEdit cover what Claude Code does by default.
  • Held: flipping CONTRACT_CHECKER_SHIPPED (scripts/resolvers/contract-done-means.ts) waits for v1.94.22.0 feat(skills): when-to-use descriptions, wider triggers and contract blocks for /investigate, /review, /qa, /verify (GST-1088 lane B) #3909 to reach main, as planned.

Review

Full review on the first head: specialists, red team, adversarial, an outside voice on GPT-6.1 Sol and the targeted gate reader. Two blocking findings, both regressions in the check-command rewrite, were fixed in the one fix round: exponential recursion on long wrapper chains, and option values read as the verb. The three informational findings were fixed in the same round: a deferral started on a turn that was not final, stall detection by stop count (a user's "how is it going?" could trigger a false block), and deferred runs that report never re-checked. Left as is: bare make and mvn clean install do not count as checks (ambiguous default targets), and uv pip install pytest still counts, as it did before this PR. The targeted gate reader was rerun on the final head and raised one informational note, left open because the review allows one fix round: perl and php run as interpreters, so perl -pi -e s/a/b/ src/a.ts (an in-place edit) and php composer.phar install count as checks, and python3 -m pip install ... still counts as it did before. A follow-up can stop counting in-place edits and interpreter-run installs. After the flip fix, the targeted reader on the final head raised one more informational note, also left open: a deferred run that report cannot re-check (its transcript is gone) keeps the deferred outcome and is not counted as a miss, where an unrecheckable blocked run is.

Security note

  • setup changes only its two skill-hook gates: they now ask bin/gstack-skill-route --default <switch> (through bun with the isolation flags) for the default and read the stored value with gstack-config get --stored. If that bin cannot run, the default is off.
  • bin/gstack-config defines GSTACK_BUN_CONFIG and spawns the same bin only to print the default of these two keys. No network calls, no new environment reads, no new dependencies, no workflow changes.

Tests

New tests failed on the code before each fix and pass now: test/pr-dependencies.test.ts (selector root), test/gstack-config-defaults.test.ts (list and defaults), test/setup-skill-hooks-gate.test.ts (SWITCH_DEFAULT flip, absent key), test/skill-contract.test.ts (checks, option values, wrapper chain timing, report re-check) and test/skill-contract-stop-hook.test.ts (timed stall, question turns). The 22 targeted and guard files pass (234 tests), typecheck is clean, and the test typecheck ratchet reports no new diagnostics. Because this PR touches ship-queue selection, the full free suite ran on a Ubicloud VM at the final tree (eadfb3fb) before push: 21,707 tests, 6 failed, all in timing or PTY tests outside this diff (review-army-budget, plan-count-checkbox, qa-fix-loop-fixture, memorable-user-prompt-hook, section-capture-native-tools, plan-seed-submission). Rerun once at the same tree, those six files passed 168 of 168, so they are recorded as flaky. CI's Free Tests run is the full run of record.

garrytan and others added 3 commits November 3, 2026 07:00
…fig lists the hook switches; installs are not checks; one deferral per running agent set (GST-1088 follow-up)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ooks, gstack-config and gstack-skill-route (GST-1088 follow-up)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… linear, agent stalls are timed, report re-checks deferred runs (GST-1088 follow-up review)

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

trunk-io Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

…eadable config turns both hooks off whatever the default (GST-1088 follow-up)

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

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

E2E Evals: ✅ PASS (reused: main moved, R2)

No paid case ran on 1c5c0efa43cd4a4467cb7cb094dd2d852a431767. It carries the GREEN verdict of run 41611477878 at 457195be85e485cc526227f562f88ad1376903df, because main moved (f6d6215 -> 1ccab0d) and the PR's own diff from its merge-base, excluding stamp files, is byte-identical to 457195b's (sha256 1890af5ded80).

OWN DIFF: identical sha256=1890af5ded80665c8cd58d3b100cd11a5cce6225b6b25c55af5d4189514cd006 (merge-base c197a139b7eba04aa3a7a937bfcd1019bff224fb -> 1ccab0d8bccba50e69587672fb82ac0574638a65)
base: f6d6215f4e3aa155e3843d56123c9f262f523b5e -> 1ccab0d8bccba50e69587672fb82ac0574638a65
selection: 4e4ff8ea430bf850a9f88a7a473f353b8a4f6a99387aa592335ee38cd10270a4 (identical to the reused gate)

Verdict reuse (R2a restamp-only, R2 main moved): a changed own diff, a non-stamp byte, a changed selection, a newer red or unbound gate, or a missing binding or receipt runs the full gate; the evals-fresh label opts out. Free Tests and every other check still ran on this head.

Dispatched narrow screen (gstack-ship-queue ready --screen) of merge commit 0f014741a00a06477f4aed4a00934fe40912b4b8.

@github-actions github-actions Bot changed the title fix(ship-queue, hooks): selector reads the checkout under review; one SWITCH_DEFAULT per hook switch; installs are not checks; timed agent deferral (GST-1088 follow-up) v1.94.33.0 fix(ship-queue, hooks): selector reads the checkout under review; one SWITCH_DEFAULT per hook switch; installs are not checks; timed agent deferral (GST-1088 follow-up) Nov 3, 2026
@capy-ai
capy-ai Bot merged commit 18d557d into main Nov 3, 2026
50 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