Skip to content

Consolidate radio/task-pm/task-reviewer to canonical files (#122 Phase 1; precedes #163-#169)#171

Merged
martin-conur merged 2 commits into
mainfrom
task/issue-170
Jul 5, 2026
Merged

Consolidate radio/task-pm/task-reviewer to canonical files (#122 Phase 1; precedes #163-#169)#171
martin-conur merged 2 commits into
mainfrom
task/issue-170

Conversation

@martin-conur

Copy link
Copy Markdown
Owner

Closes #170

Phase 1 of epic #122 — lands before the radio-reliability bundle #163#169 so each of those tickets edits one file instead of seven.

What changed

  • bin/radio — the 7 byte-identical loadout copies collapse into one canonical root file (sentinels stripped; no dispatch needed since it's identical everywhere). Every loadout install.sh now links $SCRIPT_DIR/../bin/radio.
  • bin/task-pm — the root dispatcher is replaced by the shared body. Impl comes from lib/detect-impl.sh (--impl / AW_IMPL / workflow-doc auto-detect); the agent prefix (claude / kiro) branches only the final launch line (claude "/pm" vs kiro-cli chat --agent pm). 7 copies deleted.
  • bin/task-reviewer — the claude×4 body is folded into the root file; kiro-* impls still route to kiro-gh/bin/task-reviewer until kiro-gh/bin/task-reviewer: migrate to SPEC_IDENTIFIER + AW_LOADOUT to match claude-* (post-#144) #146. AW_LOADOUT (tracker-aware behavior, task-reviewer: spec-issue cross-check is GitHub-only — breaks claude-jira / claude-notion / claude-local #144) now comes from impl detection instead of the file's own path. 4 copies deleted.
  • tools/check-drift.sh — retired radio|body, task-pm-claude|body, task-pm-kiro|body, task-reviewer-claude|body; 17 groups remain, green.
  • Tests — helpers point at the canonical binaries; task_pm.bats / task_reviewer.bats pin loadouts via AW_IMPL=<impl> run … (the workflow-doc auto-detect routing tests are unchanged and still cover detection); install_symlinks.bats asserts the radio symlink resolves to the root copy.
  • task-pm --help / task-reviewer --help now work outside a configured repo (per the fresh-install acceptance criterion; previously the dispatchers errored on impl detection before help could print).

Acceptance criteria

  • Exactly one radio, one task-pm; task-reviewer = 1 canonical + kiro-gh's. Note: the issue said "+ 3 kiro", but only kiro-gh ever shipped a task-reviewer (kiro-local/kiro-notion parity is kiro-gh/bin/task-reviewer: migrate to SPEC_IDENTIFIER + AW_LOADOUT to match claude-* (post-#144) #146, listed as a non-goal) — so 1 + 1 is the correct landing state.
  • ./run_tests.sh: 805/805 green. tools/check-drift.sh: green (17 groups).
  • Fresh ./install.sh all into a scratch $HOME: radio / task-pm / task-reviewer symlinks all resolve to the root canonicals and --help cleanly.
  • task-pm behavior is byte-equal to today on both agents except the launch line (body shared, branch is the final case "$AGENT").

🤖 Generated with Claude Code

…e 1; precedes #163-#169): single root bin/ copies replace 18 per-loadout duplicates

- bin/radio: byte-identical across all 7 loadouts — moved to root as-is
  (drift sentinels stripped), 7 copies deleted, every loadout install.sh
  retargeted to ln -sf "$SCRIPT_DIR/../bin/radio".
- bin/task-pm: dispatcher replaced by the shared body; impl resolved via
  lib/detect-impl.sh, agent prefix branches only the launch line
  (claude "/pm" vs kiro-cli chat --agent pm). 7 copies deleted.
- bin/task-reviewer: claude x4 body folded into the root file; kiro-*
  impls still route to kiro-gh/bin/task-reviewer until #146. AW_LOADOUT
  now comes from impl detection instead of the file path. 4 copies deleted.
- tools/check-drift.sh: retired radio|body, task-pm-claude|body,
  task-pm-kiro|body, task-reviewer-claude|body entries (17 groups remain).
- tests: helpers point at the canonical binaries; task_pm.bats /
  task_reviewer.bats pin loadouts via AW_IMPL; install_symlinks.bats
  asserts the radio symlink resolves to the root copy.
- task-pm/task-reviewer --help now work outside a configured repo
  (fresh-install acceptance check).

Note: the issue's "1 canonical + 3 kiro" reviewer count reflects a stale
inventory — only kiro-gh ever shipped a task-reviewer (kiro-local /
kiro-notion parity is #146), so the tree lands at 1 canonical + 1 kiro.

Closes #170

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@martin-conur

Copy link
Copy Markdown
Owner Author

Review — PR #171 (spec: #170, epic #122 Phase 1)

Verdict: no blockers. Five nits, all optional — none should hold up the merge.

Spec compliance

Checked against #170's acceptance criteria: ✅ one radio, one task-pm in the tree; task-reviewer = 1 canonical + kiro-gh; ✅ drift manifest entries retired (radio|body, task-pm-*|body, task-reviewer-claude|body); ✅ suite green (805/805 per PR body, spot-verified paths); ✅ installers relinked. The "1 canonical + 3 kiro" → "1 canonical + 1 kiro" deviation is correctly argued in the PR body — only kiro-gh ever shipped a reviewer; kiro-local/notion parity is #146's problem. Accepted.

Verification performed

  • Swept the whole tree for references to the 17 deleted per-loadout paths: zero stale references (installers, tests, docs, drift manifest, dispatchers).
  • All 7 installers' ln -sf sources resolve to existing files in the new tree (../bin/radio ×7, ../bin/task-pm ×7, ../bin/task-reviewer ×5 where applicable).
  • Old kiro task-pm behavior (env exports + exec kiro-cli chat --agent pm) is preserved byte-for-byte in the shared body's kiro branch.
  • shellcheck -x clean on the three canonical files (CI runs shellcheck, so this matters).
  • Checked the copied bodies against main: the triple gh pr view calls and double git show-ref in task-reviewer, and the double rev-parse in task-pm, are preexisting on main — consolidation copied them verbatim, so not flagged as regressions here.

Nits (optional, in rough priority order)

  1. bin/task-pm:57 — the case "$AGENT" in claude|kiro has no *) fallback. Unreachable today (detect-impl validates the impl list), but if a third agent family ever lands, task-pm renames the tab, mutates env, and exits 0 without launching anything. One line: *) echo "Error: no PM launch line for agent '$AGENT'" >&2; exit 1 ;;
  2. bin/task-reviewer:113 — the kiro-unavailable error still links closed Extend task-reviewer to claude-jira, claude-notion, claude-local + README/gh-workflow docs #136 while the comment two lines up correctly says kiro-gh/bin/task-reviewer: migrate to SPEC_IDENTIFIER + AW_LOADOUT to match claude-* (post-#144) #146 tracks parity. Inherited from the old dispatcher, but now user-visible next to a contradicting comment. Point it at kiro-gh/bin/task-reviewer: migrate to SPEC_IDENTIFIER + AW_LOADOUT to match claude-* (post-#144) #146.
  3. bin/task-reviewer[[ "$AW_LOADOUT" == "claude-gh" ]] is tested in 5 places. Deriving TRACKER="${AW_LOADOUT#*-}" once and branching on gh would make kiro-gh/bin/task-reviewer: migrate to SPEC_IDENTIFIER + AW_LOADOUT to match claude-* (post-#144) #146 (kiro-gh folds into this body, also a gh tracker) and kiro-jira loadout (only missing combo in the 2×4 grid) #92 (kiro-jira) nearly free instead of a 5-site hand-edit.
  4. tests/install_symlinks.bats:43 — the "symlink resolves to canonical root bin/radio" assertion runs only for claude-gh, and claude-jira/claude-notion/kiro-local/kiro-notion installers aren't exercised at all. The exact regression this PR guards against (an installer pointing at a deleted per-loadout path) would ship undetected for 4 of 7 loadouts; looping the existing test over all seven installers is ~10 lines.
  5. */install.sh:19-23 — the now byte-identical 3-line symlink stanza across 7 installers is a new unguarded duplication class (the retired drift entries guarded the old one). A single install-symlinks|symlink-stanza|<7 files> manifest entry in tools/check-drift.sh — mechanism already supports it — closes the gap. Alternatively fold into Epic: Loadout duplication consolidation (radio + lib-pull + prompt templates) #122 Phase 2.

Nits 4+5 could also be deferred into a small follow-up issue rather than blocking this PR — worktree churn on a −5.8k-line diff is the riskier option.

Review process note: diff reviewed via 8-angle candidate pass + verification against main; 3 efficiency candidates were discarded as preexisting-on-main rather than introduced.

…e 1; precedes #163-#169): address review nits (PR #171)

- task-pm: explicit failing *) fallback in the agent-launch case — a new
  agent family added to detect-impl without a launch line here now errors
  instead of exiting 0 after the tab rename.
- task-reviewer: kiro-unavailable error now links #146 (kiro parity
  tracker), matching the adjacent comment; was stale #136.
- task-reviewer: five scattered [[ $AW_LOADOUT == claude-gh ]] checks
  collapsed into one TRACKER="${IMPL##*-}" suffix variable, so #146/#92
  inherit tracker-aware behavior for free.
- install.sh x7: the now-identical shared-symlink stanza (task-init /
  task-work / task-done / task-pm / radio) is wrapped in an
  install-shared-symlinks sentinel region and drift-guarded by a new
  manifest entry (18 groups); task-reviewer/task-board lines stay outside
  the region. Labels refreshed (task-pm is canonical, not a dispatcher).
- install_symlinks.bats: new test sweeps all 7 installers against a clean
  ~/.local/bin, asserting radio/task-pm (and task-reviewer where shipped)
  resolve to the canonical root copies — and that kiro-local/kiro-notion
  do NOT install a reviewer.

806/806 tests green; check-drift green (18 groups).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@martin-conur

Copy link
Copy Markdown
Owner Author

Re-review — commit 09075a7

All five nits verified fixed:

  1. task-pm agent case now has a loud-failing *) fallback.
  2. ✅ Stale Extend task-reviewer to claude-jira, claude-notion, claude-local + README/gh-workflow docs #136 link → kiro-gh/bin/task-reviewer: migrate to SPEC_IDENTIFIER + AW_LOADOUT to match claude-* (post-#144) #146.
  3. TRACKER="${IMPL##*-}" replaces all five claude-gh string checks. Also verified the removed AW_LOADOUT had no surviving references (would have been an unbound-variable crash under set -u) — the launch env uses the separate TASK_FORCE_LOADOUT, so removal is safe.
  4. ✅ New test sweeps all 7 installers against a clean ~/.local/bin, including the kiro-local/kiro-notion no-reviewer assertion.
  5. install-shared-symlinks sentinel region drift-guarded across all 7 installers (18 groups green); loadout-specific reviewer/board lines correctly left outside the region.

Independently verified: targeted bats suites green locally, check-drift.sh green, shellcheck -x clean, and all 4 CI checks pass on the head commit. LGTM — ready to merge.

@martin-conur martin-conur merged commit 35b06d4 into main Jul 5, 2026
4 checks passed
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.

Consolidate radio/task-pm/task-reviewer to canonical files (#122 Phase 1; precedes #163-#169)

1 participant