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:
Garry Tan
2026-06-11 23:08:54 -07:00
co-authored by Claude Fable 5
parent 028cb52ca8
commit 88ca684929
6 changed files with 168 additions and 0 deletions
+21
View File
@@ -136,6 +136,27 @@ describe('gbrain detection override → gen-skill-docs', () => {
}
});
test('with status "timeout" (slow-but-healthy, #1964), brain blocks render like "ok"', () => {
const { tmpHome, cleanup } = makeFixture(
JSON.stringify({ gbrain_local_status: 'timeout', gbrain_on_path: true, gbrain_version: 'test-0.41.0' }),
);
try {
const snap = regenAndSnapshot({
respectDetection: true,
tmpHome,
files: PROBE_FILES,
});
const content = probeUnion(snap);
// A slow engine must not silently suppress brain features — same
// treatment as "ok" (matches gstack-gbrain-detect --is-ok).
expect(content).toContain('## Save Results to Brain');
expect(content).toContain('gbrain put "office-hours/');
} finally {
cleanup();
}
});
test('with detected:false (status != "ok"), brain blocks stay suppressed', () => {
const { tmpHome, cleanup } = makeFixture(
JSON.stringify({ gbrain_local_status: 'no-cli', gbrain_on_path: false, gbrain_version: null }),