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.
1. Three architectural variants
Variant 1 β Primitive-first (extract the shared substrate, then wire consumers)
Approach: Land three cross-cutting primitives before any feature task, then build the nine tasks as thin consumers of them: (1) a write-boundary chokepoint built on the existing proper-lockfile writer-lock/lease pattern (store.ts:228, maintenance/lease.ts) that both serializes all Brain writes (A) and exposes a single instrumentation seam for write-volume accounting (I); (2) a linear-bounded corpus-scan detector harness hosted in the maintenance lane's quiet window that context-guard's TEXT_PATTERNS (C), the redactor's new infra-topology detectors (D), and the path-hygiene check (G) all register into; (3) a unified findings/health-gate reporter feeding doctor/vault_health that the graph-health gate (E) and hygiene checks surface through. B, F, and H then land as independent leaves.
Trade-offs:
- Pro: maximal DRY β the ReDoS-linearity contract, the lease acquisition, and the findings shape are each written and tested once.
- Pro: coherent operator surfaces (one findings vocabulary across injection/graph/path).
- Con: front-loads abstraction risk β primitives must be designed for consumers not yet built; wrong guess forces rework.
- Con: primitive PRs are byte-identical-when-off and feature-invisible, which fights the "one atomic commit ships one unit" grain and complicates CHANGELOG framing.
- Con: sequences the concurrency-invariant change (A) earliest, before any safety net exists.
Complexity: large. Risk: medium-high.
Variant 2 β Thematic vertical slices (the release's own three sub-themes)
Approach: Ship three cohesive, individually-demoable verticals matching the stated theme. Write-time integrity discipline: A (single-writer lane), E (graph-health gate), H (safe fallback names). Cross-machine portability: B (scan-root-relative keys), G (hardcoded-path hygiene), I (write cost meter). Corpus-level safety: C (injection sweep), D (redactor fail-closed + topology detectors), F (signed grounding score). Extract a shared primitive only within a slice where two members genuinely share one β e.g. C and D share the linear-regex detector contract inside the safety slice.
Trade-offs:
- Pro: each slice maps to a release-narrative section and a self-contained CHANGELOG story.
- Pro: moderate, low-risk reuse that stays inside a slice boundary.
- Con: misses the strongest cross-slice couplings β A's write chokepoint (integrity slice) and I's write meter (portability slice) instrument the same boundary but never meet; C's corpus scan (safety) and G's hygiene detector (portability) want the same registry harness across slices.
- Con: some duplicated scan/reporting scaffolding across slices.
Complexity: medium. Risk: medium.
Variant 3 β Risk-ordered incremental, minimal abstraction (refactor-on-second-use)
Approach: Ignore grouping; sequence all nine strictly by blast radius, landing byte-identical-when-off, report-only leaves first and the concurrency-invariant change last. Order: G, H, I, E (additive/report-only) β B, F (read-time derivations / append-only projections, no history mutation) β C, D (deterministic scanners behind flags) β A (single-writer lane, which touches the write path every other task depends on). Each task ships self-contained via TDD as one atomic commit; shared primitives are extracted opportunistically only when a second real consumer appears β the ordering engineers those second-use points (I meters at A's chokepoint because A lands after it is anticipated; D shares C's linear-regex detector because D follows C).
Trade-offs:
- Pro: lowest per-step risk; the tree is always shippable and every step is independently revertible.
- Pro: cleanly honors "one unit, one branch, one atomic commit" and the repo's read-time-derive precedent (F, E, I compute at read time, nothing new persisted).
- Pro: the invariant-touching write-lane (A) lands after the health gate, cost meter, and safety scanners exist β the safety net precedes the risky change.
- Con: least upfront DRY; reuse emerges via ordering rather than design, risking minor rework if a late task reveals a primitive an early task could have shared.
- Con: no single unifying architecture diagram; A's cross-cutting benefit arrives latest.
Complexity: medium. Risk: low.
Recommended: Variant 3
The repo's stated grain β "each suite unit ships one-by-one via TDD on a single feature branch, one atomic conventional commit per task" β plus byte-identical-when-off makes Variant 1's speculative primitives a poor fit: a primitive PR changes no observable behavior and can't be validated by its own acceptance test, and the codebase's only principled persisted-derivation exception (memoized side-indexes) signals a strong refactor-on-second-use culture rather than design-for-reuse-upfront. Risk ordering also respects the standing invariants directly: the concurrency-touching single-writer lane (A) is the one task that can destabilize every other write path, so landing it last β after E's non-aborting health gate, I's write meter, and the C/D safety scanners are already in place β means the "safety hardening" net exists before the riskiest change, and A's proper-lockfile chokepoint becomes the natural, already-anticipated second-use seam where I's write accounting attaches. F, E, and I stay pure read-time projections over the append-only ledger and telemetry (no history mutation, nothing new on disk), and B/G/H remain independent leaves, so the sequence keeps every step revertible and honestly opt-in without forcing a big-bang abstraction the conventions would struggle to justify.