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.
TypeScript
Salience, lifecycle, and enrichment wave - implementation plan
Order is dependency-driven: T1 first (T3, T8, T10 build on it), the rest are independent and land smallest-risk-first. Every task is one atomic conventional commit, TDD (failing test first), formatter and linter green before each commit.
Tasks
Task 1: Envelope spine and semantic-checker registry
- Files: new
src/core/brain/llm-step.ts, newsrc/core/brain/response-checks.ts; modifiedsrc/core/brain/diarization.ts,src/core/brain/rollup-ladder.ts(re-declare their step shapes against the spine type, zero behavioral change);src/core/brain/response-shape.tsuntouched except exports if needed. - Acceptance: type-level test pins the spine field set; existing diarization and rollup suites pass unchanged; a semantic check registered for a test surface rejects a violating payload with a named refusal and passes a conforming one.
- Depends on: none.
Task 2: Deterministic salience gate + retriage (t_de8a0b2d)
- Files: new
src/core/brain/salience-gate.ts; modifieddream-types.ts,dream-apply.ts,dream.ts,types.ts(BrainDreamConfigthreshold),dream-stage.ts(retriage action),src/cli/brain/verbs/dream.ts, help-text, command-manifest, MCP dream tool schema. - Acceptance: with threshold set, low-salience facts are excluded from rollup envelopes and listed by name in the dream summary; threshold unset reproduces current behavior byte-for-byte;
retriageon a staged bundle reports the admitted/excluded delta after a threshold change; refusal paths carry--jsonshapes. - Depends on: none.
Task 3: extract-signals verb (t_1dace26d)
- Files: new
src/core/brain/extract-signals.ts, newsrc/cli/brain/verbs/extract-signals.ts; modifiedtypes.ts(BRAIN_SIGNAL_SOURCE_TYPE+auto_extract, all consumers),response-shape.ts(descriptor +MODEL_AUTHORED_SHAPES),response-checks.ts(cap + confidence floor),signal.tsif needed, MCP tool module +brain-tools.ts, help-text, command-manifest. - Acceptance: verb emits exactly one envelope over an imported session's turns; submitting a conforming payload writes inbox signals with
source_type: auto_extracthonoring the durability denylist and pending staging when write approval is on; an over-cap or under-floor payload is refused by name;import-sessionoutput is byte-identical to before. - Depends on: Task 1.
Task 4: delete-linked cascade (t_5e338af1 part A)
- Files: modified
src/core/brain/notes/lifecycle.ts(flag, derived-set fold, ladder),src/core/brain/destructive-sites.ts,src/mcp/brain/lifecycle-file-tools.ts,src/cli/brain/verbs/note-lifecycle.ts, help-text, command-manifest. - Acceptance: dry-run lists the deletion set (target + solely-derived files) and the report-only inbound references separately; confirm deletes exactly the listed set under one snapshot; a note referenced by any second source is reported, never deleted; destructive-site census test passes.
- Depends on: none.
Task 5: capture guidance + CLI capture ingress (t_5e338af1 part B)
- Files: modified
src/core/brain/capture/capture-note.ts(guidancein input, hash, frontmatter/body, parser),src/core/brain/capture/telegram-capture.ts(pass-through); newsrc/cli/brain/verbs/capture.ts; help-text, command-manifest,state/surfaces.tsif the surface row needs updating. - Acceptance: two captures differing only in guidance produce distinct ids; round-trip parse returns the guidance verbatim; the CLI verb writes a capture note with source, sender, and guidance; existing telegram tests pass unchanged.
- Depends on: none.
Task 6: expiration creation + mutation (t_5e338af1 part C)
- Files: modified
src/cli/brain/verbs/feedback.ts,src/mcp/brain/feedback-tools.ts(creationexpires),signal.ts/preference.ts(mutation helper throughnormalizeExpirationDate), the surface chosen for mutation (feedback verb action or lifecycle action per design note), help-text, command-manifest. - Acceptance: a signal and a preference created with
expirescarry a normalizedexpiration_dateand disappear from default queries after the date; mutation sets, changes, and explicitly clears the date; an unparseable date is refused by name at every surface; nothing bypassesnormalizeExpirationDate. - Depends on: none.
Task 7: skill drafts from mature pages (t_abaec26b)
- Files: modified
src/core/brain/skill-proposals.ts(newmature_pagepattern kind, SKILL.md materializer branch), newsrc/core/brain/skill-page-drafts.ts(maturity gate + candidate mining + envelope emission);response-shape.tsdescriptor; CLI/MCP surface for the drafting action; help-text, command-manifest. - Acceptance: a page passing the maturity gate (tier/lifecycle/confidence + reuse evidence) yields a pending proposal containing one envelope-drafted SKILL body; a page covered by an installed skill is skipped with the skip named; accept materializes a well-formed SKILL.md under the skills root through the WAL; reject is sticky; nothing writes outside the vault before accept.
- Depends on: Task 1.
Task 8: codegraph verdict region (t_3a418d07 descoped)
- Files: modified
src/core/brain/architect/generate.ts(newcodegraphoverview region), readingpartner/codegraph-report.tsoutput; region renderer. - Acceptance: with a healthy partner index the overview carries
graph-presentwith node/edge counts and health; with no partner it carriesgraph-absent, lexical-only; all fiveCodegraphIndexStatevalues render distinctly; operator prose outside the region survives byte-for-byte; the declared byte-identity exception is documented in the generator docstring. - Depends on: none.
Task 9: Mermaid containment diagram + key-decisions note (t_041c571f)
- Files: modified
src/core/brain/architect/generate.ts(newmodule-mapregion, new decisions note kind), readingarchitect/scan.tsfacts andBrain/decisions/candidates/filtered byrepo_key. - Acceptance: the Mermaid block renders containment only (modules, file counts, dominant language), is deterministic under
compareStable, and regenerates byte-identically for an unchanged project and vault; the decisions note lists ADR candidates for the repo'srepo_keyand updates when candidates change; a repo with no candidates gets an explicit empty-state line, not an absent region. - Depends on: none.
Task 10: design-note verb (t_c87644b4 trimmed)
- Files: new
src/core/brain/design-note.ts, newsrc/cli/brain/verbs/design-note.ts;response-shape.tsdescriptor;response-checks.tsexactly-one-Recommended check; MCP tool +brain-tools.ts; help-text, command-manifest. - Acceptance: the verb grounds a topic in tension, decision, and truth records (empty stores produce a named empty grounding, not a failure), emits one envelope, and a payload with zero or two
recommendedalternatives is refused by the cardinality check while exactly one passes and commits a note underBrain/decisions/. - Depends on: Task 1.
Task 11: wave docs and version
- Files:
README.md,CHANGELOG.md(## [1.51.0]+ link reference),package.json+bun run scripts/sync-version.ts(mirrored manifests), brainstorm directory committed. - Acceptance:
bun run scripts/sync-version.ts --checkpasses; CHANGELOG entry covers all shipped units and the t_916f9953 refusal note. - Depends on: Tasks 1-10.