Skip to content

ship-policy: refuse a floor above stable; doctor floor row uses runningGstackVersion (GST-1637) - #4080

Merged
capy-ai[bot] merged 6 commits into
mainfrom
capy/gst-1637-policy-floor-stable
Nov 6, 2026
Merged

capy-ai[bot] merged 6 commits into
mainfrom
capy/gst-1637-policy-floor-stable

Conversation

@garrytan

@garrytan garrytan commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 4080,
  "head": "edd4781418d25f0aa7c4b36faec39229b5607cd8",
  "version": "1.96.0.0",
  "base": "main",
  "gate": {
    "free": {
      "pass": 1611,
      "fail": 0,
      "skip": 0
    }
  },
  "ci_carried": [
    {
      "lane": "free",
      "run": 42254984720,
      "attempt": 1,
      "tree": "10ccda93e45198869a86050041d1e108983677bc"
    }
  ],
  "session_kind": "unattended",
  "head_tree": "10ccda93e45198869a86050041d1e108983677bc",
  "product_patch_id": "ecdac5cc3c260f30b419aa65af287be4ce3c63ab",
  "gstack_version": "1.96.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 210,
    "rules": "70895942bb8a8ee2",
    "base": "89e9a994d8d0fe30cadb1c1fb9f1b943fb48f3ef",
    "registry": "89e9a994d8d0fe30cadb1c1fb9f1b943fb48f3ef",
    "gate_scan": {
      "tagged": 0,
      "head": "edd4781418d25f0aa7c4b36faec39229b5607cd8"
    },
    "reasons": [
      "gate-class",
      "risk:security",
      "runtime=210"
    ],
    "risk": [
      "security"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @10ccda93e451 (7 checks, current for edd4781418d2)",
  "requires_remote": [
    "free-tests.yml/cso-macos-launcher: https://github.com/garrytan/gstack/actions/runs/42254984720/attempts/1",
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/42254984720/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/42253927679/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=10ccda93e451 tests=35951 skipped=112 runs=42254984720/1 profiles=ci-reuse/free-tests heads=edd4781418d2 verified=2026-11-06T16:57:44.546Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CLAUDE.md, capy/skill/gstack"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 4,
    "deferred": 0,
    "noted": 3,
    "fixed": 4,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 3,
    "unrecorded": 1,
    "ledgers_read": 5,
    "unbound": 3,
    "dispatches": {
      "specialist": 6
    }
  }
}

What changed

gstack-ship-policy validate now refuses a min_gstack_version floor above the newest stable release (a 1.97.0.0 floor against a 1.96.0.0 stable) instead of passing it. Image not rendered: gstack-pr-shots refused the capture because four-part version strings match its pii.ip_public rule (PR_SHOTS_INPUT_REFUSED), so the text version follows.

Before / after (text)

Before (base 1077095):

$ gstack-ship-policy validate   # floor 1.97.0.0, newest stable release 1.96.0.0
POLICY_VALID: head (unreviewed) .gstack/ship-policy.json
KEY: min_gstack_version introduced=1.91.108.0
MIN_READER: gstack 1.91.108.0 (every lane that reads this policy needs at least this version)
exit 0

After (this branch):

$ gstack-ship-policy validate   # floor 1.97.0.0, newest stable release 1.96.0.0
gstack-ship-policy: the ship policy sets min_gstack_version above the newest stable gstack release, so every stable-channel lane refuses it and no upgrade can clear that until a later release is cut (min_gstack_version 1.97.0.0 is above the newest stable gstack release 1.96.0.0 (stable VERSION (local; origin unreachable)), so every stable-channel lane refuses this policy and no upgrade clears it until a release at or above 1.97.0.0 is cut; set min_gstack_version to 1.96.0.0 or lower, without the keys that need more at min_gstack_version); fix: set min_gstack_version to the stable release named (or lower) and drop the keys that need more, then rerun gstack-ship-policy validate (POLICY_FLOOR_ABOVE_STABLE)
POLICY_INVALID: 1 error(s) in head (unreviewed) .gstack/ship-policy.json
KEY: min_gstack_version introduced=1.91.108.0
MIN_READER: gstack 1.91.108.0 (every lane that reads this policy needs at least this version)
exit 1

Why

A ship policy set min_gstack_version above every stable release, and every stable-channel lane refused the policy with no upgrade that could clear it (GST-1637). Now validate and the new pregate policy-floor check refuse that floor by name, and the doctor stops sending sessions into a fast-forward that cannot help.

Blast radius

