|
1 | 1 | # Changelog |
2 | 2 |
|
| 3 | +## [1.29.0.0] - 2026-05-08 |
| 4 | + |
| 5 | +## **Code search beats Grep across every Conductor worktree now, not just the last one you synced.** |
| 6 | + |
| 7 | +`/sync-gbrain` registers each worktree as its own gbrain source, then |
| 8 | +runs `gbrain sources attach <id>` so the worktree gets a `.gbrain-source` |
| 9 | +pin in its root. Subsequent `gbrain code-def`, `code-refs`, `code-callers` |
| 10 | +calls from anywhere under the worktree route to that source by default, |
| 11 | +no `--source` flag needed. Conductor sibling worktrees of the same repo |
| 12 | +no longer collide on a shared `gstack-code-<slug>` source ID, so the |
| 13 | +last `/sync-gbrain` run no longer silently overwrites every other |
| 14 | +worktree's index. |
| 15 | + |
| 16 | +Three correctness bugs surfaced by `/codex` adversarial review during |
| 17 | +`/ship` are fixed in the same release: silent attach failure (sync |
| 18 | +succeeds but pin is missing → unqualified `code-def` hits the wrong |
| 19 | +source), preamble inconsistency (startup hint claimed "indexed" based |
| 20 | +on global state, ignoring per-worktree pins), and orphan source leak |
| 21 | +(the pre-pathhash `gstack-code-<slug>` source stayed registered |
| 22 | +forever, polluting federated cross-source search). All three fixed |
| 23 | +before merge. |
| 24 | + |
| 25 | +### The numbers that matter |
| 26 | + |
| 27 | +End-to-end verified via `bun test test/gstack-gbrain-sync.test.ts test/gbrain-sources.test.ts test/gen-skill-docs.test.ts`: |
| 28 | + |
| 29 | +| Surface | Before | After | Δ | |
| 30 | +|---|---|---|---| |
| 31 | +| Conductor worktrees indexed independently | 1 (last-sync-wins) | N (one source per path) | branch-correct | |
| 32 | +| `gbrain code-def` from a worktree without sync | hits wrong source silently | falls back to default with notice | no silent corruption | |
| 33 | +| Orphan sources accumulated across runs | unbounded | 0 (legacy id removed on first new-format sync) | clean | |
| 34 | +| Attach-failure-to-pin behavior | stage reports `ok:true` | stage reports `ok:false` with reason | no silent correctness break | |
| 35 | +| Orchestrator registration logic | duplicated in `bin/` and `lib/` (could miss `--db` on one path) | single source of truth in `lib/gbrain-sources.ts` | DRY | |
| 36 | +| Required gbrain version | v0.20.0+ (single-brain-only) | v0.30.0+ (uses `sources attach`) | prerequisite bumped | |
| 37 | + |
| 38 | +Test count went from 405 → 408 (+3 worktree-aware tests + 1 legacy-cleanup preview test). |
| 39 | + |
| 40 | +### What this means for builders |
| 41 | + |
| 42 | +If you use Conductor to run multiple parallel branches of the same |
| 43 | +repo, you can now run `/sync-gbrain` in each one and `gbrain code-def` |
| 44 | +from inside any of them returns hits from THAT worktree's branch state, |
| 45 | +not whichever sibling synced most recently. This was a hard requirement |
| 46 | +before semantic code search could replace Grep for refactor planning, |
| 47 | +"where is X used", "what depends on what" queries across parallel |
| 48 | +worktrees. Run `gbrain autopilot --install` once per machine for |
| 49 | +ongoing background sync; gbrain owns the daemon lifecycle. |
| 50 | + |
| 51 | +### Itemized changes |
| 52 | + |
| 53 | +#### Added |
| 54 | + |
| 55 | +- Worktree-aware source IDs in `bin/gstack-gbrain-sync.ts:176-186`. Pattern is now `gstack-code-<slug>-<pathhash8>` 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. |
| 56 | +- `gbrain sources attach <id>` step in `runCodeImport` (`bin/gstack-gbrain-sync.ts:336-351`). Writes `.gbrain-source <id>` in the worktree root after sync succeeds; subsequent `gbrain code-def` calls from any subdirectory auto-route to that source. |
| 57 | +- Legacy source cleanup: on first new-format sync, removes the pre-pathhash `gstack-code-<slug>` orphan via `gbrain sources remove ... --confirm-destructive` (`bin/gstack-gbrain-sync.ts:298-318`). |
| 58 | +- `.gbrain-source` added to `.gitignore` so per-worktree pin doesn't leak across branches. |
| 59 | + |
| 60 | +#### Changed |
| 61 | + |
| 62 | +- 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. |
| 63 | +- 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`. |
| 64 | +- 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. |
| 65 | +- CLAUDE.md guidance block in the SKILL template now documents the `.gbrain-source` pin and `gbrain autopilot --install` for ongoing sync. |
| 66 | + |
| 67 | +#### Fixed |
| 68 | + |
| 69 | +- 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. |
| 70 | +- Wrong-layer Path 4 early-exit (`/codex` finding #2 from `/plan-eng-review`). |
| 71 | +- Orphan source accumulation: the pre-pathhash `gstack-code-<slug>` source stayed registered across `/sync-gbrain` runs even after the path-keyed format shipped, polluting federated `gbrain search` results with stale duplicates. |
| 72 | + |
| 73 | +#### For contributors |
| 74 | + |
| 75 | +- 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. |
| 76 | +- `/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. |
| 77 | +- 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. |
| 78 | + |
3 | 79 | ## [1.28.0.0] - 2026-05-07 |
4 | 80 |
|
5 | 81 | ## **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.** |
|
0 commit comments