Repository navigation
ship-policy: refuse a floor above stable; doctor floor row uses runningGstackVersion (GST-1637) - #4080
Merged
Conversation
…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>
|
😎 This pull request was merged. |
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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):
After (this branch):
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 verdictvalidatePolicygives; 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 includepolicy-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.
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.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.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.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.lib/pregate/checks/policy-floor.ts:19(testing): no test for a deleted, unparseable or floorless changed policy.lib/stable-release.ts:28(red-team): an inherited GIT_DIR (hook context) defeats the toplevel guard; reachable only from a user-wired hook.bin/gstack-ship-policy:93(adversarial): validate resolves the stable release (one ls-remote) even when the policy sets no floor.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
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
🤖 Generated with gstack /ship (Capy)