Repository navigation
Description
Summary
bin/gstack-gbrain-read-capability.ts answers {"status":"unknown","reason":"source-scoped get unavailable; retry later"} whenever the page it reads is larger than its 64 KiB output cap. The reason says to retry, but the result repeats on every run until a smaller page happens to list first. /sync-gbrain then reports a YELLOW verdict on a healthy brain.
Observed
gstack 1.99.5.0 at 0326b144, gbrain 0.60.619.0, macOS, local Postgres engine, a Node project with a lockfile.
/sync-gbrain(incremental): the code stage reports OK with 580 pages. The capability check then returns theunknownresult above. It did so on three runs across two sessions.gbrain list --source <id> --limit 1returns the code page forpackage-lock.json(slugpackage-lock-json).gbrain get package-lock-json --source <id>run by hand succeeds and prints 257,224 bytes, so the source-scoped read works.- The same call through
spawnSyncwith the helper's cap fails, and passes with a larger one:
maxBuffer=65536 status=143 error=ENOBUFS stdoutBytes=131072
maxBuffer=1048576 status=0 error=undefined stdoutBytes=284411
(gbrain get package-lock-json --source <id> --json, timeout: 10000, run from a small Node script, not from the helper itself.)
Cause (from reading the helper, not from instrumenting it)
- Line 41:
run()callsspawnSyncwithtimeout: 10_000, maxBuffer: 64 * 1024. - Line 66: it lists one page with
list --source <pin> --limit 1. - Lines 79 to 80: it reads that slug with
get <slug> --source <pin> --jsonand maps any failed run tounknown('source-scoped get unavailable; retry later').
So the probe's outcome depends on the size of whichever page lists first. A lockfile, a generated file or any other large code page is enough.
Effect
/sync-gbrainreportsCapability ...... WARNand a YELLOW verdict on every run while the large page lists first.- Per the skill text, an
unknownresult never installs the search guidance block, so a first-time setup in this state would not get it. I did not test a first-time setup.
Possible fixes
- Choose a small page for the probe, for example list a few and read the smallest.
- Or give the
getcall a largermaxBuffer. - Or treat
ENOBUFSon thegetas a read that was arriving, since the cap was reached by real page output.
Happy to send a PR for whichever you prefer.
Activity
capy-ai commentedon Nov 16, 2026
Thanks for the measurements. On main (8c3c39b),
bin/gstack-gbrain-read-capability.ts:41still runsgbrain getwith a 64 KiBmaxBuffer, so a large first page (a lockfile is the usual one) turns a working read intounknownon every run. It's a small, plainly correct fix, so we're taking it. It will be rebuilt on current main and linked here after November 21.nfitzsimmons commentedon Nov 18, 2026
Confirmed on gstack 1.100.0.0 at b49ed6a and gbrain 0.60.619.0, on macOS.
A bounded page read fixes this without raising the subprocess output limit or weakening source and slug checks:
The same live lockfile response shrank from 284411 bytes to 5676 bytes, and the helper changed from unknown to ready. A regression fixture with a 300000-character body fails on the original helper and passes with this change. The shared CLI fixtures were updated to match the bounded read contract.
Validation on an isolated checkout of that revision: 53 focused tests passed, product typecheck passed, and the test typecheck ratchet reported 812 known diagnostics with none new. No paid agent evaluations ran. The full suite is not claimed green: separate baseline updater-fixture and macOS snapshot-path failures were reproduced. Compatibility with older gbrain releases was not tested.
This is supporting evidence for the existing issue; no duplicate PR is proposed.
/sync-gbrain's read check works when the first page is over 64 KB (#4396
capy-ai commentedon Nov 18, 2026
Thank you @nfitzsimmons for the clear report and the argument list. The fix is merged as #4497 (d789dd9), with you credited as co-author: the /sync-gbrain read probe now reads a small window of the first page, so a page over 64 KB reports ready instead of unknown, and older gbrain versions fall back to the previous read.