The orchestrator at bin/gstack-gbrain-sync.ts auto-generates a source ID from the git remote URL, producing IDs like:
gstack-code-github.com-someuser-some-repo-name
This is 56+ chars and contains dots (.), which exceeds gbrain's source-ID constraint (1-32 lowercase alnum + interior hyphens only).
Reproduction
gh repo create user/some-repo --private && cd some-repo
bun run ~/.claude/skills/gstack/bin/gstack-gbrain-sync.ts --full
Observed
ERR code source registration failed: gbrain sources add gstack-code-github.com-... failed:
Invalid source id "gstack-code-github.com-...". Must be 1-32 lowercase alnum chars
with optional interior hyphens (e.g. "wiki", "yc-media").
The code stage of /sync-gbrain --full fails with that error. memory and brain-sync stages still succeed, but the repo's code is never indexed for gbrain search / gbrain code-def.
Expected
Source ID derived from REPO NAME ONLY (e.g., gstack-code-some-repo), not the full remote URL with github.com prefix and user/org segment.
Suggested fix
Strip github.com/ prefix, drop the user/org segment, slugify the remaining repo name, truncate to <=32 chars. The constraint regex [a-z0-9-]{1,32} already exists in gbrain — gstack just needs to respect it.
Workaround
Manually register the source first with a valid short ID:
gbrain sources add gstack-code-<short-name> --path "$(pwd)"
Then /sync-gbrain can proceed. But auto-generation should produce valid IDs without manual intervention.
The orchestrator at
bin/gstack-gbrain-sync.tsauto-generates a source ID from the git remote URL, producing IDs like:This is 56+ chars and contains dots (
.), which exceeds gbrain's source-ID constraint (1-32 lowercase alnum + interior hyphens only).Reproduction
gh repo create user/some-repo --private && cd some-repobun run ~/.claude/skills/gstack/bin/gstack-gbrain-sync.ts --fullObserved
The
codestage of/sync-gbrain --fullfails with that error.memoryandbrain-syncstages still succeed, but the repo's code is never indexed forgbrain search/gbrain code-def.Expected
Source ID derived from REPO NAME ONLY (e.g.,
gstack-code-some-repo), not the full remote URL withgithub.comprefix and user/org segment.Suggested fix
Strip
github.com/prefix, drop the user/org segment, slugify the remaining repo name, truncate to <=32 chars. The constraint regex[a-z0-9-]{1,32}already exists in gbrain — gstack just needs to respect it.Workaround
Manually register the source first with a valid short ID:
Then
/sync-gbraincan proceed. But auto-generation should produce valid IDs without manual intervention.