The change touches gstack-ship-policy validate, a new pregate check that runs only on a branch that changes .gstack/ship-policy.json, the doctor's floor row and the Capy installer trailer. When the newest stable release cannot be resolved, both TypeScript and Bash resolvers only warn (STABLE_RELEASE_UNKNOWN) and never refuse, which keeps unreachable networks, vendored copies and fixtures safe; this was walked in test/policy-floor-stable.test.ts (8 pass) and the doctor suites (39 pass).

Tests

  • test/policy-floor-stable.test.ts (new): a floor above stable is refused by name (remote tag and local stable ref); a floor at stable passes; an unresolvable stable warns and does not refuse; pregate fails, passes and warns the same way and ignores an untouched policy; an unstamped checkout gets the verdict validatePolicy gives; no fast-forward is offered when stable misses the floor, and one is offered when stable meets it.
  • test/gstack-capy-install.test.ts: the no-release floor row gives the floor note without a fix, and behind keeps its own fix.
  • test/pregate-selection.test.ts: the check list and help line include policy-floor.

Approvals

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

Summary

A floor above stable used to strand every stable-channel lane. validate and the pregate policy-floor check now refuse it (POLICY_FLOOR_ABOVE_STABLE), naming both versions, and warn when stable cannot be resolved. The doctor's floor row compares the version the checkout reads policies as (runningGstackVersion), and when no stable release meets the floor it says "no release meets this floor yet" with no fast-forward. Review also hardened the stable resolver. A vendored copy with no .git of its own no longer reads the enclosing project's tags, a tag that a half-way cut left above stable no longer counts, and the doctor skips the network lookup where timeout is missing (stock macOS) instead of running it unbounded.

Test Coverage

Step 7 audit (pass 1, tree 1be40ab): 17 of 23 paths tested (74%, 74% value-weighted), between the 60% minimum and the 80% target. Gaps at that tree: pregate policy-floor rows for a deleted, unparseable or floorless policy; the doctor with no resolvable stable release; the local-tag-only fallback. Review fixes then added three cases (vendored root, half-cut tag at origin, half-cut tag locally) to test/policy-floor-stable.test.ts, each failing first against the unfixed code (6 pass, 2 fail before; 8 pass after). The coverage audit was not rerun on the final head.

Tests ran: free count from CI carry, see Test plan

Pre-Landing Review

Pre-Landing Review: 5 issues — 5 auto-fixed, 0 asked, 0 deferred, 14 noted
REVIEW_LOOP: passes=2 blocking_found=4 deferred=0 noted=3 fixed=4 scope=frozen unrecorded=1 unbound=3 ledgers_read=5 fix_checks=1 dispatches=6
Gate edits: none detected (GATE_SCAN tagged=0 at f93768c)

Fixed: a vendored install (no .git) read the project's own release tags (red-team, reproduced; fabdaec); a release tag above stable counted as stable (outside voice, adversarial and red-team agreed; f93768c); the doctor's ls-remote ran unbounded without timeout (outside voice; f93768c); bin tests reached the live origin and failed at ba3bd54 in CI run 42243190941 (specialist; fixed by 7b31931); docs prose drifted after the fix (fix-check; edd4781).

Outside review (openai/gpt-6.1-sol, completed): Step 11 at f93768c raised one finding it marked blocking that ships here as an open note for the owner: a second, higher v tag pushed onto the stable commit would be taken as the stable release, so a floor above stable's real VERSION would pass. It needs someone with tag-push rights to create that tag; it is not a regression against base, which had no guard.

Review notes

Below the blocking floor or past the review cap; recorded here and not fixed in this PR.

  • OPEN (outside voice, Step 11 at f93768c, judged CRITICAL, at the cap) lib/stable-release.ts:39: an extra higher tag on the stable commit is taken as the stable release; resolving stable's own VERSION would close it. Owner decision.
  • INFORMATIONAL lib/stable-release.ts:59 (adversarial): the floor is compared with the stable tag's version, while lanes accept a policy by runningGstackVersion (key constants can run ahead of the tag), so a valid floor could be refused after a future release.
  • INFORMATIONAL bin/gstack-doctor-check.sh:524 (adversarial, twice): the "no release meets this floor yet" branch ignores the update channel, so a main-channel install loses a fast-forward that would clear the row.
  • INFORMATIONAL bin/gstack-doctor-check.sh:553 (fix-check): on stock macOS the doctor now judges stable from local refs only, so a stale origin/stable can say "no release meets" when an upgrade would clear it.
  • INFORMATIONAL lib/pregate/checks/policy-floor.ts:19 (testing): no test for a deleted, unparseable or floorless changed policy.
  • INFORMATIONAL lib/stable-release.ts:28 (red-team): an inherited GIT_DIR (hook context) defeats the toplevel guard; reachable only from a user-wired hook.
  • INFORMATIONAL bin/gstack-ship-policy:93 (adversarial): validate resolves the stable release (one ls-remote) even when the policy sets no floor.
  • INFORMATIONAL (adversarial): ssh prompts are not suppressed by GIT_TERMINAL_PROMPT=0; a local-only stale stable ref gives a hard refusal; a fork set as origin answers for stable; main-channel solo installs are now refused too; the doctor's regex derivation of runningGstackVersion could drift from TypeScript's.

