Repository navigation
v34.0.0
·
2 commits
to main
since this release
Immutable
release. Only release title and notes can be modified.
A major release bumping the brain format to version: 19 to unify all records in memories/, add a strictly disposable offset-indexed stdlib SQLite FTS5 cache (.bf/cache/index.sqlite3) for instant ranked BM25 retrieval and --links-to backlinks, remove hidden loop magic in favor of explicit ingest:/timeout: and per-loop env_from: secret allowlists, add always-on multi-assistant orchestration (concurrency: pools, debounce:, delayed bf emit --in|--at, bf pause/bf resume, bf events), and trim the runtime to 3 minimal dependencies (jsonschema, markdown-it-py, pyyaml, Python 3.12+). Authored Markdown notes remain compatible once rebuilt; back up your brain before upgrading and follow the manual upgrade steps below.
Breaking changes
- Brain format bumped to
version: 19: lean offset-indexed SQLite FTS5 cache, unifiedmemories/store, zero-magicbf.yaml, stdlib polling watcher, and clean.bf/layout.- Offset-indexed SQLite FTS5 cache (
.bf/cache/index.sqlite3) &search.exclude::bf buildandbf ingestmaintain a strictly disposable, contentless offset-indexed SQLite FTS5 + ref/alias/link cache under.bf/cache/index.sqlite3(hydrating top-K hits viaos.preadfrom canonical JSONL instead of duplicatingraw_jsonor body text).bf queryexecutes ranked BM25 full-text search (accent-foldedunicode61,2.5xnote boost, matching title/description/tags/aliases/ref/text) + structured flags (--kind,--scope,--type,--status,--tag,--since,--links-to,--exclude,--all-sources,--all,--format json|jsonl|text), opening.bf/cache/index.sqlite3strictly read-only (mode=ro, rejecting WAL headers, sidecars, and triggers/views) with per-source JSONL fallback.bf.yamladdssearch.exclude:to skip noisy bulk feeds on unscoped queries by default. Removedrg/jqsubprocess wrappers (--jqremoved frombf query; runjqdirectly onmemories/*.jsonl). - Unified
memories/+ optional domain schemas (noschemas/record.jsonoverride): retired the separateusages/bucket (--to usages,kind: "usage",ingest.target: usages, starterschemas/usages.json); all domain and telemetry records live inmemories/<source>.jsonl, and compiled Markdown notes live inmemories/_notes.jsonl. Per-sourceschemas/<source>.jsonfiles are optional (bundledrecordruns unconditionally via fast native Python validation;schemas/record.jsonis reserved; use--schema NAMEoringest.schema: NAMEto share one schema across partitioned sources). ReservedclientsandpromptsinRESERVED_SOURCES. - Zero-magic
bf.yaml(version: 19), per-loopenv_from:,.bf/state/+.bf/locks/, and clean CLI contracts: removed implicitsensors/auto-ingest,ingest: false, andagents/15m default timeout magic (folder conventions locate scripts only whenrun:is omitted; declareingest:andtimeout:explicitly on cycle loops); removed top-levelenv_from:so every loop opts into host/.envcredentials via its ownenv_from:(with0600.envoverriding trackedbf.yaml env:values and expandedGIT_*/XDG_*/NPM_CONFIG_*/TLS/proxy/shell env blocklist); supported both flat triggers (1h,"0 8 * * 0",{event: ...}) and optional per-trigger window objects ({every|cron, backfill?, overlap?}) with pure-Pythonwhere:predicates; moved runtime state & event bus to.bf/state/(<loop>.json,<loop>/,events.jsonl) and per-loop locks to.bf/locks/loop-<name>.lockalongside.bf/{watch,write,corpus}.lock; replacedwatchfileswith a zero-dep stdlibO_NOFOLLOWpolling watcher and dropped the interactive ANSI TUI (bf watch --format tuiand TTY auto TUI; usebf watch --format textorwatch -n 2 bf status --format text); madebf statusexit0whenever readable (restoring--checkto exit1on attention), replacedorphaned_stateswith structuredorphans: {states, dirs, logs}, softenedoverduegrace windows, moved--reset/--pruneintobf state [--brain PATH] reset|prune, unifiedbf emit --dry-runresponse shape, renamedbf status --all->--loopsandbf read --raw->--format raw, and fixed brain discovery to--brain > BF_BRAIN > enclosing bf.yaml > ~/brain(droppingBRAIN_LOCATION). - Lean 3-dependency runtime stack & repo layout: replaced
Python-Markdownwithmarkdown-it-py, replacedcroniterwith stdlibbf.cron, replacedwatchfileswith stdlib polling (3minimal runtime deps:jsonschema,markdown-it-py,pyyaml, Python>=3.12; no nativewatchfileswatcher), inlinedsrc/bf/guides/intodocs/*.md, and moved the/bfskill to top-levelskills/bf/SKILL.md. - Manual upgrade steps from
version: 18: back up your brain; bumpbf.yamltoversion: 19; removedefaults:, removeingest: falseandingest.target: usages, add explicitingest:on cycle loops that ingest records (andtimeout: 15mfor long cycle agent runs, omittingingest:/timeout:onwhen: daemonloops andingest:onemit:loops), add per-loopenv_from:for any host/.envsecrets loops need, flattenwhen:triggers ({event: {kind, source, filter}}->{event: {kind, source, where}}or{event: "<kind>"}; optional{every|cron, backfill?, overlap?}objects stay supported), and optionally addsearch: {exclude: [...]}for noisy bulk feeds; migrateusages/*.jsonlintomemories/by rewriting"kind":"usage"to"kind":"memory"(for examplejq -c '.kind = "memory"' usages/<src>.jsonl > memories/<src>.jsonl) or re-ingesting withbf ingest <src> --schema usages, move anyusages/*.forgottentomemories/, and remove/usages/*and!/usages/*.forgottenfrom.gitignore; remove empty{"type":"object"}stubs and anyschemas/record.json; replaceBRAIN_LOCATIONwithBF_BRAIN; update scripts readingstdinJSON context to readBF_*env + JSONL events onstdin; update callers frombf status(when expecting exit1on attention),bf status --all,bf read --raw,bf query --jq,bf watch --format tui, andbf run --reset/--prunetobf status --check,bf status --loops,bf read --format raw,jq ... memories/*.jsonl,bf watch --format text/watch -n 2 bf status --format text, andbf state reset|prune; remove stalememories/<note_dir>.jsonl, oldlogs/events.jsonl, and.bf/; then runbf build && bf check.
- Offset-indexed SQLite FTS5 cache (
Added
- Always-on multi-assistant orchestration primitives (
concurrency:pools,debounce:, delayedbf emit --in|--at,bf pause/bf resume,bf events, and event-bus hardening).- Named concurrency pools & event priority:
bf.yamlconcurrency:now accepts either an integer (1..32) or a named pool map ({default: 4, agents: 2, interactive: 2}), with per-looppool:validated against declared pools and event-triggered loops always prioritized ahead of periodic schedules in bothbf watchandbf run --due. - Delayed self-wakeups & trailing-edge
debounce::bf emit KIND --in DURATION | --at ISOschedules durable delayed events in.bf/state/timers.jsonl(promoted atomically bybf watchandbf run --due), andEventTriggersupportsdebounce:(1s..1h, capped at4x debounce) to coalesce bursty sensor or chat events. - Live runtime control & event inspection: added
bf pause [LOOP ...] [--all] [--for DURATION]andbf resume(muting cycle loops and stopping/restarting daemons live without editingbf.yaml), plus strictly read-onlybf events [--since SEQ] [--kind ...] [--source ...] [--timers] [--format json|jsonl|text]. - High-scale event bus & isolation: raised
.bf/state/events.jsonlretention to10,000events (16 MiBcompaction threshold), exposed boundedadded_refs/updated_refsonrecords.ingested, decoupledlogs.lockfromwrite.lock, isolated schedule failure backoff from event triggers (preventing overnight schedule errors from blocking interactive messages), and surfacedevents_missed(plusBF_EVENTS_MISSED),dead_lettered,pending_timers, andpausedinbf status.
- Named concurrency pools & event priority:
bf query --links-to TARGET,bf.yaml search.exclude+--all-sources, incrementalbf build(--dry-run), crashed-daemon detection,bf status --loopscounters, and soft scale warnings. Added first-class backlink search (bf query --links-to), configurable default source exclusions (search.exclude:+--all-sources), incremental note reuse by(ref, sha256),loop-*.lockliveness detection for crashed"running"daemons/loops,event_seq/runs/failuresinbf status --loops, degraded/overdue attention surfacing, and soft JSONL scale warnings (> 20,000records or> 64 MiB).
Fixed
- Security, durability, parser, and CLI hardening across the entire stack. Fixed
drain_tail()oversized-line boundary secret leak; decoupled canonical JSONL writes & events from best-effort SQLite cache sync; hardened SQLiteopen_readonlyagainst WAL-shmcreation, sidecar symlinks, triggers/views, andSQLITE_BUSYfalse-corruption unlinks; preventedbf state prunefrom unlinking activeflocklockfiles; fixedvalidate_core_recordvsRECORD_SCHEMAparity (null/non-stringkind,links[].kind, strict ISO timestamps, URL netloc); fixedbf.cronmon-sun/fri-sun/7-7day-of-week ranges; fixedmarkdown.pyinline-code false tasks, loose-task{: ...}attributes, heading-link section attribution, andO(N)footnote extraction; fixedunbuilt_note_dirs(fast=True)mvrename detection; held loop watermarks onincomplete=Truebatches; fixedbf watchBusyErrorbusy-spin; fixedbf query --sincedate-vs-timestamp filtering,bf read --max-bytespreservingrecord,bf read <alias>#anchor, multi-loopbf runpartial failures,bf state --brain PATH, unreferenced siblingbrains:warnings inbf check, and Office.docx/.pptx/.xlsxmemory bounds inexamples/sensors/local-documents.py.
Changed
- Cleaner acyclic module architecture (
yaml_io.py,cron.py,refs.py,state.py,index.py,render.py) and faster hot paths. Droppedwatchfiles,croniter,python-dateutil, andtzdata, added native Pythonvalidate_core_record()(~50x fasterbf checkcore validation), single-pass YAML 1.2 loading, offset-indexedos.preadbf query/read, and updatedscripts/benchmark_scale.py,scripts/test_package.py, and.github/workflows/security.yml(covering Python 3.12, 3.14, and 3.15).