Skip to content

v4.6.1 — Installer hook-wiring repair + harness-context hook + doctor wiring probe (V4 #39)

Choose a tag to compare

@alexherrero alexherrero released this 29 May 05:21
· 275 commits to main since this release

PATCH. Single-repo release; crickets stays at v2.1.0 (it received a byte-identical lib/install/python/install_state.py sync via ebf92fa but no release tag — lib-parity only). Fixes a v4.5.1/v4.6.0 installer regression: install.sh --scope user dropped hook dirs into ~/.claude/hooks/<name>/ but never merged their settings-fragment-bash.json into ~/.claude/settings.json, so settings.json had no hooks block and none of the 10 installed hooks fired on any device. (Surfaced when the agent missed a vault-resident PLAN.md because no SessionStart hook was wired to surface it.) The semver bump is PATCH — the regression fix is the load-bearing change; the new hook + doctor probe ride along as bundled improvements.

Added

  • harness-context-session-start hook (db5e6e0) — new user-scope SessionStart hook. Reads the event's cwd, resolves the active project's vault PLAN.md + progress.md via harness_memory.py vault-state-path, and injects a 4-line context block at session boot — only when both files exist (silent no-op otherwise; 500ms budget; set -uo pipefail, never blocks boot). Surfaces "this project's plan lives at <vault path>" automatically in every project, closing the gap that motivated the release. pwsh twin included.

Changed

  • install.sh --scope user now merges hook fragments + absolutizes paths (0baf142) — the user-scope install walks the installed <prefix>/hooks/*/ dirs and merges each settings-fragment-bash.json into <prefix>/settings.json, rewriting the command to the absolute user-scope dir layout bash <prefix>/hooks/<name>/<name>.sh. scripts/merge-settings-fragment.py gained a --command override for the absolutization (idempotent re-merge by the rewritten command).
  • /doctor hook-wiring check (110fe9d) — replaced the false-clean "absent hooks block is OK — --hooks opt-in" with a 7-row truth table: hook dirs on disk + no hooks block now reports [FAIL] N hooks installed but not wired — re-run install.sh (the regression), plus broken-command-path / partial-merge / missing-config / missing-fragments cases. Adds a --live synthetic SessionStart probe. Mirrored in the canonical harness/skills/doctor.md.

Internal

  • .agentm-config.json gains an additive fragments: [{path, sha256}] field (0baf142) — records each merged settings fragment for install-state-sync drift detection. No schema_version bump (schema v2 stays valid; field optional). lib/install/python/install_state.py persist exposed via a new --fragments-file CLI flag (synced byte-identical to crickets).
  • +18 unit tests (312 → 330 per OS workflow): test_merge_settings_fragment.py (8), test_install_state_fragments.py (6), test_harness_context_hook.py (4).

Backward-compat

  • Existing .agentm-config.json files without fragments keep working; install.sh adds the field on the next (re-)install.
  • Operators must re-run bash install.sh --scope user to pick up the fix — the regression left settings.json without a hooks block, so hooks stay dormant until the installer re-runs (then they fire on the next session restart).

Cross-references