pan-wizard 3.31.0 → 3.32.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 (47) hide show
  1. package/README.md +28 -24
  2. package/agents/pan-design-checker.md +18 -0
  3. package/agents/pan-optimizer.md +5 -1
  4. package/agents/pan-plan-checker.md +23 -0
  5. package/agents/pan-reviewer.md +19 -0
  6. package/agents/pan-verifier.md +23 -0
  7. package/commands/pan/design-phase.md +8 -0
  8. package/commands/pan/exec-phase.md +1 -1
  9. package/commands/pan/git.md +2 -2
  10. package/commands/pan/learn.md +2 -0
  11. package/commands/pan/optimize.md +14 -2
  12. package/commands/pan/review-deep.md +5 -5
  13. package/hooks/dist/pan-context-monitor.js +1 -1
  14. package/hooks/dist/pan-cost-logger.js +63 -11
  15. package/hooks/dist/pan-state-reinject.js +2 -2
  16. package/hooks/dist/pan-stop-guard.js +2 -2
  17. package/hooks/dist/pan-trace-logger.js +283 -18
  18. package/package.json +1 -1
  19. package/pan-wizard-core/bin/lib/commands.cjs +2 -1
  20. package/pan-wizard-core/bin/lib/constants.cjs +28 -0
  21. package/pan-wizard-core/bin/lib/cost.cjs +3 -3
  22. package/pan-wizard-core/bin/lib/findings.cjs +381 -0
  23. package/pan-wizard-core/bin/lib/focus.cjs +72 -19
  24. package/pan-wizard-core/bin/lib/foreign-planning.cjs +24 -6
  25. package/pan-wizard-core/bin/lib/hygiene.cjs +12 -2
  26. package/pan-wizard-core/bin/lib/init.cjs +4 -1
  27. package/pan-wizard-core/bin/lib/optimize.cjs +349 -21
  28. package/pan-wizard-core/bin/lib/review-deep.cjs +36 -0
  29. package/pan-wizard-core/bin/lib/state.cjs +7 -2
  30. package/pan-wizard-core/bin/lib/verdict.cjs +431 -0
  31. package/pan-wizard-core/bin/lib/verify-preflight.cjs +4 -2
  32. package/pan-wizard-core/bin/lib/verify-scope.cjs +156 -0
  33. package/pan-wizard-core/bin/lib/verify.cjs +25 -2
  34. package/pan-wizard-core/bin/pan-tools.cjs +59 -5
  35. package/pan-wizard-core/learnings/README.md +10 -7
  36. package/pan-wizard-core/mcp/tool-registry.cjs +2 -0
  37. package/pan-wizard-core/references/verdict-contract.md +101 -0
  38. package/pan-wizard-core/templates/verification-report.md +16 -0
  39. package/pan-wizard-core/workflows/exec-phase.md +65 -47
  40. package/pan-wizard-core/workflows/health.md +2 -0
  41. package/pan-wizard-core/workflows/learn.md +4 -2
  42. package/pan-wizard-core/workflows/milestone-audit.md +15 -3
  43. package/pan-wizard-core/workflows/optimize.md +14 -1
  44. package/pan-wizard-core/workflows/plan-phase.md +20 -15
  45. package/pan-wizard-core/workflows/verify-phase.md +3 -13
  46. package/pan-zcode/README.md +3 -3
  47. package/scripts/git-hooks/pre-commit +2 -1
@@ -321,21 +321,11 @@ If human_needed: list items requiring human testing.
321
321
 
322
322
  Orchestrator routes: `passed` → update_roadmap | `gaps_found` → create/execute fixes, re-verify | `human_needed` → present to user.
323
323
 
324
- **Circular optimization — log verification outcome:**
324
+ **Record the verification.** The record adds its findings to the ledger and logs the outcome to the trace (`verdict_passed`, `verdict_failed` or `verdict_needs_human`). A re-verification is the next attempt, and it closes the gaps it no longer reports:
325
325
  ```bash
326
- # Map status to impact and event type
327
- if [ "${STATUS}" = "passed" ]; then
328
- node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize trace log \
329
- --type decision --category verification_passed \
330
- --description "Phase ${PHASE_NUMBER} verification passed (score: ${SCORE})" \
331
- --agent pan-verifier --impact minor 2>/dev/null || true
332
- elif [ "${STATUS}" = "gaps_found" ]; then
333
- node ~/.claude/pan-wizard-core/bin/pan-tools.cjs optimize trace log \
334
- --type error --category verification_gaps \
335
- --description "Phase ${PHASE_NUMBER} verification found gaps (score: ${SCORE})" \
336
- --agent pan-verifier --impact major 2>/dev/null || true
337
- fi
326
+ node ~/.claude/pan-wizard-core/bin/pan-tools.cjs findings record --phase "${PHASE_NUMBER}" --file "$REPORT_PATH" 2>/dev/null || true
338
327
  ```
328
+ Recording the same report twice is a no-op, so exec-phase recording it again after this workflow returns is safe.
339
329
  </step>
340
330
 
341
331
  </process>
@@ -50,7 +50,7 @@ before ADR-0028.
50
50
  preserves the body; plus a command → skill wrapper.
51
51
  - **M4 — bundle + install.** `bin/install-zcode.js` — assembles `agents/` + `pan-mcp.json` +
52
52
  manifest + `INSTALL-ZCODE.md` into a `--target` dir; refuses to write inside the source repo;
53
- drives ZCode's own Import to finish.
53
+ leaves the finish to the human in ZCode's own Settings and Import, following `INSTALL-ZCODE.md`.
54
54
  - **M5 — hardening + docs.** Full test matrix + [`KNOWN-BETA-RISKS.md`](KNOWN-BETA-RISKS.md)
55
55
  (the beta-churn ledger + the M0 go/no-go questions).
56
56
 
@@ -59,11 +59,11 @@ Tests: `tests/pan-zcode-mcp.test.cjs`, `tests/pan-zcode-orchestration.test.cjs`,
59
59
 
60
60
  ## Still pending — M0 (needs a real ZCode install)
61
61
 
62
- Two go/no-go facts can only be settled empirically: **can a subagent call MCP tools?** and **are
62
+ Among the go/no-go facts only a real install can settle (the M0 table in `KNOWN-BETA-RISKS.md`) are **can a subagent call MCP tools?** and **are
63
63
  local stdio MCP calls metered?** Both have folded-in fallbacks (see `KNOWN-BETA-RISKS.md`), so the
64
64
  design holds either way — but confirm them before relying on the richer paths.
65
65
 
66
- A third M0 checkpoint (added 2026-08): **which protocol era does the real ZCode client speak?**
66
+ Another M0 checkpoint (added 2026-08, not yet in `KNOWN-BETA-RISKS.md`): **which protocol era does the real ZCode client speak?**
67
67
  The bridge is now dual-era (ADR-0041), so it answers both a legacy `initialize` handshake and a
68
68
  modern `server/discover` probe. Confirm on a real install which path ZCode takes and that the
69
69
  version it declares is in our supported list; if ZCode ever declares a revision newer than
@@ -10,7 +10,8 @@
10
10
  # Or with a symlink (Unix / Git Bash):
11
11
  # ln -sf ../../scripts/git-hooks/pre-commit .git/hooks/pre-commit
12
12
  #
13
- # Bypass for an emergency (creates a paper trail in the commit log):
13
+ # Bypass for an emergency (the hook only prints that the scan was skipped;
14
+ # nothing is recorded in the commit):
14
15
  # SKIP_GITLEAKS=1 git commit -m "..."
15
16
  #
16
17
  # Exit codes: