Commit Graph

30 Commits

Author SHA1 Message Date
jared 1d1e7207c0 os-status: aggregated in-process SessionStart status checks (ADR-022)
New global plugin with one SessionStart hook running all checks in-process
(hooks/checks.py, check(ctx) -> CheckResult, single registry). Three states:
ok (silent), note (near-zero-token line, never suppressed), warn (one
aggregated banner, once-per-day snooze + permanent suppress in gitignored
per-project .cc-os/). Initial checks: subagent-model-env-override (catches
the WS1 Cluster 1 incident deterministically), adr-system-present (verbatim
port of os-adr's hook, legacy .os-adr/suppress honored), vault-hub-note-present.

os-adr's own SessionStart hook moved here atomically (its hooks.json now
empty; session_start.py stays as wording source of record). Built via
OpenSpec change add-os-status-plugin; 36 model-free tests; smoke-tested
2026-07-06 incl. env-override canary.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-07 12:46:10 -04:00
jared 00e22f1676 Add os-adr evaluation harnesses (Eval A and Eval B)
Build comprehensive evaluation framework for the os-adr plugin (ADR-021).

Eval A: prompted skill-execution evaluation across haiku/sonnet models.
Six ADR lifecycle scenarios, deterministic Ruby checker, sandbox runner,
/autoresearch loop for wording optimization.

Eval B: held-out unprompted-behavior evaluation. Seven scenarios
(W1–W3 write-trigger, R1–R4 retrieval), webhook fixture with 6-ADR history
(Superseded pair + distractors), headless runner (isolated SessionStart
context), two-axis deterministic-first checker (consultation + citation
accuracy, AI judge fallback for new-file writes).

Both harnesses self-tested model-free. Grid runs deferred per locked
rollout order. Updated docs/specs to freeze scenario shapes and document
methodologies.
2026-07-03 16:44:42 -04:00
jared 36abd43107 Build os-adr plugin: ADR authoring, session hook, migration, retrieval
Implements OpenSpec change add-os-adr-plugin (archived as
2026-07-03-add-os-adr-plugin; delta specs synced to openspec/specs/).

- plugins/os-adr/: Ruby OO core (Record, Repository, Index, Template,
  Detector, Migrator, MigrationReport, Finder) behind thin bin/ CLIs;
  Python SessionStart hook via plugin-relative hooks.json; four skills
  (create, init, migrate, find); invariants.md; 47 Ruby + 15 Python
  model-free tests, all passing.
- Migration pilot passed (threshold 25%): viking 0%, delta-refinery 0%,
  llf-schema 8.3%. Retrieval verified against the real llf-schema graph;
  resolved that ADRs need no Graphify tag/edge convention (layer 3
  expands query paths via node source_files).
- docs/adr-system/: requirements (04), PRD (05), eval sketches (06).
- ADR-020 recorded; CLAUDE.md Implemented Components updated with the
  locked rollout order (pilot projects -> cc-os retrofit -> wider).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-03 14:24:19 -04:00
jared b235e99145 Migrate os-doc-hygiene plugin into cc-os; record ADR-019
Moves the doc-hygiene plugin from the standalone cc-plugins repo into
cc-os as plugins/os-doc-hygiene/, following the same pattern as
os-vault and os-orchestration. Also commits the previously-unstaged
ADR-019 (global os-orchestration plugin supersedes per-project
orchestration text), which documents the prior migration but never
made it into a commit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-03 11:12:31 -04:00
jared f138c8d98b Rename memory plugin to os-vault; fix marketplace registration
The plugin directory, symlink, and settings.json were already renamed to
os-vault, but the local-plugins marketplace manifest still declared the old
memory/./memory entry, so skills/slash-commands silently stopped registering
while hooks (wired by absolute path) kept working. Re-registered the plugin
under its new name via the marketplace manifest + claude plugin install/
uninstall, and documented the fix and standing rename procedure (ADR-018,
CLAUDE.md) so this doesn't recur.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-03 09:43:18 -04:00
jared 553fc7d04a Implement SB Content Plan Phase 1: memory-template skill + note templates
Closes #1–#6 (Forgejo jared/cc-os).

