Local-first 🧠memory for Hermes Agent that lives in your Obsidian vault and remembers project context. Nightly 😴 dream passes turn repeat corrections into confirmed preferences with measurable confidence. Adapters ship for Claude Code, Codex, and OpenClaw, with an MCP server for anything else.
Brain Lifecycle Review Suite - reviewed, validated, retained, and summarized Brain state
Status: draft Author: GitHub Copilot (via feature-release-playbook) Audience: implementation
Problem statement
Open Second Brain already captures signals, promotes preferences through dream, renders daily/weekly summaries, and reports basic discipline status. The missing surface is the lifecycle layer around those operations: pre-dream signal review, explicit artifact contracts, post-dream retention recommendations, monthly synthesis, and a warning when vault structure grows faster than actual thinking output. The selected kanban scope should ship those five capabilities without turning the deterministic core into a broad multi-phase rewrite.
Scope
- Add a deterministic intent-review stage for active signal clusters, surfaced through a CLI/MCP read-only report and threaded into dream/review-candidates as structured audit data.
- Add package-local JSON Schema contracts for the new lifecycle envelopes and selected existing Brain boundaries, with lightweight validation where it keeps MCP/CLI outputs honest.
- Add a recommendation-only retention review over retired preferences and processed signals with
keep,improve,park, andpruneoutcomes. It must not delete, move, or auto-restore artifacts. - Add a monthly review projection over the existing temporal index, daily/weekly period helpers, and vault activity counters.
- Extend discipline reporting with a complexity-to-thinking metric that can surface productivity-trap warnings without hiding existing
ok/info/alertsemantics. - Add focused core, CLI, MCP, and docs coverage for each shipped surface.
Out of scope
- Full multi-phase
dreamrewrite (t_1e4f70f5). - LLM-driven enrichment, due-date inference, or frontmatter mutation for user-authored notes.
- Background watchdogs, automatic rollback, or self-healing restore.
- Generic external memory ingest adapters.
- Destructive retention actions. This release only recommends actions and explains why.
- Heavy JSON Schema dependencies or a complete validator implementation for every JSON Schema keyword.
Chosen approach
Use the refined Variant 3 from the consultant: a thin deterministic pre-review boundary plus independent lifecycle review pillars. The implementation keeps dream as the single mutating batch operation and adds pure helpers around it. Intent review becomes the first stage of the promotion decision model, but it preserves current default promotion outcomes by making existing threshold/conflict/suppression decisions explicit rather than introducing surprising new mutation behavior.
Retention and monthly review are read-only projections. Schema contracts are package artifacts plus a small local validator for the exact envelope shapes this release owns. Discipline complexity is a bounded heuristic added to ActivitySummary and report rendering; it may elevate a structurally noisy, low-thinking day to alert, but it does not demote existing alerts or mask taste-event success.
Design decisions
- Keep mutation centralized in
dream. New CLI/MCP tools for retention, monthly review, and intent review are read-only;dreammay include intent-review data in its summary, but no separate tool writes Brain state. - Treat intent review as explicit stage separation, not a new product policy engine. The first implementation classifies clusters as
ready_for_main_review,needs_more_evidence,blocked_conflicted, orsuppressed_by_rejected_retired;planTopicsconsumes that stage so future policy can evolve behind a tested boundary. - Model retention recommendations as deterministic heuristics over current files and log evidence: recently useful retired artifacts are
keep, low-evidence or stale entries arepark, contradictory/noisy entries areimprove, and duplicate or orphaned processed signals can beprunecandidates. All decisions include reasons and source paths. - Build monthly review on
TimelineIndexand existing period helpers so daily, weekly, and monthly summaries share event semantics. The monthly envelope should include wins, patterns, decisions, advanced projects/goals when visible from events, neglected areas from configured watched/read paths, and a generated-at timestamp. - Put complexity scoring in
src/core/discipline/complexity.ts. The score should be transparent: folder depth, template/config churn, tag proliferation, and structural-file changes, compared against thinking output from Brain feedback/evidence/transitions. - Keep JSON Schema contracts additive and visible. Static schemas live in a repo-level
schemas/brain/directory and are referenced by tests and docs; lightweight validation supports only the subset needed by the new envelopes (type,required,properties,items,enum,additionalProperties). - Keep CLI/MCP naming explicit:
brain intent-review,brain retention,brain monthly, and MCP mirrorsbrain_intent_review,brain_retention,brain_monthly_review. Schema contracts can be exposed through a read-onlybrain_schema_contractsMCP tool and CLI verb if implementation remains compact. - Preserve public JSON style: snake_case over MCP, CLI
--jsonmirroring core envelopes, deterministic ordering for stable tests.
File changes
Expected new files:
src/core/brain/intent-review.tssrc/core/brain/retention.tssrc/core/brain/monthly-review.tssrc/core/brain/schema-contracts.tssrc/core/brain/schema-validator.tssrc/core/discipline/complexity.tssrc/cli/brain/verbs/intent-review.tssrc/cli/brain/verbs/retention.tssrc/cli/brain/verbs/monthly.ts- Optional:
src/cli/brain/verbs/schema-contracts.ts schemas/brain/*.schema.json- Core/CLI/MCP tests for each new surface
Expected modified files:
src/core/brain/dream.tssrc/core/brain/review-candidates.tssrc/core/brain/types.tssrc/core/discipline/decision.tssrc/core/discipline/report.tssrc/core/discipline/render.tssrc/mcp/brain-tools.tssrc/cli/brain.tssrc/cli/brain/verbs/index.tssrc/cli/brain/help-text.tsdocs/cli-reference.mddocs/how-it-works.mdREADME.mdCHANGELOG.mdin docs phase
Risks and open questions
- The biggest risk is accidental behavior drift in
dream. The guardrail is to write intent-review tests before integration and preserve current outcomes in existing dream tests. - Complexity scoring can be noisy. The first version should expose raw factors and use conservative thresholds.
- Monthly review can only summarize what deterministic events reveal; it must not invent project/goal progress from unparsed prose.
- JSON Schema validation scope must stay small. If schemas become broad enough to need full draft support, defer full enforcement behind a future ADR.
- The combined PR is intentionally larger than a single feature. Keep commits atomic by surface so review remains tractable.