Skip to content

v2.25.0 · Memory that survives — pre-compaction rescue + the session-end learning floor - #78

Open
hamza-ali-shahjahan wants to merge 1 commit into
mainfrom
feat/v2.25.0-precompact-rescue-learning-floor
Open

v2.25.0 · Memory that survives — pre-compaction rescue + the session-end learning floor#78
hamza-ali-shahjahan wants to merge 1 commit into
mainfrom
feat/v2.25.0-precompact-rescue-learning-floor

Conversation

@hamza-ali-shahjahan

Copy link
Copy Markdown
Owner

Phase 1 of 4 from the Horizon-scout way-forward plan — operator reviews, then merges (not auto-merged). Phase 0 was #77.

What

1 — precompact-rescue.ts (PreCompact hook). Right before compaction, re-runs the shared capture classifier over the transcript's user turns and appends anything missed to the SAME queue /reflect drains — no new storage, no new review surface. Dedupes against the queue across repeated compactions, drops secret-shaped text, caps at 20 rescues/run, fail-open + silent by contract. The deterministic rung of Horizon's pre-compaction flush fork; the LLM rung arrives with /dream-review (phase 2).

2 — session-learning-nudge.ts (Stop hook). CLAUDE.md's "every session that produces real work ends with a learning" rule gets a mechanical floor: managed repo + real (non-wip(auto)) commits today + no brain/learnings/ entry today + quiet capture queue → ONE blocking nudge per session to distill a learning. Marker-throttled, stop_hook_active-guarded, fail-open — can never trap a session.

3 — Both ship INERT (house pattern, decision-log 2026-07-14): activation is an explicit paste into ~/.claude/settings.json; snippets in the hooks README (retitled: capture · rescue · nudge · enablement).

4 — Writing conventions: /reflect gains the distillation guard (negative capability claims harden into refusals the agent cites against itself for months — Horizon's curator line) and names both queue feeders; templates/status-template.md lands the 7-section living summary (merge-into-previous, never rewrite); the skill-authoring playbook gains the Honesty callouts convention.

Proof (all local, green)

  • bun test ./factory/hooks — 29 pass (16 new: classifier reuse, queue dedupe across double-compaction, secret/question/meta/tool-result exclusion, fail-open on missing transcript, the full nudge decision matrix, managed-dir detection, silent-outside-managed end-to-end)
  • Full bun run test — 134 pass
  • check-changelog · check-counts (2.25.0 consistent) · check-retro · check-evals · check-skill-command-collision — green
  • check-assets: the one failure it reports locally is a pre-existing reference in the operator's uncommitted README.md edit (absent from HEAD and from this branch — verified) — this PR's CI checks committed files only

Review notes

  • Zero behavior change until you activate: both hooks are inert files + docs until wired
  • Everything reuses the day-old claude-reflect machinery — same classifier, same queue, same /reflect human gate; promotion authority still /learn-loop's
  • Next after merge: Phase 2 — /dream-review (nightly consolidation, drafts-only, behind the 14-day adoption gate) with its STANDING-ORDERS program entry

…end learning floor

- precompact-rescue.ts (PreCompact): reruns the capture classifier over the
  transcript's user turns right before compaction; missed learnings land in
  the same /reflect queue (queue-dedupe across compactions, secret-drop,
  20/run cap, fail-open, silent)
- session-learning-nudge.ts (Stop): managed repo + real (non-wip) commits
  today + no brain/learnings entry + quiet queue → ONE blocking nudge per
  session (marker-throttled, stop_hook_active-guarded, fail-open)
- both ship inert per the 2026-07-14 house pattern; activation snippets in
  the hooks README (retitled: capture · rescue · nudge · enablement)
- /reflect: distillation guard (negative capability claims harden into
  refusals) + intro names both queue feeders
- templates/status-template.md: the 7-section living summary (merge into
  previous, never rewrite); skill-authoring playbook: Honesty callouts
- 16 new tests (factory/hooks now 29); full suite 134 pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant