Repository navigation
v0.9.1 — Active-preferences digest, hygiene lints, MCP resources
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 everydreamrun and aftero2b 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}).initializeadvertisescapabilities.resources = { listChanged: false, subscribe: false }. quarantinepreference status. A confirmed pref whose recent evidence is dominantly negative (violated_count ≥ applied_count AND applied_count > low_max_applied) goes on probation. One furtherviolatedevent retires it withquarantine-violated; recovery toconfirmedwhenapplied_count > violated_count. Pinned preferences emitretain-pinnedinstead of retiring.outdatedapply-evidence result +superseded-by-contextretired reason. A singleoutdatedevent 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
artifactaccepts[[file:120-145]]/[[file:42]](inclusive, 1-based line ranges). Tolerant write — malformed ranges are accepted at write time and surfaced bybrain_doctor'smalformed-evidence-rangelint. - Computed backlinks. New inverted reference index over preferences / retired / signals / log. Exposed via
brain_backlinksMCP tool,o2b brain backlinks <id>CLI verb, andosb://backlinks/{id}resource. Drivesbrain_digest'stop_referencedsection andbrain_doctor'sbroken-backlinkslint. - Status snapshot in
second_brain_status. Newbrainfield:counts(inbox / preferences-by-status / retired / log_days / snapshots),last_dream_at,last_apply_evidence_at,sanity.signals_awaiting_dream. Mirrored asosb://status. brain_digesthot sections.top_applied(top-5 confirmed/quarantine prefs byapplied_count, zero-applied excluded) andtop_referenced(top-5 by backlink count). Both Markdown and JSON outputs.brain_doctorlints (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). NewnormaliseTextField/sanitiseTextFieldapply C0-control strip (except\t/\n),U+2028/U+2029→\n, NFC, and length caps.writeSignalsanitisesprinciple/scope/raw/source[];appendApplyEvidencesanitisesartifact/note. Inputs that sanitise down to empty fall into the existingmissing fielderror branch.
Compatibility
- All v0.9.0 callers continue to work: existing
brain_apply_evidencepayloads withresult: applied | violatedare unchanged; bare wikilinks inartifact(no:rangesuffix) remain valid. renderDigestJSON keepsschema_version: 1; the two newtop_*arrays are additive.- The
brainfield onsecond_brain_statusis 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.