Repository navigation
Description
Summary
bin/gstack-brain-cache never returns a digest for single-page entities (product, brand, competitive-intel, user-profile) even when the page exists in the brain. The planning skills then print "no product digest available yet" on every run, and brain-cache/_meta.json shows last_attempt timestamps with an empty last_refresh. Nothing surfaces the failure.
Cause
fetchSimplePage (around line 520 on main) does:
const result = spawnGbrain(['get', slug, '--json'], { timeout: 10_000 });
if (result.status !== 0) return null;
const page = JSON.parse(result.stdout) as { body?: string; title?: string };
if (!page?.body) return null;
return compressPage(slug, page.title || slug, page.body);Two mismatches with what gbrain get returns:
-
Field name. It reads the page text from
page.body.- gbrain 0.46.x:
gbrain get <slug> --jsonprints the page as markdown (frontmatter + body), not JSON, soJSON.parsethrows and the function returnsnull. (Observed live.) - gbrain 0.60.x:
--jsondoes print JSON, but inget_pageresultsbodyis the name of the read mode (auto/full/none/outline/window), and the text is carried incompiled_truth/timeline/content(src/core/ops/get-page-body.ts,src/cli/page-render.ts). Sopage.bodyis either absent or a mode string, never the page text. (From reading the 0.60.626.0 source; not run live.)
- gbrain 0.46.x:
-
Slug case. The slug is built from the project slug as-is, e.g.
gstack/product/<Owner-Name>-<repo>, which keeps the GitHub owner's capitalisation. gbrain lowercases path-derived slugs (pathToSluginsrc/core/sync.ts), and on 0.46.xgbrain getwith the mixed-case slug returnspage_not_foundwhile the lowercase slug resolves. (Observed live on 0.46.x; not checked on 0.60.x.)
Repro (gbrain 0.46.29, gstack 1.98.0.0, macOS, Postgres engine)
- In a repo whose project slug contains capitals (
gstack-slug→SLUG=Some-Org-some-repo), create the pagegstack/product/Some-Org-some-repoin the brain (gbrain putstores it asgstack/product/some-org-some-repo). gstack-brain-cache refresh --entity product --project Some-Org-some-repo→failed to refresh productgstack-brain-cache get product --project Some-Org-some-repo→(missing: brain unreachable; no cache available)gbrain get gstack/product/some-org-some-reporeturns the page, so the brain is reachable and the page exists.
Expected
A digest for the product page, or a message that distinguishes "page not found" from "brain unreachable".
Suggested fix
- Read the text from the fields
get_pageactually returns (compiled_truth, falling back tocontent), and tolerate non-JSON output from older gbrain. - Lowercase the slug before the lookup (or resolve it via
gbrainslug resolution). - Report
page_not_foundseparately from an unreachable brain so the "missing" message is accurate. - The existing brain-cache tests appear to stub
gbrain; a fixture with a realget --jsonpayload would catch this.
gstack-gbrain-read-capability.ts parses get --json too but only checks source_id and slug, so it is not affected by the field name.
Activity
capy-ai commentedon Nov 10, 2026
Thanks for the clear report. On main,
fetchSimplePagein bin/gstack-brain-cache still readspage.bodyfromgbrain get --jsonand passes the project slug with its original case, so single-page digests can't be found as you describe. We'll check which fields current gbrain returns before changing it. gstack is in a tooling freeze until November 21, so it will be looked at after that.capy-ai commentedon Nov 22, 2026
Picking this up. A maintainer agent working through a batch of fixes (our tracking thread GSTA-804) will first reproduce this on current main. If it reproduces, the agent fixes it on main and we'll close this issue with a link when the change lands. If it no longer reproduces, we'll close it and say what changed. PR #4316 is the starting point.
gbrain memory lookups find the artifacts source, product pages and ne…
capy-ai commentedon Nov 22, 2026
Fixed in #4685, now merged. Single-page brain-cache digests now read
compiled_truth(orcontent) under the lowercase slug gbrain stores. Thanks for tracking down both causes.