Evidence-SSoT Phase 0 — Knowledge Propagation Infrastructure (2026-05-15)

Evidence-SSoT Phase 0 — Knowledge Propagation Infrastructure (2026-05-15)

Problem (CEO trigger 2026-05-15)

"Informacije iz John sesija se ne preklapaju, treba one place to go and find everything."

Concrete symptom: BookStack page 2932 (SnowIT migration evidence) created but not discoverable in next session. Knowledge created in one session context does not automatically surface in subsequent sessions.

Root Cause (verifier-confirmed)

Phase 0 Architecture (lightweight, ~120 LOC total)

Phase 0 ships lightweight knowledge-propagation infrastructure before investing in full CQRS SQLite solution. Three components totaling ~120 LOC.

Component 1: Visibility (#100792)

File: ~/.claude/hooks/lightrag-auto-ingest.sh

Adds:

Effect: Silent daemon failures now visible. Previously the hook ran but wrote nowhere, swallowing all async failures.

Component 2: Append-only evidence ledger (#100793)

File: ~/system/tools/mc.js (patched)

Output: ~/system/state/evidence-index.jsonl

Behavior: On every mc.js done/ready, appends one JSON line with metadata:

{
  "ts": "2026-05-15T15:45:23.123Z",
  "mc_id": 100788,
  "verb": "done",
  "status": "COMPLETE",
  "title": "Evidence-SSoT Phase 0 documentation",
  "priority": "H",
  "actor": "skillforge",
  "session_id": "abc123",
  "evidence_path": "/path/to/evidence.json",
  "bookstack_url": "https://docs.alai.no/books/..."
}

Properties:

Component 3: SessionStart projection (#100794)

File: ~/system/tools/session-boot.js + SessionStart hook in ~/.claude/settings.json

Output: ~/system/state/session-boot-${PID}.json per session

Reads:

Per-PID file: No clobber on concurrent sessions. Survives reboot (unlike /tmp).

Schema: evidence-index.jsonl

Field Type Description
ts ISO8601 string When transition occurred
mc_id int Task ID
verb enum: done|ready|close State transition
status string Resulting status (COMPLETE, PARTIAL, BLOCKED, etc.)
title string Task title at time of transition
priority enum: H|M|L Task priority
actor string Who fired (john, edita, autowork, etc.)
session_id string|null From CLAUDE_SESSION_ID env
evidence_path string|null From --evidence-path CLI arg
bookstack_url string|null From task field

Schema: session-boot-${PID}.json

Keys:

Operating Manual

New sessions

SessionStart hook auto-fires; agent reads ~/system/state/session-boot-${PID}.json as first context source before processing user input.

Closing tasks

Just call mc.js done/ready normally; JSONL shim auto-captures metadata.

Health check

cat ~/system/state/lightrag-ingest-health.json | jq .last_ts

Recent evidence query

tail -20 ~/system/state/evidence-index.jsonl | jq -c .

Phase 1 (deferred)

Full SQLite CQRS using existing events.db schema + MC #99910 CAS lease pattern.

Trigger condition: Phase 0 baseline eval shows hit_rate gain <30pp from current state.

ETA: Only if needed. Phase 0 establishes baseline; Phase 1 ships only if lightweight approach proves insufficient.

ZAKON Candidates (NOT YET PROMULGATED)

Pending Phase 0 baseline evaluation:

Key Decisions (Panel consensus)

  1. NOT new evidence.db — Reuse existing ~/system/databases/events.db (14.6MB, events/subscriptions/dead_letter tables already present + idempotency_key + status FSM)
  2. JSONL shim ships first — (OpenAI-chief dissent: lightweight-first approach)
  3. SessionStart hook used — (NOT PreToolUse per anthropic-chief — wrong event)
  4. Per-PID files in ~/system/state/ — (NOT /tmp — macOS purges on reboot)
  5. Auto-MC from reaper deferred — (ZAKON #28 violation — flag-only for now)
  6. MC #99910 CAS lease pattern reserved for Phase 1 — (if Phase 0 baseline insufficient)

References

Timeline


Reality Anchor Doctrine v1 — Deterministic probe primacy, Writer ≠ Witness, content-addressed audit. Panel-approved 2026-05-15.
Reality Anchor Doctrine v1


Revision #4
Created 2026-05-15 14:01:14 UTC by John
Updated 2026-07-26 20:03:38 UTC by John