mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-13 08:29:04 +02:00
fix: whitelist engine-locked at all three gbrain-usable gates (#2456)
#2194 taught the classifier to report a PGLite lock held by a live \`gbrain serve\` as engine-locked instead of broken-config, but none of the three "is gbrain usable?" gates accepted the new status — so the symptom moved from a wrong error to a quieter wrong suppression: gbrain-refresh stripped GBRAIN_CONTEXT_LOAD / GBRAIN_SAVE_RESULTS blocks out of every generated SKILL.md after every upgrade, on the RECOMMENDED /setup-gbrain default (PGLite + local-stdio MCP spawns gbrain serve at session start). engine-locked is the same class as timeout (#1964): the engine is installed and healthy, a legitimate holder has the lock. All three gates now agree: - bin/gstack-gbrain-detect --is-ok exits 0 on engine-locked - bin/gstack-config gbrain-refresh case arm renders instead of suppressing - scripts/gen-skill-docs.ts --respect-detection treats it as detected Test mirrors the existing timeout case in test/gbrain-detection-override.test.ts (engine-locked renders brain blocks; the sibling no-cli case still proves suppression works). Applies the reporter's patch + test from the issue. Fixes #2456 Co-authored-by: Mateus Moraes <mmoraes@users.noreply.github.com> Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Mateus Moraes
Claude Fable 5
parent
5b65f91a8c
commit
f9f3c9801a
+7
-4
@@ -434,11 +434,14 @@ case "${1:-}" in
|
||||
fi
|
||||
|
||||
case "$STATUS" in
|
||||
ok|timeout|thin-client)
|
||||
ok|timeout|thin-client|engine-locked)
|
||||
# "timeout" = slow-but-healthy engine (#1964); "thin-client" =
|
||||
# remote-HTTP MCP brain, no local engine by design (#2051) — same
|
||||
# treatment as "ok", matching gstack-gbrain-detect --is-ok and
|
||||
# gen-skill-docs.
|
||||
# remote-HTTP MCP brain, no local engine by design (#2051);
|
||||
# "engine-locked" = same class (#2456): PGLite is single-writer, so a
|
||||
# live `gbrain serve` (typically an MCP server) holds the embedded DB.
|
||||
# gbrain is installed and healthy; a transient lock must not strip
|
||||
# brain blocks out of every SKILL.md. All get the same treatment as
|
||||
# "ok", matching gstack-gbrain-detect --is-ok and gen-skill-docs.
|
||||
echo "Detected gbrain v$VERSION (local-status: $STATUS)."
|
||||
# Render brain-aware blocks into an UNTRACKED out-dir (#2569) and
|
||||
# repoint the installed skills at it — the old in-place render wrote
|
||||
|
||||
Reference in New Issue
Block a user