From 5e641f50276db071d7fd8fc25410a59ece37ece0 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Fri, 8 May 2026 11:31:11 -0700 Subject: [PATCH] chore: bump version and changelog (v1.29.0.0) Co-Authored-By: Claude Opus 4.7 --- CHANGELOG.md | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++ VERSION | 2 +- package.json | 2 +- 3 files changed, 78 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9eeb30a19..aa1f227d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,81 @@ # Changelog +## [1.29.0.0] - 2026-05-08 + +## **Code search beats Grep across every Conductor worktree now, not just the last one you synced.** + +`/sync-gbrain` registers each worktree as its own gbrain source, then +runs `gbrain sources attach ` so the worktree gets a `.gbrain-source` +pin in its root. Subsequent `gbrain code-def`, `code-refs`, `code-callers` +calls from anywhere under the worktree route to that source by default, +no `--source` flag needed. Conductor sibling worktrees of the same repo +no longer collide on a shared `gstack-code-` source ID, so the +last `/sync-gbrain` run no longer silently overwrites every other +worktree's index. + +Three correctness bugs surfaced by `/codex` adversarial review during +`/ship` are fixed in the same release: silent attach failure (sync +succeeds but pin is missing → unqualified `code-def` hits the wrong +source), preamble inconsistency (startup hint claimed "indexed" based +on global state, ignoring per-worktree pins), and orphan source leak +(the pre-pathhash `gstack-code-` source stayed registered +forever, polluting federated cross-source search). All three fixed +before merge. + +### The numbers that matter + +End-to-end verified via `bun test test/gstack-gbrain-sync.test.ts test/gbrain-sources.test.ts test/gen-skill-docs.test.ts`: + +| Surface | Before | After | Δ | +|---|---|---|---| +| Conductor worktrees indexed independently | 1 (last-sync-wins) | N (one source per path) | branch-correct | +| `gbrain code-def` from a worktree without sync | hits wrong source silently | falls back to default with notice | no silent corruption | +| Orphan sources accumulated across runs | unbounded | 0 (legacy id removed on first new-format sync) | clean | +| Attach-failure-to-pin behavior | stage reports `ok:true` | stage reports `ok:false` with reason | no silent correctness break | +| Orchestrator registration logic | duplicated in `bin/` and `lib/` (could miss `--db` on one path) | single source of truth in `lib/gbrain-sources.ts` | DRY | +| Required gbrain version | v0.20.0+ (single-brain-only) | v0.30.0+ (uses `sources attach`) | prerequisite bumped | + +Test count went from 405 → 408 (+3 worktree-aware tests + 1 legacy-cleanup preview test). + +### What this means for builders + +If you use Conductor to run multiple parallel branches of the same +repo, you can now run `/sync-gbrain` in each one and `gbrain code-def` +from inside any of them returns hits from THAT worktree's branch state, +not whichever sibling synced most recently. This was a hard requirement +before semantic code search could replace Grep for refactor planning, +"where is X used", "what depends on what" queries across parallel +worktrees. Run `gbrain autopilot --install` once per machine for +ongoing background sync; gbrain owns the daemon lifecycle. + +### Itemized changes + +#### Added + +- Worktree-aware source IDs in `bin/gstack-gbrain-sync.ts:176-186`. Pattern is now `gstack-code--` where `pathhash8` is the first 8 hex chars of `sha1(absolute repo path)`. Conductor worktrees of the same origin coexist as separate sources in one gbrain DB. +- `gbrain sources attach ` step in `runCodeImport` (`bin/gstack-gbrain-sync.ts:336-351`). Writes `.gbrain-source ` in the worktree root after sync succeeds; subsequent `gbrain code-def` calls from any subdirectory auto-route to that source. +- Legacy source cleanup: on first new-format sync, removes the pre-pathhash `gstack-code-` orphan via `gbrain sources remove ... --confirm-destructive` (`bin/gstack-gbrain-sync.ts:298-318`). +- `.gbrain-source` added to `.gitignore` so per-worktree pin doesn't leak across branches. + +#### Changed + +- Code stage no longer skipped on remote-MCP (Path 4) installs. The early-exit in `sync-gbrain/SKILL.md.tmpl` was bouncing users out before the orchestrator ran; the local code brain works regardless of whether artifacts use a remote MCP. Replaced with split-engine prose explaining the model. +- Source registration now flows through `lib/gbrain-sources.ts:ensureSourceRegistered` exclusively. Deleted `ensureSourceRegisteredSync` from the orchestrator binary (was a near-duplicate of the lib helper at `lib/gbrain-sources.ts:100`). Removes the missed-flag risk where one path could skip `--db` or `--federated`. +- Startup preamble (`scripts/resolvers/preamble/generate-brain-sync-block.ts:48-75`) now checks for `.gbrain-source` in `git rev-parse --show-toplevel`, not the global `~/.gstack/.gbrain-sync-state.json`. Opening an unsynced worktree no longer claims "indexed" based on a sibling's sync. +- CLAUDE.md guidance block in the SKILL template now documents the `.gbrain-source` pin and `gbrain autopilot --install` for ongoing sync. + +#### Fixed + +- Silent attach failure: `gbrain sources attach` now treated as stage failure if it returns non-zero. Previously the stage reported `ok:true` while the pin was missing, so unqualified `gbrain code-def` queries silently hit the default source. Now surfaces ERR with reason in the verdict block; user knows to retry. +- Wrong-layer Path 4 early-exit (`/codex` finding #2 from `/plan-eng-review`). +- Orphan source accumulation: the pre-pathhash `gstack-code-` source stayed registered across `/sync-gbrain` runs even after the path-keyed format shipped, polluting federated `gbrain search` results with stale duplicates. + +#### For contributors + +- Phase 0 verification spike at `~/.gstack/projects/garrytan-gstack/2026-05-08-gbrain-split-engine-spike.md` documents what gbrain v0.30 actually provides (no `--db` flag, `serve --http` requires postgres, `sources attach` is the v0.30 routing primitive). The approved plan's "per-worktree PGLite + per-worktree HTTP serve" architecture was invalidated by the spike; the simpler "one brain, many sources, attach for CWD pin" model collapsed ~80% of the plan's complexity. +- `/codex` adversarial review during `/ship` caught all three correctness bugs above (silent attach, preamble inconsistency, orphan leak) before merge. Find-cost: ~10 min CC. Production-bug-cost: stale code search results that "almost worked" — the worst kind to debug. +- gbrain CLI minimum version is now v0.30.0 (uses `sources attach`, which doesn't exist in v0.20.x). Run `cd ~/git/gbrain && git pull && bun install && bun link` to upgrade. + ## [1.28.0.0] - 2026-05-07 ## **Browse handles real-world automation now: SOCKS5 with auth, container Xvfb, browser-native downloads. Plus a single-file `llms.txt` index agents can crawl in one read.** diff --git a/VERSION b/VERSION index 06513fc21..5d7709a6b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.28.0.0 +1.29.0.0 diff --git a/package.json b/package.json index 219e3a3d2..482a541c4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gstack", - "version": "1.28.0.0", + "version": "1.29.0.0", "description": "Garry's Stack — Claude Code skills + fast headless browser. One repo, one install, entire AI engineering workflow.", "license": "MIT", "type": "module",