v1.12.2.0 fix: /setup-gbrain day-two fixes (MCP scope, version parse, gh repo create order, smoke test)#1187
Merged
Merged
Conversation
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>
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>
…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>
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 04185d8). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Shorter, matter-of-fact list of the fixes. No preamble. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md
E2E Evals: ✅ PASS0/0 tests passed | $0 total cost | 12 parallel runners
12x ubicloud-standard-2 (Docker: pre-baked toolchain + deps) | wall clock ≈ slowest suite |
gonnabe88
pushed a commit
to gonnabe88/gstack
that referenced
this pull request
May 9, 2026
… gh repo create order, smoke test) (garrytan#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 04185d8). 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>
RyotaKun
pushed a commit
to RyotaKun/gstack
that referenced
this pull request
May 18, 2026
… gh repo create order, smoke test) (garrytan#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 04185d8). 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>
upardhi
pushed a commit
to upardhi/gstack
that referenced
this pull request
May 24, 2026
… gh repo create order, smoke test) (garrytan#1187)
mathiasmora2232
pushed a commit
to mathiasmora2232/gstack
that referenced
this pull request
May 30, 2026
… gh repo create order, smoke test) (garrytan#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 04185d8). 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>
upardhi
pushed a commit
to upardhi/gstack
that referenced
this pull request
Jun 7, 2026
… gh repo create order, smoke test) (garrytan#1187)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Polish for /setup-gbrain.
8bccf2a7fix: parse gbrain --version without "gbrain" prefix— D19 PATH-shadow check now compares just the version number viaawk '{print $NF}'.04185d8ffix(brain-init): drop --source flag before git init—gh repo createno longer needs--source; later steps handlegit init+ remote setup explicitly.d9b9f839fix(setup-gbrain): smoke test command + MCP user scope with absolute path— Step 9 usesgbrain put <slug>; Step 5a registers MCP with--scope userand an absolute path somcp__gbrain__*tools are available in every Claude Code session.781aebd8chore: bump version and changelog (v1.12.1.0)— also updatestest/gstack-brain-init-gh-mock.test.tsto assert--sourceis absent.3a054942docs: tighten CHANGELOG entry for v1.12.1.0Test Coverage
Diff is 73 lines across 4 files. Surgical one-line fixes in shell scripts, no new logic.
test/gstack-brain-init-gh-mock.test.tsnow asserts--sourceis absent from thegh repo createcall.Tests: 687 pass, 1 pre-existing fail (see below).
Pre-Landing Review
No issues. Surgical one-liners in shell scripts. No SQL, auth, trust boundaries, or user input parsing.
Pre-existing test failures (unrelated to this diff)
Three tests fail on this branch. All exercise production code NOT in this branch's diff (verified with
git diff origin/main --name-only). All already tracked in TODOS.md:gstack-config gbrain keys > GSTACK_HOME overrides real config dir(test/brain-sync.test.ts:104) — GSTACK_HOME isolation (P0 in TODOS.md).Opus 4.7 overlay — pacing directive > keeps Fan out / Effort-match / Literal interpretation nudges(test/model-overlay-opus-4-7.test.ts:87) — stale assertion since v1.10.1.0 (P0 in TODOS.md).no compiled binaries in git > git tracks no files larger than 2MB— documented in CLAUDE.md and TODOS.md.Test plan
bun test test/gstack-brain-init-gh-mock.test.ts— 8 pass, 0 failbun test test/skill-validation.test.ts test/gen-skill-docs.test.ts— all pass, generated SKILL.md matches template/setup-gbrainruns end-to-end: installer passes D19, brain-init creates repo + pushes, MCP registers at user scope, smoke test round-trips a page.🤖 Generated with Claude Code