Repository navigation
v1.92.14.0 feat: a .gstack-project file makes a nested repo or umbrella folder its own project (#2649, #1923) - #3777
Merged
Merged
Conversation
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…worktree binding in remote-slug and under a git HOME) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…first run The worktree binding was written only when the main checkout resolved, so a worktree outside an umbrella resolved first kept its old bucket and later switched. Walk up from the main checkout on a miss instead (under its own $HOME rule) and drop the binding file. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…to REPO_SLUG Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…eys, ignore unusable folder names; remote-slug resolves once Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…r repository Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…epository under a marker; recovered checkpoints keep their repository; a linked worktree's own marker stands for its main checkout 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>
|
😎 This pull request was merged. |
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
A repo cloned inside another repo keeps its own project once it has a
.gstack-projectfile, so its checkpoints stop landing under the workspace.Before/after as text: A repo cloned inside another repo keeps its own project once it has a .gstack-project file, so its checkpoints stop landing under the workspace
Why
#2649: a user found that 5 of their 16 nested repos filed checkpoints, learnings and decisions under the workspace repo that contains them, one with 73 checkpoints, so
/context-restorein the nested repo came up empty. An empty.gstack-projectfile now makes that folder its own project. The same file in a plain folder above several repos gives them one shared memory, which is what #1923 asked for.Blast radius
Every skill that resolves a project slug goes through
bin/gstack-slug, its TypeScript twin inlib/bin-context.tsorbrowse/bin/remote-slug, so all three learned the marker together and the parity tests compare them. Nothing changes without the file. The marker cases fail on the base and the ignored-marker controls pass on both (script ran:test/gstack-slug-project-marker.test.ts). Records that belong to one repository (pregate policy, approvals,/verifyresults, the review log, the/shipspend-cap pointer, repo mode, the Greptile answer) resolve throughgstack-slug --get REPO_SLUG, so a branch that commits a marker can't change which policy or review log applies (walked failure path: the review log and spend-cap pointer under a marker are tested cases).Approvals
Source: gstack-approvals record for capy/gsta226-e1-project-marker (display only; not an approval citation).
Summary
People who keep a repo inside another repo, or who plan in an umbrella folder above several repos, lost track of their gstack memory because it was filed under the wrong project. Creating an empty
.gstack-projectfile now picks the project root. The innermost counted marker on the way up from the current folder wins, and its slug is that folder's own remote, or its name when it has none.GSTACK_PROJECT_SLUGstill wins over everything.A marker only counts when it is a regular file you own, at a repository's top folder or in a folder outside every repository, below your home folder, in a folder whose name has a letter or digit. A cloned repo can't plant one in a subfolder to take over another project's bucket, and
gstack-slug --identityprints aMARKER_IGNORED=line with the reason for each one that didn't count. A linked worktree follows its main checkout's marker from its first run.Checkpoints saved before the marker existed stay where they were. The first run after you add a marker names
gstack-slug --adopt-legacy --from <slug> --under-root, which previews and then copies them over without replacing any existing file. Marker results get their own cache entries, so deleting the file restores the old slug exactly.Test Coverage
All new code paths have test coverage.
test/gstack-slug-project-marker.test.tscovers the bash resolver, its TypeScript twin and remote-slug: nested repo, umbrella, innermost wins, env wins, cache restored on removal, ignored subfolder, link, directory and$HOMEmarkers, hostile origin, worktrees on either side of the umbrella, no-clobber recovery, unusable folder names, cache-key collisions, a non-ASCII parent in the C locale, repo mode, and the review log and spend-cap pointer under a marker. Every fix from review landed with a test that failed first.Tests ran: focused 163
Pre-Landing Review
Review found one CRITICAL and one Medium, both fixed with failing tests first. The CRITICAL: under a marker,
/ship's spend-cap pointer (reviewPathsinlib/ship-budget.ts),gstack-review-logandgstack-review-readwould have moved with the project slug, so a repo's review history could split across buckets; all three now resolve through--get REPO_SLUG. The Medium: a linked worktree outside the umbrella resolved to its own name until its main checkout ran once; it now finds the marker on its first run. Every pass diffed against a freshly fetchedorigin/main. The last fix-check and a money-class targeted reader found nothing at the blocking floor.REVIEW_LOOP: passes=3 blocking_found=0 deferred=0 noted=4 fixed=5 scope=frozen fix_checks=2 dispatches=5
Gate edits: 3 listed, 1 read, 0 findings — 0 kept, 0 restored, 0 open
Outside review: adversarial red-team passes ran on the range; their findings were fixed (review log rows
adversarial-review gate=fixed).Review notes
--adopt-legacypreview skips stamped checkpoints written from a linked worktree that lives outside the marked folder; they stay in the old bucket.browse/bin/remote-slugspends one extra git call per run to find a linked worktree's main checkout.ln), so it needs a filesystem that supports them for the state root.browse/bin/remote-slugignoringGSTACK_PROJECT_SLUGis pre-existing on main and left alone here.Follow-up
Three display-only readers still read the review log from the project slug instead of
REPO_SLUG:bin/gstack-context-recovery,bin/gstack-specialist-statsandretro/sections/report-format.md.tmpl. Under a marker they show no review history; they never gate a ship. They go in a follow-up PR, as GStack Minder directed.Issues
Fixes #1923
Fixes #2649
TODOS
No TODO items completed in this PR.
Documentation
Status: blocked, shipped under an owner exception.
Scope: docs/, README.md, capy/skill/gstack/captain.md and authored skill templates that name project slugs or the moved records.
docs/state-root.mdanddocs/pregate.mddescribe the marker andREPO_SLUG;capy/skill/gstack/captain.mdnow says approvals live under the repository's own slug. The blocked item isretro/sections/report-format.md.tmpl, one of the three readers named under Follow-up.Documentation exception: accepted by GStack Minder (agent:GSTA-36) 2026-11-01 via GSTA-36 message to GSTA-226, 2026-11-01: Name the three display-only readers in E1 PR body as a follow-up.
Test plan
--get, Windows slug, sanitize, Greptile early x3, repo mode, ship-budget review log, review log, captain skill): 163 pass, 0 failbun run typecheck: cleanbun test test/parity-suite.test.ts: pass