|
1 | 1 | # Changelog |
2 | 2 |
|
| 3 | +## [1.43.1.0] - 2026-05-21 |
| 4 | + |
| 5 | +## **Local gbrain PGLite now defaults to Voyage's code-specialized embedding model when `VOYAGE_API_KEY` is set.** |
| 6 | +## **Symbol search ranks implementation files above tests on real code queries.** |
| 7 | + |
| 8 | +gstack-driven PGLite installs now use `voyage:voyage-code-3` (1024-dim) as the default embedding model when `VOYAGE_API_KEY` is in env. Falls back to gbrain's auto-selected provider chain (OpenAI `text-embedding-3-large` 1536-dim when `OPENAI_API_KEY` is set, etc.) when the Voyage key is absent. The switch hits 3 PGLite init sites in `/setup-gbrain` (Step 1.5 broken-db rollback, Path 3 direct PGLite, Step 4.5 split-engine local code index) and the post-install hint in `bin/gstack-gbrain-install`. Two new test files pin the contract: a free deterministic test that runs the template's voyage-gate shell against a fake gbrain to verify argv across `VOYAGE_API_KEY` set/unset/empty, and a real Voyage integration test (skips without the API key) that runs `gbrain init` + `sync --strategy code` against a sandbox PGLite to catch dimension mismatches, silent embedding failures, and provider adapter regressions. |
| 9 | + |
| 10 | +### The numbers that matter |
| 11 | + |
| 12 | +Source: head-to-head A/B against `voyage-4-large` on this codebase using `gbrain query --no-expand` (pure vector retrieval, no LLM expansion). 10 realistic code queries, a mix of symbol lookups, semantic intent, and design questions. |
| 13 | + |
| 14 | +| Surface | voyage-4-large | voyage-code-3 | Δ | |
| 15 | +|---|---|---|---| |
| 16 | +| Strict wins (right impl file beats test file) | — | 4 | +4 | |
| 17 | +| Ties (same top hit) | 5 | 5 | 0 | |
| 18 | +| Losses | 0 | 0 | 0 | |
| 19 | +| Top-1 confidence (avg) | 0.84 | 0.90 | +0.06 | |
| 20 | +| Cost per 1M tokens | $0.18 | $0.18 | 0 | |
| 21 | + |
| 22 | +| Query | voyage-4-large top hit | voyage-code-3 top hit | |
| 23 | +|---|---|---| |
| 24 | +| `ownsTerminalAgent` | `terminal-agent-integration.test.ts` (test) | `terminal-agent.ts` (impl) | |
| 25 | +| `ServerConfig terminal-agent teardown ownership` | `pair-agent-e2e.test.ts killDaemon` (loose match) | `terminal-agent.ts disposeSession` | |
| 26 | +| `unicode sanitization at server egress` | `sanitize.test.ts` | `server-node.mjs sanitizeReplacer` | |
| 27 | +| `how does websocket auth use Sec-WebSocket-Protocol` | no results | `terminal-agent.ts buildServer` | |
| 28 | + |
| 29 | +The win pattern is exactly what voyage-code-3 advertises: surfacing implementation source over tests when the query is a code concept. Cost is unchanged from voyage-4-large at $0.18 per 1M tokens. A full reindex of a 100K-LOC repo runs about $0.20. |
| 30 | + |
| 31 | +### What this means for builders |
| 32 | + |
| 33 | +If you have `VOYAGE_API_KEY` set and run `/setup-gbrain` on a fresh machine, `gbrain code-def`, `code-refs`, and semantic queries against your worktree now rank real implementation files above test fixtures with consistently higher confidence. No flag to pass, no config to edit. Existing brains keep whatever embedding model they were built with. The new default only applies to fresh inits. If you re-run `/setup-gbrain` on a machine that already has an OpenAI 1536-dim brain at `~/.gbrain/brain.pglite/`, the config rewrite triggers a column-dim mismatch that `gbrain doctor` will flag clearly. Recovery is `mv ~/.gbrain/brain.pglite ~/.gbrain/brain.pglite.bak && gbrain init --pglite --embedding-model voyage:voyage-code-3 --embedding-dimensions 1024` followed by a fresh `/sync-gbrain`. |
| 34 | + |
| 35 | +### Itemized changes |
| 36 | + |
| 37 | +**Added** |
| 38 | +- `test/gbrain-init-voyage-code-3.test.ts` — 5 deterministic tests covering the voyage-gate shell semantics + a template-shape invariant that asserts the gate appears at exactly 3 PGLite init sites |
| 39 | +- `test/gbrain-sync-voyage-code-3-integration.test.ts` — 4 tests (1 always-on guard, 3 voyage-gated) running real `gbrain init --pglite --embedding-model voyage:voyage-code-3` + `sync --strategy code` against a sandbox PGLite, asserting embeddings round-trip, doctor reports no dimension mismatch, and `code-def` finds symbols in the embedded fixture. Skips when `VOYAGE_API_KEY` or `gbrain` CLI is absent |
| 40 | + |
| 41 | +**Changed** |
| 42 | +- `setup-gbrain/SKILL.md.tmpl` — 3 PGLite init sites (Step 1.5 broken-db rollback, Path 3 direct, Step 4.5 split-engine) now gate `--embedding-model voyage:voyage-code-3 --embedding-dimensions 1024` on `VOYAGE_API_KEY`. Falls back to gbrain's auto-selected provider chain when unset |
| 43 | +- `sync-gbrain/SKILL.md.tmpl` — 2 manual repair hints (D12 missing-engine, D4 corrupted-config) suggest the voyage flags with the same fallback pattern |
| 44 | +- `bin/gstack-gbrain-install` — post-install "Next:" hint shows the voyage flags when the key is set, prints a tip about setting the key when absent |
| 45 | +- `USING_GBRAIN_WITH_GSTACK.md` — Path 3 docs explain the embedding model selection and the A/B rationale |
| 46 | +- `CLAUDE.md` — drops the obsolete `~/.zshrc grep+eval` recipe for API keys; points at the `GSTACK_*` env-shim (`lib/conductor-env-shim.ts`) as the canonical answer. Keeps the Agent SDK `env: {...}` gotcha for tests |
| 47 | + |
| 48 | +**Regenerated** |
| 49 | +- `setup-gbrain/SKILL.md`, `sync-gbrain/SKILL.md` — refreshed via `bun run gen:skill-docs --host all` after the template edits |
| 50 | + |
3 | 51 | ## [1.43.0.0] - 2026-05-20 |
4 | 52 |
|
5 | 53 | ## **iOS QA on a real iPhone — no XCTest, no WebDriverAgent, no simulators.** |
|
0 commit comments