Skip to content

v1.40.1.0 fix: refresh gbrain installer pin#1566

Open
hnshah wants to merge 2 commits into
garrytan:mainfrom
hnshah:ren/gbrain-install-pin-current
Open

v1.40.1.0 fix: refresh gbrain installer pin#1566
hnshah wants to merge 2 commits into
garrytan:mainfrom
hnshah:ren/gbrain-install-pin-current

Conversation

@hnshah
Copy link
Copy Markdown
Contributor

@hnshah hnshah commented May 17, 2026

Summary

  • Refresh bin/gstack-gbrain-install from the original gbrain v0.18.2 pin to current verified gbrain v0.35.4.0 (0c6fcab).
  • Fix the immediate clean-first-run sync crash with current gbrain by accepting the gbrain sources list --json object shape ({ sources: [...] }) during hostname-fold migration planning.
  • Normalize gstack-gbrain-detect version output from gbrain 0.35.4.0 to 0.35.4.0.
  • Teach /setup-gbrain local PGLite paths to use ollama:nomic-embed-text automatically when no OPENAI_API_KEY is present and the local Ollama embedding probe succeeds.
  • Regenerate/update /setup-gbrain docs and move the gstack-memory-ingest: CLI call format incompatible with every released gbrain (+ note on /gstack-upgrade pin staleness) #1305 part 2 TODO to completed for v1.40.1.0.

Why

Dogfooding the gstack/gbrain setup path surfaced that fresh /setup-gbrain installs were still pinned to the original v0.18.2-era gbrain even though current gstack memory features expect newer gbrain behavior. After refreshing the pin, clean /sync-gbrain --code-only hit a compatibility crash before registering the repo source:

gstack-gbrain-sync fatal: list.find is not a function

That came from one helper still assuming the old array-shaped sources list while gbrain v0.35.4.0 returns { sources: [...] }.

The same dogfood run also showed first-sync embedding failures on a machine with no OPENAI_API_KEY, even though gbrain already supports local Ollama embeddings. The setup skill now probes the actual local embedding path and initializes PGLite with --model ollama when it is already working.

Test plan

  • bun run gen:skill-docs --host all
  • bun test test/gbrain-detect-install.test.ts (15 pass)
  • bun test test/gstack-gbrain-sync.test.ts test/gbrain-detect-shape.test.ts test/gbrain-detect-install.test.ts (59 pass)
  • bun test test/setup-gbrain-path4-structure.test.ts test/gen-skill-docs.test.ts
  • HOME=$(mktemp -d) gbrain init --pglite --json --model ollama verified config writes embedding_model: "ollama:nomic-embed-text", embedding_dimensions: 768
  • git diff --check

Dogfood

Clean throwaway HOME + GSTACK_HOME:

  • gbrain init --pglite --json
  • gstack-gbrain-detect -> gbrain_version: "0.35.4.0", gbrain_local_status: "ok"
  • gstack-gbrain-sync --dry-run --code-only
  • gstack-gbrain-sync --code-only
  • Added a tiny hello.js, reran sync, and source page_count reached 1.
  • Confirmed local Ollama embedding probe succeeds: gbrain providers test --model ollama:nomic-embed-text -> 768 dims.

Verification

  • Verified 0c6fcab555b1ca0de80f47dbc2bd692499a82590 is current garrytan/gbrain master.
  • Verified that commit's package.json reports 0.35.4.0.

@hnshah hnshah changed the title fix: refresh gbrain installer pin v1.40.1.0 fix: refresh gbrain installer pin May 17, 2026
Copy link
Copy Markdown
Contributor Author

hnshah commented May 17, 2026

CI note: the code/docs gates are passing (check-freshness, version gate, actionlint, macOS/Ubicloud gates, Windows tests). The remaining build-image failure is from the workflow trying to push the CI image to GHCR from a fork: denied: installation not allowed to Write organization package.

@hnshah hnshah force-pushed the ren/gbrain-install-pin-current branch from 7624531 to 3667de6 Compare May 17, 2026 17:19
Copy link
Copy Markdown
Contributor Author

hnshah commented May 17, 2026

Dogfood update: after refreshing the installer pin to current gbrain, I ran a clean HOME/GSTACK_HOME first-run flow and found the next compatibility bug immediately: gstack-gbrain-sync --code-only crashed with list.find is not a function because sourceLocalPath() still assumed an array-shaped gbrain sources list --json, while current gbrain returns { sources: [...] }.

Amended this PR to:

  • accept both the old array shape and current object shape in sourceLocalPath()
  • add a regression test for the current object shape
  • normalize gstack-gbrain-detect version output from gbrain 0.35.4.0 to 0.35.4.0

Verification:

  • bun test test/gstack-gbrain-sync.test.ts test/gbrain-detect-shape.test.ts test/gbrain-detect-install.test.ts — 59 pass
  • clean dogfood sync now registers the repo source; after adding a tiny hello.js, page_count reached 1

@hnshah hnshah force-pushed the ren/gbrain-install-pin-current branch from 3667de6 to 0a8b0b3 Compare May 17, 2026 17:38
@hnshah
Copy link
Copy Markdown
Contributor Author

hnshah commented May 17, 2026

Follow-up from dogfooding local embeddings: this now keeps fresh local PGLite setup on the local path when possible. If OPENAI_API_KEY is absent and gbrain providers test --model ollama:nomic-embed-text succeeds, the setup skill runs gbrain init --pglite --json --model ollama.

I verified the command writes embedding_model: "ollama:nomic-embed-text" and embedding_dimensions: 768 in a throwaway HOME.

@hnshah
Copy link
Copy Markdown
Contributor Author

hnshah commented May 18, 2026

Updated this PR to the latest ready gbrain release in de176a5a.

What changed:

  • bin/gstack-gbrain-install now pins garrytan/gbrain at 03947665e4dbfeaf8a5542d160a0f4b89e4ae747 / v0.36.0.0.
  • Updated the dry-run pin assertion.
  • Updated /setup-gbrain generated/template example copy.
  • Updated the completed TODO note to reflect v0.36.0.0.

Verification:

  • Confirmed upstream gbrain master package version is 0.36.0.0 at 03947665e4dbfeaf8a5542d160a0f4b89e4ae747.
  • bun test test/gbrain-detect-install.test.ts test/setup-gbrain-path4-structure.test.ts test/gen-skill-docs.test.ts — 420 pass.
  • bun run gen:skill-docs --host all
  • git diff --check
  • Clean no-existing-clone dry run prints the new pinned commit/tag.

@hnshah
Copy link
Copy Markdown
Contributor Author

hnshah commented May 18, 2026

CI update after de176a5a:

Passing:

  • check-freshness
  • version gate
  • actionlint
  • macOS gate
  • Ubicloud gate
  • Windows tests
  • E2E report

Only failing:

  • build-image, same fork/package-permission failure as before: denied: installation not allowed to Write organization package while pushing ghcr.io/garrytan/gstack/ci.

The Docker image builds successfully and fails only at the GHCR push step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant