Skip to content

Releases: itechmeat/open-second-brain

v1.2.0 - SOLID & DRY

09 Jun 21:29
8972f13

Choose a tag to compare

Open Second Brain v1.2.0 - SOLID & DRY

This release is a codebase-wide refactor with zero behavior change: the two god modules are decomposed into cohesive domain modules, every duplicated helper gets a single source of truth, and two new guard tests make the frozen public surface mechanically enforceable. MCP tool names, CLI verbs, file formats, output strings, and exit codes are byte-identical to 1.1.0 - the release changes how the codebase is organized, not what it does, so future features land in focused modules instead of a 5,614-line monolith.

SOLID & DRY release overview

What ships

  • God module split by domain. src/mcp/brain-tools.ts carried 54 MCP tools and 100+ helpers in 5,614 lines - nine times the size of its siblings. It is now 16 cohesive modules under src/mcp/brain/ (feedback, review, context, pack, query, entity, health, brief, analytics, knowledge, admin, recall, workspace, procedure, landscape, shared), every one under 700 lines, behind an unchanged BRAIN_TOOLS aggregator so every existing import keeps working.
  • Dream pass decomposed. The 2,239-line dream.ts becomes a 1,499-line orchestrator over four extracted modules - dream-plan.ts (scan and plan-state shapes), confidence.ts (Wilson-bound confidence math), dream-refresh.ts (apply-evidence scan and promotion planning), reconcile-outcomes.ts (contradiction classification) - each unit-tested in isolation. The Brain config YAML parser also moves out of policy.ts into its own yaml-parse.ts.
  • One source of truth for duplicated helpers. Seven divergent [[wikilink]] regexes collapse into named, purpose-documented variants in wikilink.ts, with characterization tests pinning each former call site's contract before migration. The two atomic-write implementations merge into one temp-file + fsync + rename pipeline in fs-atomic.ts.
  • CLI verbs share context resolution. 76 verb files replace the repeated config / vault / agent boilerplate with brainVerbContext(flags) and resolveBrainAgent(flags, config), called at the exact position of the former inline code - flag-validation order, error messages, and exit codes stay byte-identical.
  • Frozen-surface guards. A parity test pins the exact v1.x set of 54 Brain MCP tool names (any dropped, duplicated, or renamed tool fails CI), and a layering test fails when anything under src/core calls process.exit, process.stdout.write, or console.log.

Process wins

  • Review economy: a tool change now produces a diff inside one focused domain module; the largest reviewable unit in src/mcp dropped from 5,614 to 690 lines.
  • Provable behavior preservation: every refactor unit landed only with the full suite green, and characterization tests were written before each migration, not after.
  • No shims: duplicated implementations were deleted and call sites migrated directly - the codebase ends smaller, with the single aggregation seam (brain-tools.ts) kept only because it is the registration point tests and tools.ts already use.
  • Quality record: 4,140 tests / 0 fail (47 new), TypeScript clean, lint at the pre-refactor baseline, version synced across all manifests, the OpenClaw bundle byte-identical after rebuild, an independent three-reviewer self-review pass with zero security or logic findings, and one CodeRabbit pass (one valid finding fixed, one incorrect claim refuted with evidence).

