Operations¶
Once your loops work with bf run, hand them to bf watch for continuous 24/7 supervision. You can control live loops, inspect checkpoints, upgrade versions, and recover from failures without editing bf.yaml or disturbing unrelated state.
1. Supervise continuously (bf watch)¶
bf watch supervises note rebuilds, schedules, events, delayed timers, and always-on daemons in one process:
# Live dashboard on a TTY (switches to structured JSONL under systemd or launchd)
bf watch
# Attach a read-only live view from another terminal at any time
bf status --watch
For 24/7 always-on operation, run bf watch --brain /path/to/brain under systemd --user or launchd. Your OS restarts the supervisor on login or reboot while passive daemons and scheduled or event-driven agents keep running in the background. On laptops that suspend, sleep, or drop Wi-Fi overnight, bf watch recovers automatically in three ways: it detects wall-clock sleep jumps (>= 30s, settling 15s before retrying), runs a rate-limited connectivity recovery sweep (watch.recover, 300s cooldown) whenever a previously failing cycle loop succeeds, and accepts SIGUSR1 on POSIX hosts to clear busy cooldowns, wake sleeping daemon backoffs, and retry failed scheduled loops immediately without restarting (you can also run bf run --failed on demand).
2. Control live loops and forgotten records¶
Operate live loops without editing bf.yaml:
bf pause github-issues --for 2h # Mute a flaky loop temporarily
bf resume github-issues # Resume early
bf state show github-issues # Inspect a loop's checkpoint safely mid-run
bf events --timers --format text # Inspect pending delayed wakeups
If an ingested record should stay removed on future syncs, list its ID (one per line, bare <id> or <source>:<id>) in memories/<source>.forgotten instead of overriding snapshot safety checks.
3. Upgrading¶
Upgrade the CLI with uv tool upgrade brain-framework.
Before crossing a major version, back up your brain and check Breaking changes in the changelog. Preview state cleanup with bf state prune --dry-run, then run bf state prune && bf build && bf check.
4. Maintenance runbook¶
Reset a stuck loop cursor
- Check
bf status --format textand back up.bf/state/<loop>.jsonif you want a rollback copy. - Preview with
bf state reset <loop> --dry-run, then runbf state reset <loop>. - Blast radius: clears failure counters, schedule anchor (next run re-backfills
window.backfill), and activepausedstate while anchoringevent_seqat the latest event. Verify withbf status --format text.
Prune removed loop artifacts
- Preview with
bf state prune --dry-runand copy any.bf/state/<loop>.json,.bf/state/<loop>/, orlogs/<loop>.jsonlfiles you want to keep. - Run
bf state prune. - Blast radius: deletes orphaned state files, state dirs, unlocked lock files, and logs for loops removed from
bf.yaml(active locked loops are skipped). Verifyorphansclears inbf status --format text.
Rebuild a corrupt or stale search cache
- Confirm
index: staleinbf status --format text, and stopbf watchif running so no writer races the rebuild. - Remove only
.bf/cache/(rm -rf .bf/cache, never.bf/state/). Blast radius:.bf/cache/is strictly disposable and rebuilt frommemories/*.jsonl; concurrent reads fall back to JSONL scans untilbf buildfinishes. - Run
bf buildand confirmindex: staledisappears inbf status --format text.
See Security for secret isolation, filesystem confinement, and resource limits, and Reference for every command and exit code.