Skip to content

v0.9.1 — Active-preferences digest, hygiene lints, MCP resources

Choose a tag to compare

@solaitken solaitken released this 16 May 07:12
· 207 commits to main since this release
a7b6955

OpenSecondBrain v0.9.1 — Brain visibility + hygiene

Visibility surfaces and hygiene rules on top of v0.9.0 Brain. Closes BRAIN-FUT-006 (per-turn active-preference injection) through a derived Brain/active.md file the agent reads at session start, with a matching MCP Resources surface for hosts that prefer pull access. Adds a quarantine preference state for rules whose recent evidence turns dominantly negative, an outdated apply-evidence result for explicit context shifts, claim-level provenance ranges in apply-evidence, computed backlinks, an operational status snapshot, hot sections in brain_digest, six new brain_doctor lints, and input sanitisation in the Brain writers.

No breaking changes to the v0.9.0 surface — every addition is opt-in or backwards-compatible. Pay Memory is unchanged.

Affected runtimes / agents

Runtime Plugin format Status in v0.9.1
Hermes Python plugin (plugins/hermes/) + MCP server One new MCP tool (brain_backlinks, total 18) and the new resources capability advertised through the same o2b mcp server. No skill changes.
Claude Code .claude-plugin/ + bundled hooks/skills Two new lifecycle hooks (SessionStart matcher startup|resume|clear, PostCompact matcher manual|auto) inject Brain/active.md as additionalContext so the agent sees current rules at session boundaries and after /compact. Fails closed on missing config/vault.
Codex .codex-plugin/ (same hook tree via symlink) Same hooks; same MCP surface.
OpenClaw Native JS entry (openclaw/index.js) Core TypeScript has the full surface; native JS parity for brain_backlinks and the new MCP Resources tracked under BRAIN-FUT-007.

Highlights

  • Brain/active.md — auto-generated digest of confirmed + quarantined preferences plus the three most recently retired entries. Regenerated at the tail of every dream run and after o2b brain pin/unpin. The writer is idempotent (no mtime churn when the body is unchanged).
  • MCP Resources capability. Three concrete URIs (osb://preferences/active, osb://digest/latest, osb://status) and four templates (osb://preference/{id}, osb://topic/{slug}, osb://log/{date}, osb://backlinks/{id}). initialize advertises capabilities.resources = { listChanged: false, subscribe: false }.
  • quarantine preference status. A confirmed pref whose recent evidence is dominantly negative (violated_count ≥ applied_count AND applied_count > low_max_applied) goes on probation. One further violated event retires it with quarantine-violated; recovery to confirmed when applied_count > violated_count. Pinned preferences emit retain-pinned instead of retiring.
  • outdated apply-evidence result + superseded-by-context retired reason. A single outdated event retires the preference on the next dream pass — pin protects against decay-driven retires but NOT against context-driven ones.
  • Claim-level provenance. Apply-evidence's artifact accepts [[file:120-145]] / [[file:42]] (inclusive, 1-based line ranges). Tolerant write — malformed ranges are accepted at write time and surfaced by brain_doctor's malformed-evidence-range lint.
  • Computed backlinks. New inverted reference index over preferences / retired / signals / log. Exposed via brain_backlinks MCP tool, o2b brain backlinks <id> CLI verb, and osb://backlinks/{id} resource. Drives brain_digest's top_referenced section and brain_doctor's broken-backlinks lint.
  • Status snapshot in second_brain_status. New brain field: counts (inbox / preferences-by-status / retired / log_days / snapshots), last_dream_at, last_apply_evidence_at, sanity.signals_awaiting_dream. Mirrored as osb://status.
  • brain_digest hot sections. top_applied (top-5 confirmed/quarantine prefs by applied_count, zero-applied excluded) and top_referenced (top-5 by backlink count). Both Markdown and JSON outputs.
  • brain_doctor lints (6 total): broken-backlinks, duplicate-preferences (jaccard ≥ 0.7 on principle tokens within (topic, scope) buckets), low-evidence-confirmed, pinned-without-recent-evidence, malformed-evidence-range, orphan-evidence.
  • Input sanitisation. Pay Memory's redactor promoted to src/core/redactor.ts (Pay Memory now re-exports). New normaliseTextField / sanitiseTextField apply C0-control strip (except \t/\n), U+2028/U+2029 → \n, NFC, and length caps. writeSignal sanitises principle / scope / raw / source[]; appendApplyEvidence sanitises artifact / note. Inputs that sanitise down to empty fall into the existing missing field error branch.

Compatibility

  • All v0.9.0 callers continue to work: existing brain_apply_evidence payloads with result: applied | violated are unchanged; bare wikilinks in artifact (no :range suffix) remain valid.
  • renderDigest JSON keeps schema_version: 1; the two new top_* arrays are additive.
  • The brain field on second_brain_status is additive; existing readers that ignore unknown fields are unaffected.

Upgrade

Update via the usual plugin path (hermes plugins update open-second-brain, claude plugin update, etc.). Restart the gateway / reload the host once after upgrade so the new MCP tool and resources capability are advertised. No vault migration; the new files (Brain/active.md) are produced on the next dream run.

Roadmap

The v0.9 trigger-based follow-up roadmap stays at docs/plans/2026-05-15-brain-roadmap.md. BRAIN-FUT-006 is now closed by this release; BRAIN-FUT-007 (OpenClaw native JS parity for the new Brain tools and resources) is the next sensible pickup.

Full changelog

See CHANGELOG.md for the file-level breakdown.