Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

feat(chronicle): paid backfill pointers carry chronicle-backfill's --yes consent flag (#5876)

garrytan95dd11cfe9c4
diff --git a/docs/guides/life-chronicle.md b/docs/guides/life-chronicle.md
index 3370c7842c..553ec37a7a 100644
--- a/docs/guides/life-chronicle.md
+++ b/docs/guides/life-chronicle.md
@@ -114,7 +114,7 @@ first and agree to the cost:
```bash
gbrain chronicle-backfill --since 2026-09-01 --limit 50 --dry-run
-gbrain chronicle-backfill --since 2026-09-01 --limit 50
+gbrain chronicle-backfill --since 2026-09-01 --limit 50 --yes
```
`--since` filters on the page's last update, not its own date. Re-running is
@@ -131,14 +131,14 @@ brackets are filled in with real values on each surface.
|---|---|---|---|---|---|
| `auto_chronicle_off` | decision | Automatic event extraction is off on this brain by choice (`gbrain config set auto_chronicle false`). | — | — | — |
| `auto_chronicle_invalid` | decision | auto_chronicle holds a value that is neither true nor false, so it reads as off. | `gbrain config set auto_chronicle true` | agent | paid |
-| `slug_bound_client` | decision | The writer is confined (slug-bound, delegated or namespace-restricted), so its writes never trigger extraction into life/events/. | `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50` (preview: `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50 --dry-run`) | host_admin | paid |
-| `operation_bound_client` | decision | The writer's grant lists operations without extract_facts, the permission that covers derived extraction. | `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50` (preview: `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50 --dry-run`) | host_admin | paid |
-| `no_extract` | decision | The sync ran with extraction turned off (--no-extract, or a remote sync, which never extracts). | `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50` (preview: `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50 --dry-run`) | agent | paid |
-| `history` | decision | The page's own date is more than 30 days old (chronicle.auto_recent_days); history is extracted only on request. | `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50` (preview: `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50 --dry-run`) | agent | paid |
+| `slug_bound_client` | decision | The writer is confined (slug-bound, delegated or namespace-restricted), so its writes never trigger extraction into life/events/. | `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50 --yes` (preview: `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50 --dry-run`) | host_admin | paid |
+| `operation_bound_client` | decision | The writer's grant lists operations without extract_facts, the permission that covers derived extraction. | `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50 --yes` (preview: `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50 --dry-run`) | host_admin | paid |
+| `no_extract` | decision | The sync ran with extraction turned off (--no-extract, or a remote sync, which never extracts). | `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50 --yes` (preview: `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50 --dry-run`) | agent | paid |
+| `history` | decision | The page's own date is more than 30 days old (chronicle.auto_recent_days); history is extracted only on request. | `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50 --yes` (preview: `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50 --dry-run`) | agent | paid |
| `not_yet_happened` | decision | The calendar event has not ended yet; it is picked up automatically after its end time, with no edit needed. | — | — | — |
| `too_short` | decision | The page body is under 80 characters, too short to hold events. | — | — | — |
| `dream_generated` | decision | Dream-generated pages are never mined for events. | — | — | — |
-| `no_write_decision` | discovery | This revision has no recorded write decision (written by an older binary or before this release activated), so only a trusted backfill extracts it. | `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50` (preview: `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50 --dry-run`) | agent | paid |
+| `no_write_decision` | discovery | This revision has no recorded write decision (written by an older binary or before this release activated), so only a trusted backfill extracts it. | `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50 --yes` (preview: `gbrain chronicle-backfill --source <source> --since <YYYY-MM-DD> --limit 50 --dry-run`) | agent | paid |
| `not_chronicle_shaped` | decision | The page is no longer a meeting, conversation or calendar page, so the events extracted from it were retired. | — | — | — |
| `superseded` | execution | A newer revision replaced this content before extraction ran; the newer revision carries its own decision. | — | — | — |
| `daily_limit` | execution | The automatic daily limit (chronicle.auto_daily_limit = 200 calls per rolling 24 hours) is used up; pending pages wait for a free slot. | `gbrain config set chronicle.auto_daily_limit 400` | agent | paid |
diff --git a/src/core/chronicle/reasons.ts b/src/core/chronicle/reasons.ts
index 9e5ca04621..5c8860189e 100644
--- a/src/core/chronicle/reasons.ts
+++ b/src/core/chronicle/reasons.ts
@@ -43,10 +43,13 @@ interface ChronicleReason {
fix?: (ctx: ChronicleReasonContext) => ChronicleAction;
}
-/** The backfill pointer every surface emits. Swap here when backfill gains a consent flag. */
+/**
+ * The backfill pointer every surface emits. The paid form carries `--yes` (chronicle-backfill's
+ * consent flag): it is the command to run after the user agrees, never before.
+ */
export function chronicleBackfillArgv(opts: { sourceId?: string; since: string; limit?: number; dryRun: boolean }): string[] {
return ['gbrain', 'chronicle-backfill', ...(opts.sourceId ? ['--source', opts.sourceId] : []),
- '--since', opts.since, '--limit', String(opts.limit ?? 50), ...(opts.dryRun ? ['--dry-run'] : [])];
+ '--since', opts.since, '--limit', String(opts.limit ?? 50), opts.dryRun ? '--dry-run' : '--yes'];
}
/** The run-now pointer: the chronicle phase in the foreground (paid). */
diff --git a/test/chronicle-reasons-5876.test.ts b/test/chronicle-reasons-5876.test.ts
index 9613aca0ef..37e7b45f75 100644
--- a/test/chronicle-reasons-5876.test.ts
+++ b/test/chronicle-reasons-5876.test.ts
@@ -28,7 +28,7 @@ describe('chronicle_backstop receipt', () => {
skipped: 'history', stage: 'decision',
why: "The page's own date is more than 30 days old (chronicle.auto_recent_days); history is extracted only on request.",
fix: {
- argv: ['gbrain', 'chronicle-backfill', '--source', 'work', '--since', '2026-10-04', '--limit', '50'],
+ argv: ['gbrain', 'chronicle-backfill', '--source', 'work', '--since', '2026-10-04', '--limit', '50', '--yes'],
preview_argv: ['gbrain', 'chronicle-backfill', '--source', 'work', '--since', '2026-10-04', '--limit', '50', '--dry-run'],
consent: ['paid'], actor: 'agent', requires_exclusive: false,
why: 'Preview with the dry run, then backfill these pages if the user agrees to one paid chat call per page.',