v0.15.0 — Session Pulse: runtime self-supervision
Runtime self-supervision for the harness, distilled from a study of From Concept to Production: Framework-Agnostic AI Agent Architecture Patterns (loop detectors, write-before-compact, progress checkpoints) and adapted to harness-anchor's warn-only / zero-dependency invariants.
Added
- Session Pulse (PostToolUse fast lane, all tools). The
Edit|Writematcher is removed; a pure-bash fast lane (zero JSON-engine spawns on the non-nudge path) keeps a per-(session, agent)sliding window and nudges on 3× identical calls or 3× same-tool failures. One nudge max per call, 10-call cooldown. The Edit/Write slow lane is behavior-compatible. - Two-stage context watermark. The v0.12.0 flush reminder migrates into the fast lane — fixing its own "fires only on Edit|Write" blind spot — and gains a T2 stage advising
/session-end+ a fresh session over automatic compaction. - Periodic feature checkpoint +
out_of_scope. Every 25 calls the active feature and its new optional negative-scope list are re-surfaced, closing the agent-initiated-drift half of the observation-point gap (issue #6). - PreCompact forensics. New warn-only hook records
.harness-anchor/last-compact.meta(trigger, transcript size, branch, dirty count, handoff age) and notifies the user when the handoff is stale; the SessionStart compact notice upgrades from generic caution to concrete recovery anchors. PreCompact has no agent-reaching channel — documented in CLAUDE.md invariant #1. - Evidence integrity.
/verifygains a### Integrity(tests-touched) section;/session-end's precheck scans state files for credential patterns before the commit offer (labels only — matched values never echoed) and offers[user]-protected golden-rules consolidation.
Changed
- PostToolUse registration drops its
Edit|Writematcher (fires on all tools); the JSON-engine pre-warm moves into the slow lane so the fast path stays spawn-free.
Verification
- Local:
validate-anchor.sh151/151 · hook-contracts (incl. newpost-tool-use-pulse.sh29 asserts,pre-compact.sh20 asserts) all pass · unit 15 files · posix-compat 4/4 · windows-compat 19/19 · injection budget within the 12000-char cap. - CI: 9/9 green on ubuntu / macOS / windows + ShellCheck + CodeQL.
- Every new detector/hook carries an X/Y/blind-spot observation-point header (CLAUDE.md hook rule 5). Warn-only invariant intact: no deny/block/stopReason anywhere; subagent attribution verified against the official hooks docs (
agent_id).
Full changelog: v0.14.0...v0.15.0