pan-wizard 3.35.0 → 3.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (339) hide show
  1. package/CHANGELOG.md +3645 -0
  2. package/README.md +46 -52
  3. package/agents/pan-conductor.md +2 -3
  4. package/agents/pan-counterfactual.md +1 -2
  5. package/agents/pan-debugger.md +14 -3
  6. package/agents/pan-design-checker.md +1 -2
  7. package/agents/pan-designer.md +2 -3
  8. package/agents/pan-document_code.md +1 -2
  9. package/agents/pan-executor.md +25 -0
  10. package/agents/pan-hardener.md +4 -3
  11. package/agents/pan-integration-checker.md +1 -2
  12. package/agents/pan-knowledge.md +1 -2
  13. package/agents/pan-meta-reviewer.md +3 -3
  14. package/agents/pan-optimizer.md +4 -4
  15. package/agents/pan-phase-researcher.md +80 -475
  16. package/agents/pan-plan-checker.md +40 -3
  17. package/agents/pan-planner.md +21 -7
  18. package/agents/pan-previewer.md +3 -2
  19. package/agents/pan-project-researcher.md +72 -493
  20. package/agents/pan-release.md +1 -1
  21. package/agents/pan-reviewer.md +14 -3
  22. package/agents/pan-roadmapper.md +12 -7
  23. package/agents/pan-verifier.md +9 -4
  24. package/bin/install-lib.cjs +134 -14
  25. package/bin/install.js +59 -12
  26. package/commands/pan/army.md +1 -1
  27. package/commands/pan/autodev.md +76 -0
  28. package/commands/pan/cost.md +21 -1
  29. package/commands/pan/exec-phase.md +3 -4
  30. package/commands/pan/focus-auto.md +14 -7
  31. package/commands/pan/focus-design.md +4 -5
  32. package/commands/pan/focus-docs.md +24 -0
  33. package/commands/pan/learn.md +13 -6
  34. package/commands/pan/milestone-audit.md +8 -1
  35. package/commands/pan/milestone-done.md +10 -5
  36. package/commands/pan/milestone-new.md +2 -2
  37. package/commands/pan/new-project.md +15 -12
  38. package/commands/pan/plan-phase.md +15 -9
  39. package/commands/pan/preview.md +1 -1
  40. package/commands/pan/quick.md +1 -1
  41. package/commands/pan/review-deep.md +11 -5
  42. package/commands/pan/settings.md +6 -0
  43. package/commands/pan/verify-phase.md +6 -2
  44. package/docs/AGENTS.md +917 -0
  45. package/docs/ARCHITECTURE.md +1054 -0
  46. package/docs/CLI-REFERENCE.md +4582 -0
  47. package/docs/COMPARISON.md +116 -0
  48. package/docs/DEVELOPMENT.md +490 -0
  49. package/docs/ECOSYSTEM-REVIEW-2026-06.md +107 -0
  50. package/docs/ECOSYSTEM-REVIEW-2026-08.md +349 -0
  51. package/docs/EXAMPLES.md +584 -0
  52. package/docs/FAQ.md +254 -0
  53. package/docs/FIELD-HARVEST-2026-07.md +88 -0
  54. package/docs/FIELD-REPORT-army-2026-06.md +121 -0
  55. package/docs/HOOKS.md +638 -0
  56. package/docs/IMPROVEMENT-TODO.md +246 -0
  57. package/docs/INTERNALS.md +485 -0
  58. package/docs/MIGRATION-v2-to-v3.md +258 -0
  59. package/docs/SECURITY-HARDENING.md +230 -0
  60. package/docs/SKILLS-ENHANCEMENT-PLAN-V2.md +122 -0
  61. package/docs/SKILLS-FULL-TEXT.md +9685 -0
  62. package/docs/SKILLS-REFERENCE.md +1037 -0
  63. package/docs/TROUBLESHOOTING.md +1084 -0
  64. package/docs/USER-GUIDE.md +1437 -0
  65. package/docs/archive/SKILLS-ENHANCEMENT-PLAN.md +230 -0
  66. package/docs/audits/AUDIT-2026-08-e2e-ROADMAP.md +117 -0
  67. package/docs/audits/AUDIT-2026-08-e2e-VERIFICATION.md +693 -0
  68. package/docs/audits/AUDIT-2026-08-e2e.md +1546 -0
  69. package/docs/audits/OUTSTANDING-2026-08.md +275 -0
  70. package/docs/audits/STABILITY-TEST-2026-08.md +640 -0
  71. package/docs/branding/README-brand-draft.md +119 -0
  72. package/docs/branding/handoff/IMPLEMENTATION.md +205 -0
  73. package/docs/branding/handoff/README-brand-draft.md +119 -0
  74. package/docs/branding/handoff/image-prompts.md +46 -0
  75. package/docs/branding/image-prompts.md +46 -0
  76. package/docs/branding/nano-banana-prompts.txt +60 -0
  77. package/docs/context-monitor.md +13 -0
  78. package/docs/decisions/ADR-0001-strategic-feature-prioritization.md +83 -0
  79. package/docs/decisions/ADR-0002-copilot-cli-runtime.md +71 -0
  80. package/docs/decisions/ADR-0003-smart-execution.md +84 -0
  81. package/docs/decisions/ADR-0004-copilot-cli-interaction.md +89 -0
  82. package/docs/decisions/ADR-0005-command-naming.md +80 -0
  83. package/docs/decisions/ADR-0006-focus-commands.md +101 -0
  84. package/docs/decisions/ADR-0007-ship-v1.md +73 -0
  85. package/docs/decisions/ADR-0008-map-codebase-mermaid-togaf.md +80 -0
  86. package/docs/decisions/ADR-0009-production-deployment-checklist.md +68 -0
  87. package/docs/decisions/ADR-0010-standards-integration.md +79 -0
  88. package/docs/decisions/ADR-0011-help-commands-rewrite.md +64 -0
  89. package/docs/decisions/ADR-0012-contributors-attribution-index.md +42 -0
  90. package/docs/decisions/ADR-0013-strategic-feature-additions.md +53 -0
  91. package/docs/decisions/ADR-0014-internal-cleanup-code-quality.md +53 -0
  92. package/docs/decisions/ADR-0015-focus-auto-runner.md +296 -0
  93. package/docs/decisions/ADR-0016-enhanced-doc-sync.md +54 -0
  94. package/docs/decisions/ADR-0017-enhanced-focus-design.md +69 -0
  95. package/docs/decisions/ADR-0018-user-reality-testing.md +84 -0
  96. package/docs/decisions/ADR-0019-end-to-end-user-acceptance-testing.md +113 -0
  97. package/docs/decisions/ADR-0020-ai-drift-prevention.md +55 -0
  98. package/docs/decisions/ADR-0021-codebase-mapper-v2.md +76 -0
  99. package/docs/decisions/ADR-0022-lifecycle-completeness.md +63 -0
  100. package/docs/decisions/ADR-0023-opus-4-7-adoption.md +89 -0
  101. package/docs/decisions/ADR-0024-spec-b-v2-completion.md +137 -0
  102. package/docs/decisions/ADR-0025-behavioral-guardrails-layer.md +129 -0
  103. package/docs/decisions/ADR-0026-self-improvement-loop.md +171 -0
  104. package/docs/decisions/ADR-0027-doc-code-link-graph.md +164 -0
  105. package/docs/decisions/ADR-0028-unified-agents-skills-target.md +46 -0
  106. package/docs/decisions/ADR-0029-experiment-evaluator.md +76 -0
  107. package/docs/decisions/ADR-0030-planning-concurrency.md +37 -0
  108. package/docs/decisions/ADR-0031-focus-auto-backlog-source.md +47 -0
  109. package/docs/decisions/ADR-0032-squad-model.md +64 -0
  110. package/docs/decisions/ADR-0033-army-campaign.md +40 -0
  111. package/docs/decisions/ADR-0034-scheduled-campaigns.md +57 -0
  112. package/docs/decisions/ADR-0035-army-hud-dashboard.md +40 -0
  113. package/docs/decisions/ADR-0036-agentic-memory-architecture.md +106 -0
  114. package/docs/decisions/ADR-0037-pin-security-agents-to-opus.md +51 -0
  115. package/docs/decisions/ADR-0038-skill-aligned-decomposition.md +41 -0
  116. package/docs/decisions/ADR-0039-worktree-as-project-variant.md +37 -0
  117. package/docs/decisions/ADR-0040-memory-injection-defense.md +55 -0
  118. package/docs/decisions/ADR-0041-mcp-dual-era-bridge.md +47 -0
  119. package/docs/decisions/ADR-0042-design-parity-both-flows.md +45 -0
  120. package/docs/decisions/ADR-0043-addressable-planning-roots.md +56 -0
  121. package/docs/decisions/ADR-0044-bound-the-cached-context.md +104 -0
  122. package/docs/decisions/ADR-0045-agent-plugins-bundle.md +76 -0
  123. package/docs/decisions/ADR-0046-subagent-frontmatter-decisions.md +39 -0
  124. package/docs/decisions/ADR-0047-pan-harness.md +76 -0
  125. package/docs/decisions/ADR-0048-one-core-per-project.md +43 -0
  126. package/docs/decisions/ADR-0049-machine-verdicts-and-findings-ledger.md +116 -0
  127. package/docs/specs/ai_drift_prevention_featureai.md +286 -0
  128. package/docs/specs/codebase_mapper_v2_featureai.md +930 -0
  129. package/docs/specs/command_naming_optimization_featureai.md +930 -0
  130. package/docs/specs/comp_analysis_markdown_v1.md +149 -0
  131. package/docs/specs/continuous_autonomous_execution_featureai.md +304 -0
  132. package/docs/specs/contributors_attribution_index_featureai.md +476 -0
  133. package/docs/specs/copilot_cli_interaction_featureai.md +868 -0
  134. package/docs/specs/copilot_cli_runtime_featureai.md +647 -0
  135. package/docs/specs/custom-skills-assessment.md +461 -0
  136. package/docs/specs/deployment_audit_findings_featureai.md +243 -0
  137. package/docs/specs/doc_code_link_graph_featureai.md +253 -0
  138. package/docs/specs/documentation_alignment_cleanup_featureai.md +69 -0
  139. package/docs/specs/e2e_visual_testing_featureai.md +615 -0
  140. package/docs/specs/end_to_end_user_acceptance_testing_featureai.md +810 -0
  141. package/docs/specs/evidence-loop-plan.md +76 -0
  142. package/docs/specs/evidence_loop_featureai.md +497 -0
  143. package/docs/specs/focus-auto-optimize-category.md +449 -0
  144. package/docs/specs/focus-auto-optimize-superplan.md +188 -0
  145. package/docs/specs/focus_auto_runner_featureai.md +1102 -0
  146. package/docs/specs/focus_design_v2_featureai.md +197 -0
  147. package/docs/specs/focus_sync_v2_featureai.md +202 -0
  148. package/docs/specs/git_integration_overhaul_featureai.md +326 -0
  149. package/docs/specs/glm_zai_provider_featureai.md +200 -0
  150. package/docs/specs/googlecli_adoption_featureai.md +661 -0
  151. package/docs/specs/help_commands_rewrite_featureai.md +860 -0
  152. package/docs/specs/industry_analysis_strategic_additions_featureai.md +231 -0
  153. package/docs/specs/industry_comparison_and_feature_gaps_featureai.md +674 -0
  154. package/docs/specs/internal_cleanup_code_quality_featureai.md +486 -0
  155. package/docs/specs/investigations/README.md +31 -0
  156. package/docs/specs/investigations/digests/2026-09-28.md +47 -0
  157. package/docs/specs/investigations/digests/2026-10-08.md +62 -0
  158. package/docs/specs/investigations/digests/2026-10-10.md +61 -0
  159. package/docs/specs/investigations/features/debugger-red-loop-first.md +55 -0
  160. package/docs/specs/investigations/features/harness-cross-host-behaviour.md +93 -0
  161. package/docs/specs/investigations/features/optimize-apply-regression-gate.md +66 -0
  162. package/docs/specs/investigations/features/reviewer-smell-baseline.md +57 -0
  163. package/docs/specs/investigations/features/trace-failure-capture.md +69 -0
  164. package/docs/specs/lifecycle_completeness_featureai.md +754 -0
  165. package/docs/specs/local-first-ci.md +42 -0
  166. package/docs/specs/map_codebase_mermaid_togaf_featureai.md +805 -0
  167. package/docs/specs/market-delta-2026-09-superplan.md +310 -0
  168. package/docs/specs/market-ideas-2026-09.md +131 -0
  169. package/docs/specs/market-ideas-2026-10.md +428 -0
  170. package/docs/specs/market-ideas-ledger.md +177 -0
  171. package/docs/specs/memory-optimization-2026-10.md +285 -0
  172. package/docs/specs/multi-track-planning-roots.md +143 -0
  173. package/docs/specs/multi_model_routing_featureai.md +687 -0
  174. package/docs/specs/multi_model_routing_superplan.md +197 -0
  175. package/docs/specs/opus_47_existing_enhancements_featureai.md +247 -0
  176. package/docs/specs/opus_47_extended_features_featureai.md +363 -0
  177. package/docs/specs/opus_47_extended_features_v2_featureai.md +397 -0
  178. package/docs/specs/pan_focus_commands_featureai.md +2336 -0
  179. package/docs/specs/pan_zcode_mcp_bridge_featureai.md +120 -0
  180. package/docs/specs/product-excellence-superplan.md +315 -0
  181. package/docs/specs/product_excellence_program_2026_q4_featureai.md +365 -0
  182. package/docs/specs/production_deployment_readiness_featureai.md +433 -0
  183. package/docs/specs/production_readiness_ship_v1_featureai.md +698 -0
  184. package/docs/specs/real_test_enforcement_featureai.md +213 -0
  185. package/docs/specs/reality-check-2026-09-superplan.md +362 -0
  186. package/docs/specs/right-sized-ceremony.md +74 -0
  187. package/docs/specs/roadmap_and_competition_2026_q4_featureai.md +390 -0
  188. package/docs/specs/self_improvement_loop_featureai.md +875 -0
  189. package/docs/specs/skill-aligned-decomposition.md +155 -0
  190. package/docs/specs/standards_integration_featureai.md +833 -0
  191. package/docs/specs/testing-system-redesign-2026-09.md +267 -0
  192. package/docs/specs/user_reality_testing_system_featureai.md +788 -0
  193. package/docs/specs/watch-triggers.json +22 -0
  194. package/docs/specs/workflow-integration-redesign.md +742 -0
  195. package/docs/specs/workflow_state_consistency_featureai.md +183 -0
  196. package/hooks/dist/pan-context-monitor.js +9 -2
  197. package/hooks/dist/pan-cost-logger.js +5 -0
  198. package/hooks/dist/pan-guard.js +28 -5
  199. package/hooks/dist/pan-stop-guard.js +9 -9
  200. package/hooks/dist/pan-trace-logger.js +5 -0
  201. package/package.json +10 -2
  202. package/pan-wizard-core/bin/lib/agents-md.cjs +57 -8
  203. package/pan-wizard-core/bin/lib/autodev-report.cjs +180 -0
  204. package/pan-wizard-core/bin/lib/autodev.cjs +642 -0
  205. package/pan-wizard-core/bin/lib/ci.cjs +143 -0
  206. package/pan-wizard-core/bin/lib/commands.cjs +1 -1
  207. package/pan-wizard-core/bin/lib/config.cjs +41 -5
  208. package/pan-wizard-core/bin/lib/constants.cjs +27 -1
  209. package/pan-wizard-core/bin/lib/core.cjs +31 -14
  210. package/pan-wizard-core/bin/lib/cost.cjs +160 -4
  211. package/pan-wizard-core/bin/lib/cross-family.cjs +164 -0
  212. package/pan-wizard-core/bin/lib/debug-cases.cjs +104 -0
  213. package/pan-wizard-core/bin/lib/doc-lint.cjs +5 -3
  214. package/pan-wizard-core/bin/lib/failure-class.cjs +81 -0
  215. package/pan-wizard-core/bin/lib/findings.cjs +148 -9
  216. package/pan-wizard-core/bin/lib/focus.cjs +1 -1
  217. package/pan-wizard-core/bin/lib/git.cjs +1 -1
  218. package/pan-wizard-core/bin/lib/hosts.cjs +88 -0
  219. package/pan-wizard-core/bin/lib/init.cjs +7 -2
  220. package/pan-wizard-core/bin/lib/knowledge.cjs +2 -0
  221. package/pan-wizard-core/bin/lib/merge.cjs +50 -0
  222. package/pan-wizard-core/bin/lib/mutate.cjs +268 -0
  223. package/pan-wizard-core/bin/lib/next-action.cjs +112 -0
  224. package/pan-wizard-core/bin/lib/optimize.cjs +2 -2
  225. package/pan-wizard-core/bin/lib/phase-gate.cjs +15 -9
  226. package/pan-wizard-core/bin/lib/phase-remove.cjs +91 -11
  227. package/pan-wizard-core/bin/lib/phase.cjs +85 -13
  228. package/pan-wizard-core/bin/lib/plan-lint.cjs +310 -0
  229. package/pan-wizard-core/bin/lib/preview.cjs +26 -4
  230. package/pan-wizard-core/bin/lib/requirements-lint.cjs +130 -0
  231. package/pan-wizard-core/bin/lib/research-lint.cjs +268 -0
  232. package/pan-wizard-core/bin/lib/review-deep.cjs +14 -22
  233. package/pan-wizard-core/bin/lib/review-vote.cjs +105 -0
  234. package/pan-wizard-core/bin/lib/roadmap.cjs +1 -0
  235. package/pan-wizard-core/bin/lib/runner.cjs +2 -16
  236. package/pan-wizard-core/bin/lib/sizing.cjs +356 -0
  237. package/pan-wizard-core/bin/lib/squads.cjs +1 -1
  238. package/pan-wizard-core/bin/lib/state-write.cjs +247 -0
  239. package/pan-wizard-core/bin/lib/test-gate.cjs +433 -0
  240. package/pan-wizard-core/bin/lib/uat.cjs +149 -0
  241. package/pan-wizard-core/bin/lib/usage.cjs +104 -0
  242. package/pan-wizard-core/bin/lib/verdict.cjs +26 -3
  243. package/pan-wizard-core/bin/lib/verify-plan-set.cjs +30 -1
  244. package/pan-wizard-core/bin/lib/verify-preflight.cjs +2 -2
  245. package/pan-wizard-core/bin/lib/verify-red.cjs +174 -0
  246. package/pan-wizard-core/bin/lib/verify-retro.cjs +3 -2
  247. package/pan-wizard-core/bin/lib/verify-scope.cjs +143 -2
  248. package/pan-wizard-core/bin/lib/verify.cjs +86 -31
  249. package/pan-wizard-core/bin/lib/worktree.cjs +70 -0
  250. package/pan-wizard-core/bin/pan-tools.cjs +257 -28
  251. package/pan-wizard-core/learnings/universal/autonomous-loop.md +2 -2
  252. package/pan-wizard-core/mcp/orchestrator.cjs +4 -1
  253. package/pan-wizard-core/references/continuation-format.md +3 -3
  254. package/pan-wizard-core/references/design-methodology.md +1 -1
  255. package/pan-wizard-core/references/guardrails.md +1 -1
  256. package/pan-wizard-core/references/handoff-decisions.md +1 -1
  257. package/pan-wizard-core/references/model-profiles.md +2 -3
  258. package/pan-wizard-core/references/questioning.md +24 -0
  259. package/pan-wizard-core/references/ui-brand.md +4 -6
  260. package/pan-wizard-core/references/verdict-contract.md +2 -1
  261. package/pan-wizard-core/templates/config.json +10 -2
  262. package/pan-wizard-core/templates/debug.md +1 -0
  263. package/pan-wizard-core/templates/design.md +5 -4
  264. package/pan-wizard-core/templates/discovery.md +2 -2
  265. package/pan-wizard-core/templates/phase-prompt.md +7 -0
  266. package/pan-wizard-core/templates/requirements.md +9 -0
  267. package/pan-wizard-core/templates/research.md +10 -0
  268. package/pan-wizard-core/templates/summary-complex.md +5 -1
  269. package/pan-wizard-core/templates/summary-minimal.md +4 -0
  270. package/pan-wizard-core/templates/summary-standard.md +5 -1
  271. package/pan-wizard-core/templates/summary.md +8 -1
  272. package/pan-wizard-core/workflows/add-phase.md +4 -6
  273. package/pan-wizard-core/workflows/assumptions.md +19 -1
  274. package/pan-wizard-core/workflows/diagnose-issues.md +2 -0
  275. package/pan-wizard-core/workflows/discuss-phase.md +4 -2
  276. package/pan-wizard-core/workflows/exec-lean.md +69 -0
  277. package/pan-wizard-core/workflows/exec-phase.md +79 -15
  278. package/pan-wizard-core/workflows/execute-plan.md +3 -1
  279. package/{commands/pan → pan-wizard-core/workflows}/focus-doc-audit.md +13 -29
  280. package/{commands/pan → pan-wizard-core/workflows}/focus-drift-walking.md +3 -18
  281. package/{commands/pan → pan-wizard-core/workflows}/focus-exec.md +8 -23
  282. package/{commands/pan → pan-wizard-core/workflows}/focus-plan.md +6 -20
  283. package/{commands/pan → pan-wizard-core/workflows}/focus-scan.md +3 -16
  284. package/{commands/pan → pan-wizard-core/workflows}/focus-sync.md +7 -21
  285. package/pan-wizard-core/workflows/health.md +6 -0
  286. package/pan-wizard-core/workflows/help.md +114 -77
  287. package/pan-wizard-core/workflows/insert-phase.md +4 -6
  288. package/pan-wizard-core/workflows/learn.md +3 -3
  289. package/pan-wizard-core/workflows/milestone-audit.md +2 -2
  290. package/pan-wizard-core/workflows/milestone-new.md +38 -95
  291. package/pan-wizard-core/workflows/new-project.md +96 -258
  292. package/pan-wizard-core/workflows/optimize.md +107 -5
  293. package/pan-wizard-core/workflows/phase-tests.md +10 -0
  294. package/pan-wizard-core/workflows/plan-phase.md +106 -45
  295. package/pan-wizard-core/workflows/profile.md +50 -0
  296. package/pan-wizard-core/workflows/progress.md +10 -0
  297. package/pan-wizard-core/workflows/quick.md +34 -43
  298. package/pan-wizard-core/workflows/remove-phase.md +11 -1
  299. package/pan-wizard-core/workflows/research-phase.md +118 -40
  300. package/pan-wizard-core/workflows/resume-project.md +18 -2
  301. package/pan-wizard-core/workflows/settings.md +33 -19
  302. package/pan-wizard-core/workflows/todo-check.md +6 -2
  303. package/pan-wizard-core/workflows/transition.md +22 -4
  304. package/pan-wizard-core/workflows/uat-walkthrough.md +90 -0
  305. package/pan-wizard-core/workflows/update.md +1 -1
  306. package/pan-wizard-core/workflows/verify-phase.md +39 -46
  307. package/scripts/build-agent-plugin.js +35 -15
  308. package/scripts/build-help.cjs +106 -0
  309. package/scripts/build-plugin.js +10 -1
  310. package/scripts/deprecate-old-versions.js +70 -3
  311. package/scripts/generate-skills-docs.py +1 -1
  312. package/scripts/git-hooks/pre-push +27 -0
  313. package/scripts/install-git-hooks.js +7 -5
  314. package/scripts/install-pre-push.cjs +38 -0
  315. package/scripts/land.cjs +151 -0
  316. package/scripts/local-ci.cjs +501 -0
  317. package/scripts/local-schedule.cjs +277 -0
  318. package/scripts/mutation-probe.cjs +7 -80
  319. package/scripts/prompt-lint.cjs +32 -0
  320. package/scripts/prompt-rules.cjs +156 -0
  321. package/scripts/run-tests.cjs +7 -1
  322. package/scripts/test-quality-lint.cjs +3 -3
  323. package/scripts/test-surface.cjs +175 -6
  324. package/agents/pan-research-synthesizer.md +0 -246
  325. package/commands/pan/audit-deployment.md +0 -386
  326. package/commands/pan/dashboard.md +0 -22
  327. package/commands/pan/discord.md +0 -19
  328. package/commands/pan/mcp-bridge.md +0 -143
  329. package/commands/pan/milestone-cleanup.md +0 -19
  330. package/commands/pan/milestone-gaps.md +0 -35
  331. package/commands/pan/optimize.md +0 -115
  332. package/commands/pan/profile.md +0 -76
  333. package/commands/pan/research-phase.md +0 -189
  334. package/pan-wizard-core/bin/lib/bridge.cjs +0 -269
  335. package/pan-wizard-core/templates/research-project/architecture.md +0 -204
  336. package/pan-wizard-core/templates/research-project/features.md +0 -147
  337. package/pan-wizard-core/templates/research-project/pitfalls.md +0 -200
  338. package/pan-wizard-core/templates/research-project/stack.md +0 -120
  339. package/pan-wizard-core/templates/research-project/summary.md +0 -170
