Skip to content

v1.92.14.0 feat: a .gstack-project file makes a nested repo or umbrella folder its own project (#2649, #1923) - #3777

Merged
capy-ai[bot] merged 10 commits into
mainfrom
capy/gsta226-e1-project-marker
Nov 1, 2026
Merged

capy-ai[bot] merged 10 commits into
mainfrom
capy/gsta226-e1-project-marker

Conversation

@garrytan

@garrytan garrytan commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3777,
  "head": "491ed293ba0f51c80b78fb7c7e4916ad203330c1",
  "version": "1.92.3.0",
  "base": "main",
  "gate": {
    "focused": {
      "pass": 163,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "8ce8ae90186286883d5b3cc4754b37f46ee8e858",
  "product_patch_id": "ffe5e5a3ae594b3c2abb93284dea7c78d32e34d1",
  "gstack_version": "1.91.379.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 450,
    "rules": "150435b0a543019a",
    "base": "64fb6ecaf8f3a6022a39a52c68b215fc4cbe1e16",
    "registry": "64fb6ecaf8f3a6022a39a52c68b215fc4cbe1e16",
    "gate_scan": {
      "tagged": 1,
      "head": "491ed293ba0f51c80b78fb7c7e4916ad203330c1"
    },
    "reasons": [
      "gate-class",
      "runtime=450>50"
    ]
  },
  "pregate": "requires-remote cleared @8ce8ae901862 (1 checks, current for 491ed293ba0f)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41262426011",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41262426008",
    "pregate.json/remote_gate: remote-gate tree=8ce8ae901862 tests=13959"
  ],
  "issues": {
    "fixes": [
      1923,
      2649
    ],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "blocked",
    "scope": "docs/, README.md, capy/skill/gstack/captain.md and authored skill templates that name project slugs or the moved records",
    "exception": {
      "accepted_by": "GStack Minder (agent:GSTA-36)",
      "date": "2026-11-01",
      "via": "GSTA-36 message to GSTA-226, 2026-11-01",
      "reason": "Name the three display-only readers in E1 PR body as a follow-up."
    }
  },
  "review_loop": {
    "passes": 3,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 4,
    "fixed": 5,
    "scope": "frozen",
    "fix_checks": 2,
    "dispatches": {
      "specialist": 3,
      "red-team": 2
    }
  },
  "review_targeted": {
    "classes": [
      "money",
      "gate"
    ],
    "rules": "baeb8f7ef7da92d0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "ffe5e5a3ae594b3c2abb93284dea7c78d32e34d1",
    "status": "done",
    "findings": 0,
    "raised_by": "targeted"
  }
}

What changed

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

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.

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
--- Before · before.txt · captured output
+++ After · after.txt · captured output
 # acme/app is cloned inside the acme/workspace repo, with an empty .gstack-project file
 $ gstack-slug --get SLUG
+acme-app
-acme-workspace
 $ gstack-slug --identity | grep -E 'SLUG|MARKER'
+SLUG=acme-app
+PROJECT_MARKER=~/code/ws/app/.gstack-project
-SLUG=acme-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-restore in the nested repo came up empty. An empty .gstack-project file 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 in lib/bin-context.ts or browse/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, /verify results, the review log, the /ship spend-cap pointer, repo mode, the Greptile answer) resolve through gstack-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

Date Asked Exact words Outcome Covers Still pending
2026-10-31 Build verdict: E1 BUILD (nested repo marker, folds in E3/#1923), E2 BUILD low priority, recommendations A1 C1 D1 F1 H1 B1 G1 E1 I1 “Do it” (Garry (via GStack Minder)) approved the GSTA-226 plan as relayed, every recommendation none
2026-11-01 Accept plan gate_rev 2 as built “Do it: v2 accepted as built, recorded as GStack Minder's own decision (agent:GSTA-36), not Garry's words” (GStack Minder (agent:GSTA-36)) approved gate_rev 2 differences from the plan Garry saw none
2026-11-01 Fix the CRITICAL review-log/spend-cap path finding; one extra fix-check pass “fix the CRITICAL by resolving the ship-budget reviewPaths, the review-log path and the third path through --get REPO_SLUG ... Third pass is a fix-check plus a money-class targeted reader on the range; rule 23 grant for that one pass” (GStack Minder (agent:GSTA-36)) approved review pass p6 beyond the cap (rule 23) none

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-project file 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_SLUG still 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 --identity prints a MARKER_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.ts covers 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 $HOME markers, 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 (reviewPaths in lib/ship-budget.ts), gstack-review-log and gstack-review-read would 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 fetched origin/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

  • The --adopt-legacy preview skips stamped checkpoints written from a linked worktree that lives outside the marked folder; they stay in the old bucket.
  • browse/bin/remote-slug spends one extra git call per run to find a linked worktree's main checkout.
  • No-clobber recovery uses hard links (ln), so it needs a filesystem that supports them for the state root.
  • browse/bin/remote-slug ignoring GSTACK_PROJECT_SLUG is pre-existing on main and left alone here.
  • A linked worktree shares its main checkout's repository identity by design, including a marker placed at the worktree's own top folder.

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-stats and retro/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.md and docs/pregate.md describe the marker and REPO_SLUG; capy/skill/gstack/captain.md now says approvals live under the repository's own slug. The blocked item is retro/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

  • Focused lane (13 files: project marker, slug parity, cwd walk-up, --get, Windows slug, sanitize, Greptile early x3, repo mode, ship-budget review log, review log, captain skill): 163 pass, 0 fail
  • Remote pregate on Ubicloud, tree 8ce8ae901862 (the pushed head): 13959 tests, 0 failed
  • bun run typecheck: clean
  • bun test test/parity-suite.test.ts: pass

garrytan and others added 10 commits November 1, 2026 00:09
… its own project (#2649, #1923)

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>
…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>
@trunk-io

trunk-io Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@github-actions github-actions Bot changed the title feat: a .gstack-project file makes a nested repo or umbrella folder its own project (#2649, #1923) v1.92.14.0 feat: a .gstack-project file makes a nested repo or umbrella folder its own project (#2649, #1923) Nov 1, 2026
@capy-ai
capy-ai Bot merged commit 482ffd1 into main Nov 1, 2026
63 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

1 participant