Skip to content

v34.0.0

Choose a tag to compare

@github-actions github-actions released this 25 Nov 20:00
· 2 commits to main since this release
Immutable release. Only release title and notes can be modified.
2020d27

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, unified memories/ store, zero-magic bf.yaml, stdlib polling watcher, and clean .bf/ layout.
    • Offset-indexed SQLite FTS5 cache (.bf/cache/index.sqlite3) & search.exclude:: bf build and bf ingest maintain a strictly disposable, contentless offset-indexed SQLite FTS5 + ref/alias/link cache under .bf/cache/index.sqlite3 (hydrating top-K hits via os.pread from canonical JSONL instead of duplicating raw_json or body text). bf query executes ranked BM25 full-text search (accent-folded unicode61, 2.5x note 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.sqlite3 strictly read-only (mode=ro, rejecting WAL headers, sidecars, and triggers/views) with per-source JSONL fallback. bf.yaml adds search.exclude: to skip noisy bulk feeds on unscoped queries by default. Removed rg/jq subprocess wrappers (--jq removed from bf query; run jq directly on memories/*.jsonl).
    • Unified memories/ + optional domain schemas (no schemas/record.json override): retired the separate usages/ bucket (--to usages, kind: "usage", ingest.target: usages, starter schemas/usages.json); all domain and telemetry records live in memories/<source>.jsonl, and compiled Markdown notes live in memories/_notes.jsonl. Per-source schemas/<source>.json files are optional (bundled record runs unconditionally via fast native Python validation; schemas/record.json is reserved; use --schema NAME or ingest.schema: NAME to share one schema across partitioned sources). Reserved clients and prompts in RESERVED_SOURCES.
    • Zero-magic bf.yaml (version: 19), per-loop env_from:, .bf/state/ + .bf/locks/, and clean CLI contracts: removed implicit sensors/ auto-ingest, ingest: false, and agents/ 15m default timeout magic (folder conventions locate scripts only when run: is omitted; declare ingest: and timeout: explicitly on cycle loops); removed top-level env_from: so every loop opts into host/.env credentials via its own env_from: (with 0600 .env overriding tracked bf.yaml env: values and expanded GIT_*/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-Python where: predicates; moved runtime state & event bus to .bf/state/ (<loop>.json, <loop>/, events.jsonl) and per-loop locks to .bf/locks/loop-<name>.lock alongside .bf/{watch,write,corpus}.lock; replaced watchfiles with a zero-dep stdlib O_NOFOLLOW polling watcher and dropped the interactive ANSI TUI (bf watch --format tui and TTY auto TUI; use bf watch --format text or watch -n 2 bf status --format text); made bf status exit 0 whenever readable (restoring --check to exit 1 on attention), replaced orphaned_states with structured orphans: {states, dirs, logs}, softened overdue grace windows, moved --reset/--prune into bf state [--brain PATH] reset|prune, unified bf emit --dry-run response shape, renamed bf status --all -> --loops and bf read --raw -> --format raw, and fixed brain discovery to --brain > BF_BRAIN > enclosing bf.yaml > ~/brain (dropping BRAIN_LOCATION).
    • Lean 3-dependency runtime stack & repo layout: replaced Python-Markdown with markdown-it-py, replaced croniter with stdlib bf.cron, replaced watchfiles with stdlib polling (3 minimal runtime deps: jsonschema, markdown-it-py, pyyaml, Python >=3.12; no native watchfiles watcher), inlined src/bf/guides/ into docs/*.md, and moved the /bf skill to top-level skills/bf/SKILL.md.
    • Manual upgrade steps from version: 18: back up your brain; bump bf.yaml to version: 19; remove defaults:, remove ingest: false and ingest.target: usages, add explicit ingest: on cycle loops that ingest records (and timeout: 15m for long cycle agent runs, omitting ingest:/timeout: on when: daemon loops and ingest: on emit: loops), add per-loop env_from: for any host/.env secrets loops need, flatten when: triggers ({event: {kind, source, filter}} -> {event: {kind, source, where}} or {event: "<kind>"}; optional {every|cron, backfill?, overlap?} objects stay supported), and optionally add search: {exclude: [...]} for noisy bulk feeds; migrate usages/*.jsonl into memories/ by rewriting "kind":"usage" to "kind":"memory" (for example jq -c '.kind = "memory"' usages/<src>.jsonl > memories/<src>.jsonl) or re-ingesting with bf ingest <src> --schema usages, move any usages/*.forgotten to memories/, and remove /usages/* and !/usages/*.forgotten from .gitignore; remove empty {"type":"object"} stubs and any schemas/record.json; replace BRAIN_LOCATION with BF_BRAIN; update scripts reading stdin JSON context to read BF_* env + JSONL events on stdin; update callers from bf status (when expecting exit 1 on attention), bf status --all, bf read --raw, bf query --jq, bf watch --format tui, and bf run --reset/--prune to bf status --check, bf status --loops, bf read --format raw, jq ... memories/*.jsonl, bf watch --format text / watch -n 2 bf status --format text, and bf state reset|prune; remove stale memories/<note_dir>.jsonl, old logs/events.jsonl, and .bf/; then run bf build && bf check.

Added

  • Always-on multi-assistant orchestration primitives (concurrency: pools, debounce:, delayed bf emit --in|--at, bf pause/bf resume, bf events, and event-bus hardening).
    • Named concurrency pools & event priority: bf.yaml concurrency: now accepts either an integer (1..32) or a named pool map ({default: 4, agents: 2, interactive: 2}), with per-loop pool: validated against declared pools and event-triggered loops always prioritized ahead of periodic schedules in both bf watch and bf run --due.
    • Delayed self-wakeups & trailing-edge debounce:: bf emit KIND --in DURATION | --at ISO schedules durable delayed events in .bf/state/timers.jsonl (promoted atomically by bf watch and bf run --due), and EventTrigger supports debounce: (1s..1h, capped at 4x debounce) to coalesce bursty sensor or chat events.
    • Live runtime control & event inspection: added bf pause [LOOP ...] [--all] [--for DURATION] and bf resume (muting cycle loops and stopping/restarting daemons live without editing bf.yaml), plus strictly read-only bf events [--since SEQ] [--kind ...] [--source ...] [--timers] [--format json|jsonl|text].
    • High-scale event bus & isolation: raised .bf/state/events.jsonl retention to 10,000 events (16 MiB compaction threshold), exposed bounded added_refs/updated_refs on records.ingested, decoupled logs.lock from write.lock, isolated schedule failure backoff from event triggers (preventing overnight schedule errors from blocking interactive messages), and surfaced events_missed (plus BF_EVENTS_MISSED), dead_lettered, pending_timers, and paused in bf status.
  • bf query --links-to TARGET, bf.yaml search.exclude + --all-sources, incremental bf build (--dry-run), crashed-daemon detection, bf status --loops counters, 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-*.lock liveness detection for crashed "running" daemons/loops, event_seq/runs/failures in bf status --loops, degraded/overdue attention surfacing, and soft JSONL scale warnings (> 20,000 records 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 SQLite open_readonly against WAL -shm creation, sidecar symlinks, triggers/views, and SQLITE_BUSY false-corruption unlinks; prevented bf state prune from unlinking active flock lockfiles; fixed validate_core_record vs RECORD_SCHEMA parity (null/non-string kind, links[].kind, strict ISO timestamps, URL netloc); fixed bf.cron mon-sun/fri-sun/7-7 day-of-week ranges; fixed markdown.py inline-code false tasks, loose-task {: ...} attributes, heading-link section attribution, and O(N) footnote extraction; fixed unbuilt_note_dirs(fast=True) mv rename detection; held loop watermarks on incomplete=True batches; fixed bf watch BusyError busy-spin; fixed bf query --since date-vs-timestamp filtering, bf read --max-bytes preserving record, bf read <alias>#anchor, multi-loop bf run partial failures, bf state --brain PATH, unreferenced sibling brains: warnings in bf check, and Office .docx/.pptx/.xlsx memory bounds in examples/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. Dropped watchfiles, croniter, python-dateutil, and tzdata, added native Python validate_core_record() (~50x faster bf check core validation), single-pass YAML 1.2 loading, offset-indexed os.pread bf query/read, and updated scripts/benchmark_scale.py, scripts/test_package.py, and .github/workflows/security.yml (covering Python 3.12, 3.14, and 3.15).