@@ -0,0 +1,285 @@
1
+ # Memory optimisation review — `2026-10-04`
2
+
3
+ **Question:** are PAN's memory techniques optimal? What does the market ship, and what does PAN's memory do in practice?
4
+
5
+ **Method:**
6
+ - **Market sweep.** Three research scouts ran in parallel: host tools, peers and memory tools, and research and standards.
7
+ - **PAN's design.** A read of PAN's memory modules, workflows and ADRs.
8
+ - **Field measurement.** Read-only measurements on the projects where PAN is installed for real work. Only sizes, counts and dates were recorded, never content. Client projects appear under codenames.
9
+ - **Live measurement.** One Claude Code `-p` call measured the session-start footprint.
10
+
11
+ The ledger rows are MI-091 onward in `market-ideas-ledger.md`.
12
+
13
+ ## Verdict
14
+
15
+ **PAN's memory *design* is right.** The evidence and the market have converged on what PAN already does:
16
+ - Markdown files on disk.
17
+ - A small always-loaded layer.
18
+ - Fresh-context subagents that hand off through files.
19
+ - State re-injected after compaction.
20
+ - Gated promotion of learnings.
21
+ - Quarantine for injected directives.
22
+ - Load-time budgets, and no vector store.
23
+
24
+ None of PAN's recorded memory decisions is overturned. MI-010, MI-057 and ADR-0036's "no index-everything store" all hold.
25
+
26
+ **In operation, PAN's memory is not optimal.** It has eight problems:
27
+ 1. The largest re-read cost is unbounded. The planner loads the whole roadmap and requirements, and the roadmap grows without limit.
28
+ 2. A CRLF bug silently disables the `state.md` bound on every Windows project measured.
29
+ 3. The per-agent memory layer has an elaborate read path but almost no writes.
30
+ 4. Learnings are chosen by file size, not by the task.
31
+ 5. Stored facts carry no citations or expiry. That is the one technique with a real A/B result behind it.
32
+ 6. The context monitor's countdown contradicts current vendor guidance and can be bypassed.
33
+ 7. The host memory where cross-session memory actually accumulates is invisible to PAN.
34
+ 8. Copilot may load PAN's AGENTS.md section twice.
35
+
36
+ **The lever is per-turn re-read context.** Across the field cost ledgers, cache-read tokens outnumber output tokens by 245–365 to 1. Anthropic reports the same shape for its newest coding model, where the input-to-output ratio rose from 189:1 to 324:1.
37
+
38
+ ## Baseline — PAN's memory today
39
+
40
+ | Layer | Where | Written by | Read by | Bound |
41
+ |---|---|---|---|---|
42
+ | Durable state | `.planning/` (project, requirements, roadmap, state, standards, phases) | workflows, `pan-tools` | every spawn reads a subset: an executor the plan, state.md, config and CLAUDE.md; a planner also the whole roadmap.md and requirements.md | `state compact` and `memory optimize` for state.md only (ADR-0044); nothing for the roadmap or requirements |
43
+ | Per-agent memory | `.planning/memory/<agent>.md` | `verify retro` lessons, `optimize apply` | exec-phase `load_phase_memory` → `MEMORY_RULES` | budget plus cue-scoped `memory select` (ADR-0036) |
44
+ | Shipped learnings | `pan-wizard-core/learnings/{universal,internal}` | PAN, through the promote gate | `learn topics-for --agent <role>` | 5,000-token budget, static role relevance |
45
+ | Session learnings | `.planning/learnings.md` (LEARN-NNN) | `commands-learnings` extraction | — | — |
46
+ | Instructions | AGENTS.md marker section; CLAUDE.md `@AGENTS.md` bridge | installer, `memory rebuild` | host at session start | fixed template |
47
+ | Compaction survival | `pan-state-reinject.js` | — | host after compaction (Claude and Codex SessionStart `compact`; Gemini and Copilot marker + tool result) | 2,000-character block |
48
+ | Context pressure | `pan-context-monitor.js` | — | injected at ≤35% / ≤25% remaining | debounce |
49
+ | Injection defense | `quarantine.md` (ADR-0040) | `memory optimize` | humans | — |
50
+
51
+ ## What the field shows
52
+
53
+ Every measurement below is read-only, taken on `2026-10-04`.
54
+
55
+ | # | Finding | Evidence |
56
+ |---|---|---|
57
+ | F1 | **The planner loads the whole roadmap and requirements.** `plan-phase` passes both full files to the planner and the checker. A phase slice (the phase's section from `roadmap get-phase`, plus the requirement lines it names) is **89–98% smaller**. | Averaged over every phase of each project: 54-phase project ~145,980 → ~3,028 tokens; forecasting client ~14,246 → ~799; compliance client ~7,630 → ~675; lending client ~7,483 → ~554; PAN's benchmark projects ~7,464 → ~818 and ~4,450 → ~313 |
58
+ | F2 | **The roadmap is what grows in a long project, and nothing bounds it.** hygiene's `cache-context` check flags it CRITICAL with `fix: null`. Its "re-read on every agent call" model is also wrong per role (see F1). | 54-phase project: roadmap.md 476 KB, requirements.md 94 KB; check reports ~157,620 tokens. Forecasting client: ~26,727 |
59
+ | F3 | **Bug: `memory optimize` and auto-optimize change nothing on CRLF files.** Every Windows field project measured is CRLF throughout. Other parsers (`state compact`, `roadmap get-phase`, hygiene) handle CRLF. | 7 of 7 projects: state, roadmap and requirements 100% CRLF lines. Forecasting client state.md as-is: no change; normalised to LF: Decisions reconciled, 145 entries archived, 35,424 → 10,324 bytes |
60
+ | F4 | **Agent memory has a read path but almost no writes.** | 2 of 23 installs have entries (42 and 10; last written `2026-08-17` and `2026-08-21`) |
61
+ | F5 | **Session learnings are unused.** | `.planning/learnings.md` is empty in all 23 |
62
+ | F6 | **Learnings are chosen by size, not by task.** Topics are ranked by static role relevance, then filled smallest-first into 5,000 tokens. Most relevant topics drop out whatever the task is. | executor: 24 dropped (test-integrity, concurrency, migration-safety…); planner 22; verifier 21. The cue-aware scorer in `memory select` is not used here |
63
+ | F7 | **Cross-session memory accumulates in the host, not in PAN.** | Claude Code auto-memory: lending client 33 files / 274 KB, index 19.6 KB with lines up to 1,457 characters; a benchmark project 70 files / 281 KB; policies client index line 3,542 characters. PAN neither reads nor checks it |
64
+ | F8 | **The session-start footprint is modest.** | Claude Code 2.1.288, haiku, `-p`, no MCP: empty folder 32,183 prompt tokens; fresh PAN install 36,692. PAN adds ~4.5k |
65
+ | F9 | **Re-read context dominates spend.** | Cache-read to output 245–365 : 1 across field ledgers; executor spawns ~1–3.4M cache-read tokens each (median) |
66
+ | F10 | **The live bloat in `state.md` sits in a protected section.** | Forecasting client: Decisions 28 KB / 157 bullets, 80% of the file. `state compact` protects the section; `memory optimize` would cap it but for F3 |
67
+
68
+ ## What the market ships
69
+
70
+ Full scout tables are kept with the run; the rows below are the ones that bear on PAN.
71
+
72
+ | Technique | Who | Evidence | PAN status |
73
+ |---|---|---|---|
74
+ | Keep working context small and focused | research | Chroma "Context Rot" (one distractor already hurts; ~300 focused tokens beat ~113k on LongMemEval); Du et al. 13.9–85% drop with length; lost-in-the-middle | **PARTIAL.** Principle in ADR-0036; violated by F1/F2 |
75
+ | Small always-on index, detail on demand | Claude Code (200 lines / 25 KB index), Windsurf, Cursor, Kiro, Letta, Serena | Vercel: compressed 8 KB index 100% vs skill 53–79% | **HAVE** for instructions; **MISSING** for planning files (F1) |
76
+ | Don't store what the code already says | BMAD, Claude Code, Serena, Codex | Gloaguen et al. (arXiv 2602.11988, v3 `2026-09-29`): context files gave no significant success gain and cost +19–23%; overviews didn't help | **PARTIAL.** The promote gate has no explicit admission rule; codebase-map overviews are read by agents |
77
+ | Cited facts, verified before use, expiring when unused | Copilot Memory | **GitHub A/B (`2026-01-15`): PR merge rate 90% vs 83%, p < 0.00001.** The only outcome A/B in the field | **MISSING** |
78
+ | Lessons from observed failures, not traces | BMAD `record`, SuperClaude reflexion, research | Memory transfer: high-level insights generalise, raw traces transfer negatively; subtask memory +4.7 pp on SWE-bench Verified | **PARTIAL.** Design yes; write path starved (F4) |
79
+ | Gate writes; supersede instead of overwrite | mem0, Graphiti, BMAD; research | Experience-following spreads errors; MINJA 98.2% injection success via queries alone | **HAVE.** Promote gate, ADR-0040 quarantine, archive-not-delete |
80
+ | Deterministic itemised updates, never an LLM rewrite of the whole file | research (ACE) | "Context collapse": an 18k-token context rewritten to 122 tokens fell below the no-memory baseline | **HAVE.** `memory optimize` is deterministic (F3 aside) |
81
+ | Restart from files with a handoff rather than carry long sessions | Anthropic harness guidance; research | Multi-turn −39% (15 LLMs); restating in one turn recovers 95.1% | **HAVE.** Fresh-context subagents, `.planning/` |
82
+ | Re-inject state after compaction | Claude/Codex SessionStart `compact`, planning-with-files, agentmemory, Cognee | — | **HAVE** on four hosts (M10, M33); OpenCode open (MI-038) |
83
+ | Steer the compaction summary | Claude Code "Compact Instructions" in CLAUDE.md; Codex `compact_prompt`; OpenCode `experimental.session.compacting` | vendor docs | **MISSING** |
84
+ | Don't show the model a token countdown | Anthropic prompting guidance (Fable 5) | Countdowns trigger premature wrap-up and hand-off suggestions | **CONFLICT.** The context monitor injects remaining-% warnings |
85
+ | Telemetry on whether injected memory was used | Cognee ("12/40 turns had hits"), claude-mem | — | **PARTIAL.** `memory_primed` trace events count loads, not use |
86
+ | Measure resume cost | planning-with-files benchmark | stop halfway; fresh session told "continue"; count turns | **MISSING** in the harness |
87
+ | Vector or graph memory stores | claude-mem, mem0, Zep, Cognee, Ruflo, MemPalace, Hindsight | Vendor-run benchmarks only; LoCoMo audit: 6.4% wrong gold answers, judge accepts 62.81% of wrong answers; files + grep scored 74.0% (Letta) | **DECLINED** (ADR-0036 D4); holds |
88
+ | A cross-runtime memory format | IETF individual drafts (SAIHM, AIMEM bundle, infantado), W3C community group | No host adoption; four hosts ship four formats | **DECLINED** (MI-010); trigger unmet |
89
+
90
+ Host facts that change PAN's work:
91
+ - **Gemini CLI removed `save_memory`** in v0.44.0 (`2026-05-27`). PAN never used it.
92
+ - **Claude Code reads AGENTS.md natively** (2.1.277), but only when no CLAUDE.md exists.
93
+ - **Copilot reads `.claude/rules`** since 1.0.89.
94
+ - **Copilot lists AGENTS.md and CLAUDE.md as separate enabled sources.** A local probe on 1.0.91 showed this, so PAN's section may load twice there. This is unconfirmed.
95
+ - **Claude Code measures its status-line context percentages against the full window, not the auto-compact window.**
96
+ - **Hook output caps:** Codex spills hook output above ~2.5k tokens to a file, and Claude caps hook output at 10,000 characters. PAN's re-injection block fits both.
97
+
98
+ ## Proposal — the queue
99
+
100
+ The work is ordered by the size of the lever (F9) and by risk. Correctness comes first, then the large re-read cut, then quality. Points use the usual scale: S 2, M 4.
101
+
102
+ | ID | Pri | Size | Pts | Title | Evidence | Gate |
103
+ |---|---|---|---|---|---|---|
104
+ | O1 | P1 | S | 2 | **Fix `memory optimize` and auto-optimize on CRLF files.** Parse line endings with `\r?\n`, then write back in the file's own style. Add a CRLF-parity test that runs every planning-file parser on LF and CRLF copies of the same fixture and expects equal results | F3, F10 | The parity test fails before the fix. A dry run on a copy of a CRLF field state.md shows the reduction |
105
+ | O2 | P1 | M | 4 | **Load only the current phase's slice of the planning files.** A `pan-tools` verb returns the phase's roadmap section, a one-line index of every phase, the requirement lines the phase names, and its dependencies' goals. plan-phase (planner, checker), research-phase and verify-phase read that instead of the whole `roadmap.md` and `requirements.md` | F1; context-rot evidence; ADR-0036's own principle | Unit tests. Field dry-run sizes match F1. Harness `plan-phase-checker-loop` and `markdown-exec-phase-chain` pass on the slice |
106
+ | O3 | P2 | M | 4 | **Bound the roadmap and requirements as ADR-0044 bounds state.md.** `roadmap compact` moves shipped phases' detail to `roadmap-history.md` and keeps each checklist line plus a one-line goal; requirements of shipped milestones get the same treatment. hygiene's `cache-context` check offers these fixes and reports loads per role | F2 | A dry run on a copy of the 54-phase project. A hygiene test with fixes present. A planner still finds a shipped phase through the history file |
107
+ | O4 | P2 | M | 4 | **Cited, verified, expiring memory** (the Copilot Memory pattern, without dependencies). Agent-memory entries and promoted learnings may carry `cites: path[#symbol]`. `memory select` checks the citations against the working tree and drops or flags an entry whose evidence is gone. Entries record when they were last used; unused ones are archived after a window; hygiene reports stale entries | GitHub A/B 90% vs 83%; MemoryAgentBench ≤28% on fact updates | Unit tests. A harness rep where a seeded stale memory is filtered out before injection |
108
+ | O5 | P2 | S | 2 | **Choose learnings by the task.** `learn topics-for --cue "<phase objective; files>"` reuses `selectMemory`'s lexical scorer and ranks by cue match, then relevance, then size. The workflows pass the phase cue | F6; ADR-0036 ("selected by cue") | A golden set of phase objectives with expected topics; the cue ranking beats size-greedy on precision and recall |
109
+ | O6 | P2 | M | 4 | **Give agent memory a gated write path, or retire it.** Record a lesson only from an observed failure (a verifier gap, a failed test gate, a retry), with the correction, evidence and a citation. Admission rule: nothing the code already says. Add telemetry for injected entries that were used | F4, F5; lessons-over-traces evidence | A harness chain: a seeded failure produces one entry, and the next phase's executor receives it. If two reps show no effect, retire the layer and record why |
110
+ | O7 | P2 | S | 2 | **Context monitor without a countdown.** The injected message asks the agent to checkpoint `state.md` (the stopping point) rather than reporting a remaining percentage. Where the host exposes it, measure against the auto-compact window, not the model window | Anthropic guidance on countdowns; Claude `autoCompactWindow` | Unit tests. A harness A/B at forced low context: completion without premature wrap-up |
111
+ | O8 | P2 | S | 2 | **Steer the compaction summary.** A short "Compact Instructions" section in PAN's CLAUDE.md block, and a Codex `compact_prompt` hint, naming what must survive: the current phase, plan and stopping point, and the path to `state.md` | Claude and Codex docs | Install tests. A live `/compact` whose PostCompact `compact_summary` names the position |
112
+ | O9 | P3 | S | 2 | **Load PAN's instructions once on Copilot.** Confirm with `/context` whether AGENTS.md plus CLAUDE.md (`@AGENTS.md`) load the section twice, and if so emit the bridge so Copilot de-duplicates it | Copilot local probe (unconfirmed) | A live `/context` on Copilot. A test pinning the emitted shape |
113
+ | O10 | P3 | S | 2 | **Observe the host's memory without owning it.** hygiene reads Claude Code's per-project memory store, read-only. It reports the index against the host's 200-line / 25 KB load limit, and index lines that hold content instead of a pointer. MI-010 is unchanged | F7 | A unit test with a fake home. A field scan flags the oversized indexes |
114
+ | O11 | P3 | M | 4 | **Harness scenario for resume cost** (planning-with-files' protocol). Stop mid-phase, start a fresh session told only to continue, and count turns and cost to finish. This is the baseline that measures O2, O6, O7 and O8 | planning-with-files evals | The scenario runs at tier 2 with `--repeat` |
115
+ | O12 | P3 | S | 2 | **OpenCode: the last host without state re-injection.** Use the `experimental.session.compacting` plugin hook (MI-038), and the `instructions` array, which can load `.planning/memory/*.md` | OpenCode docs | A live compaction check on OpenCode |
116
+
117
+ **Sessions:**
118
+ - **Session A — correctness and the big cut:** O1, O2, O3 (10 points).
119
+ - **Session B — memory quality:** O4, O5, O6 (10 points).
120
+ - **Session C — host integration and measurement:** O7, O8, O9, O10, O11, O12 (14 points). O11 should land early in C, since it measures the rest.
121
+
122
+ **Expected effect:**
123
+ - **O1** restores the `state.md` bound on Windows projects: 71% smaller on the measured client file.
124
+ - **O2 and O3** cut the planner's planning-file load by roughly 90% or more. They also let a long project's planner fit in a 200k window at all: today the 54-phase project hands it ~146k tokens before any code.
125
+ - **O7 and O8** reduce the two ways compaction loses PAN's position.
126
+ - **O4, O5 and O6** improve what little memory PAN injects; O6 proves its effect or retires it.
127
+
128
+ ## Results — `2026-10-04`, branch `feat/memory-optimization-2026-10`
129
+
130
+ Every item was built, with tests that fail when its rule is undone, and every rule was revert-proofed one at a time. The harness gates ran against packed builds of the branch. Spend on paid checks this run: the harness reps listed below and three short live probes (under $0.30 together).
131
+
132
+ | ID | Status | What landed | Gate result |
133
+ |---|---|---|---|
134
+ | O1 | DONE — `6f6e198` | Every planning-file parser reads on LF and writes back in the file's own line ending (`toLf`, `dominantEol`, `withEol`). | CRLF-parity test over every parser fails before the fix. Field dry run: the forecasting client's state.md goes 35,424 → 10,484 bytes. |
135
+ | O2 | DONE — `79667bb`, `49b8425`, `86aa9c2`, `8c3e848` | `roadmap slice <phase> [--write]`. The planner, checker, researcher, executor and verifier read it instead of the whole roadmap.md and requirements.md. Two prompts that still loaded the whole set were found and fixed along the way: the "prime the cache" step (ADR-0023 amended) and the verifier (found by the harness). | Field slices are 75–98% smaller. Harness `markdown-exec-phase-chain` PASSED with zero whole-file reads by phase agents, counted from their own transcripts (`context-reads.cjs`). `plan-phase-checker-loop`: the researcher and checker read only the slice in all three reps, and the planner in two. In the third, the planner's roadmap edit read the seed's 30-line roadmap whole after `wc -l` showed it tiny, so the seed now carries a long project's roadmap (see O2-final below). |
136
+ | O3 | DONE — `fc29af6`, `49b8425` | `roadmap compact [--apply] [--keep N]` moves shipped phases to `roadmap-history.md` and leaves a stub. `get-phase`, `report phase` and slices read a compacted phase back from the history. hygiene offers `compact-roadmap`. | Dry run on the 54-phase project: 40 sections move, ~121k → ~39k tokens. 17 rules revert-proofed. **Requirements:** no compactor of its own. No field project has shipped a milestone through PAN, phase agents now read only their requirement lines, and `/pan:milestone-done` already archives a shipped milestone's requirements. |
137
+ | O4 | DONE — `86aa9c2` | Cited, verified, expiring entries (`--cites`, `memory select` drops stale and expired entries, `--mark-used`, `memory prune`, hygiene `memory-stale`); `learn promote --cites` with lint L-007. **Security fix found on the way:** exec-phase loaded every file in `.planning/memory/`, the ADR-0040 quarantine and a 114 KB state archive included, into every executor prompt. Memory then loaded only from agent logs; since the O6 decision nothing loads it at all. | 18 rules revert-proofed. Harness `memory-citations` PASSED: only the valid cited entry reached the executors; the stale entry, the quarantined directive and the state archive did not; the entry's use was recorded. The scenario is now `memory-not-loaded`, which expects none of them. |
138
+ | O5 | DONE — `fc28b6b` | `learn topics-for --cue`: topics matched to the task, keeping those scoring at least half the best match. The four workflows that load learnings pass the cue. | Golden set of 18 labelled objectives: precision 0.06 → 0.37, recall 0.45 → 0.76, ~13 → ~4.7 topics loaded. |
139
+ | O6 | RETIRED on the owner's decision — built `e41cb55`, `f00655b`; retired `506d1fb` | Built: `memory record`, the gated write path (a fixed finding or a trace session as evidence, a citation that holds, no directive, no duplicate); exec-phase `record_lessons`; the planner's memory in plan-phase; the optimizer's `memory_entry`; use telemetry. **Retired:** every load of agent memory into an agent and every automatic writer (`record_lessons`, army's `retro --write-memory`, the optimizer's memory entries), plus `validate health`'s `MEM_BUDGET`. `memory record` stays as a command. | 12 + 5 rules revert-proofed when built. Harness, 16 reps: the write path and routing work; no behavioural effect over the controls. The retirement: 15 mutations caught by the new class test; harness `memory-not-loaded` checks the deployed chain. |
140
+ | O7 | DONE — `610b054` | The context note carries no figure and asks for a checkpoint. The room left is measured against the auto-compact point (env, settings per model and for all, the 1M default, the percentage override). | Unit and e2e tests. `claude -p` renders no status line (checked with a `statusLine` command that never ran), so no bridge file was written and the monitor was silent in headless runs. **Follow-up done:** with no fresh bridge the monitor now reads the session transcript, and a subagent's call reads the subagent's own. Harness `context-note-headless` is the gate (see Follow-up below). |
141
+ | O8 | DONE — `c4580f3` | A "Compact instructions" section in PAN's CLAUDE.md block. An old bridge is upgraded in place. Codex `compact_prompt` deliberately left out: it replaces the built-in prompt and the default provider ignores it. | Live `/compact` per arm with a PostCompact hook: the summary with the section followed it (no code blocks, 24% shorter); the one without carried two code blocks; both kept phase, plan and stopping point in a session that short. |
142
+ | O9 | CONFIRMED, documented — `b570895` | Copilot loads PAN's section twice in a dual Claude + Copilot project. No project-side layout fixes it: Copilot dedupes only identical files, and Claude Code needs the import. TROUBLESHOOTING gives the user-side fix (`/instructions`). | `copilot instruction list --json` on 1.0.91 lists AGENTS.md and CLAUDE.md as two enabled sources; recorded 1.0.88 sessions show the section twice (~630 bytes per request). A test keeps PAN from adding a third copy. |
143
+ | O10 | DONE — `b560fd5` | hygiene `host-memory`, read-only: Claude Code's MEMORY.md against its 200-line / 25 KB load limit, and index lines that hold content. MI-010 unchanged. | Fake-home unit tests; 8 rules revert-proofed. Field scan flagged two client indexes for content-heavy lines; none over the limit. |
144
+ | O11 | DONE — `7995acd`, `fddae65` | Harness `resume-cost`: the seed stopped halfway, a fresh session told only "continue", turns and cost read from the step's own record. | Baseline, 2 reps: finished both times in 12 and 17 turns, $0.44 and $0.62, 67 s and 98 s. |
145
+ | O12 | DONE — `1e23b86` | An OpenCode plugin (`.opencode/plugins/pan-wizard.js`, CommonJS `{ id, server }`) pushes PAN's position onto the compaction prompt. Installed, manifest-tracked and uninstalled for OpenCode only. | OpenCode 1.18.32, no model call: `debug config` lists it (now a `live-gate-opencode` step); an instrumented copy showed OpenCode importing it and calling `server()`, which returned the compaction hook. |
146
+
147
+ ### Harness runs (`d:\pantesting\harness-runs\`, all against packed builds of the branch)
148
+
149
+ | Run | Scenario × reps | Result | Notes |
150
+ |---|---|---|---|
151
+ | `run-20261004-115435-7Q1od0` | `plan-phase-checker-loop` ×2, `markdown-exec-phase-chain` ×2 | 0 / 4 on their checks; the chains themselves worked | First O2 gate. The planner's reps failed only on a `phases list` assertion that never matched (the scenario had never been run). The exec chain's reps found the verifier and an executor reading the whole files, which led to the O2 follow-up. $11.46 |
152
+ | `run-20261004-123606-yj08Rs` | `markdown-exec-phase-chain`, `memory-citations`, `plan-phase-checker-loop` ×1 | 2 / 3 | The exec chain read zero whole files after the fix. The O4 gate passed. The planner read the 30-line seed roadmap whole once, which led to the grown seed. $8.42 |
153
+ | `run-20261004-130834-iwUDhB` | `plan-phase-checker-loop` ×2 (grown seed), `resume-cost` ×2 | 3 / 4 | **O2-final:** on a long project's roadmap, the researcher, planner and checker read only the slice in both reps. **O11 baseline:** a fresh session told only "continue" finished the half-done phase both times, in 12 and 17 turns, $0.44 and $0.62, 67 s and 98 s. Rep 1 failed its measurement step on a script bug (it read claude's JSON instead of the harness step record), since fixed and re-measured from the record. $7.88 |
154
+ | `run-20261004-130155-pAwKuq` | `memory-lesson-chain` ×2, `memory-lesson-control` ×2 | 4 / 4 | O6 mechanism, below. $12.83 |
155
+ | `run-20261004-133439-25lZk5` | `memory-convention-chain` ×2, `memory-convention-control` ×2 | 4 / 4 | O6 effect, below. $11.37 |
156
+ | `run-20261004-173408-7PFC09` | `memory-not-loaded` ×1 (the retirement, built from `7430625`) | 0 / 1 as run; passes re-measured | No executor prompt carried memory, the orchestrator ran no memory command, and nothing the run wrote followed a seeded entry. It failed one expectation: no agent may open the folder. The orchestrator had listed `.planning/` on its own and run `head` on every memory file, the quarantine included. It obeyed none of them. The counter had also counted a `git reset -- .planning/memory` as a read. The gate now asserts what PAN controls and what would do harm (no seeded marker in anything the run wrote). It reports reads per agent without failing on them, and judges each segment of a shell command. Re-measured on the same workspace and transcripts: passes, with one read reported. $2.19 |
157
+ | `run-20261004-181357-v3GL7Y` | `context-note-headless` ×1 (built from `fb9faac`) | 1 / 1 | O7's gate. A `claude -p` session on Opus 5.5 with a 100K compaction window read three files. Its calls measured 41.7K, 54.4K and 67.0K tokens. After the third, the transcript recorded PAN's warning note with no bridge for the session, and the host compacted right after. That located the compaction point: 33K short of the window, as on the 1M default, where O7 had assumed the window itself. With the margin, the same calls give the critical note one call earlier. $0.62 |
158
+ | `run-20261004-182101-95QZoA` | `context-note-headless` ×1 (built from `2b80915`, the margin) | 1 / 1 | With the 33K margin the critical note fired after the second read's call (54,356 tokens), one call earlier. The host compacted after the call that measured 67,149, the margin's point again, and the note was recorded before it. No bridge for the session. $0.65 |
159
+
160
+ The four O6 scenarios, their scripts and their seeds were retired with the step they measured (`506d1fb`; last present at `715d83e`). `memory-citations` became `memory-not-loaded`.
161
+
162
+ ### O6 — what the lesson-chain runs showed
163
+
164
+ The four runs use the same seed and the same fix round (the gap: `greet` does not reject a bad name). They split by arm only at phase 2.
165
+
166
+ - **The gate is used with judgement.** In both chain reps the orchestrator recorded one lesson through `memory record`, with `evidence: finding:` and a citation. Both lessons were conditional: "when a requirement says a function rejects bad input, build the guard and its tests in the same plan". In both control reps it recorded none, and said why. The gap was a planning slip: no plan was assigned REQ-02, so the executor was not at fault, and a general "validate arguments" rule would push phase 2 into work its requirement does not ask for. That is the admission rule ("not a phase-specific slip; not what the code already says") working as written.
167
+ - **Injection works.** Both recorded lessons reached phase 2's executor prompt, read from the orchestrator's transcript.
168
+ - **No behavioural effect, and none was possible in this design.** Phase 2 has no validation requirement, so the conditional lesson correctly did not apply. `farewell` validated in 0 of 2 chain reps and 0 of 2 control reps. The seed tests what the write path does, not what a lesson is worth.
169
+ - **A real gap it exposed, now fixed (`f00655b`).** PAN injected memory only into executors, so the planning lessons the fix round naturally produces, and `verify retro`'s recurring plan gaps, reached no planner. plan-phase now gives `pan-planner`'s log to the planner and the plan checker. `record_lessons` files each lesson with the agent that would have prevented the failure.
170
+
171
+ **The effect experiment** (`memory-convention-chain` / `-control`, run `run-20261004-133439-25lZk5`, 4 / 4, $11.37) uses a project quirk. `npm test` runs only the test files `test/manifest.json` lists. Phase 1 wrote a test and never listed it, and phase 2's plan never mentions the manifest. The measurement is whether phase 2 lists its new test, with and without the lesson.
172
+
173
+ | Rep | Lesson recorded by the fix round | Lesson in phase 2's executor `<project_memory>` | Phase 2 listed its test |
174
+ |---|---|---|---|
175
+ | chain 1 | yes, filed for `pan-planner` | no (a planning lesson; phase 2 came pre-planned) | yes |
176
+ | chain 2 | yes, filed for `pan-planner` | no | yes |
177
+ | control 1 | yes, then removed with `.planning/memory/` | no | yes |
178
+ | control 2 | yes, then removed | no | yes |
179
+
180
+ The transcripts say how phase 2 knew without memory:
181
+ - The orchestrator ran the `npm test` baseline, saw "running 2 test file(s) from test/manifest.json", and told its executor to check that the new test actually runs.
182
+ - The executors read `scripts/test.cjs` and the manifest themselves.
183
+ - One executor `cat`-ed the planner's memory file on its own. The "never read a memory file into a prompt" rule binds the orchestrator, not the subagents it spawns.
184
+
185
+ The lesson was also something the code already says (the runner states the rule), which the admission rule forbids recording. The gate cannot judge that.
186
+
187
+ **Verdict on O6.** The write path works: 6 of 8 fix rounds recorded a lesson through the gate, the other 2 declined with a correct reason, and every recorded lesson was routed to the right agent once routing existed. Recorded lessons reach their agents.
188
+
189
+ **What the runs did not show** is any behavioural effect: 8 reps of phase 2 across two designs, and every control behaved the same without memory. Within a two-phase horizon, PAN's other channels already carry what a fix round learns: `state.md` decisions, summaries, the orchestrator's own prompt, and executors that read the repository.
190
+
191
+ That meets this queue's own rule ("if two reps show no effect, retire the layer"). But the layer's claimed value is the long horizon, after `memory optimize` and `state compact` have moved a decision out of `state.md`, and no run tested that. The owner was offered two options: retire the injection, or keep the layer and run one long-horizon experiment (a lesson recorded in phase 1, `state.md` compacted, measured in phase 4).
192
+
193
+ **Decision (`2026-10-04`, the owner): retire the injection** (`506d1fb`, ADR-0036 amended).
194
+ - **The injection:** exec-phase's `load_phase_memory`, the executors' `<project_memory>` block and `record_lessons` are gone, and so are plan-phase's planner memory step and both of its blocks.
195
+ - **The writers that fed only the injection** were listed before any change. The owner chose to stop the automatic ones:
196
+ - `/pan:army` and `pan-conductor` no longer pass `retro --write-memory`. Mission Control carries retro's patterns into the next mission's plan.
197
+ - `pan-optimizer` proposes notes that name where a lesson belongs (the project's instructions, a test, or the code), and no longer reads the store.
198
+ - `optimize apply` warns on any write into `.planning/memory/`.
199
+ - **What stays:** the store, every `memory` command, hygiene, the quarantine and `/pan:knowledge`.
200
+ - **Also removed:** `validate health --full`'s `MEM_BUDGET`, which measured a cost that is gone.
201
+ - **Gates:** a class test forbids any shipped prompt from loading or writing agent memory (15 mutations caught). Harness `memory-not-loaded` checks the deployed chain. Its one model run (`run-20261004-173408-7PFC09`) failed (`memory_file_reads = 2`); the pass after the fix was re-scored from recorded transcripts, not re-run, so the harness ledger row stays unresolved until a live re-run (R49 in `market-ideas-2026-10.md`, corrected `2026-10-11`).
202
+ - **Revisit when** a long-horizon run shows an effect.
203
+
204
+ **Found while retiring (`5f6f077`):** `docs/CLI-REFERENCE.md` had held a second copy of its first 3,400 lines since `86aa9c2`. An O4 edit script passed `String.replace` a replacement holding a regex ending in `+$` followed by a backtick. In a replacement string, `` $` `` inserts everything before the match. The paste went through five commits unseen. A doc-lint test now fails on any markdown file whose opening appears twice.
205
+
206
+ **Follow-up (done):** the context monitor reads context size from the session transcript when no status-line bridge exists, so the note reaches headless runs. Built from payloads and transcripts captured from Claude Code 2.1.288 on `2026-10-04` in a scratch `claude -p` probe:
207
+ - The assistant record that issued a tool call is in the file when PostToolUse fires, so its usage is the call's context.
208
+ - A subagent's payload names the main transcript and carries `agent_id`; the subagent's records are in `<session>/subagents/agent-<id>.jsonl`.
209
+ - A hook's `additionalContext` is recorded as a `hook_additional_context` attachment.
210
+
211
+ 21 rules were mutated: 20 were caught, and the 21st (dropping a tail's partial first line) is an equivalent mutant on well-formed JSONL. Harness `context-note-headless` gives a `claude -p` session a 100K compaction window and reads past the warning line, then checks that the transcript recorded the note before the host compacted, with no bridge present. Its first run located the compaction point at 33K short of the window, and the monitor now measures against that.
212
+
213
+ ## On watch
214
+
215
+ - **Codebase-map overviews as agent input.** The ETH study found repository overviews don't help, while developer-written specifics do. The verifier reads `conventions.md` (specifics) and `structure.md` (an overview). Measure in the harness before dropping either.
216
+ - **Masking old tool output** halves cost with no accuracy loss in the research. It's a host transcript concern, reachable only through Claude Mods (MI-074, WATCH).
217
+ - **Claude's AGENTS.md native mode.** If PAN's bridge creates a CLAUDE.md where none existed, nested AGENTS.md files may stop loading. This comes from the docs; verify live.
218
+ - **Codex `/import`** may copy PAN's Claude hooks, commands and bridge next to PAN's own Codex install. Untested.
219
+
220
+ ## What not to do — re-affirmed with this run's evidence
221
+
222
+ - **No vector or graph store** (ADR-0036 D4):
223
+ - Every such tool brings a native or server dependency.
224
+ - Grep and BM25 came close on coding-shaped data.
225
+ - The published benchmarks are vendor-run, and LoCoMo itself is flawed.
226
+ - One tool's own audit caught it silently falling back to mock embeddings.
227
+ - **No ownership of host-native memory** (MI-010). No interchange format has a host adopter.
228
+ - **No automatic copying of learnings to a global store** (MI-057).
229
+ - **No LLM rewrite of a whole memory file.** ACE's "context collapse" fell below the no-memory baseline; keep reconcile deterministic.
230
+ - **No always-on transcript-capture daemon.** It brings dependencies, privacy exposure and no outcome evidence.
231
+ - **No repository overviews added to the always-loaded layer.** In the ETH study they cost about 20% more for no success gain.
232
+
233
+ ## Sources (read `2026-10-04` unless dated)
234
+
235
+ **Research:**
236
+ - https://arxiv.org/abs/2602.11988
237
+ - https://www.trychroma.com/research/context-rot
238
+ - https://arxiv.org/abs/2510.05381
239
+ - https://arxiv.org/abs/2307.03172
240
+ - https://arxiv.org/abs/2508.21433
241
+ - https://arxiv.org/abs/2505.06120
242
+ - https://arxiv.org/abs/2510.04618
243
+ - https://arxiv.org/abs/2505.16067
244
+ - https://arxiv.org/abs/2503.03704
245
+ - https://arxiv.org/abs/2507.05257
246
+ - https://arxiv.org/abs/2410.10813
247
+ - https://arxiv.org/abs/2604.14004
248
+ - https://arxiv.org/abs/2602.21611
249
+
250
+ **Vendor:**
251
+ - https://github.blog/ai-and-ml/github-copilot/building-an-agentic-memory-system-for-github-copilot/
252
+ - https://docs.github.com/en/copilot/concepts/agents/copilot-memory
253
+ - https://claude.com/blog/context-management
254
+ - https://claude.com/blog/claude-opus-5-5-built-for-coding-sessions-that-use-more-context
255
+ - https://www.anthropic.com/engineering/harness-design-long-running-apps
256
+ - https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5
257
+ - https://vercel.com/blog/agents-md-outperforms-skills-in-our-agent-evals
258
+
259
+ **Host docs:**
260
+ - https://code.claude.com/docs/en/memory.md
261
+ - https://code.claude.com/docs/en/context-window.md
262
+ - https://code.claude.com/docs/en/hooks.md
263
+ - https://code.claude.com/docs/en/model-config
264
+ - https://learn.chatgpt.com/docs/customization/memories.md
265
+ - https://learn.chatgpt.com/docs/hooks.md
266
+ - https://geminicli.com/docs/tools/memory
267
+ - https://docs.github.com/en/copilot/concepts/agents/copilot-cli/context-management
268
+ - https://opencode.ai/docs/plugins.md
269
+ - https://opencode.ai/docs/rules.md
270
+
271
+ **Peers:**
272
+ - github.com/open-gsd/gsd-core
273
+ - github.com/OthmanAdi/planning-with-files (docs/evals.md)
274
+ - github.com/bmad-code-org/BMAD-METHOD
275
+ - github.com/oraios/serena
276
+ - github.com/mem0ai/mem0
277
+ - github.com/letta-ai/letta-code
278
+ - github.com/getzep/graphiti
279
+ - github.com/dial481/locomo-audit
280
+
281
+ **Standards:**
282
+ - https://agents.md
283
+ - https://agentskills.io/specification
284
+ - https://datatracker.ietf.org/doc/draft-saihm-memory-protocol/
285
+ - https://www.w3.org/community/ai-agent-memory-interop/
@@ -0,0 +1,143 @@
1
+ # Multi-Track Planning Roots & Milestone Resolution — Feature Specification
2
+
3
+ **Generated:** 2026-08-21
4
+ **Version:** 1.0
5
+ **Status:** Implemented
6
+ **Source:** Field defect report against PAN 3.25.0, filed from a host repository holding four independently-planned products in one git repo (planning trees at `.planning/` plus `.planning/tracks/{core,defense,verify}/`)
7
+
8
+ ---
9
+
10
+ ## Problem Statement
11
+
12
+ Two defects, both confirmed still present in 3.26.0. They share a shape worth naming up front: **each fails by silently succeeding against the wrong thing.**
13
+
14
+ ### D1 — No command could target a planning track
15
+
16
+ Every command resolved `.planning/` relative to its working directory with no way to point elsewhere. In a repo with more than one planning tree, three of four were unreachable, and the commands did not fail — they succeeded against the wrong tree.
17
+
18
+ | Command | Intended target | Actual |
19
+ |---|---|---|
20
+ | `hygiene scan` | all four tracks | scanned `.planning/` only; reported **clean** while `tracks/verify/optimization/traces` held 18 sessions against a retention of 5 |
21
+ | `milestone-audit` | the `core` track | resolved the root (exchange) track |
22
+ | `milestone-done` | — | would have archived the wrong milestone |
23
+
24
+ `hygiene` is the sharpest case: it exists to prune stale trace sessions, 13 were prunable, and it returned `summary.total: 0`.
25
+
26
+ ### D2 — The milestone resolver spliced two different milestones
27
+
28
+ `getMilestoneInfo` derived version and name with two **independent** unanchored regexes over the whole of `roadmap.md`:
29
+
30
+ ```js
31
+ const versionMatch = roadmap.match(/v(\d+\.\d+)/); // first vN.N ANYWHERE, prose included
32
+ const nameMatch = roadmap.match(/## .*v\d+\.\d+[:\s]+([^\n(]+)/); // matches inside `### ` too
33
+ ```
34
+
35
+ Three faults compounded: the version pattern was unanchored and read versions out of body prose; the name pattern was matched independently, so the two halves could come from different milestones; and `## ` matches inside `### `.
36
+
37
+ Reported observation — `init milestone-op` returned `milestone_version: "v4.2"` with `milestone_name: "— Full Platform"`. `v4.2` was *Ledger Rebrand*; *Full Platform* was `v4.1`. **The pair did not exist.** The version came from body prose at `roadmap.md:19`; the name from an H3 at `roadmap.md:75`.
38
+
39
+ **Confirmed worse than reported.** The defect fires on PAN's **own** documented roadmap format (`templates/roadmap.md`, "Milestone-Grouped Roadmap"), not only on the reporter's `###`-style layout:
40
+
41
+ ```markdown
42
+ ## Milestones
43
+ - ✅ **v1.0 MVP** - Phases 1-4 (shipped)
44
+ - 🚧 **v1.1 Hardening** - Phases 5-6 (in progress)
45
+ ### 🚧 v1.1 Hardening (In Progress)
46
+ ```
47
+
48
+ → old resolver returned `v1.0` (a **shipped** milestone, read from the summary bullet list) spliced with `Hardening` (the name of v1.1).
49
+
50
+ **Red herring, recorded so it is not chased again.** The reporter's roadmap separately had *two* milestones marked `(current)`. That was a genuine planning-state error, but it was not the cause: the old resolver never read `(current)` at all.
51
+
52
+ **Correction to the report's suggested fix.** It proposed falling back to `state.md`'s `milestone:` field, "which was correct here throughout". That is circular in PAN's model — `state.cjs` *writes* that field from `getMilestoneInfo()` (`buildStateFrontmatter`). It cannot be an independent source of truth. The fix therefore had to come entirely from within roadmap parsing.
53
+
54
+ ## Requirements
55
+
56
+ | ID | Requirement |
57
+ |---|---|
58
+ | REQ-01 | A command can target a planning tree other than `.planning/`, by flag and by environment variable |
59
+ | REQ-02 | Every command that resolves a planning root reports which root it resolved, from where, and whether it exists |
60
+ | REQ-03 | `hygiene` can sweep the root tree and every discovered track in one invocation, attributing each finding to its track |
61
+ | REQ-04 | Project-level checks (version alignment) are reported once per invocation, not once per tree |
62
+ | REQ-05 | A planning root may not escape the project root |
63
+ | REQ-06 | Milestone version and name are always read from a single heading |
64
+ | REQ-07 | Milestone headings are matched anchored, at any heading level, and never inside body prose |
65
+ | REQ-08 | An explicit current-milestone marker outranks document position |
66
+ | REQ-09 | Multiple milestones marked current is surfaced as ambiguous rather than resolved silently |
67
+ | REQ-10 | Default behaviour is unchanged when no targeting flag is passed |
68
+ | REQ-11 | `milestone-audit` can target one tree and enumerate every tree, and refuses to audit an unresolvable milestone |
69
+
70
+ ## Design
71
+
72
+ ### Planning root resolution
73
+
74
+ `pan-wizard-core/bin/lib/planning-root.cjs` — a leaf module (requires only `fs`, `path`). See [ADR-0043](../decisions/ADR-0043-addressable-planning-roots.md) for the decision record.
75
+
76
+ Resolution precedence: `--planning-dir` / `--track` → `PAN_PLANNING_DIR` → `PAN_TRACK` → `.planning`.
77
+
78
+ Roots are stored project-relative and POSIX-separated, because the same value serves both as an absolute-path component and, verbatim, as the display path in output and `git add` arguments.
79
+
80
+ Key exports:
81
+
82
+ | Function | Purpose |
83
+ |---|---|
84
+ | `resolvePlanningRoot()` | `{rel, source, track}` — never a bare string |
85
+ | `describePlanningRoot(cwd)` | adds `planning_root_exists`; the shape commands spread into output |
86
+ | `planningRoots(cwd, {allTracks})` | the trees a command should act on |
87
+ | `discoverTracks(cwd)` | `.planning/tracks/*/` directories carrying a planning spine |
88
+ | `withPlanningRoot(rel, fn, track)` | pins the root (and its track label) for a synchronous callback, restores in `finally` |
89
+
90
+ Path construction is confined to `utils.planningPath(cwd, …segments)` (absolute) and `utils.planningRel(…segments)` (project-relative display). ~90 direct `path.join(cwd, PLANNING_DIR, …)` sites were routed through them.
91
+
92
+ ### Milestone resolution
93
+
94
+ `parseMilestoneHeadings(roadmap)` extracts `{version, name, status, line, heading}` from each **anchored** heading (`/^[ \t]{0,3}#{1,6}[ \t]+(.*\bv\d+(?:\.\d+)+\b.*?)[ \t]*$/`) plus `<summary>` lines, which is how PAN's template collapses shipped milestones. Version and name come from the same captured heading — that constraint *is* the fix.
95
+
96
+ Status is read from the markers PAN's own template emits — `✅`/shipped, `🚧`/current/in-progress, `📋`/planned. `current` is matched as a word anywhere in the heading rather than as an exact `(current)` parenthetical: real roadmaps write `(current, phases 6–10)`, and requiring the strict form missed the marker and fell through to positional guessing.
97
+
98
+ `selectCurrentMilestone()` prefers, in order: a heading marked current → the first unshipped heading → the last shipped heading. Multiple current markers return `ambiguous: true` alongside the pick.
99
+
100
+ `getMilestoneInfo()` returns the previous `{version, name}` plus `{status, basis, ambiguous, candidates}` — additive, so existing callers are unaffected.
101
+
102
+ ## CLI surface
103
+
104
+ ```text
105
+ pan-tools <command> [args] [--raw] [--cwd <path>]
106
+ [--track <name> | --planning-dir <path>] [--all-tracks]
107
+ ```
108
+
109
+ | Flag | Effect |
110
+ |---|---|
111
+ | `--track <name>` | act on `.planning/tracks/<name>/` |
112
+ | `--planning-dir <path>` | act on an arbitrary project-relative planning tree |
113
+ | `--all-tracks` | (`hygiene`, `init milestone-op`) act on the root tree **and** every discovered track |
114
+ | `PAN_TRACK`, `PAN_PLANNING_DIR` | same, via environment; flags win |
115
+
116
+ `--track` and `--planning-dir` are mutually exclusive.
117
+
118
+ ## Security
119
+
120
+ `--planning-dir` rejects absolute paths (`/`, `\`), Windows drive-relative paths (`C:foo`), and any `..` segment. `--track` is restricted to `^[A-Za-z0-9][A-Za-z0-9._-]*$`, so a track name can only ever be one path segment. Both barriers are inline literal checks rather than helper calls — static analysis does not follow guards across function boundaries.
121
+
122
+ ## Verification
123
+
124
+ | Requirement | Evidence |
125
+ |---|---|
126
+ | REQ-01, REQ-05 | `tests/planning-root.test.cjs` — precedence, traversal rejection, slug alphabet |
127
+ | REQ-02 | `tests/planning-root.test.cjs` (`describePlanningRoot`), `tests/hygiene.test.cjs` (a mistyped `--track` reports `planning_root_exists: false` beside its zero findings) |
128
+ | REQ-03, REQ-04 | `tests/hygiene.test.cjs` — multi-track sweep, per-track attribution, version drift counted once |
129
+ | REQ-06…REQ-09 | `tests/milestone-resolver.test.cjs` — prose-version rejection, same-heading pairing, PAN's own template, ambiguity |
130
+ | REQ-10 | the full pre-existing suite passed after the ~90-site reroute and before any new test was added |
131
+ | REQ-11 | `tests/milestone-resolver.test.cjs` — `--track` resolves a sibling tree's milestone, `--all-tracks` labels each tree, an ambiguous track is listed in `ambiguous_tracks[]` |
132
+
133
+ Field reproduction: a fixture mirroring the reported repo (root tree + `core`/`defense`/`verify` tracks, 18 aged trace sessions in `verify`, plus a decoy non-track folder) yields **13 findings** under `--track verify` — matching the reported count exactly — and `clean --all-tracks --apply` prunes `verify` to the newest 5 while leaving the root tree and `core` untouched.
134
+
135
+ ### Milestone audit
136
+
137
+ `init milestone-op` gained `--all-tracks`, returning `{all_tracks, track_count, ambiguous_tracks[], tracks[]}` — one full payload per tree. The payload also carries **how** the milestone was decided (`milestone_status`, `milestone_basis`, `milestone_ambiguous`, `milestone_candidates`), so a caller can distinguish a real `v1.0` from a fallback.
138
+
139
+ `workflows/milestone-audit.md` no longer hardcodes `.planning/`: it reads `planning_root` from the init payload and uses it for every glob and for the report path. Two gates were added — the audit must state the tree it read, and it must **stop** when `milestone_ambiguous` is true rather than auditing a silently-chosen milestone.
140
+
141
+ ## Follow-on work
142
+
143
+ `--track` / `--planning-dir` work for every command because they resolve at the seam. `--all-tracks` **aggregation** is implemented for `hygiene` and `init milestone-op`; extending it to the phase/state commands is separate work.