Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

test(chronicle): advisor pins the scoped backfill pointer and the default-on notice (#5876)

garrytanf3bfa23f185d
diff --git a/test/chronicle-advisor.test.ts b/test/chronicle-advisor.test.ts
index 551d99c25d..81a0aeb8a3 100644
--- a/test/chronicle-advisor.test.ts
+++ b/test/chronicle-advisor.test.ts
@@ -28,7 +28,9 @@ describe('collectChronicle', () => {
const gap = findings.find((f) => f.id === 'chronicle_coverage_gap');
expect(gap).toBeTruthy();
expect(gap!.severity).toBe('info');
- expect(gap!.fix.command_argv).toEqual(['gbrain', 'chronicle-backfill']);
+ // #5876: every pointer is a scoped, previewed backfill (paid work needs the user's agreement).
+ const since = new Date(Date.now() - 30 * 86_400_000).toISOString().slice(0, 10);
+ expect(gap!.fix.command_argv).toEqual(['gbrain', 'chronicle-backfill', '--since', since, '--limit', '50', '--dry-run']);
});
test('flags unresolved ontology conflicts', async () => {
@@ -40,8 +42,15 @@ describe('collectChronicle', () => {
expect(conflict!.severity).toBe('warn');
});
- test('no findings on a clean brain', async () => {
- const findings = await collectChronicle.collect(ctx());
- expect(findings).toHaveLength(0);
+ test('no findings on a clean brain whose operator answered the auto_chronicle default', async () => {
+ // #5876: until `config set auto_chronicle` answers it, the default-on notice is the only finding.
+ await engine.unsetConfig('chronicle.default_on_acknowledged');
+ expect((await collectChronicle.collect(ctx())).map((f) => f.id)).toEqual(['auto_chronicle_default_on']);
+ await engine.setConfig('chronicle.default_on_acknowledged', '2026-10-04T00:00:00Z');
+ try {
+ expect(await collectChronicle.collect(ctx())).toHaveLength(0);
+ } finally {
+ await engine.unsetConfig('chronicle.default_on_acknowledged');
+ }
});
});