mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-02 11:45:20 +02:00
v1.12.2.0 fix: /setup-gbrain day-two fixes (MCP scope, version parse, gh repo create order, smoke test) (#1187)
* fix: parse gbrain --version without "gbrain" prefix
Installer's D19 PATH-shadow check compared `expected_version` from
package.json against `actual_version` from `gbrain --version`. The
output is "gbrain 0.18.2" with a literal prefix; `tr -d '[:space:]'`
left "gbrain0.18.2" which never matched "0.18.2", causing every
fresh install to exit 3 with a false-positive shadowing error.
Use `awk '{print $NF}'` to grab just the last whitespace-separated
token before stripping whitespace.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(brain-init): drop --source flag before git init
gstack-brain-init used `gh repo create --source $GSTACK_HOME` before
running `git init` on that directory. gh requires --source to point at
an existing git repo, so the call fails with "not a git repository"
on first run. The fallback path (gh repo view) could only recover if
the repo was somehow pre-created — which it wasn't.
Fix: omit --source from `gh repo create`. The script's later steps
(git init, remote add, push) wire up the remote explicitly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(setup-gbrain): smoke test command + MCP user scope with absolute path
Three Step 5a/9 defects found running /setup-gbrain end-to-end:
1. Step 9 smoke test used `gbrain put_page --title ... --tags ...`,
which doesn't exist. The real command is `gbrain put <slug>` with
body piped on stdin. Updated to match.
2. Step 5a registered MCP with `claude mcp add gbrain -- gbrain serve`.
Default scope is local (per-workspace), so other projects never saw
gbrain. Cross-session memory is the whole point — user scope is
correct.
3. Step 5a passed `gbrain` by bare name, relying on PATH being resolved
when Claude Code spawns the subprocess. Fragile across shell configs.
Use absolute path from `command -v gbrain` with ~/.bun/bin/gbrain
fallback.
Also: remove any stale local-scope registration before re-adding, and
tell the user that open Claude Code sessions need a restart to see
the new mcp__gbrain__* tools (loaded at session start, not mid-session).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore: bump version and changelog (v1.12.1.0)
Also updates test/gstack-brain-init-gh-mock.test.ts to match the fixed
behavior of bin/gstack-brain-init (the assertion previously required
`--source`, which was the bug being fixed in 04185d8f).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* docs: tighten CHANGELOG entry for v1.12.1.0
Shorter, matter-of-fact list of the fixes. No preamble.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -134,8 +134,10 @@ describe('gstack-brain-init uses gh CLI when present + authed', () => {
|
||||
expect(createCall).toContain('gstack-brain-testuser');
|
||||
expect(createCall).toContain('--private');
|
||||
expect(createCall).toContain('--description');
|
||||
expect(createCall).toContain('--source');
|
||||
expect(createCall).toContain(tmpHome);
|
||||
// --source is intentionally omitted: gh requires the source dir to already
|
||||
// be a git repo, but brain-init doesn't `git init $GSTACK_HOME` until later.
|
||||
// Creating bare and wiring up the remote explicitly avoids that ordering bug.
|
||||
expect(createCall).not.toContain('--source');
|
||||
});
|
||||
|
||||
test('falls back to gh repo view when create reports already-exists', () => {
|
||||
|
||||
Reference in New Issue
Block a user