Repository navigation
Conversation
…rees (#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>
…nt 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>
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>
…s both date inputs 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 |
…Windows shard passes Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
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]>
Contributor
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
Step 12 now loads and saves retro history in the state root, shared by every worktree, instead of .context/retros inside the working tree.
Before/after as text: Step 12 now loads and saves retro history in the state root, shared by every worktree, instead of .context/retros inside the working tree
Why
Fixes the bug reported in #3749: running /retro in a linked worktree said "First retro recorded" even though the main checkout had weeks of history, and the snapshot it saved was deleted along with the worktree. History now lives in one folder per repository that every worktree shares, so trends work from any checkout and survive
git worktree remove.Blast radius
The change touches
bin/gstack-retro-metrics(a new--historymode; the metrics mode is unchanged), /retro Steps 12 and 13, its gbrain prior-retros query and one line in docs/skills.md. The one risky part is moving users' old.context/retrossnapshots. A move never replaces an existing file, a copy is deleted only when it is byte-identical to a stored snapshot, and a.context/retrosthat resolves outside its worktree is left alone.test/regression-3749-retro-history-worktree.test.tscovers each of these cases with the real Step 12 block in a git worktree fixture (script ran).Approvals
Source: gstack-approvals record for fix/3749-retro-history-state-root (display only; not an approval citation).
Summary
/retro kept its history in
.context/retros/inside the working tree. A run in a linked worktree (Conductor, Claude Code) found none of the main checkout's snapshots, reported a first retro, and its own snapshot was deleted with the worktree.gstack-retro-metrics --history --next <date>now finds the history folder at<state root>/projects/<slug>/retros. The slug comes from the git common dir, so every worktree resolves the same folder. On first use it moves old snapshots there from this worktree and the main checkout. It lists earlier snapshots and reserves the next file name, so two retros running at once never write the same file. Review found a real data-loss path in the first version, where a symlinked.context/retroscould delete the history it pointed at, plus two races between worktrees. All three are fixed, and each has a test that fails without the fix.Test Coverage
test/regression-3749-retro-history-worktree.test.ts(new, 6 tests) runs the real Step 12 block: a worktree sees the main checkout's snapshot; the new snapshot path is outside the worktree and survivesgit worktree remove; migration keeps every snapshot (identical copies collapse, differing ones get the next number); a symlinked.context/retroscannot delete history; two runs get different snapshot paths; the gbrain glob reads the shared folder.round1-failing-first.log).RETRO_HISTORY_MIGRATEDcount line and the slug-failure and mkdir-failure error lines (low risk, listed under Review notes).PREGATE_REMOTE: tree=ce8330a9856e… tests=18337 failed=0Pre-Landing Review
Round 1 found 3 blocking findings and 4 smaller ones. All were fixed in a145111: the symlinked
.context/retrosdata-loss path, a check-then-move race in migration, an unreservedRETRO_FILE, identical content stored under two numbers,RETRO_HISTORY_ERRORbeing read as an outdated helper, and--nextwith no value looping forever. Round 2 (specialist and Red Team on the fix range) found only informational notes. One scoped fix-check on two later prose trims, both forced by tests, came backNO FINDINGS, and so did a second fix-check on the test-only Windows path fix in 5b62581.REVIEW_LOOP: passes=2 blocking_found=3 deferred=0 noted=4 fixed=6 scope=frozen fix_checks=2 dispatches=3
Gate edits: none detected (GATE_SCAN tagged=0 at 4bda480)
Outside review: gpt-6.1-sol (round 1) asked for changes on the symlink data-loss path and the two races; all three are fixed and covered by tests.
Review notes
bin/gstack-retro-metricsreservation: a{}stub from a retro that never reached Step 13 stays in the history folder. The skill tells the model to skip it, but the gbrain prior-retros query (newest 5 by mtime) can still show it. (Red Team, informational)/retro compare: Step 13 now depends on Step 12'sRETRO_FILE, and the compare-mode prose could be read as skipping Step 12. (Red Team, informational)--nextdate check, the guard for a missing option value, or the collapse of a copy that matches a different number. Each was checked by hand. (specialist, informational).context/retrosis not writable and the state root is on another filesystem, the no-clobber retry loop can copy one snapshot many times. (fix-check, informational).contextis a symlink outside the repository is no longer migrated: nothing is lost, but its old history stays where it is. (fix-check, informational)--nextvalue with no date reads as an outdated helper. (fix-check, informational)Exploratory QA
Six CLI probes in a scratch git repository with a temporary state root. All passed: migration, running twice, a same-name snapshot with different content, a non-git directory, and two edge cases that were then fixed in a145111 (
--nextwith no value hung;--next ../../xwas accepted). No browser surface.Design Review
No frontend files changed, so design review was skipped.
Eval Results
Selected judges (
bun run eval:bg:pr --local, run evals-pr-gstack-fix-3749-retro-history-state-root-20261101-174026-24637, tested 4bda480): 2 pass, 0 fail. retro/SKILL.md instructions panel scored clarity 4, completeness 4, actionability 4, and the cross-skill greptile consistency judge passed.Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches).
Issues
Refs #3749
Fixes the bug reported in #3749; the Captain closes the issue after merge.
TODOS
No TODO items completed in this PR.
Documentation
Status: blocked under an owner-accepted exception. Scope: docs/, README.md, the retro skill template and its generated SKILL.md, and the changelog fragment. Audit gsta245-3749-docs2 found every document current at 99f7f7c. Two later prose trims in retro/SKILL.md(.tmpl), forced by tests and reviewed by the fix-check, made that audit stale, and /ship allows no third audit.
Documentation exception: accepted by GStack Minder 2026-11-01 via GSTA-36 Captain reply to GSTA-245: Docs audit gsta245-3749-docs2 (current at 99f7f7c) stands for this PR; the later change is the reviewed retro Step 12/13 prose trim, and no docs/ or README content changed.
Test plan
bun teston the 19 focused files: 988 pass, 0 failbun run typecheck: exit 0bun run typecheck:test: exit 0🤖 Generated with Claude Code