Exploratory QA

Smoke probes only (the QA method files were not read, so this is partial coverage): validate on this repo's policy against the live origin (POLICY_VALID, floor 1.96.0.0); this checkout's resolver against the live origin (release tag v1.96.0.0 at origin's stable) and its Bash twin (1.96.0.0); a vendored .git-less copy inside a tagged project (not a gstack checkout of its own, floor not compared); a 9.0.0.0 floor (refused, POLICY_GSTACK_TOO_OLD). No failures. Not run: macOS without timeout, Windows (CI windows lanes cover it).

Design Review

No frontend files changed — design review skipped.

Eval Results

evals: none affected. No gstack skill template, judge or eval harness changed; eval-select listed behavioral probes only through derived references of bin/lib files (scheduled and release coverage), and the crew's paid cap is $10.

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.

Verification Results

No Step 8.1 obligations (no plan bound). Smoke probes above: 5 PASS, 0 FAIL, 0 BLOCKED; macOS-without-timeout and Windows probes NOT RUN locally.

TODOS

No TODO items completed in this PR.

Documentation

Status: current. No edits were needed; the branch's own doc changes already cover GST-1637.

Scope: branch capy/gst-1637-policy-floor-stable at edd4781, compared with base 1077095. The candidate lists 20 committed files. Nothing is staged, unstaged or untracked.

Documentation health

  • docs/ship-policy.md: current. It documents the POLICY_FLOOR_ABOVE_STABLE refusal in validate, how the stable release is resolved, and GSTACK_STABLE_REPO.
  • docs/pregate.md: current. It documents the policy-floor check.
  • docs/troubleshooting.md: current. It adds the POLICY_FLOOR_ABOVE_STABLE and STABLE_RELEASE_UNKNOWN anchors and updates the PROJECT_FLOOR_UNMET text.
  • docs/capy-install.md: current. It updates the doctor floor row and the trailer note grammar.
  • capy/skill/gstack/SKILL.md and capy/skill/gstack/lane-card.md: current. A floor fix runs once, and a no-release floor is reported, not fixed.

Coverage debt: no doc describes the new stable and warnings fields in gstack-ship-policy validate --json. Docs never described this JSON shape before.

Diagram drift: none.

Test plan

  • free = bun run test: carried from CI run 42254984720/1 (workflow_dispatch at edd4781, tree 10ccda93e451), tests_ran=1611 files, exit 0
  • pregate --allow-repo-commands at edd4781: requires-remote cleared (macOS jobs from run 42254984720, windows-smoke run 42253927679); secrets warn (7 MEDIUM pii.ip_public, version strings in test/policy-floor-stable.test.ts)
  • Focused local: test/policy-floor-stable.test.ts 8 pass; doctor, capy-install, pregate, ship-policy, module-size and spawnsync suites 183 pass; typecheck clean
  • Every pull_request check at edd4781 green when this body was written

🤖 Generated with gstack /ship (Capy)

Open in Capy

…e release; doctor floor row compares runningGstackVersion and offers no no-op fast-forward (GST-1637)

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 5 commits November 6, 2026 15:27
…ject path, not a forward-slash join (Windows)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…n test-setup); pregate-invalidation counts the policy-floor check

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A vendored gstack copy (no .git of its own, inside a project) no longer resolves the newest stable release from the enclosing project's release tags: newestStableRelease and the doctor's _dc_newest_stable resolve only when the root is the top of its own git checkout, else the floor is not compared (STABLE_RELEASE_UNKNOWN) and the doctor keeps the real upgrade fix.

Review-Finding: p1/red-team#1 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
The newest stable release is the highest release tag at origin's stable commit (a tag a half-way cut left behind no longer counts), and locally the VERSION at the stable ref wins over local tags. The doctor skips the remote lookup where timeout is missing (stock macOS) instead of running it unbounded.

Review-Finding: p1/outside-voice#1 reader=outside-voice
Review-Finding: p1/outside-voice#2 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p3/fix-check#2 reader=fix-check
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 64862e4 into main Nov 6, 2026
68 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