- Reconcile vault-conventions.md to a single authoritative frontmatter schema (#1)
- Add memory-template plugin skill: template-design + new-type-creation (#2)
- Add howto/convention/reference note templates, each dogfooded (#3–#5)
- Patch 4 proof-of-concept notes to the settled schema (#6)

Note: vault note files (templates, patched notes, vault-conventions.md) live in the separate ~/Documents/SecondBrain repo and are committed by its own SessionEnd hook; this commit covers only the cc-os-tracked files (skill + docs).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 16:13:51 -04:00
jared 3ca305944b Refine Plan A: split Step 2 into skill + templates, harden injection economics
Plan A's Step 2 now splits into two distinct phases: 2a writes the
`memory-template` skill (which documents the repeatable 4-step
template-design process and new-type-creation workflow), and 2b writes
the three template files. Step 4 (new-type creation) is absorbed into
the 2a skill's new-type-creation flow.

Added "Injection economics govern template design" as the governing
principle — every vault section must pass the test "a named consumer
acts differently because this is here." Frontmatter schema clarified:
`date:` field restored as immutable creation timestamp, `source:` now
records project provenance (not file paths). Step 1 removal list
corrected to preserve `date:`.

Known Issues table: added fix for non-enum `subtype: cookbook` in the
cookbook note. Migration pools now reference Plan B Phase 3 agent
instead of the planned `/memory-audit` skill.
2026-06-30 11:13:57 -04:00
jared 4a87acc97f Harden SB content + findability plans via round-table review
Key changes:
- Plan B Phase 3: replace on-demand-only framing with queue-and-defer
  pattern (SessionEnd writes candidate queue fast in Python; next
  SessionStart processes it with already-running LLM — no API call,
  no terminal block, one-session lag is acceptable)
- Plan B Phase 3: cut Part B (discrepancy detection) until vault has
  25+ active howto notes
- Plan B Phase 2: fix injection hook name (session_context.py, not
  session_start.py — the latter has no output channel)
- Plan B Phase 1: add generated_at timestamp to vault-index.json
  structure so /memory-find can surface staleness
- Plan B: add silent hook failure risk row to Risks table
- Plan B: update Open Questions to reflect queue-and-defer decisions
- Plan A Layer 1: clarify opt-out framing for inline classification
- Plan A Layer 2: add cross-ref to Plan B Phase 3 invocation decision
- CLAUDE.md: clarify Graphify vault graph vs vault-index.json roles

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-28 16:51:43 -04:00
jared c582bb1928 Add Plan A + Plan B for SecondBrain active use
Refactors 08-sb-active-use-plan.md into two focused plans following a
design session that diagnosed separate content and findability problems.

Plan A (09): note types (convention/reference/howto), templates, value
gate, two-layer write mechanism, and vault population build order.
Plan B (10): vault-index.json, /memory-find skill, SessionStart
injection, and SessionEnd agent for self-evolving knowledge capture.

08 is retained with a superseded notice linking to the new plans.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 17:54:03 -04:00
jared 98f8290631 Refine memory-project onboarding: type-based exclude taxonomy + 16k-context model
Assessment now reasons about ignorable content by category (fetched
deps, build output, caches, tooling/AI-assistant dirs, lockfiles, bulk
data, binaries) so it generalizes across stacks. Onboarding switches to
the config.yaml model qwen25-coder-7b-16k: inference is GPU-bound at
~65 tok/s, so the speed lever is fewer chunks per doc via a larger
context window (GRAPHIFY_OLLAMA_NUM_CTX does not propagate through the
OpenAI-compatible path; context must come from the modelfile). Extends
ADR-017.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 10:57:06 -04:00
jared 72397a00b8 Add assessment-first onboarding to memory-project skill (ADR-017)
Onboarding ran a bare `graphify extract`, but graphify does not honor
.gitignore — it needs its own .graphifyignore. Without one, onboarding
viking-warrior-training-log walked node_modules/ (5,858 files) and
routed its non-code files through the Ollama doc pass; the run was
killed after ~1 hour with no graph.json.

Onboarding is now assessment-first: survey the repo, generate a
per-project .graphifyignore (the ignore set varies by stack), confirm
with the user, then extract. Records the gotcha and decision in ADR-017.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-17 09:17:33 -04:00
jared 7ede69ec85 Add vault_sync.py hook; complete Step 5b and 2e pilot
Step 5b (Obsidian vault -> VPS git sync) is now fully done: the vault is a
private Forgejo repo (SecondBrain) and vault_sync.py auto-commits+pushes it on
SessionEnd, mirroring memsearch_sync.py. Step 2e pilot done (llf-schema project
graph onboarded). Step 2d closed (live vault graph is the baseline). Docs and
implementation status updated.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 15:23:32 -04:00
jared 48e4d77795 Source memory plugin in git; port hooks to Python; archive change
- Move memory plugin source from ~/.claude/plugins/memory (untracked) into cc-os/plugins/memory under git
- Port four bash hooks to Python deep-module architecture (config.py, hook_io.py, session_state.py + thin entry points)
- Split memsearch auto-commit+push into dedicated memsearch_sync.py SessionEnd hook (relocation of ADR-015, behavior preserved)
- Cutover via symlink + settings.json rewrite; fresh-session test verified all hooks fire
- Add ADR-016; update CLAUDE.md, build plan, and fix stale bash-hook/source-path references
- Sync three new-capability delta specs into openspec/specs; archive change as 2026-06-12-memory-plugin-source-and-port

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 12:42:05 -04:00
jared 53a3c4c2c2 Document ADR-015: memsearch episodic sync and resolved commingling design
memsearch episodic memory (Step 4) is now live and synced via git. Record
the final sync design: dedicated private Forgejo repo at
forgejo.swansoncloud.com/jared/memsearch, auto-commit+push via cc-os
session-end hook, and the resolved decision to use a single global
cross-client store (not per-client repos). Commingling is an explicit
design choice, not a tolerated risk. Update build plan to split Step 5 into
5a (episodic sync, done) and 5b (vault sync, remaining). Update CLAUDE.md
implementation status, USER-GUIDE to reflect memsearch now operational, and
add full ADR-015 decision record with rationale and alternatives.
2026-06-09 15:11:12 -04:00
jared accae31fba Archive memsearch-episodic-layer change
- Sync memsearch-episodic delta spec to openspec/specs/memsearch-episodic/spec.md
- Update README.md: memsearch now active alongside Graphify
- Move change to openspec/changes/archive/2026-06-09-memsearch-episodic-layer/

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-09 14:35:50 -04:00
jared 61a33f137b Document vault conventions completion and migration scaffolding seeding
Step 1 (vault conventions initialization) is now complete: vault-
conventions.md exists at ~/Documents/SecondBrain/ (canonical naming
resolved), all 6 fixture notes are seeded for Graphify extraction
testing, and 14 handbook + design notes have been migrated to the
vault as first-class migration scaffolding per the empirical finding
locked 2026-06-05. Update CLAUDE.md and build-plan.md to reflect
completion and implementation status.
2026-06-09 09:41:27 -04:00
jared 5834036370 Document memory-project skill completion and vault/project query refactor
Complete the memory-project skill implementation. Rename memory-query to
memory-vault, split project graph queries into memory-project skill, mark
memory-project DONE in build plan, and clarify session-context.sh scope
(now project graph path only — vault injection removed). Update user guide
with examples of both vault and project graph query workflows.
2026-06-08 13:24:53 -04:00
jared 2317a087ce Update build plan status and CLAUDE.md with implementation progress
- Mark Steps 2a, 2b, 3, 6 complete; add implementation status notes
- Add "Implemented Components" section with progressive disclosure to CLAUDE.md
- Document installed plugin, Graphify, and vault setup as working baseline
- Update last-updated date to 2026-06-08
- Add standing instruction to keep CLAUDE.md current as implementation progresses

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-08 09:42:04 -04:00
jared f914ab4878 Complete memory plugin implementation — hooks, skills, and graph-connectivity findings
- Memory plugin installed globally at ~/.claude/plugins/memory/ with three hooks:
  session-start.sh (background graphify rebuild), session-context.sh (UserPromptSubmit
  vault injection), and post-tool-use-write.sh (session log + dirty-file tracking)
- Root cause fixed: SessionStart has last-write-wins semantics (undocumented); moved
  vault context injection to UserPromptSubmit which concatenates multiple hooks
- Verified working: vault graph map (366 nodes, 346 edges) injected into every session
- ADR-014: Graphify is a structure extractor, not a topic clusterer — hub notes +
  wikilinks must be author-provided; migration scaffolding is now a first-class deliverable
- Graph connectivity findings documented in 07-graph-connectivity-findings.md
- Archive 2026-06-05-add-memory-plugin change; sync memory-plugin-hooks and
  memory-plugin-skills to stable specs
- Add graphify-out/ to .gitignore (build artifact)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-05 16:39:49 -04:00
jared 3e38398500 Complete graphify-ollama-setup OpenSpec change
Executes all 16 tasks: local extraction-model benchmark with qwen2.5-coder:7b
selected as the default (7B parameter count, multi-modal, outperforms Mistral on
structured output), disposable vault graph build workflow, and supporting docs.
Adds extraction model options handbook, updates implementation process with
reconciliation strategy, and archives the scoring results.
2026-06-05 11:44:40 -04:00
jared 3823bb7c91 Record post-reboot GPU timing and mark deferred #3 resolved
GPU is fully resident and functional post-reboot (~74 tok/s steady-state).
Driver mismatch is resolved; gemma4:e4b confirmed at/above section C's
estimate. Deferred follow-up #3 (Confirm GPU timing post-reboot) marked
RESOLVED.
2026-06-04 14:52:21 -04:00
jared 65595c3995 Consolidate local-LLM gut-check findings and update pointers
Add new doc docs/memory-system/benchmark/local-llm-findings-2026-06-04.md
consolidating the local-LLM doc-extraction gut-check run. Key findings:
gemma4:e4b is the best installed model and adequate for the extraction
role (below frontier haiku but acceptable, catching ~45–60% of Opus's
high-value entities); GPU went unused due to NVIDIA driver version
mismatch (fix = reboot, pending); and Graphify owns the ollama call
(HTTP API, prompt/chunking/context/parsing internal) so raw-ollama
tuning is not production config. Add progressive-disclosure pointers
from 04-build-plan.md and 05-implementation-process.md.
2026-06-04 14:37:39 -04:00
jared 77355b4b44 Execute Step 2c: Claude reference-set benchmark — 18 gold-standard outputs
Completed the benchmark run that gates Ollama model selection. Generated 18
reference fragments (6 cross-domain fixtures × 3 Claude tiers) and tightened
extraction spec rules based on first-run learnings. Updated implementation
status to reflect that reference set is complete and Ollama scoring is
unblocked. Populated fixture list in dispatch-prompt with final selection.
2026-06-04 12:49:22 -04:00
jared b408a62136 Align 04-build-plan vault path with ADR-012
Replace the stale ~/brain placeholder with the locked vault location
~/Documents/SecondBrain so the build plan agrees with ADR-012 and the
runbook. Pre-existing inconsistency, surfaced during change verification.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 11:18:31 -04:00
jared 77febc8aca Add incremental-migration + reference-benchmark change (ADR-013)
Invert the build order to build-first / migrate-incrementally and
redesign Step 2c as a Claude reference-set benchmark.

- ADR-013 records the build-order inversion; CLAUDE.md locked-decisions
  pointer updated
- New benchmark deliverable under docs/memory-system/benchmark/:
  shared extraction spec + copy/paste dispatch prompt + reference-outputs
- Runbook (05): Step 1 = fixture selection with bulk migration deferred;
  Step 2c = Claude-tiers-only reference set, quality-only metrics, Opus
  as gold-standard rubric (produces references, not a model choice)
- 04-build-plan reconciled to the new build order and benchmark design
- Sync incremental-migration + reference-extraction-benchmark specs into
  openspec/specs/; archive the completed change

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 11:17:32 -04:00
jared 235fd45ff7 Update design docs and add implementation runbook per ADR-011/012
Update CLAUDE.md: clarify the knowledge layer now specifies the
~/Documents/SecondBrain vault, six-facet taxonomy, and reference the
locked decisions (ADR-011, ADR-012).

Update 02-system-design.md: align with faceted taxonomy (type/
client/project/domain/tool/convention/ plus scope/), express hierarchy
via hubs + wikilinks + Graphify edges rather than nested paths, name
the vault explicitly, update build-plan timestamp.

Add 05-implementation-process.md: concrete build runbook integrating the
locked decisions — seven steps bottom-up from vault migration through
plugin packaging, with the Graphify + Ollama model benchmark (Step 2c)
marked as the critical gate. Open questions deferred or defaulted; most
are non-blocking.

Design milestone: tag taxonomy and vault location locked.
2026-06-04 09:35:43 -04:00
jared f73cb46a53 ADR-011: Faceted tag taxonomy; ADR-012: reuse SecondBrain vault
Lock two design decisions: (1) six independent namespaced tag facets
(type/client/project/domain/tool/convention/) plus scope/, with
hierarchy expressed via hub notes and Graphify edges, not nested paths;
(2) adopt the existing ~/Documents/SecondBrain vault as the knowledge
layer rather than creating a new one — it is already flat, governs to
the correct semantics, and contains useful patterns (proactive-query
spec, tag-inference table).

See ADR-011 and ADR-012 for rationale, rejected alternatives, and
migration cost (mechanical schema updates on existing ~20 notes).
2026-06-04 09:35:38 -04:00
jared 334d5fc703 Remove handoff doc and pivot to Graphify knowledge layer
The handoff document was a session artifact; it is no longer needed.
Update all architecture docs to reflect the design pivot: Graphify
knowledge graph supersedes the earlier Ruby/SQLite tag-index CLI and
the deferred QMD semantic layer. The vault metadata (summary + tags)
is retained; only the bespoke index is removed. Update ADRs 003, 005,
and 006 to note they are superseded by ADR-010 (Graphify), and update
all system-design doc references from the three-layer model to the
final two-layer model (episodic + knowledge).
2026-06-04 07:57:39 -04:00
jared 2bc95ed30e Replace Ruby tag-index CLI with Graphify knowledge graph
Graphify eliminates the need for the Ruby/SQLite tag index (Step 2 on
the critical path). It provides entity extraction and relationship
inference over vault docs via a local SLM, and deterministic code
graphs for projects via AST — both at significantly lower complexity.
This commit records the architecture decision and evaluation that
justifies the pivot.

Vault graphs still require author-maintained summaries (human router
hint), but tagging discipline is now optional. Project code graphs are
free (no LLM cost). Stale-node drift requires periodic `--force`
rebuilds; strategy documented for SessionStart hooks.

The three-layer memory system remains unchanged: episodic (memsearch),
knowledge (Graphify + vault), integration (custom glue). See
06-graphify-evaluation.md for the open questions and limitations.
2026-06-03 17:36:12 -04:00
jared 54b00364cd Add 3-layer memory system design documentation
This documents the complete architecture for a personal, cross-project
memory system for Claude Code: three-layer (episodic/knowledge/deferred-
semantic) design using Milvus Lite for fast local storage with lazy
remote sync. Includes video synthesis, architecture decisions with
rejected alternatives (MemPalace, Mem0, Postgres, LightRAG), concrete
build plan with scripts and hooks, and initial handoff for implementation.
2026-06-03 16:47:50 -04:00