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,213 @@
1
+ # Real Test Enforcement & Integration Test Scaffolding — Feature Specification
2
+
3
+ **Generated:** 2026-03-09
4
+ **Version:** 1.0
5
+ **Status:** Proposed
6
+ **Source:** Deployment audit of d:\xxxxx (SQL Server Analyser — Rust CLI, PAN v2.8.0)
7
+
8
+ ---
9
+
10
+ ## Problem Statement
11
+
12
+ A deployment audit of a completed 6-phase Rust CLI project that communicates with SQL Server via DMV queries revealed a critical test quality gap: **PAN generated 96 unit tests — all pure data-structure tests — with zero integration tests, zero E2E tests, and zero Docker infrastructure** for a tool whose entire value proposition is connecting to a live database.
13
+
14
+ ### Specific Failures Observed
15
+
16
+ 1. **Plans don't require test tier classification.** Plans say "add unit tests for helpers" but the phase goal says "User can connect to SQL Server and discover databases." The test plan has no mechanism to flag that unit tests on string formatting do not validate the behavioral goal.
17
+
18
+ 2. **Plan-checker doesn't validate test-criteria alignment.** The plan-checker agent verifies structural completeness (frontmatter, dependencies, artifacts) but never asks: "Will these tests actually prove the success criteria are met?" A plan with success criterion "User can run `discover` and see server version" passed plan-check with only `csv_field()` tests planned.
19
+
20
+ 3. **Verifier accepts hollow test coverage.** Verification reports note `cargo test: 96 pass` as evidence of quality, but don't distinguish between tests that exercise behavioral criteria vs tests that only cover utility helpers. Phase 2 verification says "PASS" for "User can run `tables` subcommand" based on format_size() unit tests alone.
21
+
22
+ 4. **No Docker/infrastructure scaffolding during research or planning.** The research phase identified `tiberius` as the SQL driver and documented DMV queries, but never proposed a Docker Compose for test SQL Server. No phase produced test seed data, integration test infrastructure, or CI configuration.
23
+
24
+ 5. **Missing verification for 3 of 6 phases.** Phases 1, 3, 4 executed to completion but were never verified — no `verification.md` exists. The auto_advance workflow setting allowed execution to proceed without verification gates.
25
+
26
+ 6. **No Playwright/headed testing guidance for web projects.** While this specific project is CLI-only, PAN's `phase-tests` command generates unit test stubs for all project types. For web frontends, it should scaffold Playwright with headed mode for development and propose page object models matching planned UI flows.
27
+
28
+ ## Demand Evidence
29
+
30
+ | Evidence Type | Source | Finding |
31
+ |---|---|---|
32
+ | Deployment audit | d:\xxxxx cargo test | 96 tests, ALL are pure-function unit tests (csv_field, format_size, parse_column_list) |
33
+ | Deployment audit | d:\xxxxx src/ | 0 integration tests against real SQL Server, 0 E2E CLI tests |
34
+ | Deployment audit | d:\xxxxx | No `tests/` directory, no Docker Compose, no test seed SQL |
35
+ | Test distribution | index_stats.rs | 11 tests on DDL string building; 0 tests executing DDL against SQL Server |
36
+ | Test distribution | wait_stats.rs | 19 tests on wait category mapping; 0 tests reading real DMV wait data |
37
+ | Test distribution | query_stats.rs | 18 tests on duration formatting; 0 tests querying real plan cache |
38
+ | Test distribution | security_checks.rs | 2 tests on display_name(); 0 tests running security audit against real instance |
39
+ | Verification gap | Phases 1, 3, 4 | Executed but never verified — auto_advance skipped verification |
40
+ | Plan quality | All 13 plans | No plan includes test tier table, Docker requirements, or integration test strategy |
41
+ | Verifier reports | Phases 2, 5, 6 | `cargo test: PASS (N tests)` accepted as evidence without analyzing test scope |
42
+
43
+ ## Success Criteria
44
+
45
+ ```
46
+ SC-1: Plan templates include mandatory test tier table (Unit/Integration/E2E) with infrastructure column
47
+ SC-2: Plan-checker flags when success criteria mention user-observable behavior but test plan only has unit tests
48
+ SC-3: Verifier checks that behavioral success criteria have matching integration or E2E tests, not just unit tests
49
+ SC-4: Research phase detects external service dependencies and proposes Docker Compose for test infrastructure
50
+ SC-5: phase-tests command generates integration test scaffolding (not just unit stubs) when project has external dependencies
51
+ SC-6: phase-tests command scaffolds Playwright with headed mode for web frontend projects
52
+ SC-7: Verification gate cannot be auto-advanced when verification is enabled in config
53
+ SC-8: No regression in existing 1636+ PAN Wizard tests
54
+ ```
55
+
56
+ ## Competitive Landscape
57
+
58
+ No AI coding tool currently enforces integration test quality or scaffolds test infrastructure. This would be a differentiator.
59
+
60
+ | Tool | Test Generation | Test Tier Awareness | Docker Scaffolding | E2E/Playwright | Verification Gate |
61
+ |---|---|---|---|---|---|
62
+ | **PAN Wizard (current)** | Unit stubs only | None | None | None | Bypassable |
63
+ | **Aider** | None | None | None | None | N/A |
64
+ | **Cursor** | Inline suggestions | None | None | None | N/A |
65
+ | **Cline** | None | None | None | None | N/A |
66
+ | **Devin** | Task-specific | None | Some Docker | None | None |
67
+
68
+ ## Design
69
+
70
+ ### Architecture
71
+
72
+ The changes integrate into 4 existing PAN workflow stages:
73
+
74
+ ```
75
+ Research Phase ──► Plan Phase ──► Execute Phase ──► Verify Phase
76
+ │ │ │
77
+ [NEW: detect [NEW: test tier [NEW: test-criteria
78
+ external deps, table required, alignment check,
79
+ propose Docker plan-checker behavioral coverage
80
+ Compose] validates tiers] validation]
81
+ │
82
+ [NEW: phase-tests
83
+ generates integration
84
+ scaffolding + Playwright]
85
+ ```
86
+
87
+ ### Test Tier Model
88
+
89
+ Plans must classify tests into tiers that map to infrastructure needs:
90
+
91
+ | Tier | Scope | Infrastructure | Example |
92
+ |---|---|---|---|
93
+ | **T1: Unit** | Pure functions, data structures | None | `csv_field("a,b")` returns `"\"a,b\""` |
94
+ | **T2: Integration** | Code + external service | Docker container | `get_server_info(&mut client)` returns real server version |
95
+ | **T3: E2E** | Full CLI/UI end-to-end | Docker + built binary | `sqla discover -c "..." -d TestDB` outputs JSON with tables |
96
+ | **T4: Visual/UI** | Browser-rendered UI flows | Playwright (headed) | Navigate to dashboard, verify chart renders with real data |
97
+
98
+ ### Criteria-to-Tier Mapping Rules
99
+
100
+ Success criteria language maps to minimum test tier:
101
+
102
+ | Criterion Pattern | Minimum Tier | Rationale |
103
+ |---|---|---|
104
+ | "User can run X and see Y" | T3 (E2E) | Observable behavior requires real execution |
105
+ | "X connects to Y" | T2 (Integration) | Connection requires real service |
106
+ | "X returns/produces Y format" | T1 (Unit) if pure transform, T2 if from external data | Depends on data source |
107
+ | "User sees X in browser/UI" | T4 (Visual) | Requires rendered UI |
108
+ | "X handles errors gracefully" | T2 (Integration) | Error paths need real failure injection |
109
+
110
+ ### Docker Detection Heuristics
111
+
112
+ During research phase, detect external dependencies by scanning:
113
+
114
+ | Language | Dependency Indicators | Docker Image |
115
+ |---|---|---|
116
+ | Rust | `tiberius`, `sqlx`, `diesel` in Cargo.toml | `mcr.microsoft.com/mssql/server:2022-latest` |
117
+ | Rust | `redis`, `fred` in Cargo.toml | `redis:7-alpine` |
118
+ | Node.js | `pg`, `mysql2`, `mssql` in package.json | Respective DB images |
119
+ | .NET | `Microsoft.EntityFrameworkCore.SqlServer` | `mcr.microsoft.com/mssql/server:2022-latest` |
120
+ | Python | `psycopg2`, `sqlalchemy` in requirements.txt | `postgres:16-alpine` |
121
+ | Any | `rabbitmq`, `amqplib` | `rabbitmq:3-management` |
122
+ | Any | Frontend framework (React, Vue, Svelte, Flutter) | Playwright browsers |
123
+
124
+ ### Playwright Scaffolding
125
+
126
+ For web frontend projects, generate:
127
+
128
+ 1. `playwright.config.ts` with headed mode default for development:
129
+ ```typescript
130
+ headless: process.env.CI === 'true' // headed locally, headless in CI
131
+ video: 'on-first-retry'
132
+ trace: 'on-first-retry'
133
+ ```
134
+
135
+ 2. Page object models matching planned UI components
136
+ 3. E2E flows matching success criteria ("User can navigate to X and see Y")
137
+ 4. Visual regression baseline configuration
138
+
139
+ ## Feature Ladder
140
+
141
+ | Version | Scope | Value | Effort |
142
+ |---|---|---|---|
143
+ | **v0 (MVP)** | Test tier table in plan template + plan-checker validation | Plans explicitly declare test strategy; checker flags unit-only for behavioral criteria | M |
144
+ | **v1** | Verifier test-criteria alignment + Docker detection in research | Verifier rejects hollow coverage; research auto-proposes Docker Compose | L |
145
+ | **v2** | phase-tests integration scaffolding + Playwright generation | Full test infrastructure scaffolded automatically per project type | XL |
146
+
147
+ ## Implementation Tasks
148
+
149
+ | # | ID | Title | Files | Effort | Pts | Priority |
150
+ |---|---|---|---|---|---|---|
151
+ | 1 | T.1 | Add test tier table to plan template | `templates/summary-*.md`, `templates/phase-prompt.md` | S | 2 | P0 |
152
+ | 2 | T.2 | Add test tier table to planner agent prompt | `agents/pan-planner.md` | S | 2 | P0 |
153
+ | 3 | T.3 | Plan-checker: validate test-criteria alignment | `agents/pan-plan-checker.md` | M | 4 | P0 |
154
+ | 4 | T.4 | Verifier: check behavioral criteria have integration/E2E tests | `agents/pan-verifier.md` | M | 4 | P1 |
155
+ | 5 | T.5 | Verifier: flag phases with no verification.md when verifier is enabled | `agents/pan-verifier.md`, `workflows/verify-phase.md` | S | 2 | P1 |
156
+ | 6 | T.6 | Research agent: detect external dependencies from project files | `agents/pan-project-researcher.md`, `agents/pan-phase-researcher.md` | M | 4 | P1 |
157
+ | 7 | T.7 | Research agent: propose Docker Compose for detected dependencies | `templates/research-project/stack.md`, `agents/pan-project-researcher.md` | M | 4 | P1 |
158
+ | 8 | T.8 | phase-tests: generate integration test scaffolding per language | `workflows/phase-tests.md`, `commands/pan/phase-tests.md` | L | 6 | P2 |
159
+ | 9 | T.9 | phase-tests: scaffold Playwright config for web frontends | `workflows/phase-tests.md`, `commands/pan/phase-tests.md` | M | 4 | P2 |
160
+ | 10 | T.10 | phase-tests: generate Docker Compose from research artifacts | `workflows/phase-tests.md` | M | 4 | P2 |
161
+ | 11 | T.11 | phase-tests: generate seed data SQL/scripts for detected databases | `workflows/phase-tests.md` | M | 4 | P2 |
162
+ | 12 | T.12 | Verification gate: prevent auto-advance when verifier=true but no verification.md | `workflows/exec-phase.md`, `pan-wizard-core/bin/lib/verify.cjs` | M | 4 | P1 |
163
+ | 13 | T.13 | Tests for T.1-T.5 (template + agent prompt validation) | `tests/` | M | 4 | P0 |
164
+ | 14 | T.14 | Tests for T.6-T.7 (research dependency detection) | `tests/` | M | 4 | P1 |
165
+ | 15 | T.15 | Tests for T.8-T.12 (phase-tests scaffolding) | `tests/` | M | 4 | P2 |
166
+
167
+ ### Dependency Graph
168
+
169
+ ```
170
+ T.1 + T.2 ──► T.3 ──► T.13 (tests)
171
+ │
172
+ T.4 + T.5 ──► T.12 ──► T.14 (tests)
173
+ │
174
+ T.6 + T.7 ──► T.8 + T.9 + T.10 + T.11 ──► T.15 (tests)
175
+ ```
176
+
177
+ ### Execution Waves
178
+
179
+ ```
180
+ Wave 1 (P0, 8 pts): T.1 + T.2 + T.3 — plan template + checker
181
+ Wave 2 (P0, 4 pts): T.13 — tests for Wave 1
182
+ Wave 3 (P1, 14 pts): T.4 + T.5 + T.6 + T.7 + T.12 — verifier + research + gate
183
+ Wave 4 (P1, 4 pts): T.14 — tests for Wave 3
184
+ Wave 5 (P2, 18 pts): T.8 + T.9 + T.10 + T.11 — phase-tests scaffolding
185
+ Wave 6 (P2, 4 pts): T.15 — tests for Wave 5
186
+
187
+ Total: 52 pts across 6 waves
188
+ ```
189
+
190
+ ## Test Plan
191
+
192
+ | Level | Count | What It Catches |
193
+ |---|---|---|
194
+ | Unit | 10+ | Template has test tier table, planner prompt includes tier guidance |
195
+ | Unit | 5+ | Plan-checker detects missing integration tier for behavioral criteria |
196
+ | Unit | 5+ | Verifier flags hollow test coverage (unit-only for DB project) |
197
+ | Unit | 5+ | Research agent detects tiberius/sqlx/pg and proposes Docker |
198
+ | Integration | 5+ | phase-tests generates working Docker Compose + integration test files |
199
+ | Integration | 3+ | Playwright config generated with correct headed/headless settings |
200
+
201
+ ## Risk Register
202
+
203
+ | Risk | Probability | Impact | Mitigation |
204
+ |---|---|---|---|
205
+ | Plan-checker too aggressive — flags projects that genuinely only need unit tests | Medium | Medium | Tier requirement only triggers when success criteria contain behavioral language ("User can run/see/connect") |
206
+ | Docker Compose generation incorrect for edge cases | Low | Low | Template-based generation with well-tested heuristics; user can edit |
207
+ | Playwright scaffolding breaks for non-standard frontend setups | Medium | Low | Conservative detection (only well-known frameworks); fallback to manual setup instructions |
208
+ | Auto-advance prevention too strict | Low | Medium | Only enforced when `workflow.verifier: true` in config.json; can be disabled |
209
+ | Integration test scaffolding generates non-compiling code | Medium | Medium | Language-specific templates tested against real project structures; includes TODO markers |
210
+
211
+ ---
212
+
213
+ *Generated by /pan:audit-deployment — 2026-03-09*
@@ -0,0 +1,362 @@
1
+ # PAN Wizard Work Plan — Reality Check 2026-09
2
+
3
+ **Generated:** 2026-09-10 (evening) · **Tree:** `feat/market-delta-2026-09-s1` @ `5684d38` (v3.27.0 + unreleased commits; PR #29 open, every check green, mergeable) · **Source:** the first `/reality-check` run, recorded as §9 of [ECOSYSTEM-REVIEW-2026-08.md](../ECOSYSTEM-REVIEW-2026-08.md) and as the Addendum (findings RC1–RC23, items R1–R20) of [market-delta-2026-09-superplan.md](market-delta-2026-09-superplan.md). This plan expands every one of those items into implementation steps a session can execute with `/execplan`, and adds R21 so the one parked finding has a protocol instead of a shrug.
4
+
5
+ > **Counts doctrine.** Per CLAUDE.md this file carries no filesystem-derived counts; the baseline points at the counts table and the commands that reproduce each result. **Point-in-time.** Every line-number anchor below was read on 2026-09-10 — re-grep before editing, the tree moves (`git rev-parse HEAD && git status --porcelain`). **Branching.** PR #29 carries S1–S5 and the harness; start this plan on a fresh branch off `main` once #29 merges (`feat/reality-check-2026-09`), not on top of #29.
6
+
7
+ ---
8
+
9
+ ## Baseline (Phase 0)
10
+
11
+ | Metric | Value | Reproduce |
12
+ |---|---|---|
13
+ | Version | `package.json` (3.27.0 at generation) | `node -p "require('./package.json').version"` |
14
+ | Suite | fully green, no skips, roughly half a minute | `npm run test:all` |
15
+ | Release gates | all eight passed | `node scripts/release-check.js` |
16
+ | Harness, model-free tier | every runnable scenario passed; Codex, Copilot and Antigravity live gates skipped (no CLI here) | `npm run harness` |
17
+ | Harness, model tier (concurrent run, not this session's) | markdown exec-phase chain three of five reps; native chain unmeasured (budget-starved pre-`87e53c9`) | `d:/pantesting/harness-runs/run-20260910-190841-i1aw/report.md` |
18
+ | CI | PR #29 green on the full matrix, CodeQL, gitleaks, audit | `gh pr view 29 --json statusCheckRollup` |
19
+ | Unreleased work | every commit since the tag | `git log v3.27.0..HEAD --oneline` |
20
+ | Open TODOs in shipped source | none beyond decomposition breadcrumbs and the todo feature's own patterns | `grep -rnE "TODO\|FIXME\|HACK" bin pan-wizard-core/bin --include=*.js --include=*.cjs` |
21
+ | Rate table | matches the pricing page; verified today | `node pan-wizard-core/bin/pan-tools.cjs models check` |
22
+
23
+ Counts (tests, suites, commands, agents, modules, specs, ADRs) live only in `CLAUDE.md`'s table; refresh it with the snippet at the top of that file after any session that adds a test file or a spec.
24
+
25
+ ---
26
+
27
+ ## Coverage map — every finding has an item
28
+
29
+ | Finding | Item(s) | Finding | Item(s) |
30
+ |---|---|---|---|
31
+ | RC1 Fable-default claim false | R1 | RC13 stray `nul/` | R11 |
32
+ | RC2 `validate health` exit 0 on broken | R2 | RC14 TROUBLESHOOTING precision | R12 |
33
+ | RC3 F13 false (BMAD, GSD) | R3 (done) | RC15 Copilot `model:` lists | R13 |
34
+ | RC4 README location prompt | R4 | RC16 Antigravity variant | R14 |
35
+ | RC5 README hook count | R4 | RC17 gsd-core shares `.planning/` | R15 |
36
+ | RC6 COMPARISON stale/false | R5 (partly done) | RC18 one core copy per runtime dir | R16a, R16b |
37
+ | RC7 README claims weakened | R4 | RC19 body budget (parked item 11) | R21 |
38
+ | RC8 OpenCode path undocumented; no OpenCode/Gemini live gates | R6 | RC20 behavioural claims without scenarios | R17 |
39
+ | RC9 four priced models unrated | R7 | RC21 roster (OpenSpec, gsd-core, Taskmaster) | R18 (done) |
40
+ | RC10 zero-dep unpinned | R8 | RC22 markdown chain three of five | R19 |
41
+ | RC11 server version literal | R9 | RC23 phantom probe findings | R20 |
42
+ | RC12 stale bundle ships silently | R10 | | |
43
+
44
+ ---
45
+
46
+ ## Priority classes and sizes (Phases 1 and 3)
47
+
48
+ **P0 BROKEN** · **P1 WRONG** (silent incorrect output, false docs) · **P2 STABILITY** · **P3 MISSING TESTS** · **P4 FEATURE GAPS** · **P5 NEW FEATURES** · **P6 DOCUMENTATION** · **P7 POLISH**. Sizes: XS 1 · S 2 · M 4 · L 10 · XL 20. No P0: the suite, the gates and the installer are green.
49
+
50
+ **Rules every item obeys.** (1) A behavioural change ships with a test that was seen red first — break the fix, watch the named assertion fail, restore (the revert-proof column). (2) Nothing installs into the source repo; every install goes to `d:\pantesting`. (3) Counts stay in CLAUDE.md; evergreen docs name models by capability; dated files (CHANGELOG, specs, ADRs, ECOSYSTEM-REVIEW) may name versions. (4) A market claim in code or docs carries a primary-source URL and the date read. (5) Generated docs (`docs/SKILLS-*.md`) are regenerated, never hand-edited.
51
+
52
+ ---
53
+
54
+ ## Items (Phase 3) — detailed
55
+
56
+ ### R1 · P1 · XS (1) — Reword the "Claude Code's default" claim
57
+
58
+ **Finding.** RC1. `code.claude.com/docs/en/model-config` (read 2026-09-10): "Neither Fable model is the account-type default on any plan or provider." `default` is Opus 5 (Max, Team Premium, Enterprise, API, Bedrock, Google Cloud) or Sonnet 5 (Pro, Team Standard); the `fable` and `best` aliases resolve to Fable 5.1. The rate row and the flagship bump are right; the stated reason is wrong in three places that ship.
59
+
60
+ **Files.** `CHANGELOG.md` `[Unreleased]` intro and the section "Fixed — the rate table on the current default model"; `pan-wizard-core/bin/lib/cost.cjs` comment block above the `claude-fable-5-1` row.
61
+
62
+ **Steps.**
63
+ 1. CHANGELOG: retitle the section "Fixed — the rate table on the model the `fable` and `best` aliases resolve to". Replace "the model Claude Code now defaults to", "Claude Code defaults to since 2.1.257" and "follows Claude Code's default" with alias language, and add one sentence quoting the model-config page with the date read.
64
+ 2. `cost.cjs`: change "4× too high on the model Claude Code now defaults to" to "4× too high on the model the `fable`/`best` aliases resolve to (model-config, read 2026-09-10: neither Fable model is a plan default)".
65
+ 3. `bin/install.js` `RECOMMENDED_MODELS`: confirm the comment makes no default claim (it does not today); leave it.
66
+ 4. Do not rewrite F2/1b in the September superplan — the Addendum's "Corrections to this plan" already records it; frozen rows stay frozen.
67
+
68
+ **Tests / gate.** `grep -nE "Claude Code.*default" CHANGELOG.md pan-wizard-core/bin/lib/cost.cjs` returns nothing near Fable. CHANGELOG is lint-exempt, so the gate is the grep plus a read.
69
+
70
+ **Revert-proof.** Not applicable (prose). **Status.** Done `2026-09-10` (commit c35c41d).
71
+
72
+ ### R2 · P1 · S (2) — `validate health` sets its exit code
73
+
74
+ **Finding.** RC2. `cmdValidateHealth` (`pan-wizard-core/bin/lib/verify.cjs`, from line 1280) calls `output()` twice without an exit code — the early return when `.planning/` is missing (status `broken`, E001) and the final `output(result, raw)` near line 1421. `output()` derives the code from the error family (`error`, `*_error`); the health payload's `errors[]` is a plural collection outside it, so a `broken` verdict exits 0. `docs/CLI-REFERENCE.md` states verdict commands set the code explicitly, and `reconcile` does (`verify.cjs` line 511). No test pins the health exit code.
75
+
76
+ **Files.** `verify.cjs` (both `output` sites); `tests/exit-code-contract.test.cjs` (real-CLI spawn pattern) or `tests/verify-health-codes.test.cjs`; `docs/CLI-REFERENCE.md` (`validate health` entry); `pan-wizard-core/workflows/health.md` (reads JSON; unaffected, verify).
77
+
78
+ **Steps.**
79
+ 1. In `cmdValidateHealth`, compute `const exitCode = status === HEALTH_STATUS.BROKEN ? 1 : 0` after the status is decided (and after `--repair` has run, so the code reflects the post-repair state), and pass it as `output(result, raw, undefined, exitCode)` at both sites. `degraded` exits 0 — warnings are not failures; write that rule in a comment.
80
+ 2. Decide against a new `uninitialized` status for E001 in this item: `HEALTH_STATUS` (`constants.cjs` line 539) has three values, `health.md` documents those three, and `tests/verify-health-codes.test.cjs` is driven from the CLI-REFERENCE code table. Keep `broken` + E001, exit 1. Record the optional follow-up (a fourth status, with the doc table, the workflow and the test updated together) in the item's closing note.
81
+ 3. CLI-REFERENCE: add "Exit code: 1 when `status` is `broken`, 0 otherwise" to the `validate health` entry.
82
+ 4. Confirm callers: `grep -rn "validate health" hooks commands pan-wizard-core/workflows bin` shows only `health.md` (JSON parse) and `links.md` (prose). Nothing gates on exit 0.
83
+
84
+ **Tests.** In `tests/exit-code-contract.test.cjs`, a block "validate health is a verdict": spawn the real CLI in a temp dir with no `.planning/` → exit 1 and `status: broken`; in a scaffolded healthy tree (`pan-tools init` in the temp dir, or the fixture `tests/verify-health.test.cjs` already uses) → exit 0. **Revert-proof.** Remove the fourth argument at one site → the corresponding assertion fails.
85
+
86
+ **Status.** Done `2026-09-10` (commit f34423b).
87
+
88
+ ### R3 · P1 · XS (1) — F13 correction · **Done 2026-09-10**
89
+
90
+ Recorded in the Addendum ("Corrections to this plan") and §9. **Verify:** `grep -n "open-gsd/gsd-core" docs/specs/market-delta-2026-09-superplan.md docs/ECOSYSTEM-REVIEW-2026-08.md` finds both.
91
+
92
+ ### R4 · P6 · M (4) — README accuracy pass
93
+
94
+ **Finding.** RC4, RC5, RC7 (the claims audit's FALSE and WEAKENED rows). Line anchors are from 2026-09-10; re-grep each phrase before editing.
95
+
96
+ **Files.** `README.md`; `docs/COMPARISON.md` (the builtins list).
97
+
98
+ **Steps.**
99
+ 1. Install steps (near line 133): replace the "Location — Global or local" prompt bullet with "Location defaults to the current project (`--local`); pass `--global` for your home config directory" — the installer prompts for runtime only (`bin/install.js` runtime prompt block near line 3110).
100
+ 2. Docs table (near line 886): "5 built-in hooks" → "the built-in hooks" (counts doctrine; six ship).
101
+ 3. Bot army (hero line near 7, section near 79): add "on Claude Code" — `agents/pan-conductor.md` line 3 says Claude Code only; `--hierarchical` falls back to flat elsewhere.
102
+ 4. Fresh-context spawning (near 59, 364, 526, 587): qualify "on Claude Code; other runtimes delegate through their native agent mechanism" — `install-lib.cjs` rewrites `Task(...)` to a prose adapter (lines 423–425, 460–462, 712–714).
103
+ 5. Atomic commits (near 365, 553–565): "one commit per task; consecutive trivial chore or docs tasks may be coalesced (P-1605, `agents/pan-executor.md` 340–349)".
104
+ 6. Plan-checker loop (near 347, 525): "up to three revision passes, then the remaining issues come to you" (`workflows/plan-phase.md` 466–509).
105
+ 7. map-codebase (near 288): "single-shot with one agent for repositories under the sharding threshold; six-way sharded above it" (`commands/pan/map-codebase.md` 53–60).
106
+ 8. `mode` / `depth` (near 727): "chosen at `/pan:new-project`; they are not config defaults" (`config.cjs` defines neither).
107
+ 9. "every agent runs on the model you launched with" (near 740): add "except the reviewer-class agents, which pin a reasoning-tier model (see USER-GUIDE)". Write by capability — no family or version name (the model-version-drift lint and the role-claim guard both scan README).
108
+ 10. Caps and abort (near 104): "enforced by the conductor's protocol; the MCP `pan_next_action` path enforces caps in code" (`agents/pan-conductor.md` 27–35; `orchestrator.cjs` 126).
109
+ 11. Scheduled campaign (near 106): "the daily budget is advisory unless `budget.enforce` is set, and an external scheduler triggers `--continue`" (`config.cjs` 64–69; `campaign.cjs` 2–6).
110
+ 12. COMPARISON builtins list (line 45): add `readline`.
111
+
112
+ **Tests / gate.** `node --test tests/doc-lint.test.cjs tests/model-version-drift.test.cjs` green; re-run the skill's Phase 1.2 claims audit → no FALSE row, and every WEAKENED row now carries its qualifier in the README. **Status.** Done `2026-09-10` (commit a9df350).
113
+
114
+ ### R5 · P6 · M (4) — COMPARISON.md refresh (remainder)
115
+
116
+ **Finding.** RC6. Done today: the MCP row, "Leads" items 3–5, the date line, a dated verification note. Remaining: the matrix columns and PAN's understated rows.
117
+
118
+ **Files.** `docs/COMPARISON.md`.
119
+
120
+ **Steps.**
121
+ 1. Columns: rename Windsurf to "Devin Desktop (formerly Windsurf; Cascade removed September 2026)"; mark Continue.dev "(repository read-only since June 2026)" or drop the column; mark Aider "(dormant; no release since 2025)"; refresh Cline (4.x subagents, Agent Plugins discovery) and Cursor (3.0 parallel agents in worktrees, `/goal`) from their changelogs, each with the date read.
122
+ 2. PAN rows, from the audit's evidence: Multi-Agent (army, `--hierarchical`, four native Claude Code workflow scripts), Git (`/pan:git` subcommands, branching strategies, worktrees, revert-only release), Cost (ledger, rate table, `/pan:phase-budget`, campaign budgets), Cross-Platform (hooks on four runtimes, unified tree, both plugin bundles), Session (stop-guard, hygiene, `health --repair`, campaigns), Context (statusline and context-monitor hooks, `learn topics-for`), Plan Verification (twelve checker dimensions), Codebase Awareness (single-shot vs sharded, native `pan-map-codebase`).
123
+ 3. New section "Direct peers — spec-driven layers": a table of Spec Kit, BMAD, gsd-core, Superpowers and OpenSpec against Appendix C of the skill (durable state, research, plan verification, UAT, deterministic orchestration, harness, distribution, MCP, runtimes, cost routing), each cell dated. Source data: the peer agent's grid in the run and each project's releases page.
124
+ 4. "Leads" item 1 (context-rot prevention): read gsd-core's executor workflow before keeping "no competitor solves this"; if it spawns per-plan executors, rewrite the item as a shared strength with PAN's differentiator (learnings-scoped context, stop-guard).
125
+ 5. Collapse the two-date "Last verified" line to one date once every row has been touched.
126
+
127
+ **Gate.** No "no competitor" or "nobody else" phrase remains without a dated check (`grep -nE "no competitor|nobody else|every competitor" docs/COMPARISON.md`); doc-lint and model-drift green. **Status.** Done `2026-09-10` (commit b9ca497).
128
+
129
+ ### R6 · P3 · S (2) — OpenCode and Gemini live gates; cite the loader
130
+
131
+ **Finding.** RC8. PAN writes `.opencode/opencode.json` (config-dir-relative `localPath` in `MCP_REGISTRATION.opencode`, `bin/install-lib.cjs` 1129–1130). The docs page lists only a repo-root `opencode.json`; the loader source (`packages/opencode/src/config/config.ts`, the branch `if (dir.endsWith(".opencode") …) for (const file of ["opencode.json","opencode.jsonc"])`) reads it. The `why` cites the docs page. The harness has live gates for Codex, Copilot and Antigravity only.
132
+
133
+ **Files.** `bin/install-lib.cjs` (`MCP_REGISTRATION.opencode.why`); `harness/scenarios/live-gate-opencode.json`, `harness/scenarios/live-gate-gemini.json`; `tests/mcp-registration.test.cjs`.
134
+
135
+ **Steps.**
136
+ 1. `why`: append "Loader source `packages/opencode/src/config/config.ts` reads `opencode.json`/`.jsonc` inside any `.opencode` directory (read 2026-09-10); the docs page lists only the repo-root file, so this path is live but undocumented — re-check the loader on OpenCode upgrades."
137
+ 2. `live-gate-opencode.json` (tier 0, `requires.cli: opencode`, seed `empty`, `install: ["--opencode","--local"]`): steps `cli opencode --version` → `exit:0`; `fs` read `.opencode/opencode.json` → `json:mcp.pan.type=local`; `cli opencode mcp list` → `exit:0`, `stdout~pan` if the subcommand exists — otherwise record stderr as the evidence (the Antigravity gate's "either outcome is information" pattern). Follow `live-gate-codex.json` for shape and `why` text.
138
+ 3. `live-gate-gemini.json` (tier 0, `requires.cli: gemini`, `install: ["--gemini","--local"]`): `cli gemini --version` → `exit:0`; `cli gemini mcp list` → `stdout~pan`; the `why` must say the workspace has to be trusted first (RC14) and name the flag or prompt that trusts it.
139
+ 4. Pin the `why` in `tests/mcp-registration.test.cjs`: the opencode row's rationale names `config.ts`.
140
+
141
+ **Gate.** `npm run harness` shows both scenarios SKIPPED with reason on this machine; they pass on a machine with the CLIs (record the run id in the ledger). **Revert-proof.** Remove `config.ts` from the `why` → the pin fails. **Status.** Done `2026-09-10` (commit 5320552).
142
+
143
+ ### R7 · P2 · S (2) — Rate rows for four priced models
144
+
145
+ **Finding.** RC9. `resolveRate` returns `null` for `claude-mythos-5-1`, `claude-mythos-5`, `claude-opus-4-5-20251101`, `claude-sonnet-4-5-20250929`; all are on `platform.claude.com/docs/en/about-claude/pricing` (read 2026-09-10): Mythos 5.1 $10/$50, cache read $0.25, write $12.50; Mythos 5 $10/$50/$1/$12.50; Opus 4.5 $5/$25/$0.50/$6.25; Sonnet 4.5 $3/$15/$0.30/$3.75.
146
+
147
+ **Files.** `pan-wizard-core/bin/lib/cost.cjs` (`DEFAULT_RATES`, lines 57–69); `tests/cost.test.cjs`.
148
+
149
+ **Steps.**
150
+ 1. Add rows `claude-mythos-5-1`, `claude-mythos-5`, `claude-opus-4-5`, `claude-sonnet-4-5` with the numbers above and a comment citing the pricing page and the date. Mythos 5.1 shares Fable 5.1's 0.025× cache-read convention — say so in the comment (the pricing footnote names both).
151
+ 2. Leave `RATES_VERIFIED_AT` at `2026-09-10`. Put the pricing-page URL in the commit message (the rule from the September plan).
152
+
153
+ **Tests.** Dated ids resolve via `familyPrefixRate` (line 108) to the new rows: `claude-opus-4-5-20251101` → the 4.5 row, not a 4.x neighbour; `claude-sonnet-4-5-20250929` → the 4.5 row; `claude-mythos-5-1` differs from `claude-mythos-5` (copy the `claude-fable-5-1` longest-prefix test at lines 53–70). **Revert-proof.** Delete one row → its test fails. **Status.** Done `2026-09-10` (commit 1d42428).
154
+
155
+ ### R8 · P3 · XS (1) — Pin "zero runtime dependencies"
156
+
157
+ **Finding.** RC10. No test or gate asserts `package.json` has no `dependencies`.
158
+
159
+ **Files.** New `tests/package-contract.test.cjs`; `scripts/release-check.js` Gate 6.
160
+
161
+ **Steps.**
162
+ 1. Test: `require('../package.json').dependencies` is undefined or empty; `files` excludes `dist/`, `harness/`, `marketplace/`; `bin` points at `bin/install.js`.
163
+ 2. Gate 6 (npm pack size sanity, line 128): add one line failing the gate when `dependencies` is non-empty, with the reason "PAN ships zero runtime dependencies (README, COMPARISON)".
164
+ 3. Refresh the CLAUDE.md counts table (unit test files row) via the snippet.
165
+
166
+ **Revert-proof.** In a temp copy of `package.json` with `"dependencies": {"x":"1"}`, the test fails. **Status.** Done `2026-09-10` (commit 79582dc).
167
+
168
+ ### R9 · P7 · XS (1) — MCP server reports the package version
169
+
170
+ **Finding.** RC11. `SERVER_INFO = { name: 'pan-mcp', version: '0.1.0' }` (`pan-wizard-core/mcp/server.cjs` line 53) while the package is 3.27.0. Tests check only the name (`tests/pan-zcode-mcp.test.cjs` lines 131, 233).
171
+
172
+ **Steps.**
173
+ 1. `readPackageVersion()`: try `path.join(__dirname, '..', '..', 'package.json')` — the repo root in the source tree, the runtime directory in an install (the installer writes `package.json` beside `pan-wizard-core/`), absent in the plugin bundle; fall back to the plugin manifest at `../../.claude-plugin/plugin.json` if present, else the literal `0.0.0-unknown`. Read once at module load, never throw.
174
+ 2. `SERVER_INFO.version = readPackageVersion()`; keep the export.
175
+
176
+ **Tests.** In `pan-zcode-mcp.test.cjs`, `initialize` returns `serverInfo.version === require('../package.json').version`; a test with a fake `__dirname` layout lacking both files gets the fallback. Optionally extend `harness/scenarios/mcp-bridge-cwd.json` with `rpc:<id>.result.serverInfo.version=<pkg>` if the runner exposes the package version to `expect` templates (check `fill()` vars first). **Revert-proof.** Restore the literal → the equality fails. **Status.** Done `2026-09-10` (commits ab50f06, 27945f2).
177
+
178
+ ### R10 · P4 · S (2) — Stale Agent Plugins bundle cannot ship
179
+
180
+ **Finding.** RC12. `.agents/plugins/marketplace.json` and `.github/plugin/marketplace.json` resolve to `./dist/pan-agent-plugin`; release Gate 8 builds both bundles into a temp dir (`scripts/release-check.js` 196–215) and never looks at `dist/`; `dist/pan-agent-plugin/` was observed stale today (built before the S3 vendor-directory commit). The Claude `command` source rebuilds on resolve; the Agent Plugins sources cannot.
181
+
182
+ **Files.** `scripts/release-check.js` (Gate 8); a pure helper `dirDigest(dir)` (file list + sha256) in `bin/install-lib.cjs` or a new `scripts/lib/dir-digest.cjs`; `marketplace/README.md` (line 141 area); tests.
183
+
184
+ **Steps.**
185
+ 1. After building `agentOut` in Gate 8: if `dist/pan-agent-plugin/` exists and `dirDigest(dist) !== dirDigest(agentOut)`, fail the gate with "dist/pan-agent-plugin is stale — run `npm run build:agent-plugin` (the Codex and Copilot marketplaces install from it)". The gate stays read-only: it never writes `dist/`.
186
+ 2. Apply the same comparison to `dist/pan-wizard-plugin/` as a warning only (the Claude marketplace rebuilds on resolve).
187
+ 3. `marketplace/README.md`: one paragraph — build the bundle before any local Codex or Copilot install, and the release gate now refuses a stale one.
188
+
189
+ **Tests.** Unit test for `dirDigest` (order-independent, content-sensitive); a release-check test that seeds a stale `dist/` copy in a temp checkout and sees the gate go red (the plugin-marketplace test's harness pattern). **Revert-proof.** Touch one byte in `dist/pan-agent-plugin/plugin.json` → Gate 8 fails. **Status.** Done `2026-09-10` (commit fecb9d2).
190
+
191
+ ### R11 · P7 · XS (1) — Remove the stray `nul/` directory · user action
192
+
193
+ **Finding.** RC13. `D:\PanWizard\nul\` holds an npm cache (`_cacache`, `_logs`) created 2026-08-21; git cannot open it and warns on every command.
194
+
195
+ **Steps.**
196
+ 1. From cmd (Windows reserved name, extended-path form): `rd /s /q \\?\D:\PanWizard\nul`.
197
+ 2. Find the cause so it does not recur: `grep -rnE "cache[= ]+nul|NPM_CONFIG_CACHE|> ?nul\b" scripts package.json .github tests` — a PowerShell `> nul` redirection or a `--cache nul` argument run through Git Bash creates a real path named `nul`.
198
+ 3. Verify `git status` prints no warning.
199
+
200
+ **Status.** Open (user action; Claude does not delete directories it did not create).
201
+
202
+ ### R12 · P6 · XS (1) — TROUBLESHOOTING precision
203
+
204
+ **Finding.** RC14, from the runtime re-verification.
205
+
206
+ **Files.** `docs/TROUBLESHOOTING.md`: "The `pan` MCP server is missing on Gemini CLI in a fresh checkout" (near line 937), "Per-agent `effort:` appears to have no effect" (near 637), and a note near the update/upgrade guidance.
207
+
208
+ **Steps.**
209
+ 1. Gemini: in an untrusted folder the whole project `.gemini/settings.json` is skipped, so PAN's hooks are absent too, not only the MCP server (trusted-folders doc plus release `0.59.0`, read 2026-09-10).
210
+ 2. Effort: a `maxEffortLevel` setting (top-level or per model under `modelSettings`, Claude Code `2.1.267`) can clamp PAN's `effort:` frontmatter; check it before assuming the frontmatter is ignored.
211
+ 3. Codex: since `0.154.0`, live sessions pick up plugin skill and hook changes after an upgrade without a restart; a stale skill after `pan-check-update` is therefore not a Codex caching issue.
212
+
213
+ Write by capability where a model is involved; runtime version numbers are fine. **Gate.** `node --test tests/model-version-drift.test.cjs tests/doc-lint.test.cjs` green. **Status.** Done `2026-09-10` (commit 2f36176).
214
+
215
+ ### R13 · P5 · S (2) — Copilot agent `model:` fallback lists · gated
216
+
217
+ **Finding.** RC15. Copilot CLI `1.0.83` custom agents accept a `model:` list tried in order and `model-policy: required` (`docs.github.com` custom-agents page, read 2026-09-10). `convertClaudeToCopilotAgent` (`bin/install-lib.cjs` from line 742) emits `name`, `description` and `tools` only; three agents pin a model (`agents/pan-hardener.md`, `pan-meta-reviewer.md`, `pan-reviewer.md`).
218
+
219
+ **Steps.**
220
+ 1. Re-read the Copilot page for the exact field names and accepted model ids (Copilot spells them with dots, e.g. `claude-fable-5.1`); record the URL and date in a code comment.
221
+ 2. Add a Copilot row to `PROVIDER_MODELS` in `pan-wizard-core/bin/lib/core.cjs` if absent (tier → Copilot id), so the converter maps a pinned tier to `[primary, fallback]` and emits `model:` as a YAML list plus `model-policy: prefer` (degrade gracefully; `required` would refuse to run when the model is unavailable).
222
+ 3. Emit only when a flag or config enables it (ADR-0028: unverified frontmatter waits for a live check); default off until the live gate below passes, then flip.
223
+
224
+ **Tests.** `tests/copilot-install.test.cjs`: list emitted when enabled, absent when disabled; non-pinned agents get no `model:`. **Gate.** Extend `live-gate-copilot.json` with a step that installs an agent carrying the list and checks Copilot accepts it (`copilot agent list` or the CLI's own validation output). **Revert-proof.** Disable the emission path → the enabled-case test fails. **Status.** Built `2026-09-10` (commit 194565c): the converter takes `modelLists` and emits the list plus `model-policy: prefer`; default output byte-identical. Not wired into the installer — the live probe in `live-gate-copilot.json` (writes a probe agent, asks `copilot agent list`) must pass first. Needs a machine with Copilot CLI.
225
+
226
+ ### R14 · P4 · M (4) — Antigravity: measure first, then variant if needed
227
+
228
+ **Finding.** RC16. ADR-0045 deferred an Antigravity variant (own `$schema` `https://antigravity.google/schemas/v1/plugin.json`, fields `name`/`description`/`$schema`, `mcp_config.json` not `mcp.json`, discovery in `.agents/plugins/` and `_agents/plugins/`). `live-gate-antigravity.json` exists and skips here. Superpowers documents `agy plugin install <github-url>` of a `.claude-plugin` repository, so Antigravity may load Claude-format plugins.
229
+
230
+ **Steps.**
231
+ 1. On a machine with `agy`: run `node harness/src/run.cjs --scenario live-gate-antigravity` (installs the Agent Plugins bundle). Then a second probe, added to the scenario as a separate step: `agy plugin install <path to dist/pan-wizard-plugin>` (Claude format). Record both outcomes in the ledger.
232
+ 2. Outcome "Claude plugin accepted": no variant; document the install line for Antigravity in `marketplace/README.md` and `docs/USER-GUIDE.md`; close.
233
+ 3. Outcome "both rejected": add step 8 to `scripts/build-agent-plugin.js` behind `--antigravity` (or a sibling `build-antigravity-plugin.js`), emitting `dist/pan-antigravity-plugin/` with `plugin.json` (three fields only), `mcp_config.json` (shape verified from `antigravity.google/docs/cli/plugins`, read on the day), `hooks.json`, `skills/` (unchanged), `agents/` and `rules/` as documented; reuse the existing converters (one compiler, two call sites). Conformance test mirroring `tests/agent-plugin-build.test.cjs` with the closed three-key schema pinned as a fixture.
234
+ 4. Add the emitted variant to Gate 8 and to the `.agents/plugins/` discovery path.
235
+
236
+ **Gate.** `live-gate-antigravity` passes with either the bundle or the variant. **Status.** Probe added `2026-09-10` (commit 194565c): `live-gate-antigravity.json` now also builds the Claude plugin and tries `agy plugin install` on it. Both outcomes are information; the variant is built only if both bundles are rejected. Needs a machine with `agy`.
237
+
238
+ ### R15 · P2 · M (4) — Recognise a foreign `.planning/` and refuse to touch it
239
+
240
+ **Finding.** RC17, sharpened. gsd-core writes `.planning/PROJECT.md`, `REQUIREMENTS.md`, `ROADMAP.md`, `STATE.md` in uppercase (its USER-GUIDE, read 2026-09-10) — exactly PAN's `LEGACY_UPPERCASE_FILES` (`pan-wizard-core/bin/lib/hygiene.cjs` line 68). `hygiene scan` will therefore report a gsd-core project as `legacy-filenames`, and `hygiene clean --apply` would **rename another tool's state files**. `validate health` cannot tell a foreign tree from a broken one. gsd-core also writes paths PAN never does — `MILESTONES.md`, `HANDOFF.json`, `.gsd-allow-shrink`, `forensics/`, `threads/`, `seeds/`, `ui-reviews/`, `sketches/`, `spikes/`, `onboarding/` — and a flat, dotted-key `config.json` (`workflow.discuss_mode`, `graphify.enabled`, `intel.enabled`, `hooks.workflow_guard`, `dynamic_routing`), where PAN's is nested.
241
+
242
+ **Files.** `pan-wizard-core/bin/lib/constants.cjs`, `hygiene.cjs`, `verify.cjs`, `init.cjs` (and the new-project workflow's preflight); `docs/CLI-REFERENCE.md` (health code table); `docs/TROUBLESHOOTING.md`; `docs/USER-GUIDE.md` (planning roots); tests and a fixture.
243
+
244
+ **Steps.**
245
+ 1. `constants.cjs`: `FOREIGN_PLANNING_MARKERS = { gsd: { files: ['HANDOFF.json','MILESTONES.md','.gsd-allow-shrink'], dirs: ['forensics','threads','seeds','ui-reviews','sketches','spikes','onboarding'], configKeys: ['graphify.enabled','intel.enabled','hooks.workflow_guard','workflow.discuss_mode','dynamic_routing'] } }` with the source URL and date in a comment.
246
+ 2. `hygiene.cjs`: `detectForeignPlanningTree(dir)` returns `{ tool, evidence[] }` when at least two markers match or any dotted config key is present. When detected: emit one `foreign-planning-tree` finding (severity `warn`, `fixable: false`, evidence listed), **skip** `legacy-filenames` entirely, and make `clean` refuse `rename-lowercase` with a hard message: "this `.planning/` belongs to gsd-core; PAN will not rename its files — give PAN its own tree with `--planning-dir` (ADR-0043)".
247
+ 3. `verify.cjs` `cmdValidateHealth`: when `.planning/` exists and is foreign, add error code `E00N FOREIGN_TREE` with the same fix text; add the row to the CLI-REFERENCE code table (the `verify-health-codes` test is driven from that table, so the doc and the code move together).
248
+ 4. `init.cjs` / new-project preflight: refuse to scaffold into a foreign tree; suggest `--planning-dir .planning-pan`.
249
+ 5. Docs: TROUBLESHOOTING "Another tool already owns `.planning/`"; USER-GUIDE planning-roots section gains the coexistence paragraph.
250
+
251
+ **Tests.** Fixture `tests/fixtures/foreign-planning/gsd/` (uppercase files, `HANDOFF.json`, dotted `config.json`): `hygiene scan` reports `foreign-planning-tree` and **no** `legacy-filenames`; `hygiene clean --apply` performs zero renames (assert the file names afterwards); `validate health` reports the new code and exits 1 (after R2). A PAN legacy tree (uppercase files, nested PAN config, no gsd markers) still gets `legacy-filenames` — both directions pinned. **Revert-proof.** Drop the marker check → the zero-rename assertion fails. **Status.** Done `2026-09-10` (commit a3c4f28).
252
+
253
+ ### R16a · P7 · S (2) — Decision: one core per project (ADR)
254
+
255
+ **Finding.** RC18. Every selected runtime directory carries its own full `pan-wizard-core` copy; `--unified-skills` adds a sixth at `.agents/pan-wizard-core/`. Measure with the skill's Phase 4.2 command on a packed install in `d:\pantesting`. ADR-0028 Phase 2 already made the shared core the runtime-neutral home for unified skills; the per-runtime copies remain for the proprietary command trees.
256
+
257
+ **Steps.** Write ADR-0048 with: context and the measurement command; options — (A) status quo, (B) local installs point every runtime's commands, hooks and MCP registration at `.agents/pan-wizard-core/` and drop the per-runtime copies, (C) links (rejected: Windows symlink privileges); costs of (B) — manifest ownership and ref-counted uninstall (exists for the shared tree), path rewriting in the converters (`rewriteSharedCoreMarkdown` exists), `--config-dir` custom dirs, hooks resolving the core relative to the runtime dir, `MCP_REGISTRATION` paths, and the fact that **global installs cannot share** (different runtime homes); the gate for (B) — `install-matrix` and `runtime-roundtrip` green, footprint measured before and after. **Status.** Done `2026-09-10` (commit 2444f61); decided the same evening — option A accepted, see the ADR.
258
+
259
+ ### R16b · P7 · L (10) — Implement the shared core for local installs · conditional
260
+
261
+ Only if ADR-0048 accepts (B). Steps live in the ADR; sequence: converters and path rewriting first (unit-tested), installer wiring second, uninstall third, harness `install-matrix` and the runtime round-trip scenario last. Own session. **Status.** Closed `2026-09-10` — ADR-0048 accepted option A; the duplication is an accepted cost with a recorded revisit trigger.
262
+
263
+ ### R17 · P3 · M (4) — Harness scenarios for the uncovered behavioural claims · blocked on spend
264
+
265
+ **Finding.** RC20. No scenario covers: research → plan → checker loop, UAT diagnosis, quick mode, pause and resume, bot army, unified-skills discovery, map-codebase modes. Only the `two-plan-phase` seed exists.
266
+
267
+ **Steps.**
268
+ 1. Seeds under `harness/seeds/`: `phase-needs-plan` (a roadmap with one unplanned phase), `uat-with-failure` (a `uat.md` carrying one failed truth), `small-repo` (for single-shot map-codebase).
269
+ 2. Scenarios (tier 1 or 2, each with a mutation fixture that proves it can fail, per ADR-0047): `plan-phase-checker-loop` (expects research and plan files plus a checker verdict), `uat-diagnose` (expects debugger findings and a fix plan), `quick-mode` (expects `.planning/quick/` artefacts and a commit), `pause-resume` (expects `.continue-here.md` then a resumed state), `map-codebase-single-shot` (expects `.planning/codebase/` documents from one agent), `unified-skills-discovery` (per runtime, `requires.cli`; ADR-0028 P4's live discovery gate).
270
+ 3. Size the caps from the README's measurement (a chain rep costs several dollars); run each new scenario five times.
271
+
272
+ **Gate.** Each scenario's mutation fixture is red before the real seed is green; the ledger records the run ids. **Status.** Built `2026-09-10` (commit fc0e16c): seeds `phase-needs-plan`, `uat-with-failure`, `small-repo`; scenarios `plan-phase-checker-loop`, `uat-diagnose-native`, `quick-mode`, `pause-resume`, `map-codebase-single-shot`, `unified-skills-discovery`. All validate; none has run — each needs `--max-usd`. The UAT path uses the native `/pan-diagnose-issues` because the markdown walkthrough is interactive.
273
+
274
+ ### R19 · P2 · M (4) — Run item 5c properly · blocked on spend
275
+
276
+ **Finding.** RC22. Run `run-20260910-190841-i1aw` (build `8e776bf`, twenty-dollar cap) completed the markdown chain in three of five reps: rep 4 exited non-zero with `passed=false`; rep 5 produced no summaries and no source files. The native chain was budget-starved before step 1 in every rep by the pre-`87e53c9` equal split.
277
+
278
+ **Steps.**
279
+ 1. `node harness/src/run.cjs --scenario markdown-exec-phase-chain --scenario native-exec-waves-chain --tier 2 --repeat 5 --max-usd 50 --keep` (the README's sizing for both chains together).
280
+ 2. Read the failed reps' workspaces under `ws/` and the `claude -p` JSON: find the drop point (which step the orchestrator skipped, or which tool call failed) and whether the stop-guard hook fired.
281
+ 3. Compare completion rates. Decision rule (from the August review): recommend the native path on Claude Code only if it completes at least as often as the markdown path.
282
+ 4. Record the result as a dated note in §9's successor and update the ledger; if the markdown path stays below five of five, open a P2 item against the drop point with the transcript as evidence.
283
+
284
+ **Gate.** Five reps each, one run, one build. **Status.** Done `2026-09-11`. Markdown `/pan:exec-phase`: five of five (mean $4.97, 14.4 min per rep; `run-20260910-214704-wgJSxr`). Native `/pan-exec-waves` under the lifted ceiling (R23, `run-20260910-235141-ITzx9T`): five of five, verification file in every rep (mean $4.71, 12.3 min). By the August rule the native path is the recommended one on Claude Code; USER-GUIDE says so with the numbers' provenance. Every native rep before the ceiling fix measured the ceiling (RC24), not the chain.
285
+
286
+ ### R20 · P3 · S (2) — A model step that never ran cannot file a finding
287
+
288
+ **Finding.** RC23. Two tier-1 runs of `plugin-agent-scope` spent nothing, finished in seconds and printed neither greppable line; the ledger now carries two findings the two-run rule will promote. `runModelStep` (`harness/src/model.cjs`) returns `costUsd`, `turns`, `durationMs`, `stdout`; `run.cjs` (lines 150–262) evaluates `expect` on the result regardless.
289
+
290
+ **Steps.**
291
+ 1. In `run.cjs`, after `runModelStep`: if `!r.refused && r.costUsd === 0 && (r.turns === null || r.turns === 0)`, set `rec.status = 'error'`, `rec.note = 'model step produced no turns and no spend — probe or harness fault: ' + stderr`, skip assertion evaluation, do not create findings, and let the run exit non-zero (an error is not green).
292
+ 2. Reproduce the probe: `node harness/src/run.cjs --scenario plugin-agent-scope --tier 1 --max-usd 1 --keep`, read `ws/` and the `claude -p` stderr (a missing `--plugin-dir`, a permissions refusal, or a plugin that never installed are the candidates); fix the scenario or the runner accordingly.
293
+ 3. Ledger: after the fix, a passing run resolves the two phantom findings. If the probe cannot be made to run here, withdraw them in a commit whose message states why (the PanLoop practice), rather than leaving promotable phantoms.
294
+
295
+ **Tests.** A unit test in the harness test file feeding a zero-turn, zero-cost result → status `error`, no findings, exit non-zero. **Revert-proof.** Remove the guard → the test fails. **Status.** Done `2026-09-10` (commit 5eb7ae7).
296
+
297
+ ### R21 · P7 · M (4) — Body-budget split, measured not guessed · blocked on a live session
298
+
299
+ **Finding.** RC19 (parked item 11). Five emitted skills exceed the Agent Skills body recommendation (`focus-design`, `focus-auto`, `focus-doc-audit`, `focus-drift-walking`, `pan-army` once the adapter header is added). The August note stands: a split changes what the agent reads and when, which a size check cannot verify.
300
+
301
+ **Steps.**
302
+ 1. Measure: on a packed install, run `/skill-doctor` in a live Claude Code session and record each PAN skill's context cost; keep the Phase 4.1 loop as the offline oracle.
303
+ 2. Split one offender, the largest (`commands/pan/focus-design.md`): activation instructions stay in the command; the procedural body moves to `pan-wizard-core/references/focus-design-procedure.md`, pulled by an `@` reference at the step that needs it (the tier-3 mechanism the compiler already uses).
304
+ 3. A/B at tier 1: the same `/pan:focus-design` prompt on the same seed, two reps each with the original and the split; compare the artefacts produced and the `cost` ledger tokens.
305
+ 4. Parity or better → apply the pattern to the other four and add a test that the emitted `SKILL.md` bodies stay under the recommendation; worse → record why in the item and re-park with the evidence.
306
+
307
+ **Gate.** Artefact parity and lower activation tokens, measured. **Status.** Measured `2026-09-10` (commit 0cfd82f, run `run-20260910-215459-NRyNkG`): control $1.61 and $1.79 (3.8 and 5.4 min), split $1.83 and $1.81 (6.2 and 6.7 min); same section structure, the split arm's specs ~30% longer. **Verdict: the split does not reduce the cost of using the command** (the body loads on invocation either way and the extra Read adds a turn) — it raises cost ~7% and time ~40%. The shipped layout stays; the variant remains in `harness/variants/` as the record. Item 11 closes: the Agent Skills body recommendation protects activation cost, and a PAN command's activation is its invocation. The `/skill-doctor` reading needs Claude Code 2.1.261 (this machine runs 2.1.233); the scenario is gated by `requires.minVersion` (commit bb52a4f).
308
+
309
+ ### R18 · P6 · XS (1) — Roster · **Done 2026-09-10**
310
+
311
+ Appendix B of `.claude/commands/reality-check.md` names gsd-core, OpenSpec and Taskmaster's dormancy; §9 carries the roster change. **Verify:** `grep -n "open-gsd/gsd-core\|Fission-AI/OpenSpec" .claude/commands/reality-check.md`.
312
+
313
+ ---
314
+
315
+ ## Session queue (Phase 4)
316
+
317
+ Items are small, so sessions are bounded by their blockers rather than by the forty-point budget; S6 and S7 fit one sitting each and can be run back to back.
318
+
319
+ | Session | Items | Pts | Theme | Exit criterion |
320
+ |---|---|---|---|---|
321
+ | **S6** | R1, R2, R7, R8, R9, R12, R4 | 12 | Truth pass before the next release — **Done `2026-09-10`** | CHANGELOG states the alias reason; `validate health` exit pinned by a real-CLI test; four rate rows cited and tested; zero-dep pinned; server reports the package version; README has no FALSE row on a claims re-audit; full suite and all gates green |
322
+ | **S7** | R15, R20, R10, R6, R5, R16a | 16 | Foreign trees, probe integrity, comparison, gates — **Done `2026-09-10`** (ADR-0048 written, Proposed) | `hygiene clean` performs zero renames on the gsd fixture; a zero-spend model step records `error`; a stale `dist/` turns Gate 8 red; OpenCode and Gemini gates exist and skip with reason here; COMPARISON has no undated "no competitor"; ADR-0048 written either way |
323
+ | **S8** | R19, R17, R21, R13, R14 | 18 | Model tier and live gates | run where `claude` has a spend cap and where `copilot` and `agy` exist; five reps per chain; each new scenario proven able to fail |
324
+ | **S9** | R16b | 10 | Shared core | **Closed `2026-09-10`** — ADR-0048 accepted option A (status quo); nothing to implement |
325
+ | Any time | R11 | 1 | User action | `git status` prints no warning |
326
+
327
+ **Executed `2026-09-10` (evening), S6 and S7, on the current branch by the user's instruction rather than on a fresh one.** Every item's suite, release gates (including the new stale-bundle check) and the model-free harness were green at the close; a fresh five-runtime install in `d:\pantesting\execplan-check` confirmed the verdict exit code, the foreign-tree refusal and the bridge's reported version. Found while executing: `validate health`'s exit code reached the `pan://health` resource and eleven scenario tests that had encoded exit 0 (all updated); the runtime directory's `package.json` carries no version, so the bridge reads the install manifest; the stale-bundle gate fired on its first real run, on a `dist/` left behind by earlier commits in the same session.
328
+
329
+ **Ordering rationale.** S6 fixes what is wrong in the tree PR #29 is about to merge and costs one sitting. S7 leads with R15 because it is the only item where PAN could damage another tool's files, and with R20 because the next model-tier run must not file phantom findings. S8 needs machines and money this one does not have; R19 goes first there because it is the one measurement the whole native-workflows move rests on.
330
+
331
+ ---
332
+
333
+ ## Execution protocol (per session, with `/execplan`)
334
+
335
+ 1. Branch: `feat/reality-check-2026-09` off `main` after PR #29 merges. Never on top of #29.
336
+ 2. Per item: implement → run the item's tests → **revert-proof** (break the fix, see the named assertion red, restore) → `npm test` for the touched area.
337
+ 3. Per session close: `npm run test:all`, `node scripts/release-check.js`, `npm run harness`; regenerate `docs/SKILLS-*.md` if any command or dev skill changed (`python scripts/generate-skills-docs.py`); refresh the CLAUDE.md counts table if a test file or spec was added; `node --test tests/doc-lint.test.cjs tests/model-version-drift.test.cjs tests/claude-md-counts.test.cjs`.
338
+ 4. Commit with `/commit`, one commit per item or per coherent group; the user decides when to push and open the PR (push with an explicit refspec — the tag-push trap is on record).
339
+ 5. Update the memory note with what was refuted or learned, not with what the repo already records.
340
+ 6. Mark each item's Status in this file when it closes, with the date and the commit; do not renumber.
341
+
342
+ ---
343
+
344
+ ## What not to do (carried forward, all still holding)
345
+
346
+ Do not retire the markdown workflows · do not chase a sixth runtime · do not standardise `.planning/` · do not soften the behavioural harness · do not list on a skills marketplace on quality grounds alone · do not fork the skills compiler · do not emit frontmatter a runtime has not been seen to read · do not add a model rate without a primary citation · **do not describe `.planning/` as unthreatened or unique** (gsd-core shares the layout; the differentiator is depth) · **do not write "no competitor" or "nobody else" in an evergreen doc without a dated peer check**. New for this plan: **do not let `hygiene clean` rename anything in a tree PAN did not create** — R15 makes that a hard refusal.
347
+
348
+ ---
349
+
350
+ ## Verification caveats and blockers
351
+
352
+ - **CLIs absent here:** `codex`, `copilot`, `gemini`, `opencode`, `agy` (only `claude`). R6, R13, R14 and the unified-skills scenario in R17 record SKIPPED until run elsewhere.
353
+ - **Spend:** R17, R19 and R21 need `--max-usd`; size from the README's per-rep measurement and run five reps.
354
+ - **User action:** R11.
355
+ - **Secondary-source claims that gate building:** Antigravity's acceptance of Claude-format plugins (Superpowers' install line only); Copilot's exact `model:` list semantics beyond the docs page. Both are measured before code ships (R14 step 1, R13 step 1).
356
+ - **Anchors move:** every line number here is from 2026-09-10; re-grep the quoted phrase, not the number.
357
+
358
+ ---
359
+
360
+ ## Sources
361
+
362
+ The run's sources are listed in the Addendum of [market-delta-2026-09-superplan.md](market-delta-2026-09-superplan.md). Added for this plan: `raw.githubusercontent.com/open-gsd/gsd-core/main/docs/USER-GUIDE.md` (the `.planning/` layout and `config.json` keys behind R15) and `github.com/open-gsd/gsd-core` (read 2026-09-10).