Notes

  • Zero behavior change by design; the only observable delta is tool registration order inside tools/list enumeration (the name set and every tool's schema are unchanged).
  • The brainstorm audit trail - consultant variants, the chosen approach, and the rejected alternatives - is committed under docs/brainstorm/solid-dry-refactor/.
  • Release image: the terminal-style overview (animated GIF in this body; static PNG and the SVG source attached as assets).

v1.1.0 - Language-Agnostic & Lean

09 Jun 18:23
6651228

Choose a tag to compare

Open Second Brain v1.1.0 - Language-Agnostic & Lean

This release finishes making the entire recall path language-neutral and trims the surface. Search, classification, and now real-time fact extraction recall by structure - URLs, e-mail addresses, unit-bound quantities, corpus statistics, explicit frontmatter - instead of hardcoded English or Russian word lists, so a turn extracts and ranks the same whatever language it is written in. The Pay Memory subsystem is removed entirely, dropping the advertised tool surface from 77 to 69, and the README is rewritten to show what the plugin is for rather than catalogue every agent function.

Language-Agnostic & Lean release overview

What ships

  • Language-agnostic fact extraction. fact-extract.ts and the truth-claim ingest keep only structurally detectable, language-neutral families - url, email, and quantity bound to a currency glyph, ISO-4217 code, or percent. Every English trigger phrase, action verb, and stop-word list is deleted; a Japanese or Russian turn with a URL / @-address / $120 extracts identically to an English one. Quantities aggregate by entity + unit (the prose action verb is no longer invented). The extractor is also hardened against quadratic regex backtracking and a URL-userinfo over-match found in self-review.
  • BREAKING - Pay Memory removed. The pay.sh integration and the entire payment-memory subsystem are taken out: eight MCP tools (payment_*, asset_capture) and the payment CLI verbs are no longer advertised or callable, and the OpenClaw bundle drops its payment registrations. Brain, schema, and search are unchanged; historical Brain/payments/ content in a vault is left untouched.
  • Search and classification de-hardcoded. Structural signals, corpus document-frequency, and explicit frontmatter replace the EN/RU keyword lists in the surfacing gate, context lanes, and query expansion.
  • README slimmed to user value. 213 -> 134 lines: the version-by-version feature catalog and the full CLI dump move behind the documentation links, leaving a compact "What you get" overview.

Process wins

  • The last component carrying per-language word lists is gone; recall behaviour no longer depends on the language a user happens to write in.
  • No misleading fallbacks: removed fact families are removed, not stubbed - prose facts simply are not auto-captured by the LLM-free path (a deliberate, precision-safe recall reduction).
  • Quality record: 4093 tests / 0 fail, TypeScript clean, lint 0 errors, version synced across all manifests, an independent self-review pass (a ReDoS and a URL over-match found and fixed pre-merge), and one CodeRabbit pass.

Notes

  • Breaking change: the Pay Memory removal. Brain / schema / search surfaces are unchanged.
  • Compression-aware session continuity is intentionally not in this release: it is gated on an upstream Hermes signal (NousResearch/hermes-agent#42940) and tracked separately.
  • Release image: the terminal-style overview (animated GIF in this body; static PNG and the SVG source attached as assets).

v1.0.1 - Hermes Registration Fix

07 Jun 11:49
72bac52

Choose a tag to compare

Open Second Brain v1.0.1 - Hermes Registration Fix

A fresh Hermes gateway now registers the Open Second Brain memory provider with its full curated tool set - "Memory provider 'open-second-brain' registered (10 tools)" - instead of zero, so every brain_* call from the model routes through the memory manager rather than dying as "Unknown tool". Hermes builds its memory-tool routing table once, at provider registration, before any provider initializes, and never rebuilds it; the provider now serves vendored static copies of its curated tool schemas through that window and hands back to live tools/list schemas the moment its o2b mcp bridge is up.

Hermes Registration Fix release overview

What ships

  • Static schema fallback at registration. get_tool_schemas() returns vendored (name, description, inputSchema) copies of the 10 curated MEMORY_TOOLS whenever the bridge is not available - before initialize() runs, and also when a live listing fails after a degraded start. Once the bridge is up, live tools/list schemas win exactly as before. The handle_tool_call() initialization guard is untouched: by the time the model can call a tool, initialization has already happened.
  • Anti-drift guard. The vendored copies in plugins/hermes/_schemas.py are verbatim projections of the live server's tools/list, and tests/python/test_static_schemas.py compares them field by field against a live o2b mcp in CI - a schema change in the TypeScript core that is not re-vendored fails the build instead of shipping stale copies. The test skips with a visible reason when the Bun runtime is unavailable, so unit runs without the toolchain stay green.
  • Hermes-ordering regression tests. The exact gateway sequence - routing table built from get_tool_schemas() pre-init, initialize() afterwards, tool call dispatched through that table - is now an end-to-end test, alongside pre/post-init name-set identity and listing-failure fallback cases.
  • Install doc verify step. install/hermes.md documents the expected registration log line: (10 tools) is the health signal, (0 tools) means a version older than 1.0.1.

Process wins

  • The gateway log itself becomes the verification surface - no tool call needed to detect a dead memory surface.
  • The fix lives entirely on the provider side: no Hermes patch required, no public API change (1.0.0 freeze respected), no new dependencies in the stdlib-only shim.
  • Lifecycle hooks (prefetch, sync_turn, system prompt block, pre-compress, session end) were never affected and are unchanged.
  • Quality record: Python 70/70 (61 baseline + 9 new, no regressions), anti-drift green against the live server, TypeScript 4248/0, tsc clean, an independent reviewer pass with zero blocking findings, and a real-environment smoke test reproducing the exact Hermes registration ordering.

Notes

  • Patch release: no behavior change for any non-Hermes runtime; the static copies add a few kilobytes to the shim and zero I/O at gateway boot.
  • A follow-up proposal for upstream hermes-agent (rebuild _tool_to_provider after initialize_all(), or resolve lazily at dispatch) is documented in the task; with it, providers with init-time discovery would work without vendored schemas.
  • Release image: terminal-style overview (animated GIF in this body; static PNG and the SVG source attached as assets).

v1.0.0 - Stability & Trust

05 Jun 14:43
957a403

Choose a tag to compare

Open Second Brain v1.0.0 - Stability & Trust

The first major release turns eleven cycles of accumulated capability into a commitment: the public contracts - the MCP tool surface, the CLI verb tree, configuration keys, the search schema ladder, and every on-disk schema string - are now frozen under an explicit stability policy, and the one breaking change a major version allows is spent deliberately on deleting the 18 hidden alias tools left over from the token-diet consolidation, replaced by tombstones that answer a stale call with the exact replacement tool and view. Around the freeze ship four hardening layers that make the version number an earned label rather than a milestone: cooperative timeouts with clean abort semantics on every long-running pass, a validate-before-apply staged lifecycle for the self-improvement loop, timezone-aware presentation over storage that stays canonical UTC, and self-comparing reports that answer "what changed since last run" deterministically.

Stability & Trust release overview

What ships

  • API freeze + deprecation sweep. The 18 hidden aliases (10 brain views, 8 schema views) are removed; the advertised tool list and the callable surface are now the same 77-tool set. Calling a removed name answers an INVALID_PARAMS tombstone naming the replacement (brain_digest was removed in 1.0.0; call brain_brief with view="digest"), brain_doctor flags stale references in vault notes, root instruction files, and installed skills, and docs/updating.md carries the full migration table. The policy itself lives in docs/stability.md: what is frozen, what counts as breaking per contract class, and what stays deliberately unfrozen.
  • Operation safeguard. Every long pass - dream, index, reindex, bridge discovery, communities, the maintenance lane - runs under a cooperative deadline checked at natural iteration boundaries (per file, per embedding batch, per candidate, per sweep, per lane task). Bun runs SQLite synchronously, so the safeguard is honest about what it can do: abort BETWEEN atomic writes, never a fake async cancellation around work that keeps running. Budgets resolve safeguard_timeout_<op>_seconds -> OPEN_SECOND_BRAIN_SAFEGUARD_TIMEOUT -> safeguard_timeout_seconds -> 600s, 0 disables; lane task results classify timed_out and persisted error strings cap at 4096 bytes with an explicit marker.
  • Staged dream pipeline. o2b brain dream stage persists the next learning pass as a reviewable, discardable bundle under Brain/dream/staged/<run-id>/ - a manifest (schema o2b.dream-stage.v1), a human-readable REPORT.md, the scanned sources with content hashes, and the planned mutations as data. validate recomputes the clock-normalized plan and reports drift; apply re-validates with the clock it runs with and then executes the one and only promotion engine, so the reviewed plan and the applied plan cannot diverge; discard drops the bundle without a trace. MCP rides the existing brain_dream tool via an action parameter - the 1.0.0 surface adds zero new tools. Stage and apply publish dream_stage records into the Brain/metrics/ dashboard layer.
  • Timezone presentation layer. With timezone: configured (env VAULT_TIMEZONE), brief and analytics envelopes gain additive timezone + local_time fields and human output renders the operator's wall clock; storage, frontmatter, log headings, and run ids remain canonical UTC everywhere.
  • Dual-output reports. With report_snapshots_enabled, each digest / daily / weekly run persists a machine-diffable snapshot (Brain/reports/<surface>/<date>.json, schema o2b.report-snapshot.v1) and reports a deterministic delta against the previous one - objects diff by key path, object arrays by stable identity, primitive arrays as sets, so array order never fabricates a change - as a delta JSON field and a "Since last run" block.

Process wins

  • The advertised surface and the callable surface are the same set: no shadow API survives into 1.0.
  • Migration knowledge ships inside the error message, the doctor report, and the docs - a stale client cannot get lost.
  • A vault that configures nothing behaves identically to 0.45.0, except calls to the 18 removed aliases - the one documented break.
  • Quality record: 4248 tests / 0 fail (552 files), TypeScript clean, lint baseline 111/0, Python 61/61, the OpenClaw bundle gate green, an independent reviewer pass (one determinism bug found and fixed pre-merge), and one CodeRabbit pass with all 13 findings applied - including a path-traversal guard on bundle ids.

Notes

  • Breaking change: only the 18 alias removals. Full table: docs/updating.md. Everything else is additive and opt-in.
  • The staged dream lifecycle and report snapshots extend the Brain/metrics/ machine-readable layer introduced in v0.45.0 - the contract the upcoming dashboard plugin reads.
  • Release image: the new terminal-style overview (animated GIF in this body; static PNG and the SVG source attached as assets).

v0.45.0 - Link & Recall Intelligence Suite

05 Jun 10:04
6d09d3c

Choose a tag to compare

Open Second Brain v0.45.0 - Link & Recall Intelligence Suite

The graph self-organizes and recall quality becomes a number: wikilinks to frontmatter aliases materialize as real edges at index time, an orphan-first pass over the vec index proposes links between embedding-near notes that never name each other - as a reviewable artifact the operator accepts or dismisses, never a silent mutation - deterministic label propagation turns link-graph communities into derived cluster digests, a fixed-dataset recall benchmark (hit@k + MRR) fails CI on ranking regressions and doubles as the objective function for a bounded, replayable self-tuning fold that only activates under an explicit flag, and a bare query can expand into the structured lex/vec/hyde lanes with no model and no paid call, while every pass reports one run-level record into the Brain/metrics/ contract a future dashboard reads without importing internals.

Link & Recall Intelligence Suite

What ships

Capability Surface
Vault-wide alias resolution (schema v7, shadowing-safe, exact path wins) index materialization, IndexStats.aliasResolved
Bridge discovery with accept/dismiss lifecycle o2b brain bridges, MCP brain_bridges, Brain/proposals/bridges.md
Graph-wide communities with derived digests o2b brain clusters, MCP brain_clusters, Brain/clusters/
Reproducible recall benchmark + CI gate o2b brain benchmark, MCP brain_benchmark, fixture thresholds hit@5 >= 0.9 / MRR >= 0.85
Deterministic lex/vec/hyde query expansion o2b search --expand, search({expand: true})
Opt-in self-tuning recall (bounded grid, benchmark-judged) o2b brain tune, MCP brain_tune, Brain/search/tuning.json
Dashboard-ready metrics layer (o2b.metrics.v1) Brain/metrics/<surface>.jsonl, contract in docs/metrics.md
Maintenance-lane passes bridges + clusters tasks behind the existing window/busy/lease gates

Process wins

  • Latent structure surfaces without risk: proposals are artifacts, accepting one writes exactly one related: wikilink under the schema pack's link constraints, dismissals persist across runs.
  • Ranking changes stop shipping blind: the committed fixture vault and dataset pin recall thresholds in CI, and the same runner scores any operator vault on demand.
  • Self-tuning cannot drift: a fixed 24-point grid, every evaluated score persisted with the dataset hash, values re-validated against bounds on each read, defaults restored by deleting one file.
  • The dashboard lands on a ready contract: five surfaces already emit schema-versioned run-level records, documented for consumers that never import Open Second Brain internals.

Notes

  • MCP tool count grows 73 -> 77 (brain_bridges, brain_clusters, brain_benchmark, brain_tune).
  • A vault that enables none of the new features behaves bit-identically; the new search_pool_multiplier knob defaults to the historical value.
  • The bridge verb ships as bridges because o2b brain links remains the v0.38.0 wikilink-normalize contract.
  • Suite: 4174 tests / 0 failures; lint and typecheck clean; live CLI smoke of every new verb including the vec path end to end.

Full changelog: https://github.com/itechmeat/open-second-brain/blob/main/CHANGELOG.md

v0.44.0 - Write-time integrity, secret custody, quiet maintenance

05 Jun 06:16
789e3e3

Choose a tag to compare

Open Second Brain v0.44.0 - Write-time integrity, secret custody, quiet maintenance

Every write into the Brain now passes a declared contract: the schema pack becomes the single declarative ontology - controlled-vocabulary labels, link-type endpoint constraints, per-type attribute descriptors, and a frontmatter field tier map, all additive - and each contract enforces at its existing seam, so an out-of-vocabulary label is rejected with the allowed values in the error, a typed edge whose endpoint page types violate the declared pairs falls back to an untyped link at index materialization, a hand-edited identity join key stages a drift finding the snapshot never absorbs instead of silently corrupting the index, an agent uses a deploy token through an allowlist-gated subprocess without the value ever entering its context, and the heavy dream/reindex pass waits for a quiet window behind an expiring lease instead of landing on top of live recall.

Write-Time Integrity & Governance Suite

What ships

Capability Surface
Schema-pack ontology fields: labels, link_constraints, attributes, frontmatter_tiers - additive, audited mutations Brain/_brain.yaml, o2b brain schema apply
Controlled-vocabulary labels: fail-closed, single-choice per dimension, filterable recall o2b brain label, MCP brain_labels, --property labels=<dim>/<value>
Link-type endpoint constraints enforced at index materialization (index schema v6); removing a constraint restores the edges relation_blocked, IndexStats.relationViolations, schema lint
Per-type attribute fields whose validation errors list the declared fields WITH descriptions o2b brain attr, schema explain output
Four-level frontmatter tier guard: tier-respecting writer merge, identity-drift detection, staged repair o2b brain tiers check|restore|accept, MCP brain_tiers, doctor warning
Capability-gated secret custody: AES-256-GCM at rest, stdin-only ingestion, allowlisted exec with a minimal child env, redacted output, no-values audit o2b brain secret, MCP brain_secrets, Brain/log/secret-custody/
Quiet-window lease-guarded maintenance lane: window + busy + lease gates, stale-first tasks, bounded journal o2b brain maintenance, MCP brain_maintenance

Process wins

  • The ontology is declared once and every write seam reads the same source of truth - no validateWrite() framework layer, just the schema-pack machinery three releases already proved.
  • Errors teach instead of refusing: the rejected label carries the allowed values, the rejected attribute carries the declared fields with their natural-language descriptions, so agents converge on the operator's domain language without reading docs.
  • Humans are never write-denied: the tier guard detects hand-edits against an index snapshot and stages restore | accept - the operator stays the judge, and reindexes never absorb the edit.
  • Custody extends the governance thesis from redaction to safe use: the credential enters via stdin, lives as per-value ciphertext, leaves only into an allowlisted subprocess env, and every operation lands a no-values audit record.
  • Heavy maintenance becomes a polite tenant: gate refusals exit 0 and land in the journal, the lease survives crashes by expiry, and --force can skip the soft gates but never mutual exclusion.
  • Bit-identical neutral defaults throughout: a vault that declares none of the new fields parses, renders, indexes, and recalls exactly as v0.43.1 - pinned by tests.

Notes

  • Suite: 4090+ tests pass (527 files), typecheck clean, oxlint baseline preserved, python plugin suite 61/61.
  • MCP tool count grows 69 -> 73 (brain_labels, brain_tiers, brain_secrets, brain_maintenance), all with preview budgets.
  • The search index schema advances to v6 (additive, reindex-safe): documents.page_type, documents.tier_snapshot, links.relation_blocked, and the tier_drift table.
  • Secret custody's threat model is stated honestly: it protects against context leakage, vault sync exposure, and casual reads - not against root or same-user processes.
  • Full changelog: https://github.com/itechmeat/open-second-brain/blob/main/CHANGELOG.md

v0.43.1 - Hermes CLI discovery contract completed

04 Jun 21:10
c03d569

Choose a tag to compare

Open Second Brain v0.43.1 - Hermes CLI discovery contract completed

Patch release: standalone installs of the Hermes plugin now actually expose the documented hermes open-second-brain CLI subtree. Hermes discovers plugin CLI commands by scanning exactly one file - <plugin_root>/cli.py - while the implementation lives in plugins/hermes/cli.py, so the documented subcommands were never discoverable on a stock Hermes; an 18-line root re-export shim through the loader's synthetic parent packages closes the gap, and a loader-contract test mirrors the upstream scan's exact import sequence so it cannot reopen silently.

            BEFORE                                  AFTER

  hermes discover_plugin_cli_commands     hermes discover_plugin_cli_commands
        scans <plugin_root>/cli.py              scans <plugin_root>/cli.py
                  |                                       |
            file missing                        cli.py (root shim, 18 lines)
                  |                                       |
                  x                          re-exports register_cli / run
   `hermes open-second-brain`                             |
        unknown command                       plugins/hermes/cli.py
                                                          |
                                             `hermes open-second-brain ...`
                                            discoverable before provider load

What ships

Artifact Role
cli.py (repo root) SDK-free relative re-export of register_cli / run through the synthetic parent packages the upstream loader registers (hermes-agent PR #37366)
HermesLoaderContractTests Reproduces the upstream scan's import sequence - synthetic parents pre-registered, root __init__.py never executed - pinning the contract on both sides

Notes

v0.43.0 - Entity truth ledger, outcome-aware dream, foresight

04 Jun 20:25
a0054dd

Choose a tag to compare

Open Second Brain v0.43.0 - Entity truth ledger, outcome-aware dream, foresight

The Brain now knows what is true about an entity RIGHT NOW and learns from what actually happened downstream: an append-only claim ledger folds extracted facts into addressable per-entity aspect slots with superseded history and provenance, contradictions inside the conflict window materialize as ask_user findings instead of silently coexisting, merges can no longer collapse two people's claims into one, quantitative questions are answered by exact-match aggregation that nearby numbers cannot pollute, two agents independently converging on one entity fire a push-mode trigger, apply-evidence carries a downstream outcome that stages regression findings against rules that look confirmed but hurt, failed approaches persist as FTS-recallable dead-ends, inbox signals rank by embedding novelty with zero provider calls, the weekly synthesis nominates the most-developable note of the window, and the foresight fold projects what comes due next - the Brain's first forward-looking surface.

Entity Truth & Self-Improving Dream Suite

What ships

Capability Surface
Entity claim ledger: sharded append-only JSONL, replayable fold, current value + superseded history per (entity, aspect) slot Brain/truth/, o2b brain truth ingest|slots|sweep, MCP brain_truth
Temporal-structural conflict detection: two values, one slot, 30d window, independent sources, resolution always ask_user o2b brain truth conflicts
Exact-match quantity aggregation: totals sum only exact (entity, action, unit) tuples o2b brain truth aggregate, quantity fact family
Atomic-fact decomposition: deterministic markdown-structure splitting with an abbreviation guard, optional ledger ingest o2b brain facts decompose [--ingest]
Name-aware merge guard + entity-contamination check o2b brain merge (entity-guard), deep-synthesis contaminated
Cross-agent collision detection: push-mode agent_collision triggers with cooldown dedup trigger queue, o2b brain truth collisions
Outcome-tied apply-evidence: success|failure|unknown staging outcome_regressions with a deterministic 0.8 confidence penalty o2b brain apply-evidence --outcome, MCP brain_apply_evidence
Dead-end registry: negative knowledge as markdown, bounded with archive-on-overflow, FTS-recallable Brain/dead-ends/, o2b brain dead-end, MCP brain_dead_ends
Surprisal novelty sampling over the existing sqlite-vec index brain_review_candidates.signal_novelty
Weekly top-source nomination + foresight projection (recurrence cadences, open commitments, open questions) weekly synthesis topSource, o2b brain foresight [--write], MCP brain_foresight

Process wins

  • Recall gets a current-truth surface it can trust: one addressable slot answers "what is true now" with the full superseded lineage behind it.
  • Nothing auto-resolves: conflicts stage ask_user, regressions stage a penalty, retirement still walks the existing gates - the operator stays the judge.
  • Negative knowledge compounds: "avoid X" surfaces beside "prefer Y" with zero search changes because dead-ends are plain markdown.
  • Knowledge stops being trapped in the agent that learned it: convergence fires while the work is still happening, not at the next manual diff.
  • Bit-identical neutral defaults throughout: a vault without claims, outcomes, dead-ends, or embeddings ranks, dreams, and reports exactly as v0.42.0 - pinned by tests.

Notes

  • Suite: 3973 tests pass (510 files), typecheck clean, oxlint baseline preserved, python plugin suite 60/60.
  • MCP tool count grows 66 -> 69 (brain_truth, brain_dead_ends, brain_foresight), all with preview budgets.
  • The claim ledger follows the proven activation-store discipline: events are authority, state.json is a recomputable cache, sweep is explicit and bounded.
  • extractFacts' span dedup key now uses a \u0000 escape instead of a literal NUL byte, so fact-extract.ts diffs as text again.
  • Full changelog: https://github.com/itechmeat/open-second-brain/blob/main/CHANGELOG.md

v0.42.0 - Time-Aware Recall & Activation Suite

04 Jun 16:52
b16c37d

Choose a tag to compare

Open Second Brain v0.42.0 - Time-Aware Recall & Activation Suite

Recall now reflects what the agent actually keeps using and respects when things happened rather than when files were written: recorded accesses reinforce a per-document activation that decays by content-type half-life so preferences and decisions never fade while session notes do, habitual companions boost each other through co-access edges, preference pages carry a dream-stamped freshness trend that biases ranking toward rules still earning their keep, since/until filters obey declared valid_from/valid_until validity windows with temporal-bridge traversal pulling in causes and consequences, and a zero-candidate evidence query runs exactly one broadened retry instead of dead-ending in an abstention - all deterministic, bounded, explainable, and bit-identical for vaults without the new data.

Time-Aware Recall & Activation Suite

What ships

  • Access-reinforced activation - CLI/MCP searches record surfaced documents as one hashed JSON event per access under Brain/search/activation/; the derived state is a replayable fold, and a capped activation boost decays stored strength by a content-type half-life table (preferences/decisions/antipatterns never decay, projects ~120d, handoffs/sessions ~30d, notes 60d). o2b brain activation status | sweep inspects and compacts the store; --no-record-access / record_access: false opt out per query.
  • Co-access reinforcement edges - documents habitually surfaced together gain pairwise counts; companions in the same candidate pool reinforce each other with a capped co_access boost (single co-occurrences are noise).
  • Freshness-trend classification - the dream refresh classifies every preference's evidence time distribution into new | strengthening | stable | weakening | stale, stamps freshness_trend into frontmatter opportunistically (no-op runs stay no-op), and recall multiplies the relevance portion (1.05 / 0.93 / 0.85) with an explainable reason; the belief-evolution envelope carries the live classification.
  • Event-time recall discipline - valid_from/valid_until validity windows govern since/until by interval overlap with mtime only as the fallback: an old file about a recent event is found, a fresh file about a closed-out event is excluded, unparseable values warn and fall back.
  • Temporal-bridge traversal - with a time range active, link-graph expansions are kept only inside a padded event-time neighbourhood (default 7d) and decay by temporal proximity (temporal_bridge reason).
  • Self-correcting two-pass recall - a zero-candidate first pass in evidence-pack mode triggers exactly one broadened OR retry, reported as secondPass with per-result second_pass reasons (search_two_pass_enabled kill switch).
  • Hermes integration cleanup - the upstream loader now registers parent namespaces for user-installed providers, so the plugin entrypoint dropped its file-path self-bootstrap for a plain relative re-export.

Process wins

  • Usage signal without authoring - the working set forms from real recall behaviour; nothing to tag, nothing to curate, and the whole layer is one o2b brain activation sweep away from a clean slate.
  • Trust gradient on rules - a weakening preference visibly sinks before the dream pass retires it, and the reason string says exactly why.
  • LongMemEval's largest failure category closed - storage-vs-event-time confusion is structurally impossible once a document declares its validity window.
  • Determinism preserved end to end - injected clocks, replayable folds, bounded boosts, explicit kill switches, an activation fingerprint in the query-cache key, and the MCP tool count unchanged at 66.

Notes

  • Quality gates: 3838 bun tests, 60 Python tests, strict tsc, oxlint baseline, live CLI smoke; independent reviewer pass plus a CodeRabbit pass (4 of 5 findings applied with 5 regression tests, 1 declined with rationale).
  • A vault that never records accesses, stamps trends, or declares validity windows ranks bit-identically to v0.41.0.
  • Full diff: v0.41.0...v0.42.0

v0.41.0 - Agent Write Contract Suite

04 Jun 12:00
c3a2fcc

Choose a tag to compare

Open Second Brain v0.41.0 - Agent Write Contract Suite

The Agent Write Contract Suite defines how external agents write into and deliberate with the Brain while the core stays deterministic: a file-backed write-session kernel gives callers a JSON-envelope lifecycle where opening a session returns the generation prompt, schema hints, and collision metadata, submitting returns machine-readable correction errors without losing state, and only a cleanly validated artifact commits - atomically, audited, and never over an existing file without explicit intent; a multi-persona decision panel rides the same kernel as a session kind, memory import gains a pluggable backend boundary with the Claude Code adapter as its byte-identical default, and explicit remember-writes can mirror into a cross-agent shared namespace that fails soft by contract.

Agent Write Contract Suite

What ships

  • Write-session protocol. o2b brain session open --target Brain/...md (and the MCP brain_write_session tool) opens a session whose envelope tells the calling agent exactly what to generate; submit validates fail-closed and answers done, needs-correction with coded {code, path, message} errors plus a compact correction prompt (retry cap default 3, then terminal), or needs-review for operator-gated sessions where a separate approve commits. Sessions persist as plain JSON under Brain/.sessions/write/ with lazy TTL and a sweep operation - they survive process restarts and vault sync. Reserved namespaces (Brain/preferences/, Brain/log/, Brain/_brain.yaml, machine stores) are refused before a session opens; create intent never overwrites (checked at submit AND at the commit chokepoint, closing the approve-window race); merge appends a session-stamped delimited section and existing bytes survive verbatim. Every terminal transition lands exactly one write-session audit event in the Brain log.
  • Decision panel. o2b brain panel open <topic> convenes distinct analytical lenses as deterministic session steps - persona:<slug> in declared order, then synthesis with every accepted answer in view - and commits a structured decision note under Brain/decisions/panels/ with per-persona sections. Personas are operator-curated notes under Brain/personas/ (built-in default set: technical, strategic, risk, user-experience). The panel inherits the kernel's correction loop, retry cap, TTL, review gate, and audit instead of owning a second state machine; the Brain supplies sequencing and validation only, the calling agent authors every word.
  • Memory backend boundary. A MemorySourceBackend protocol (discoverMemoryDir, parseMemoryFile, renderPreference, slugifyName) with a frozen registry and config-driven selection via the memory_backend key (default claude). The Claude Code adapter delegates to the existing import modules - regression tests pin the default path byte-identical - and an unknown backend id fails loudly with the registered list. A second agent runtime becomes one self-contained adapter module, no core changes.
  • Cross-agent shared namespace. The opt-in shared_namespace config key mirrors explicit remember-writes (feedback signals and narrative notes) into a second vault after the primary write succeeds, attributed by agent identity plus origin_vault. Mirroring is fail-soft by contract: a broken or self-pointing shared vault degrades to a reported mirror: "failed" and the primary write never notices; the key absent means zero behavior change.

Process wins

  • One shared kernel carries the suite: the panel is a session kind on the write-session engine, so TTL, retry, collision metadata, review gating, and audit were built once and reused - the consultant's unified-kernel recommendation made structural.
  • The no-LLM-in-core rule survives contact with generation: every artifact byte comes from the calling agent, and the deterministic core contributes prompts, validation, sequencing, and atomic commits - regeneration is diffable and auditable.
  • Everything additive: no existing record shape or public API changes, the MCP contract grows by exactly one deliberate tool (65 -> 66), and unconfigured setups stay byte-identical on every seam (backend, mirror, sessions).

Notes

  • Session files live inside the vault, so an interrupted correction loop resumes on another device; concurrent same-second opens are safe - the first save goes through an exclusive hardlink-based create, so two openers can never claim the same id.
  • The store reads fail closed: a valid-JSON but structurally incomplete session record surfaces as an error probe, never as writable state; sweep also removes files whose names violate the id grammar.
  • Verification: 3,761 tests pass (+80 across 10 new suites including an end-to-end flow), typecheck clean, lint baseline unchanged (111 warnings, 0 errors), 60 Python provider tests pass, all version manifests synced to 0.41.0, live smoke of session open -> correction -> commit and a full panel run on a real vault, independent reviewer pass (2 blockers fixed pre-QA) plus a CodeRabbit pass with 13 of 14 findings applied and 1 declined with written rationale.