Skip to content

Restore hook registrations dropped in the 2026-07-11 consolidation (LoopDetector / DriftReminder / AlgorithmNudge)#1585

Open
elhoim wants to merge 1 commit into
danielmiessler:mainfrom
elhoim:restore-hook-registrations
Open

Restore hook registrations dropped in the 2026-07-11 consolidation (LoopDetector / DriftReminder / AlgorithmNudge)#1585
elhoim wants to merge 1 commit into
danielmiessler:mainfrom
elhoim:restore-hook-registrations

Conversation

@elhoim

@elhoim elhoim commented Jul 23, 2026

Copy link
Copy Markdown

The 2026-07-11 "hooks-BPE consolidation" (per LIFEOS/DOCUMENTATION/Hooks/HookSystem.md) built per-event dispatcher hooks but never registered three of them in the shipped install payload (LifeOS/install/hooks/hooks.json, the sole source Tools/InstallHooks.ts merges into a user's settings.json), even though HookSystem.md documents all three as registered and live. This PR brings the shipped config back in line with the docs.

1. PostToolObserver.hook.ts — missing from PostToolUse

HookSystem.md:322 documents it in the PostToolUse catch-all group (sync, timeout: 5, ahead of EventLogger.hook.ts). HookSystem.md:343-345 describes it as the dispatcher that bundles LoopDetector.run() (exact-repeat / oscillation / hammering detection) and the PostToolUse branch of AlgorithmNudge.run().

User-visible effect of the gap: unregistered, LoopDetector never runs — no detection of repeat/oscillation/hammering tool-call patterns.

Fix: added to the existing matcher:"" catch-all group in PostToolUse (not a new group — a second empty-matcher group would cause a merge dupe on InstallHooks.ts's idempotent-merge), ahead of EventLogger.hook.ts, matching the documented order exactly.

2. DriftReminder.hook.ts — missing from UserPromptSubmit

HookSystem.md:142 documents it registered on UserPromptSubmit (timeout: 5, async: true). HookSystem.md:168-170 describes it as the deterministic voice/format drift nudge (banned-vocab regex, banner-presence check, em-dash count against the Stop-hook last-response cache; no LLM calls).

User-visible effect of the gap: the voice/format drift check other live hooks and the system prompt assume is running never fires.

Fix: added to UserPromptSubmit, positioned per the documented fire order.

3. AlgorithmNudge.hook.ts — missing its UserPromptSubmit registration

HookSystem.md:144 documents it registered on UserPromptSubmit (timeout: 5, async: true) in addition to its existing PostToolUseFailure registration (unchanged by this PR — still present, not duplicated). HookSystem.md:1562 states explicitly: "the UserPromptSubmit chain is 6 hooks (PromptProcessing, SatisfactionCapture, ReminderRouter, DriftReminder, MemoryTurnStart, AlgorithmNudge)" — the shipped payload only had 4.

User-visible effect of the gap: per HookSystem.md:178-183, the UserPromptSubmit branch is what fires the always-on skill-routing nudge ("prompt matches a skill's USE WHEN → invoke, don't handroll") and, in a live Algorithm run, the principal-message nudge — both dead without this registration. It is also documented as the sole writer of state.primaryTranscript on this path, which other AlgorithmNudge branches use to gate subagent-noise suppression — missing it leaves that gate failing open.

Fix: added to UserPromptSubmit at the position HookSystem.md:1562 documents (last in the chain), leaving the PostToolUseFailure registration untouched.


Scope note: only LifeOS/install/hooks/hooks.json needed changes — it is the single authoritative hook-registration payload (InstallHooks.ts merges only this file into settings.json; settings.system.json / settings.enhancements.json carry no hooks key, and there is no second copy of hooks.json elsewhere in the tree, so no parallel mirror needed updating).

Diff is additive-only: three new hook entries, no existing entries removed, reordered, or duplicated.

…tions

The 2026-07-11 hooks-BPE consolidation created per-event dispatcher hooks
but never registered three of them in the shipped install payload, even
though LIFEOS/DOCUMENTATION/Hooks/HookSystem.md documents all three as
registered:

- PostToolObserver.hook.ts was missing from the PostToolUse catch-all
  group (HookSystem.md:322 documents it there, sync, timeout 5, ahead of
  EventLogger.hook.ts). Unregistered, LoopDetector.run() (folded into
  PostToolObserver per HookSystem.md:22) never runs.

- DriftReminder.hook.ts was missing from UserPromptSubmit
  (HookSystem.md:142, timeout 5, async). Voice/format drift nudges never
  fire.

- AlgorithmNudge.hook.ts was missing its UserPromptSubmit registration
  (HookSystem.md:144, timeout 5, async) — it remains registered on
  PostToolUseFailure, unchanged. HookSystem.md:1562 documents the
  UserPromptSubmit chain as 6 hooks ending in AlgorithmNudge; the shipped
  payload only had 4. Missing this drops the always-on skill-routing and
  principal-message nudges and leaves state.primaryTranscript unset,
  which HookSystem.md documents as gating subagent-noise suppression for
  AlgorithmNudge's other branches.

This restores config to match what HookSystem.md already documents as
live, using the exact registration shapes and UserPromptSubmit fire
order given there (PromptProcessing, SatisfactionCapture, ReminderRouter,
DriftReminder, MemoryTurnStart, AlgorithmNudge).
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