mirror of
https://github.com/garrytan/gstack.git
synced 2026-05-07 05:56:41 +02:00
feat: wire setup-gbrain + brain-restore + brain-uninstall to use the helper
setup-gbrain Step 7 now invokes gstack-gbrain-source-wireup --strict after
gstack-brain-init + gbrain_sync_mode is set. Strict mode means the user sees
the failure rather than silently ending up with an unwired brain.
bin/gstack-brain-init drops 60 lines of dead code: the HTTP POST to
${GBRAIN_URL}/ingest-repo, the GBRAIN_URL_VAL/GBRAIN_TOKEN_VAL probes, the
consumers.json writer, and the chore commit step. CONSUMERS_FILE variable
declaration removed. The closing message no longer points at the dead
gstack-brain-consumer add path.
bin/gstack-brain-restore drops the 18-line consumers.json token-rehydration
block (was a no-op for the only consumer that ever existed). Adds a
best-effort wireup invocation after the brain-repo clone so 2nd-Mac restore
gets gbrain federation automatically. Failure prints a stderr WARNING but
does not abort the restore — restore's primary job is the git clone.
bin/gstack-brain-uninstall calls the helper's --uninstall mode (which
removes the gbrain source registration, the git worktree, and the
future-launchd-plist stub) before the existing legacy consumers.json
removal. Ordering is fragile-by-design: helper derives source-id via
multi-fallback so it works even after .git is destroyed.
bin/gstack-brain-consumer gets a DEPRECATED header note. Stays in the tree
for one cycle of grace; removal in v1.13.0.0.
setup-gbrain/SKILL.md is regenerated from the .tmpl via gen:skill-docs.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+18
-1
@@ -1345,7 +1345,7 @@ For `/setup-gbrain --repo` invocations, execute ONLY Step 6 and exit.
|
||||
|
||||
---
|
||||
|
||||
## Step 7: Offer gstack-brain-sync
|
||||
## Step 7: Offer gstack-brain-sync + wire it into gbrain
|
||||
|
||||
Separate AskUserQuestion: "Also sync your gstack session memory (learnings,
|
||||
plans, retros) to a private git repo that gbrain can index across machines?"
|
||||
@@ -1363,6 +1363,23 @@ If yes:
|
||||
# or "full" if user picked yes-full
|
||||
```
|
||||
|
||||
Then wire the brain repo into gbrain so its content is searchable from any
|
||||
gbrain client (this Claude Code session, future Macs, optional cloud agents).
|
||||
The helper creates a `git worktree` of `~/.gstack/`, registers it as a
|
||||
federated source on the user's gbrain (Supabase or PGLite), and runs an
|
||||
initial `gbrain sync`. Local-Mac only. No cloud agent required. Subsequent
|
||||
skill runs trigger incremental sync via the existing skill-end push hook.
|
||||
|
||||
```bash
|
||||
~/.claude/skills/gstack/bin/gstack-gbrain-source-wireup --strict
|
||||
```
|
||||
|
||||
`--strict` exits non-zero on missing prereqs (gbrain not installed, < 0.18.0,
|
||||
or no `~/.gstack/.git` yet) so the user sees the failure rather than silently
|
||||
ending up with an unwired brain. On non-zero exit, surface the helper's
|
||||
output and STOP per skill rules — search-across-machines won't work until
|
||||
the prereq is fixed.
|
||||
|
||||
---
|
||||
|
||||
## Step 8: Persist `## GBrain Configuration` in CLAUDE.md
|
||||
|
||||
@@ -347,7 +347,7 @@ For `/setup-gbrain --repo` invocations, execute ONLY Step 6 and exit.
|
||||
|
||||
---
|
||||
|
||||
## Step 7: Offer gstack-brain-sync
|
||||
## Step 7: Offer gstack-brain-sync + wire it into gbrain
|
||||
|
||||
Separate AskUserQuestion: "Also sync your gstack session memory (learnings,
|
||||
plans, retros) to a private git repo that gbrain can index across machines?"
|
||||
@@ -365,6 +365,23 @@ If yes:
|
||||
# or "full" if user picked yes-full
|
||||
```
|
||||
|
||||
Then wire the brain repo into gbrain so its content is searchable from any
|
||||
gbrain client (this Claude Code session, future Macs, optional cloud agents).
|
||||
The helper creates a `git worktree` of `~/.gstack/`, registers it as a
|
||||
federated source on the user's gbrain (Supabase or PGLite), and runs an
|
||||
initial `gbrain sync`. Local-Mac only. No cloud agent required. Subsequent
|
||||
skill runs trigger incremental sync via the existing skill-end push hook.
|
||||
|
||||
```bash
|
||||
~/.claude/skills/gstack/bin/gstack-gbrain-source-wireup --strict
|
||||
```
|
||||
|
||||
`--strict` exits non-zero on missing prereqs (gbrain not installed, < 0.18.0,
|
||||
or no `~/.gstack/.git` yet) so the user sees the failure rather than silently
|
||||
ending up with an unwired brain. On non-zero exit, surface the helper's
|
||||
output and STOP per skill rules — search-across-machines won't work until
|
||||
the prereq is fixed.
|
||||
|
||||
---
|
||||
|
||||
## Step 8: Persist `## GBrain Configuration` in CLAUDE.md
|
||||
|
||||
Reference in New Issue
Block a user