Repository navigation
Conversation
…cal main or a shadowing tag (GST-883, failing first) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…n/<base> by full ref name; review-plan scans the merge base its own diff used (GST-883) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
Merging to
After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here |
…review-plan-origin-base
Contributor
|
Frozen in wave |
capy-ai Bot
added a commit
that referenced
this pull request
Nov 2, 2026
* fix(retro): keep retro history in the state root, shared across worktrees (#3749) /retro saved snapshots under .context/retros inside the working tree, so a run in a linked worktree saw none of the main checkout's history, reported "First retro recorded", and wrote a snapshot that git worktree remove deletes. gstack-retro-metrics --history [--next <date>] now resolves the history directory as <state root>/projects/<slug>/retros (the slug is keyed on the git common dir, so every worktree shares it), moves any legacy .context/retros from this worktree and the main checkout into it, lists prior snapshots and prints the next snapshot path. Step 12/13 and the gbrain prior-retros query use it. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(gate-diff): read a bare base as origin/<base> in gate-diff and diff-scope (#3650) gstack-gate-diff and gstack-diff-scope resolved a bare base such as main to the local branch whenever it shared history with HEAD. A local main that is behind origin/main (a linked worktree, or a Capy clone, where local main never moves) then set the merge base, so /ship's gate scan and specialist scope also read commits already upstream. Both now prefer origin/<base> when it resolves, the base /ship fetches and merges against. Fixes #3650 Co-authored-by: exGeni <[email protected]> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(retro): make history migration safe against symlinks and concurrent runs (#3749 review) Review pass 1 findings: a .context/retros that resolves outside its worktree (or to the shared history itself) is left alone, so migration can no longer delete the history it points at; moves are no-clobber with retry; a copy identical to any same-date snapshot collapses; RETRO_FILE is reserved as {} so overlapping runs in two worktrees never share a path; --next must be a YYYY-MM-DD date; a missing option value no longer loops forever. Step 12 names RETRO_HISTORY_ERROR instead of reading it as a stale helper. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(changelog): fragment for the #3749 retro history fix Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes (diff-scope reads slash-named bases through origin too) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(retro): trim Step 12/13 prose back under the parity skeleton cap Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: Step 11 review fixes (a fork branch, a colliding tag or another remote never replaces the base) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(retro): keep today="<today>" in Step 12 so the judge excerpt keeps both date inputs Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(changelog): describe the fork, tag and remote guards (#3650) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(retro): compare #3749 history paths with forward slashes so the Windows shard passes Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(review): review-plan and gate-diff plan the same with a stale local main or a shadowing tag (GST-883, failing first) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(review): gate-diff and review-plan resolve a branch base to origin/<base> by full ref name; review-plan scans the merge base its own diff used (GST-883) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(changelog): GST-883 fragment Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(review-risk): hostile-input time bounds for every risk pattern; the R51 rm and rmSync rules fail (GST-898) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(review-risk): the R51 rm and rmSync rules run in linear time (GST-898) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(review-packets-removed): repin lib/review-risk.ts on the GST-898 verdict-identity replay Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(review-risk): padding cannot push recursive: true out of the rmSync window; repin on the GST-898 no-loss replay Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(changelog): GST-898 fragment wording Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(review): planner misreads: SVG chart as runtime, session data as auth, bare base in diff-scope and receipt depth (GST-911, GST-884, failing first) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(review): a drawing-only SVG is data and a scripted one is security; session data files are not auth; diff-scope and the receipt depth read origin/<base> by full ref name (GST-911, GST-884) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(review): the SVG drawing check refuses CSS escapes and reads zero-padded character references; the security class reads a file's changed SVG lines joined (GST-911 review pass 1) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(review): a stray quote cannot hide an external href in a drawing SVG (GST-911 review pass 2, failing first) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(review): the SVG drawing check reads every name= without consuming its value, so a stray quote cannot hide an external href (GST-911 review pass 2) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(review): CSS in a drawing SVG holds only declarations and url(#id): image-set(), image(), element() keep it code (GST-911 Step 11, failing first) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(review): a drawing SVG's CSS holds declarations only, no @ rule and no function but url(#id), which closes image-set(), image(), element() and every other CSS load (GST-911 Step 11) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * test(review): a style element's CSS is read past comments and CDATA, unclosed style tags are refused in linear time, and every drawing verdict holds at 1 MB and 8 MB (GST-911, failing first) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(review): walk a style element's CSS with indexOf, dropping comments and reading CDATA, so no hidden </style> ends it early and unclosed style tags refuse in linear time (GST-911) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(review-policy): the linear-time claim covers R51's rm and rmSync rules (GST-898) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(review-policy): state the rmSync padding rule exactly (GST-898) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix(review-depth): linear url() refusal in svgDrawing (wave review-2, red-team CRITICAL) SVG_REFUSED's url() entry backtracked quadratically on url( followed by a long whitespace run (80k spaces: 820 ms; 1 MB: over 230 s), and svgDrawing runs in collectLive and in collectCommit, which ship-queue ready, train build and land call with no timeout. The rewritten entry refuses exactly what #3838's pattern refused. Repin lib/review-depth.ts under no-loss replay GST-911-redos (verdict identity: 60,000 seeded strings, the edges and every SVG blob in history, zero differences). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: pre-landing review fixes (wave review-2, pass 1) - bin/gstack-diff-scope: _resolve_base takes a related local <base> before another remote's twin, the order resolveBase uses, so the two tools pick the same base for a bare name when origin/<base> is unrelated. - lib/review-depth.ts: a drawing's DOCTYPE names no document but W3C's SVG DTD; SYSTEM and other PUBLIC identifiers keep the SVG code. Repin lib/review-depth.ts under no-loss replay GST-911-redos (the DOCTYPE change only keeps more SVGs code, so it drops no reviewer). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * fix: freeze the exported SVG_REFUSED list (wave review-2, Step 11) Exported only so test/review-risk-redos.test.ts can reach the url() entry; a frozen readonly copy keeps any importer from changing verdicts while DEPTH_RULES still reports the original rules. Repin lib/review-depth.ts under no-loss replay GST-911-redos (no pattern changed). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * Revert "fix: freeze the exported SVG_REFUSED list (wave review-2, Step 11)" The fix-check (wave review-2) showed Object.freeze is shallow: each RegExp can still be changed in place, so the freeze did not close adversarial-native#1, and it moved the tree past the one the Step 11 voices reviewed. The finding ships as an open note (its reviewer rated it Low, not blocking; no production caller mutates the list). Restores the lib/review-depth.ts pin under no-loss replay GST-911-redos. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(changelog): wave review-2 entry for the integrator fixes Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * docs(review-policy): a drawing's DOCTYPE names no outside document (wave review-2 docs audit) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Co-authored-by: exGeni <[email protected]>
3 tasks done
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
Stale local main: review-plan planned a one-line code change as gate class at full depth (before); now it plans code, light, nothing gate-tagged (after).
Before/after as text: Stale local main: review-plan planned a one-line code change as gate class at full depth (before); now it plans code, light, nothing gate-tagged (after)
Why
On gstack-evals#123 a plain code change planned as a gate-class review at full depth, because the local
mainwas four commits behindorigin/mainand the gate scan read a test edit that was already upstream. That cost about 15-20M reader tokens the change did not need (GEVA-117). Now the plan reads the same merge base as the rest of the review, so how fresh your localmainis no longer changes how deep /ship reviews.Blast radius
resolveBaseinlib/gate-diff/git.tsis shared bygstack-gate-diff, so every caller that runsgstack-gate-diff <base>(scripts/resolvers/gate-scan.ts:22,ship/sections/review-army.md:117,ship/sections/test-coverage.md:400,review/SKILL.md:312) now scans fromorigin/<base>instead of the local branch. That is safe because the merge base withorigin/<base>is whatgstack-review-plan's own diff andgstack-review-dispatchalready used (#3780), and a base that no remote has still resolves to the local branch, with a note on stderr. Evidence rung: script ran (the repro above, andtest/review-plan-origin-base.test.ts, which fails 5 of 5 at 589ff24 and passes 5 of 5 here).Approvals
Source: gstack-approvals record for gst-883-review-plan-origin-base (display only; not an approval citation).
Summary
A stale local
maindecided how deep /ship reviewed a change:gstack-review-planhanded the bare base name togstack-gate-diff, which diffed against the local branch, so commits already onorigin/mainshowed up as this branch's gate edits. Nowgstack-gate-diffresolves a branch name to its remote-tracking branch first,gstack-review-planpasses its own merge base togstack-diff-scopeandgstack-gate-diff, and both read branches by their full ref names, so a tag namedmainororigin/maincan't stand in for the base either.Caller audit (lines at 76ec425):
bin/gstack-review-plan:120-121(scopeOf,gateTagsOf)collected.mergeBase ?? basebin/gstack-gate-diff:147andresolveBase(lib/gate-diff/git.ts:101)refs/remotes/<remote>/<base>first,refs/heads/<base>fallback with a stderr notelib/review-collect.ts:174(collectLive)scripts/resolvers/gate-scan.ts:22,ship/sections/review-army.md:117,ship/sections/test-coverage.md:400,review/SKILL.md:312resolveBaselib/ship-receipt-depth.ts:61lib/ship-preflight.ts:42,63,70bin/gstack-review-dispatch:143(mergeBaseWith)bin/gstack-diff-scope:36Failing-first proof:
bun test test/review-plan-origin-base.test.tsat 589ff24 (origin/main when this branch was cut) fails all 5 cases: the stale-mainplan (gate, full,RH-1:1against code, light, none), theorigin/maintag, themaintag, the no-remote-tracking note and the unrelated-origin note. All 5 pass at dff41a9 and at the head.Test Coverage
All new code paths have test coverage:
test/review-plan-origin-base.test.ts(5 tests, new) covers the stale base, both shadow tags, the fallback note for a branch no remote has, an unrelatedorigin/mainand the quiet no-remote path.Regression proof — fails at 589ff24 · passes after fix (5 of 5).
Tests ran: focused 136
Pre-Landing Review
No blocking issues found. REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=1 fixed=0 scope=frozen dispatches=4
The receipt shows
passes=1because the first machine was lost and the review was redone at the final head (pass gst883-r1). The earlier rounds (two review rounds and a full-diff outside-voice pass) and the Captain-granted scoped fix-check are recorded only in the decision trail (GSTA-167-gst883-decisions.tsv, rows 11-21 and 27-28).Gate edits: none detected (gate scan: listed=1 eligible=0 tagged={})
Outside review: gpt-6.1-sol, clean. The adversarial pass found no blocker.
Before this rebuild, a scoped fix-check (granted by the Captain under R51 for the shadow-tag finding from round 2) found no new blocker.
Review notes
These are informational and were not fixed here:
bin/gstack-review-dispatch:143(mergeBaseWith) andlib/ship-receipt-depth.ts:61still readorigin/<base>by short name, so a tag namedorigin/mainstill shadows them. This existed before the branch.collectLive(lib/review-collect.ts:174) still reads an already-qualified--base origin/mainby short name. No in-tree caller passes a qualified base.rev-parse, so a tag literally namedrefs/remotes/origin/maincan still match when the real tracking ref is missing;git show-ref --verifywould be exact.collectLivechecks only origin, then the local branch, whileresolveBasewalks every remote, so the two can pick different bases when origin lacks the branch.GATE_SUMMARY:, so a caller that reads2>&1and expectsGATE_SUMMARY:first sees the note first. It fires only for a base branch no remote has.bin/gstack-diff-scope:36uses the bare base, and its seven prose callers pass<base>.Exploratory QA
CLI change: the repro above ran on a scratch repository at origin/main and on this branch.
Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
TODOS
No TODO items completed in this PR.
Documentation
Documentation: current (audit gst883-docs-3 at 76ec425, no edits needed). Reviewed scope: docs/, README.md, AGENTS.md, CONTRIBUTING.md, review/ and ship/sections gate-diff call sites, and the changed bin/lib files. This branch updates
docs/designs/HONEST_WORK_GATE_INTEGRITY.mdand thegstack-gate-diffusage text to say a branch base resolves to its remote-tracking branch first.Test plan
bun test --max-concurrency 2on the 13 files in the ship lane): 136 pass, 0 failgstack-pregate --stage tests --remote) on tree 381de1c2efcf: 4354 tests, 0 failedbun run typecheck: clean🤖 Generated with Claude Code