refactor: retire legacy src/ hooks; migrate all live behavior to the daemon path#34
Merged
Merged
Conversation
…daemon path The project ran two hook systems in parallel: the legacy `src/` hooks (package "agent-mem") and the current plugin/daemon path (`ultan/` + `hooks/hooks.json`). The plugin switch silently dropped several behaviors that were live before it. This removes `src/` entirely and ports every behavior that was live before the switch (the 7-hook `settings.json` set) into the daemon path. Migrated (were live, lost at the switch): - Assistant-prose capture: the daemon reads the Claude Code transcript on a sealing Stop/SessionEnd and folds assistant turns into the buffer the Librarian sees (daemon/agent_mem_daemon/transcript.py + scheduler injection; ultan/_hooks.py forwards transcript_path). - PreToolUse tool-blocking: re-added the PreToolUse hook + ultan/_blockers.py (block_triggers, severity deny|advise). - Nudge consume/budget/inject: ultan/_nudges.py completes the half-migrated pipeline (the Scholar wrote pending-nudges.md but nothing consumed it). - SessionStart boot-context injection: ultan/_session_context.py. - project_slug priming parity. Removed: - The entire src/ tree + its workspace member, set-version.sh / check-version-coherence.sh entries, CI matrix entry, and a dead agent-mem dep. - The /ultan-install command (install.py + README + global command file) — the plugin now owns hook installation. Preserved/rebuilt: - `agent-mem doctor`'s structural lint reimplemented in-process (tools/search/_lint.py) since it shelled out to the deleted src/scripts/lint.py; resolution mirrors the daemon's wikilink_resolves so it's accurate at scale. Thin-install safety: ultan/ imports no `aliases` (retrieval-only); the bucket helpers are mirrored locally so the base install + no-extra CI job pass. Suites green: 79 ultan, 683 daemon, 171 tools/search; pyright 0; ruff clean. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Two hook systems ran in parallel: the legacy
src/hooks (package "agent-mem") and the current plugin/daemon path (ultan/+hooks/hooks.json). The switch to the plugin silently dropped several behaviors that were live before it. This removessrc/entirely and ports every behavior that was live before the switch (the 7-hook~/.claude/settings.json.ultan-bakset) into the daemon path.Migrated (were live, lost at the switch)
daemon/agent_mem_daemon/transcript.py+ scheduler injection;ultan/_hooks.pyforwardstranscript_path.ultan/_blockers.py(block_triggers, severity deny|advise). Was live until 2026-06-09 (18k PreToolUse events).ultan/_nudges.pycompletes a half-migrated pipeline: the Scholar still wrotepending-nudges.mdbut nothing consumed it.ultan/_session_context.py(the old handler returned 0 without emitting the additionalContext envelope).Removed
src/tree + its workspace member,set-version.sh/check-version-coherence.shentries, CI matrix entry, a deadagent-memdep./ultan-install(install.py + README + global command file) — the plugin owns hook installation now.Preserved / rebuilt
agent-mem doctor's structural lint reimplemented in-process (tools/search/_lint.py); it had shelled out to the deletedsrc/scripts/lint.py. Resolution mirrors the daemon'swikilink_resolves, so it's accurate (0 false broken-links / orphans on the real 542-entry library).Reviewer notes (judgment calls)
ultan/imports noaliases(retrieval-only) — bucket helpers are mirrored locally, matching_priming.py/_session_context.py, so the base install + the no-extra CI job pass. (A regression here was caught and fixed mid-work.)missing_backlinkcheck: it produced 555 noise suggestions (this library links content one-directionally by design). Trivial to restore if you want strict parity.Verification
agent-mem doctorruns clean against the real store.🤖 Generated with Claude Code