Operations — status, checks, cache, recovery, limits, and privacy¶
Keep one brain healthy, verified, and fast without weakening safety boundaries or losing evidence.
Inspect health and prerequisites (bf status, bf doctor)¶
bf status
bf status --check
bf doctor
bf statusandbf doctorrun offline without starting configured jobs.bf status --checkexits1wheneverproblems, cache issues, attention entries (failed,overdue,neveronce due,silent, or 3 consecutive incompletedegradedruns), or unresolvedqueuefailures/uncertain runs/active work exist.bf doctorverifies executables inrun/harness/send/gate, binaries inrequires.bins, presence of env vars inrequires.env, andprompt:files.
Validate notes and evaluate search (bf validate, bf eval)¶
bf validate
bf eval --baseline baseline.json
bf validatechecksbf.yaml(version: 11), OKF frontmatter (type,status), Markdown links and conflict markers, identities,relations, and optionalvalidate:rules (max_stale_days,warn_stale_days,index_note,required_status,forbid_patterns).bf evalruns offline suites inevals/*.yaml(version: 11) checkingquery,read,scope,limit,expect,forbid,text,empty, MRR, and optional--baselineregression comparisons.
Cache, .bf/runtime.sqlite3, and memories/ backup & recovery¶
.bf/cache.sqlite3 is a disposable index, whereas memories/ (evidence) and .bf/runtime.sqlite3 (durable runs, event cursors, wakes, deliveries, and failure incidents) are authoritative/durable local state:
- Rebuild disposable search cache (
bf build): ifbf statusreports"pending_transaction": trueor cache corruption, stop writers and runbf build && bf validate && bf status --check. Onmemories/.pending/manifest errors, move the corrupt stray file out of the brain, rebuild, and re-collect that source. Never editmemories/files manually without runningbf build. - Back up
memories/+.bf/runtime.sqlite3cleanly: stop activebf watch/ updates first (or take a consistent SQLite backup before archivingmemories/andbf.yaml):
mkdir -p ~/brain-backups/snapshot
sqlite3 ~/brain/.bf/runtime.sqlite3 ".backup '$HOME/brain-backups/snapshot/runtime.sqlite3'"
tar --exclude='.bf' -czf ~/brain-backups/snapshot/brain-files.tar.gz -C ~/brain .
- Recover
.bf/runtime.sqlite3(never delete on corruption): - Keep
.bf/runtime.sqlite3and.bf/runtime.sqlite3-journalpaired and runbf queueto roll back an interrupted write. - Restore
.bf/runtime.sqlite3from your most recent consistent backup (withbf watchstopped) rather than deleting or recreating it empty.
Quoted queue and runtime diagnostics¶
| Diagnostic | Recovery |
|---|---|
runtime queue has no unresolved-work slots; clear pending work first |
Inspect and --retry or --cancel unresolved items in bf queue. |
runtime queue reached its size limit; resolve or clear pending work |
Drain pending/failed deliveries (MAX_PENDING / 96 MiB reserve ceiling). |
runtime queue holds unresolved work under a previous path or name; resolve via bf queue first |
Restore the prior brain path/name, resolve bf queue, then rename or move again. |
runtime database predates this release; preserve it and follow upgrade steps in the changelog |
Preserve .bf/runtime.sqlite3 and run manual steps in CHANGELOG. |
unexpected runtime database schema; preserve it and repair it |
Preserve .bf/runtime.sqlite3 and inspect/restore with the matching BF release. |
runtime database holds an interrupted write; run bf queue to recover it |
Keep .bf/runtime.sqlite3 and .bf/runtime.sqlite3-journal together and run bf queue. |
Limits and safeguards¶
| Resource | Limit |
|---|---|
bf.yaml, registry, eval suites |
1 MiB each; YAML depth <= 32, 20,000 events |
| Authored note | 4 MiB; path <= 7,988 percent-encoded chars; aliases/links/tags <= 1,000 each |
Record file & text |
16 MiB file; metadata JSON <= 2 MiB; text <= 4 MiB (unless max_text_bytes cuts with partial) |
| Directory scan & problem caps | 100,000 entries/folder (bf status warns at 80,000); 200 skipped files/problems reported per reply |
| Search & exact read pages | Query <= 4,096 chars / 32 terms; limit 1–50; soft page cut ~32 KiB, hard reply cap 4 MiB |
Jobs, triggers & requires |
<= 128 jobs/brain; <= 32 on rules/job; <= 64 bins / <= 64 env; timeout 1–3,600s |
| Prompts, stdin, stdout & streams | Prompt <= 120,000 bytes; --stdin <= 1 MiB in 10s; stdout default 64 MiB (max 256 MiB) |
| Runtime DB, wakes & retention | DB 256 MiB; 10,000 pending cap (96 MiB); <= 16 wakes, depth <= 8; completed state kept 35d |
| Logs & usage telemetry | logs/NAME.log <= 1 MiB; .bf/usage.sqlite3 <= 1 MiB (30d daily aggregates, never queries/refs) |
Privacy and security boundaries¶
- Local by default: BF collects zero telemetry and runs no server. Connecting cloud model harnesses (
claude,codex, etc.) sends prompt inputs to that provider. - No symlink or shell escapes:
storage.StoreusesO_NOFOLLOWto reject symlinks and special files inside brains and.bf/(mode700). - Untrusted content & audience separation: keep private and team brains in separate Git repos, authenticate inbound message senders, review pulled
bf.yamland script edits before running jobs, and keep rawlogs/and.bf/runtime.sqlite3private. Useuv run --locked bfstrictly on registered brains (registered: true). - Reporting issues: report bugs with synthetic reproductions at GitHub issues and security issues privately via SECURITY.md.