mirror of
https://github.com/garrytan/gstack.git
synced 2026-09-13 16:38:56 +02:00
test: coverage-audit additions for the fix wave
Ship Step 7 gap-fill (all passing, 248 tests across the touched suites): memory + dream stage probe-timeout proceeds, gbrain-detect override paths, stale-flag passthrough, 200-body-missing-.security fail-closed case, telemetry redaction edges, and credential-pattern edge cases. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
028cb52ca8
commit
88ca684929
@@ -391,6 +391,20 @@ describe("lib/gbrain-local-status — cache behavior", () => {
|
||||
expect(localEngineStatus({ noCache: false })).toBe("ok");
|
||||
});
|
||||
|
||||
it("invalidates cache when GBRAIN_HOME changes (key invariant, codex D11)", () => {
|
||||
env = makeEnv({ withGbrain: true, gbrainBehavior: "ok", withConfig: true });
|
||||
restoreEnv = applyEnv(env);
|
||||
expect(localEngineStatus({ noCache: false })).toBe("ok");
|
||||
|
||||
// Point GBRAIN_HOME at an empty dir: a stale cached "ok" must not win —
|
||||
// gbrain_home is part of the cache key, so this re-probes and finds no
|
||||
// config at the new location.
|
||||
const altHome = join(env.tmp, "alt-gbrain-empty");
|
||||
mkdirSync(altHome, { recursive: true });
|
||||
process.env.GBRAIN_HOME = altHome;
|
||||
expect(localEngineStatus({ noCache: false })).toBe("missing-config");
|
||||
});
|
||||
|
||||
it("invalidates cache when HOME changes (key invariant)", () => {
|
||||
env = makeEnv({ withGbrain: true, gbrainBehavior: "ok", withConfig: true });
|
||||
restoreEnv = applyEnv(env);
|
||||
|
||||
Reference in New Issue
Block a user