0cf1406314
Verified Stop event collision before B5 registration: - User-level (~/.claude/settings.json): Stop hook = agent-type Sonnet-4.6 economy compliance verifier (already wired in 6-component arch). - Project-level (.claude/settings.json): Stop slot empty. observer-stop-hook will register as command-type entry in project-level Stop array. Independent slot from user-level agent; no overwrite, no collision. Per Pravila ADR-010 HK1 hard-rule. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
37 lines
2.0 KiB
Markdown
37 lines
2.0 KiB
Markdown
# Observer infrastructure
|
|
|
|
Passive evidence-loop for the Лидерра «brain» per ADR-011.
|
|
|
|
## Files
|
|
|
|
- `episodes-YYYY-MM.jsonl` — append-only JSONL, one line per Claude session. Written by `tools/observer-stop-hook.mjs` on Stop-event.
|
|
- `notes/YYYY-MM-DD-<slug>.md` — optional MD notes for sessions with qualitative history.
|
|
- `STATUS.md` — auto-generated dashboard. Regenerated per-commit by `tools/status-md-generator.mjs`.
|
|
- `.read-counter.json` — C3 observer-of-observer counter. Updated on Read of observer files.
|
|
|
|
## Lifecycle
|
|
|
|
1. **Write**: every Claude session ends with a JSONL append (Stop-hook).
|
|
2. **Aggregate**: `/brain-retro` skill reads JSONL each sprint, proposes regulatory candidates.
|
|
3. **Surface**: `STATUS.md` shows controllers + monthly stats.
|
|
4. **Self-prune**: C3 warns if 54 weeks pass without any read of observer files.
|
|
|
|
## Privacy
|
|
|
|
PII filter (phone numbers, emails, tokens) is applied **before** every write — see `tools/observer-pii-filter.mjs`. gitleaks pre-push also scans observer files as part of full-history sweep.
|
|
|
|
## Don't
|
|
|
|
- Don't edit `episodes-*.jsonl` manually — it's append-only.
|
|
- Don't write outside `docs/observer/notes/` for hand-curated notes.
|
|
- Don't change `.read-counter.json` manually — it's maintained by hooks.
|
|
|
|
## HK1 pre-check (Pravila ADR-010) — verified 2026-05-19
|
|
|
|
Before registering `tools/observer-stop-hook.mjs` on Stop event (Task B5), verified collision against 6-component economy/skill-discipline architecture:
|
|
|
|
- **User-level** `~/.claude/settings.json` already has Stop hook: **agent-type** Sonnet-4.6 economy compliance verifier (analyzes transcript for claim-without-evidence violations).
|
|
- **Project-level** `.claude/settings.json` — Stop slot empty.
|
|
|
|
**Result**: no overwrite. observer-stop-hook will be added as **command-type entry in project-level Stop array**. Project + user scopes are independent slots in Claude Code 2.x — both run on the same Stop event without conflict. The agent verifier (user scope) and the JSONL appender (project scope) have non-overlapping responsibilities.
|