CC-025 — Second Brain + Agentic OS: Phases 1-3
Executed: 2026-07-07 on eco-chi-001, as eco user
Repo touched: /home/eco/Dev/smk9-app/ (AGENTS.md only)
Summary
Built the three-layer architecture that makes the Van Clief incident (2026-07-02: two research files written to /tmp, lost on reboot) structurally impossible. All three phases complete, all done-criteria met, Fireman 89/89 (no regressions).
Phase 1 — Session Path Resolver
- Created
/home/eco/second-brain/directory tree:sessions/,notes/{smk9,encompass,personal,tech},alexandria/{inbox,rejected},workspaces/ - Wrote
path_resolver.py— returns a durable dated session path per agent/task, verified - Added rsync cron (
*/15 * * * *) syncingsessions/→ VPS/home/smk9/second-brain-mirror/sessions/; SSH key confirmed working; manual trigger verified a test file arrived on the VPS - Appended
## OUTPUT CONTRACTsection to/home/eco/Dev/smk9-app/AGENTS.md— two-surface rule,/tmpban for work output - Smoke test passed: session path created → file written → rsync’d → confirmed present on VPS
Phase 2 — LLM Wiki + Basic Memory MCP
- Installed Basic Memory via pipx (
basic-memory 0.22.1) - Initialized wiki at
notes/:SCHEMA.md(conventions, tag taxonomy, page thresholds),index.md,log.md, all subdirectories (raw/{articles,papers,decisions},entities/,concepts/,comparisons/,queries/, plus the 4 project namespaces) - Registered project
smk9-ecosystem→/home/eco/second-brain/notesviabasic-memory project add(note: the briefing’s suggested~/.config/basic-memory/config.jsonpath is not what Basic Memory actually reads — real config lives at~/.basic-memory/config.json, auto-managed by the CLI; used the proper CLI command instead) - Registered
basic-memoryas an MCP server in Hermes viahermes mcp add basic-memory --command basic-memory --args mcp --project smk9-ecosystem— 23 tools connected and enabled; verified viahermes mcp test basic-memory - Wrote 9 agent entity pages (
notes/entities/: hermes, gary-webb, kobi, spider-man, tom-skilling, jake-from-state-farm, sal-the-plumber, indiana-holmes, alexandria) + 1 architecture decision page (notes/tech/cc-025-second-brain.md) - Smoke test: wrote a test note via
basic-memory tool write-note, confirmed it landed on disk, retrieved it viabasic-memory tool search-notes(exact MCP tool code path, same as what Hermes calls), then deleted the test note
Phase 3 — Alexandria Intake Cron
- Wrote
emit_to_alexandria.py— writes a metadata sidecar (alexandria_meta.json) next to any session output; importable, compiles clean - Wrote
alexandria_intake.py— walks sessions for pending sidecars, applies the confidence gate (≥0.8 → wiki+decisions_log if decision; 0.6-0.8 → wiki only; <0.6 → quarantine), routes by artifact type - Bug found and fixed during testing:
quarantine()originally wrote every rejected item to the same filename (rejected/alexandria_meta.json, sincesidecar_path.nameis identical across all sessions) — a second rejected item would silently overwrite the first, directly undermining Phase 3’s “nothing is lost” goal. Fixed by namespacing the rejected filename with the parent session directory name. Verified fix with two simultaneous low-confidence test items — both now preserved as distinct files. - Added intake cron (
*/15 * * * *) runningalexandria_intake.py - End-to-end test using Indiana Holmes as guinea pig: path resolver → wrote fake compliance research output → emitted sidecar (confidence 0.9) → ran intake → wiki note created at
notes/smk9/research/2026-07-07-indiana-holmes-test-research-c8552040.mdwith correct frontmatter - Tested all three confidence tiers explicitly: 0.9 → wiki (high), 0.7 → wiki (medium), 0.3 and 0.2 → both quarantined as distinct files
- MCP query smoke test: after
basic-memory reindex(files written directly to disk by the intake script need a sync/reindex pass — the MCP server doesn’t watch continuously unless it’s the active running process),search-notes "rabies vaccination mandated"returned the Indiana Holmes test note as the top scoring result
Deviations from the briefing
- Basic Memory config path: briefing said
~/.config/basic-memory/config.json; actual tool reads~/.basic-memory/config.jsonand is managed viabasic-memory project add. Used the real mechanism. - Hermes MCP registration: briefing suggested hand-editing a
mcp: servers:block inconfig.yaml; that key doesn’t exist in this Hermes version’s schema (themcp:at line 201 is an LLM-routing-provider config, unrelated). Usedhermes mcp addinstead — safer, and it’s what the CLI is for. - Files written directly to the wiki directory (not through the MCP
write_notetool) require abasic-memory reindexbefore they’re searchable — not called out in the briefing, worth remembering: the intake cron writes raw markdown files, so downstream search will lag until the next reindex/sync unless a Basic Memory MCP server is kept running continuously to watch the directory. - Fixed a genuine filename-collision bug in
alexandria_intake.py’squarantine()function (see Phase 3 above) — not just following the spec verbatim where it was wrong.
Status vs. DONE CRITERIA
All 11 criteria met:
- ✅
path_resolver.pyverified - ✅ rsync cron verified (manual trigger + file confirmed on VPS)
- ✅ AGENTS.md Output Contract section added
- ✅ Basic Memory installed,
--versionclean - ✅ Wiki structure initialized (SCHEMA.md, index.md, log.md)
- ✅ 9 agent pages + 1 architecture page created
- ✅ Basic Memory registered in Hermes MCP, 23 tools visible/enabled
- ✅
emit_to_alexandria.pywritten, importable - ✅
alexandria_intake.pyroutes correctly at all three confidence tiers (bug fixed during verification) - ✅ Full pipeline smoke test passed end-to-end
- ✅ Fireman 89/89 — no regressions to SMK9 app (only file touched in the repo was AGENTS.md)
Not done (explicitly out of scope per briefing)
- Qdrant integration (stubbed in
alexandria_intake.pycomments, not wired) - Firestore
client_datarouting (stubbed, not wired) - Phase 4 (
events/directory) and Phase 5+ (workspaces/ICM stage folders) — directories created empty per the structure spec, no logic built