feat: legacy-install migration + S9 agent-discipline fixes (v5.4.0 prep) - #196
Merged
Merged
Conversation
The reviewFindings field has been written at item-start since the schema landed, but no subcommand ever set it — S9 in the field validated metrics end-to-end and every item read 0 despite real judge findings. Set (not increment) semantics keep the command idempotent when a judge pass is re-run. sprint-master wiring lands separately. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Two gaps surfaced by dungeon-game S9: (a) per-item reviewFindings always read 0 because no step recorded the judge's accepted-count after the quality-reviewer verdict — TEST state now calls sprint-metrics.sh review-findings after every judge pass; (b) docs-only diffs had no defined lens path (S7-001/S9-004 set the precedent in the field) — they now skip code lenses and get a claim-accuracy judge pass, recorded the same way. Condensed the duplicated PLAN/SPEC checkpoint procedure to stay under the 200-line orchestrator cap. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Encodes the dungeon-game S9 process findings at the distributed layer
(they were previously patched only into per-sprint prompt instances):
GUI-subsystem executables return immediately from naive shell invocation,
so backgrounded test runs die when the agent turn ends (3h28m lost on one
S-sized item). Both agents now: use the canonical
.claude/scripts/run-*-tests.* runner seam when the project ships one,
never background or abandon a run in flight, watch CI in the foreground
(gh run watch --exit-status), and push at every durable boundary.
pr-pipeliner additionally gains a "ci-pending: {run_id, head_sha}" output
contract (fixes pushed, CI running at turn end) with sprint-master
picking up the gate, and a single immediate retry on transient gh 401s.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…nt + hook de-dup) Pre-5.0 installs file-copied agents/scripts into projects and wired hooks into project settings; the plugin now serves agents namespaced, hooks via hooks.json, and scripts from bin/ (on the Bash tool PATH — no project shim needed). Old projects are hybrids with stale copies and double-firing hooks. strip-retired-hooks.sh gains a `migrate` mode (delegating to new bin/legacy-migrate.sh; the original <settings-file> mode is unchanged and aam-bootstrap.sh keeps using it): - Manifest-driven: only filenames AAM has ever shipped (historical + current payload) are candidates; everything else under .claude/agents/ and .claude/scripts/ is user property and is never touched. - Customization-safe: candidates matching the current plugin copy (or differing only in whitespace/line endings) retire; divergent ones are skipped by default (--force-divergent overrides). - Dry-run by default; --apply acts. Retirement MOVES files to .claude/legacy-retired-<UTC>/ — backup-first, never rm. - Hook de-dup removes project entries whose command basename matches a hook the plugin registers via hooks.json (read live, with a built-in fallback), plus the retired auto-cycle/correction-capture hooks, via the existing surgical jq transform. statusLine wiring stays project- level but a legacy .claude/scripts/context-monitor.sh statusLine is repointed at the plugin copy. Scripts still referenced by surviving settings are kept. - Also: correction-capture-hook.sh (retired v4.6) added to the retired pattern — it was missing, and real field installs still register it. 13 new migrate-mode tests + 1 legacy-mode regression test. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds docs/migration-guide.md (identify legacy installs via .claude/aiagentminder-version < 5.0, update plugin, /aiagentminder:setup, dry-run -> review -> --apply, verify hooks fire once and bare script names resolve via the plugin bin/-on-PATH mechanism). Repoints the customization guide pre-v5.0 step from raw rm -rf at the customization-safe script. Bumps all four version points to 5.4.0 (minor: new functionality, backwards compatible) per docs/RELEASING.md; tag + GitHub release publish remain owner steps post-merge. 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.
Summary
Five parts, one per commit — legacy-install migration plus the agent-discipline fixes from the dungeon-game S9 retrospective.
Origin story
dungeon-game (initialized at AAM v4.5.0, pre-plugin) ran sprints S6–S9 on the plugin while stale file copies sat in
.claude/agents/+.claude/scripts/and duplicate hook registrations in project settings fired twice per event. S9's retro also surfaced two process gaps that belonged at the distributed layer, not in per-sprint prompt instances: (a) per-itemreviewFindingsmetrics read 0 despite real judge findings — nothing ever set the field; (b) GUI-subsystem executables (Unity.exe on Windows) return immediately from naive shell invocation, so backgrounded test runs died when executor turns ended (3h28m lost on one S-sized item).1.
bin/sprint-metrics.sh—review-findingssubcommand (bcfcb38)Set-not-increment semantics (idempotent on judge re-runs); validates a non-negative integer; unknown item ids leave the file untouched. 6 new tests.
2.
agents/sprint-master.md— wire the metric + docs-only precedent (dd323b2)TEST state now records the ACCEPTED finding count (critical+high+medium+low from the judge's JSON summary) via
sprint-metrics.sh review-findingsafter every judge pass, including clean passes. Docs-only diffs skip code lenses and route straight to quality-reviewer for a claim-accuracy judge pass (the S7-001/S9-004 field precedent), recorded the same way. Condensed the duplicated PLAN/SPEC checkpoint procedure to stay under the 200-line orchestrator cap (now 199).3. Long-Running Operations sections —
item-executor+pr-pipeliner(7f318d0)Stack-agnostic: mandatory use of the project's canonical
.claude/scripts/run-*-tests.*runner seam when one ships; never background a long-running test/build run or end a turn with one in flight (poll in the SAME turn); foreground CI watching (gh run watch --exit-status, bounded timeout); push at every durable boundary. pr-pipeliner additionally:"ci-pending: {run_id, head_sha}"output contract with sprint-master picking up the gate, and one immediate retry on transientgh401s.4. Legacy migration —
strip-retired-hooks.sh migrate→bin/legacy-migrate.sh(a8bbd08)agents/+bin/) are candidates. Everything else under.claude/agents//.claude/scripts/is user property — never touched (verified against the real dungeon-game layout, incl. its user-ownedrun-editmode-tests.ps1).--force-divergentoverrides.--applyto act. Retirement MOVES files to.claude/legacy-retired-<UTC>/— never deletes; files are git-tracked too, so doubly recoverable.hooks/hooks.json, built-in fallback), plus retired hooks, via the existing surgical jq transform. statusLine stays project-level by design, but a legacy.claude/scripts/context-monitor.shstatusLine is repointed at the plugin copy so the file can retire. Scripts still referenced by surviving settings are kept.sprint-update.shetc. because Claude Code puts the plugin'sbin/on the Bash tool's PATH while the plugin is enabled (README:96, customization-guide). No project shim needed post-migration; the guide's verify step checkscommand -v sprint-update.sh.correction-capture-hook.sh(retired v4.6) was missing from the retired strip pattern — real field installs still had it registered. The original<settings-file>mode is unchanged;aam-bootstrap.shkeeps using it. Decomposed intolegacy-migrate.sh(244 lines) + slimmedstrip-retired-hooks.sh(103 lines, sourceable lib) to respect the 300-line guidance. 14 new tests.5.
docs/migration-guide.md+ release prep (de5b574)Concise guide: identify (
.claude/aiagentminder-version< 5.0) → update plugin →/aiagentminder:setup→ dry-run → review →--apply→ verify (hooks fire once; scripts resolve via PATH). Customization guide's raw shell-delete migration advice replaced with the safe script. CHANGELOG[5.4.0]section; all four version points bumped to 5.4.0 (minor — new functionality, backwards compatible).Test plan
npm test: 389 tests, 380 pass locally — the 9 failures are pre-existing Windows-local environment artifacts (exec-bit layout checks, git-diff secret-scan, sed fallback) identical to the pre-change baseline; ubuntu CI is the gate.npm run validate: versions5.4.0× 4, zero plugin-manifest errors; exec bits set in the git index (100755) for both touched bin scripts.Remaining owner steps (per docs/RELEASING.md — cannot be done from this PR)
git checkout main && git pull, then tag:git tag v5.4.0 && git push origin v5.4.0(release workflow re-validates and drafts the GitHub Release).v5.4.0 — legacy migration + agent long-run discipline)./aiagentminder:setup+bash strip-retired-hooks.sh migratein legacy target repos (dungeon-game first).🤖 Generated with Claude Code