pan-wizard 3.32.0 → 3.34.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.
- package/README.md +23 -20
- package/agents/pan-conductor.md +18 -17
- package/agents/pan-counterfactual.md +2 -2
- package/agents/pan-debugger.md +27 -8
- package/agents/pan-design-checker.md +1 -1
- package/agents/pan-designer.md +2 -2
- package/agents/pan-distiller.md +3 -3
- package/agents/pan-document_code.md +16 -16
- package/agents/pan-executor.md +15 -11
- package/agents/pan-experiment-runner.md +15 -17
- package/agents/pan-hardener.md +15 -15
- package/agents/pan-integration-checker.md +2 -2
- package/agents/pan-knowledge.md +2 -2
- package/agents/pan-meta-reviewer.md +5 -5
- package/agents/pan-optimizer.md +40 -44
- package/agents/pan-phase-researcher.md +10 -10
- package/agents/pan-plan-checker.md +36 -30
- package/agents/pan-planner.md +77 -53
- package/agents/pan-previewer.md +1 -1
- package/agents/pan-project-researcher.md +21 -78
- package/agents/pan-release.md +1 -1
- package/agents/pan-research-synthesizer.md +2 -2
- package/agents/pan-reviewer.md +24 -2
- package/agents/pan-roadmapper.md +20 -62
- package/agents/pan-verifier.md +53 -30
- package/bin/install-lib.cjs +228 -38
- package/bin/install.js +86 -15
- package/commands/pan/army.md +16 -12
- package/commands/pan/assumptions.md +2 -2
- package/commands/pan/audit-deployment.md +11 -12
- package/commands/pan/cost.md +8 -4
- package/commands/pan/debug.md +10 -7
- package/commands/pan/design-phase.md +3 -3
- package/commands/pan/discuss-phase.md +2 -0
- package/commands/pan/exec-phase.md +21 -37
- package/commands/pan/experiment.md +11 -10
- package/commands/pan/focus-auto.md +33 -27
- package/commands/pan/focus-design.md +9 -6
- package/commands/pan/focus-doc-audit.md +4 -3
- package/commands/pan/focus-drift-walking.md +4 -3
- package/commands/pan/focus-exec.md +7 -7
- package/commands/pan/focus-plan.md +12 -11
- package/commands/pan/focus-scan.md +7 -10
- package/commands/pan/focus-sync.md +3 -2
- package/commands/pan/git.md +8 -8
- package/commands/pan/health.md +2 -2
- package/commands/pan/hud.md +3 -2
- package/commands/pan/hygiene.md +14 -7
- package/commands/pan/knowledge.md +9 -9
- package/commands/pan/learn.md +10 -7
- package/commands/pan/links.md +4 -1
- package/commands/pan/map-codebase.md +5 -5
- package/commands/pan/mcp-bridge.md +18 -18
- package/commands/pan/milestone-done.md +7 -5
- package/commands/pan/milestone-new.md +1 -1
- package/commands/pan/new-project.md +10 -10
- package/commands/pan/optimize.md +16 -14
- package/commands/pan/patches.md +2 -6
- package/commands/pan/pause.md +1 -1
- package/commands/pan/phase-tests.md +4 -3
- package/commands/pan/plan-phase.md +9 -19
- package/commands/pan/preview.md +1 -1
- package/commands/pan/profile.md +4 -4
- package/commands/pan/quick.md +1 -1
- package/commands/pan/remove-phase.md +1 -1
- package/commands/pan/report.md +2 -2
- package/commands/pan/research-phase.md +14 -15
- package/commands/pan/resume.md +9 -11
- package/commands/pan/retro.md +5 -3
- package/commands/pan/review-deep.md +10 -10
- package/commands/pan/settings.md +1 -1
- package/commands/pan/todo-add.md +2 -2
- package/commands/pan/todo-check.md +2 -2
- package/commands/pan/verify-phase.md +0 -11
- package/commands/pan/what-if.md +2 -2
- package/hooks/dist/pan-context-monitor.js +343 -44
- package/hooks/dist/pan-cost-logger.js +30 -0
- package/hooks/dist/pan-state-reinject.js +140 -15
- package/hooks/dist/pan-statusline.js +68 -22
- package/hooks/dist/pan-stop-guard.js +7 -2
- package/package.json +1 -1
- package/pan-wizard-core/bin/lib/agents-md.cjs +48 -7
- package/pan-wizard-core/bin/lib/bridge.cjs +6 -5
- package/pan-wizard-core/bin/lib/campaign.cjs +4 -2
- package/pan-wizard-core/bin/lib/commands-learnings.cjs +19 -2
- package/pan-wizard-core/bin/lib/commands.cjs +126 -5
- package/pan-wizard-core/bin/lib/config.cjs +112 -1
- package/pan-wizard-core/bin/lib/constants.cjs +29 -15
- package/pan-wizard-core/bin/lib/context-budget.cjs +12 -9
- package/pan-wizard-core/bin/lib/core.cjs +77 -23
- package/pan-wizard-core/bin/lib/cost-rebuild.cjs +13 -1
- package/pan-wizard-core/bin/lib/cost.cjs +149 -10
- package/pan-wizard-core/bin/lib/distill.cjs +6 -3
- package/pan-wizard-core/bin/lib/doc-lint.cjs +30 -11
- package/pan-wizard-core/bin/lib/findings.cjs +15 -4
- package/pan-wizard-core/bin/lib/focus.cjs +13 -4
- package/pan-wizard-core/bin/lib/frontmatter.cjs +105 -26
- package/pan-wizard-core/bin/lib/hygiene.cjs +178 -17
- package/pan-wizard-core/bin/lib/init.cjs +12 -5
- package/pan-wizard-core/bin/lib/knowledge.cjs +17 -1
- package/pan-wizard-core/bin/lib/learn-index.cjs +111 -10
- package/pan-wizard-core/bin/lib/learn-lint.cjs +30 -3
- package/pan-wizard-core/bin/lib/memory-optimize.cjs +8 -4
- package/pan-wizard-core/bin/lib/memory.cjs +508 -54
- package/pan-wizard-core/bin/lib/milestone.cjs +8 -3
- package/pan-wizard-core/bin/lib/optimize.cjs +84 -16
- package/pan-wizard-core/bin/lib/phase-remove.cjs +85 -21
- package/pan-wizard-core/bin/lib/phase-report.cjs +8 -2
- package/pan-wizard-core/bin/lib/phase.cjs +67 -15
- package/pan-wizard-core/bin/lib/preview.cjs +3 -1
- package/pan-wizard-core/bin/lib/review-deep.cjs +2 -2
- package/pan-wizard-core/bin/lib/roadmap-compact.cjs +267 -0
- package/pan-wizard-core/bin/lib/roadmap.cjs +243 -9
- package/pan-wizard-core/bin/lib/runner.cjs +2 -1
- package/pan-wizard-core/bin/lib/state-compact.cjs +11 -6
- package/pan-wizard-core/bin/lib/state.cjs +47 -31
- package/pan-wizard-core/bin/lib/template.cjs +11 -4
- package/pan-wizard-core/bin/lib/verdict.cjs +54 -4
- package/pan-wizard-core/bin/lib/verify-drift.cjs +14 -5
- package/pan-wizard-core/bin/lib/verify-preflight.cjs +4 -13
- package/pan-wizard-core/bin/lib/verify-retro.cjs +5 -3
- package/pan-wizard-core/bin/lib/verify-scope.cjs +74 -4
- package/pan-wizard-core/bin/lib/verify.cjs +117 -35
- package/pan-wizard-core/bin/lib/whatif.cjs +5 -3
- package/pan-wizard-core/bin/pan-tools.cjs +111 -17
- package/pan-wizard-core/learnings/index.json +5 -5
- package/pan-wizard-core/mcp/server.cjs +18 -9
- package/pan-wizard-core/opencode/pan-wizard.js +111 -0
- package/pan-wizard-core/references/checkpoints.md +7 -5
- package/pan-wizard-core/references/continuation-format.md +3 -3
- package/pan-wizard-core/references/decimal-phase-calculation.md +2 -3
- package/pan-wizard-core/references/design-methodology.md +1 -1
- package/pan-wizard-core/references/git-integration.md +4 -6
- package/pan-wizard-core/references/git-planning-commit.md +2 -2
- package/pan-wizard-core/references/guardrails.md +2 -2
- package/pan-wizard-core/references/handoff-decisions.md +3 -3
- package/pan-wizard-core/references/model-profile-resolution.md +5 -5
- package/pan-wizard-core/references/model-profiles.md +14 -9
- package/pan-wizard-core/references/phase-argument-parsing.md +7 -7
- package/pan-wizard-core/references/planning-config.md +4 -4
- package/pan-wizard-core/references/tdd.md +10 -1
- package/pan-wizard-core/references/verdict-contract.md +2 -1
- package/pan-wizard-core/references/verification-patterns.md +5 -5
- package/pan-wizard-core/templates/codebase/architecture.md +2 -2
- package/pan-wizard-core/templates/codebase/best-practices.md +2 -2
- package/pan-wizard-core/templates/codebase/concerns.md +3 -3
- package/pan-wizard-core/templates/codebase/integrations.md +6 -6
- package/pan-wizard-core/templates/codebase/relationships.md +2 -2
- package/pan-wizard-core/templates/codebase/stack.md +2 -2
- package/pan-wizard-core/templates/codebase/structure.md +4 -4
- package/pan-wizard-core/templates/codebase/testing.md +4 -4
- package/pan-wizard-core/templates/continue-here.md +1 -1
- package/pan-wizard-core/templates/debug-subagent-prompt.md +3 -2
- package/pan-wizard-core/templates/debug.md +15 -1
- package/pan-wizard-core/templates/discovery.md +1 -1
- package/pan-wizard-core/templates/milestone-archive.md +6 -6
- package/pan-wizard-core/templates/milestone.md +1 -1
- package/pan-wizard-core/templates/phase-prompt.md +31 -18
- package/pan-wizard-core/templates/planner-subagent-prompt.md +3 -5
- package/pan-wizard-core/templates/research-project/architecture.md +3 -3
- package/pan-wizard-core/templates/research-project/features.md +1 -1
- package/pan-wizard-core/templates/research-project/pitfalls.md +1 -1
- package/pan-wizard-core/templates/research-project/stack.md +3 -3
- package/pan-wizard-core/templates/research.md +5 -5
- package/pan-wizard-core/templates/retrospective.md +1 -1
- package/pan-wizard-core/templates/roadmap.md +15 -15
- package/pan-wizard-core/templates/summary-complex.md +1 -0
- package/pan-wizard-core/templates/summary-minimal.md +1 -0
- package/pan-wizard-core/templates/summary-standard.md +2 -1
- package/pan-wizard-core/templates/summary.md +18 -2
- package/pan-wizard-core/templates/uat.md +3 -3
- package/pan-wizard-core/templates/user-setup.md +8 -8
- package/pan-wizard-core/templates/verification-report.md +54 -4
- package/pan-wizard-core/workflows/add-phase.md +1 -1
- package/pan-wizard-core/workflows/assumptions.md +1 -1
- package/pan-wizard-core/workflows/discuss-phase.md +9 -8
- package/pan-wizard-core/workflows/exec-phase.md +34 -60
- package/pan-wizard-core/workflows/execute-plan.md +8 -7
- package/pan-wizard-core/workflows/health.md +13 -11
- package/pan-wizard-core/workflows/help.md +8 -9
- package/pan-wizard-core/workflows/learn.md +13 -11
- package/pan-wizard-core/workflows/map-codebase.md +10 -10
- package/pan-wizard-core/workflows/milestone-audit.md +10 -10
- package/pan-wizard-core/workflows/milestone-gaps.md +17 -24
- package/pan-wizard-core/workflows/milestone-new.md +7 -6
- package/pan-wizard-core/workflows/new-project.md +10 -10
- package/pan-wizard-core/workflows/optimize.md +11 -9
- package/pan-wizard-core/workflows/pause.md +6 -1
- package/pan-wizard-core/workflows/phase-tests.md +4 -4
- package/pan-wizard-core/workflows/plan-phase.md +31 -34
- package/pan-wizard-core/workflows/profile.md +2 -2
- package/pan-wizard-core/workflows/progress.md +5 -7
- package/pan-wizard-core/workflows/quick.md +10 -8
- package/pan-wizard-core/workflows/remove-phase.md +1 -1
- package/pan-wizard-core/workflows/research-phase.md +9 -5
- package/pan-wizard-core/workflows/resume-project.md +4 -6
- package/pan-wizard-core/workflows/retro.md +3 -1
- package/pan-wizard-core/workflows/settings.md +16 -24
- package/pan-wizard-core/workflows/todo-check.md +1 -1
- package/pan-wizard-core/workflows/transition.md +12 -12
- package/pan-wizard-core/workflows/update.md +25 -17
- package/pan-wizard-core/workflows/verify-phase.md +24 -17
- package/pan-zcode/KNOWN-BETA-RISKS.md +2 -2
- package/pan-zcode/README.md +7 -7
- package/pan-zcode/bin/install-zcode.js +1 -1
- package/scripts/build-agent-plugin.js +19 -5
- package/scripts/build-plugin.js +3 -1
- package/scripts/generate-skills-docs.py +13 -4
- package/scripts/test-surface.cjs +4 -0
|
@@ -24,19 +24,32 @@ case "$VERSION_FILE" in
|
|
|
24
24
|
./*) SCOPE="LOCAL" ;;
|
|
25
25
|
*) SCOPE="GLOBAL" ;;
|
|
26
26
|
esac
|
|
27
|
+
# The same templated path names the runtime: the installer rewrites ~/.claude/ to
|
|
28
|
+
# this runtime's own directory. With no runtime flag the installer installs Claude
|
|
29
|
+
# Code only, so the flag must be passed.
|
|
30
|
+
case "$VERSION_FILE" in
|
|
31
|
+
*.codex/*) RUNTIME="--codex" ;;
|
|
32
|
+
*.gemini/*) RUNTIME="--gemini" ;;
|
|
33
|
+
*opencode/*) RUNTIME="--opencode" ;;
|
|
34
|
+
*.github/*|*.copilot/*) RUNTIME="--copilot" ;;
|
|
35
|
+
*) RUNTIME="--claude" ;;
|
|
36
|
+
esac
|
|
27
37
|
|
|
28
38
|
if [ -f "$VERSION_FILE" ] && [ -f "$MARKER_FILE" ] && grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+' "$VERSION_FILE"; then
|
|
29
39
|
cat "$VERSION_FILE"
|
|
40
|
+
echo "$RUNTIME"
|
|
30
41
|
echo "$SCOPE"
|
|
31
42
|
else
|
|
32
43
|
echo "UNKNOWN"
|
|
44
|
+
echo "$RUNTIME"
|
|
45
|
+
echo "$SCOPE"
|
|
33
46
|
fi
|
|
34
47
|
```
|
|
35
48
|
|
|
36
|
-
Parse output (there is ONE install; scope
|
|
37
|
-
- If last line is "LOCAL": this install is local-scoped (templated prefix is `./`-relative);
|
|
38
|
-
- If last line is "GLOBAL": this install is global-scoped (templated prefix is an absolute path);
|
|
39
|
-
- If "UNKNOWN": the VERSION/marker files are missing or invalid; proceed to install step (treat as version 0.0.0)
|
|
49
|
+
Parse output (there is ONE install; scope and runtime are derived from the single templated prefix). The output is three lines: the installed version (or `UNKNOWN`), the runtime flag (`--claude`, `--codex`, `--gemini`, `--opencode` or `--copilot`) and the scope. Remember the runtime flag: the install step writes it into its command.
|
|
50
|
+
- If last line is "LOCAL": this install is local-scoped (templated prefix is `./`-relative); use `--local`
|
|
51
|
+
- If last line is "GLOBAL": this install is global-scoped (templated prefix is an absolute path); use `--global`
|
|
52
|
+
- If the first line is "UNKNOWN": the VERSION/marker files are missing or invalid; proceed to install step (treat as version 0.0.0) — the runtime and scope lines still apply
|
|
40
53
|
|
|
41
54
|
**If VERSION file missing:**
|
|
42
55
|
```
|
|
@@ -63,7 +76,7 @@ npm view pan-wizard version 2>/dev/null
|
|
|
63
76
|
```
|
|
64
77
|
Couldn't check for updates (offline or npm unavailable).
|
|
65
78
|
|
|
66
|
-
To update manually: `npx pan-wizard --global`
|
|
79
|
+
To update manually: `npx -y pan-wizard@latest {runtime_flag} --global` (`--local` for a local install), with the runtime flag and scope step 1 printed
|
|
67
80
|
```
|
|
68
81
|
|
|
69
82
|
Exit.
|
|
@@ -155,28 +168,23 @@ Run the update using the install type detected in step 1:
|
|
|
155
168
|
|
|
156
169
|
**If LOCAL install:**
|
|
157
170
|
```bash
|
|
158
|
-
npx -y pan-wizard@latest --local
|
|
171
|
+
npx -y pan-wizard@latest {runtime_flag} --local
|
|
159
172
|
```
|
|
160
173
|
|
|
161
|
-
**If GLOBAL install
|
|
174
|
+
**If GLOBAL install:**
|
|
162
175
|
```bash
|
|
163
|
-
npx -y pan-wizard@latest --global
|
|
176
|
+
npx -y pan-wizard@latest {runtime_flag} --global
|
|
164
177
|
```
|
|
165
178
|
|
|
166
|
-
|
|
179
|
+
`{runtime_flag}` is the runtime line step 1 printed: write the flag itself into the command. A variable set in step 1's shell call is gone in this one (each Bash call starts a new shell), and an empty `""` argument in its place installs Claude Code only. A `--config-dir` or `--unified-skills` install is not recognised from its path: for those, re-run the installer with your original flags instead.
|
|
167
180
|
|
|
168
|
-
|
|
181
|
+
Capture output. If install fails, show error and exit.
|
|
169
182
|
|
|
170
|
-
|
|
171
|
-
```bash
|
|
172
|
-
rm -f ~/.claude/cache/pan-update-check.json
|
|
173
|
-
```
|
|
183
|
+
Clear the update cache so the statusline indicator disappears. The update-check hook keeps it under your home directory for every install, local or global, in the runtime's own config directory: `.claude` (Claude Code), `.codex` (Codex), `.gemini` (Gemini CLI) or `.copilot` (Copilot CLI); OpenCode runs no update-check hook, so there is nothing to clear there:
|
|
174
184
|
|
|
175
|
-
**If GLOBAL install:**
|
|
176
185
|
```bash
|
|
177
|
-
rm -f
|
|
186
|
+
rm -f "$HOME/<config dir from the list above>/cache/pan-update-check.json"
|
|
178
187
|
```
|
|
179
|
-
(Paths are templated at install time for runtime compatibility)
|
|
180
188
|
</step>
|
|
181
189
|
|
|
182
190
|
<step name="display_result">
|
|
@@ -22,7 +22,7 @@ Then verify each level against the actual codebase.
|
|
|
22
22
|
@~/.claude/pan-wizard-core/references/guardrails.md
|
|
23
23
|
@~/.claude/pan-wizard-core/templates/verification-report.md
|
|
24
24
|
|
|
25
|
-
> **Also see:** `~/.claude/pan-wizard-core/learnings/universal/` — AI-derived patterns from prior experiments. **Don't skim the whole folder.** Run `pan-tools learn topics-for --agent verifier --token-budget 5000 --raw` to load
|
|
25
|
+
> **Also see:** `~/.claude/pan-wizard-core/learnings/universal/` — AI-derived patterns from prior experiments. **Don't skim the whole folder.** Run `pan-tools learn topics-for --agent verifier --cue "<phase goal; the files it touches>" --token-budget 5000 --raw` to load the topics that match this task, within the budget; if none matches, it falls back to the topics tagged relevant for verification. Per P-RES-002 (distractor-density research), reading every topic degrades reasoning even at modest token counts.
|
|
26
26
|
</required_reading>
|
|
27
27
|
|
|
28
28
|
## Re-Read Checkpoints
|
|
@@ -47,14 +47,15 @@ INIT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs init phase-op "${PHASE_A
|
|
|
47
47
|
|
|
48
48
|
Extract from init JSON: `phase_dir`, `phase_number`, `phase_name`, `has_plans`, `plan_count`.
|
|
49
49
|
|
|
50
|
-
Then load phase details and list plans/summaries:
|
|
50
|
+
Then load phase details, write the phase's roadmap slice, and list plans/summaries:
|
|
51
51
|
```bash
|
|
52
52
|
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "${phase_number}"
|
|
53
|
-
|
|
53
|
+
SLICE_PATH=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap slice "${phase_number}" --write --raw)
|
|
54
|
+
grep -E "^\|[^|]*\| *Phase +0*${phase_number#0} " .planning/requirements.md 2>/dev/null
|
|
54
55
|
ls "$phase_dir"/*-summary.md "$phase_dir"/*-plan.md 2>/dev/null
|
|
55
56
|
```
|
|
56
57
|
|
|
57
|
-
Extract **phase goal** from
|
|
58
|
+
Extract the **phase goal** and success criteria from `get-phase` (the outcome to verify, not tasks), and the phase's **requirements** from `$SLICE_PATH` (its `## Its requirements` lines). Do not read roadmap.md or requirements.md whole: on a long project they are the largest files in `.planning/`, and the slice carries what verification needs from them. If `SLICE_PATH` is empty, grep requirements.md for the phase's IDs instead.
|
|
58
59
|
</step>
|
|
59
60
|
|
|
60
61
|
<step name="check_prior_verification">
|
|
@@ -62,7 +63,7 @@ Extract **phase goal** from roadmap.md (the outcome to verify, not tasks) and **
|
|
|
62
63
|
|
|
63
64
|
If `phase_number` > 1:
|
|
64
65
|
```bash
|
|
65
|
-
PREV=$((phase_number - 1))
|
|
66
|
+
case "$phase_number" in *.*) PREV="${phase_number%%.*}" ;; *[A-Za-z]) PREV="${phase_number%[A-Za-z]}" ;; *) PREV=$((10#$phase_number - 1)) ;; esac
|
|
66
67
|
# Resolve the previous phase's directory via find-phase (handles zero-padding
|
|
67
68
|
# and the .planning/phases/ layout), like exec-phase does — do NOT glob
|
|
68
69
|
# .planning/phase-N*/ (wrong dir, unpadded, matches nothing). With --raw,
|
|
@@ -120,6 +121,7 @@ executed. Empty is not zero. Judge the exit code, then the counts.
|
|
|
120
121
|
| Condition | Action |
|
|
121
122
|
|-----------|--------|
|
|
122
123
|
| `TEST_EXIT` = 0 **and** `TEST_FAIL` = 0 (a real number) | Record counts, continue to must-haves |
|
|
124
|
+
| `TEST_EXIT` = 0 **and** no `ℹ` count lines (a runner other than Node's built-in one) | Set `test_gate_status: passed`; record the runner's own summary line as the counts |
|
|
123
125
|
| `TEST_EXIT` ≠ 0 **and** failures were reported | Set `test_gate_status: failed`, include failure details |
|
|
124
126
|
| `TEST_EXIT` ≠ 0 **and** `TEST_FAIL` is empty/absent — the suite CRASHED or could not run (syntax error, missing module, bad import, no runner) | Set `test_gate_status: failed`, and record the reason as `suite did not run`. **Never `skipped`, never `passed`.** A suite that cannot execute is stronger evidence of a broken phase than one that runs and fails |
|
|
125
127
|
| `HAS_TEST` = `no` (handled in step 1) | Record as `test_gate_status: skipped`, continue. This is the ONLY legitimate route to `skipped` |
|
|
@@ -136,6 +138,10 @@ TEST_TOTAL: ${TEST_COUNT}
|
|
|
136
138
|
TEST_PASSED: ${TEST_PASS}
|
|
137
139
|
TEST_FAILED: ${TEST_FAIL}
|
|
138
140
|
```
|
|
141
|
+
Write `test_gate: ${TEST_GATE_STATUS}` into the verification.md frontmatter. When it is
|
|
142
|
+
`skipped`, also add a `not_checked` entry (`check: "tests"`, `reason: "no test script in
|
|
143
|
+
package.json"`). The recorder reads both: a pass whose tests never ran is recorded as a
|
|
144
|
+
pass with tests not checked, never as a plain pass.
|
|
139
145
|
|
|
140
146
|
**If test gate FAILED:** Continue verification (gather full picture) but set overall status to `gaps_found` regardless of goal-backward results. Include test failures as gaps in the report.
|
|
141
147
|
</step>
|
|
@@ -146,13 +152,13 @@ TEST_FAILED: ${TEST_FAIL}
|
|
|
146
152
|
Use pan-tools to extract must_haves from each PLAN:
|
|
147
153
|
|
|
148
154
|
```bash
|
|
149
|
-
for plan in "$
|
|
155
|
+
for plan in "$phase_dir"/*-plan.md; do
|
|
150
156
|
MUST_HAVES=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs frontmatter get "$plan" --field must_haves)
|
|
151
157
|
echo "=== $plan ===" && echo "$MUST_HAVES"
|
|
152
158
|
done
|
|
153
159
|
```
|
|
154
160
|
|
|
155
|
-
Returns
|
|
161
|
+
Returns `{ "must_haves": { truths: [...], artifacts: [...], key_links: [...] } }`: each truth a string, each artifact an object (`path`, `provides`, …), each key link an object (`from`, `to`, `via`).
|
|
156
162
|
|
|
157
163
|
Aggregate all must_haves across plans for phase-level verification.
|
|
158
164
|
|
|
@@ -161,7 +167,7 @@ Aggregate all must_haves across plans for phase-level verification.
|
|
|
161
167
|
If no must_haves in frontmatter (MUST_HAVES returns error or empty), check for Success Criteria:
|
|
162
168
|
|
|
163
169
|
```bash
|
|
164
|
-
PHASE_DATA=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "${phase_number}"
|
|
170
|
+
PHASE_DATA=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs roadmap get-phase "${phase_number}")
|
|
165
171
|
```
|
|
166
172
|
|
|
167
173
|
Parse the `success_criteria` array from the JSON output. If non-empty:
|
|
@@ -196,7 +202,7 @@ For each truth: identify supporting artifacts → check artifact status → chec
|
|
|
196
202
|
Use pan-tools for artifact verification against must_haves in each PLAN:
|
|
197
203
|
|
|
198
204
|
```bash
|
|
199
|
-
for plan in "$
|
|
205
|
+
for plan in "$phase_dir"/*-plan.md; do
|
|
200
206
|
ARTIFACT_RESULT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs verify artifacts "$plan")
|
|
201
207
|
echo "=== $plan ===" && echo "$ARTIFACT_RESULT"
|
|
202
208
|
done
|
|
@@ -228,7 +234,7 @@ WIRED = imported AND used. ORPHANED = exists but not imported/used.
|
|
|
228
234
|
Use pan-tools for key link verification against must_haves in each PLAN:
|
|
229
235
|
|
|
230
236
|
```bash
|
|
231
|
-
for plan in "$
|
|
237
|
+
for plan in "$phase_dir"/*-plan.md; do
|
|
232
238
|
LINKS_RESULT=$(node ~/.claude/pan-wizard-core/bin/pan-tools.cjs verify key-links "$plan")
|
|
233
239
|
echo "=== $plan ===" && echo "$LINKS_RESULT"
|
|
234
240
|
done
|
|
@@ -238,8 +244,8 @@ Parse JSON result: `{ all_verified, verified, total, links: [{from, to, via, ver
|
|
|
238
244
|
|
|
239
245
|
**Link status from result:**
|
|
240
246
|
- `verified=true` → WIRED
|
|
241
|
-
- `verified=false` with "not found" → NOT_WIRED
|
|
242
|
-
- `verified=false` with
|
|
247
|
+
- `verified=false` with detail "Source file not found" or "Target not referenced in source" → NOT_WIRED
|
|
248
|
+
- `verified=false` with detail `Pattern "…" not found in source or target` → PARTIAL
|
|
243
249
|
|
|
244
250
|
**Fallback patterns (if key_links not in must_haves):**
|
|
245
251
|
|
|
@@ -256,7 +262,7 @@ Record status and evidence for each key link.
|
|
|
256
262
|
<step name="verify_requirements">
|
|
257
263
|
If requirements.md exists:
|
|
258
264
|
```bash
|
|
259
|
-
grep -E "Phase
|
|
265
|
+
grep -E "^\|[^|]*\| *Phase +0*${phase_number#0} " .planning/requirements.md 2>/dev/null
|
|
260
266
|
```
|
|
261
267
|
|
|
262
268
|
For each requirement: parse description → identify supporting truths/artifacts → status: ✓ SATISFIED / ✗ BLOCKED / ? NEEDS HUMAN.
|
|
@@ -284,7 +290,7 @@ Format each as: Test Name → What to do → Expected result → Why can't verif
|
|
|
284
290
|
</step>
|
|
285
291
|
|
|
286
292
|
<step name="determine_status">
|
|
287
|
-
**passed:** All truths VERIFIED, all artifacts pass levels 1-3, all key links WIRED, no blocker anti-patterns, AND test gate passed or skipped.
|
|
293
|
+
**passed:** All truths VERIFIED, all artifacts pass levels 1-3, all key links WIRED, no blocker anti-patterns, AND test gate passed or skipped. A skipped gate is listed in `not_checked` with its reason, and the report to the user says the tests did not run.
|
|
288
294
|
|
|
289
295
|
**gaps_found:** Any truth FAILED, artifact MISSING/STUB, key link NOT_WIRED, blocker found, OR test gate FAILED (test regressions detected).
|
|
290
296
|
|
|
@@ -305,10 +311,11 @@ If gaps_found:
|
|
|
305
311
|
|
|
306
312
|
<step name="create_report">
|
|
307
313
|
```bash
|
|
308
|
-
REPORT_PATH="$
|
|
314
|
+
REPORT_PATH="$phase_dir/${phase_number}-verification.md"
|
|
315
|
+
VERIFIED_COMMIT=$(git rev-parse HEAD 2>/dev/null)
|
|
309
316
|
```
|
|
310
317
|
|
|
311
|
-
Fill template sections: frontmatter (phase/timestamp
|
|
318
|
+
Fill template sections: frontmatter (phase/timestamp/`verified_commit: ${VERIFIED_COMMIT}`/status/score/`test_gate`), **test gate results** (status/total/passed/failed), goal achievement, artifact table, wiring table, requirements coverage, anti-patterns, human verification, gaps summary, fix plans (if gaps_found), metadata.
|
|
312
319
|
|
|
313
320
|
See ~/.claude/pan-wizard-core/templates/verification-report.md for complete template.
|
|
314
321
|
</step>
|
|
@@ -323,7 +330,7 @@ Orchestrator routes: `passed` → update_roadmap | `gaps_found` → create/execu
|
|
|
323
330
|
|
|
324
331
|
**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
332
|
```bash
|
|
326
|
-
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs findings record --phase "${
|
|
333
|
+
node ~/.claude/pan-wizard-core/bin/pan-tools.cjs findings record --phase "${phase_number}" --file "$REPORT_PATH" 2>/dev/null || true
|
|
327
334
|
```
|
|
328
335
|
Recording the same report twice is a no-op, so exec-phase recording it again after this workflow returns is safe.
|
|
329
336
|
</step>
|
|
@@ -11,7 +11,7 @@ hard-depend on, and the go/no-go facts that can only be settled on a real ZCode
|
|
|
11
11
|
| # | Question | If NO → fallback (already in the design) |
|
|
12
12
|
|---|----------|------------------------------------------|
|
|
13
13
|
| 1 | Can a **subagent call MCP tools**? | Primary Agent makes every `pan-mcp` call and feeds results into subagent prompts. Determinism unaffected. |
|
|
14
|
-
| 2 | Are **local stdio MCP calls metered** against the MCP-Calls quota? |
|
|
14
|
+
| 2 | Are **local stdio MCP calls metered** against the MCP-Calls quota? | The read-only aggregators (`pan://state`, `pan://phases`, `pan://progress`, `pan://health`, `pan://links`, `pan://cost`, `pan://findings`) are MCP *resources*; reads that take an argument or fail without a roadmap (`pan_find_phase`, `pan_resolve_model`, `pan_roadmap_analyze`, `pan_preview_phases`, `pan_preview_phase`) and the per-step `pan_next_action` poll are tools, which a metered quota would count; batch/cache; never make a hosted z.ai MCP load-bearing. |
|
|
15
15
|
| 3 | Exact **subagent frontmatter schema** / plugin layout / MCP config path? | Drive ZCode's own Import / Settings; treat `pan-zcode/lib/convert-agent.cjs` output as a labelled fallback, not a contract. |
|
|
16
16
|
| 4 | Any **file-based / headless** way to register an MCP server, or GUI-only? | `install-zcode.js` emits a bundle + `INSTALL-ZCODE.md`; the human finishes in ZCode's UI. |
|
|
17
17
|
| 5 | Any **lifecycle hook** that can hard-gate a spawn? | Enforce caps at the MCP-tool-call boundary (the orchestrator), not pre-spawn. |
|
|
@@ -21,7 +21,7 @@ hard-depend on, and the go/no-go facts that can only be settled on a real ZCode
|
|
|
21
21
|
- **The merge gate is not self-sufficient.** Under ZCode Full Access, a raw Bash
|
|
22
22
|
`git push` bypasses `pan_confirm_merge`. Non-bypassability rests on **server-side
|
|
23
23
|
branch protection**; the MCP gate is the second, in-process lock. `INSTALL-ZCODE.md`
|
|
24
|
-
mandates branch protection and "
|
|
24
|
+
mandates branch protection and "Never run the install/import step in ZCode Full Access mode."
|
|
25
25
|
- **No subagent nesting.** The army flattens to one delegation layer (PAN already caps
|
|
26
26
|
nesting at 2, so this is tolerable). `Task` is dropped from ported subagents.
|
|
27
27
|
- **User-global subagents only.** No repo-scoped rosters or per-project model profiles.
|
package/pan-zcode/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# PAN-Z — a ZCode-native PAN subsystem
|
|
2
2
|
|
|
3
|
-
PAN-Z gives [ZCode](https://zcode.z.ai) (z.ai's GLM
|
|
3
|
+
PAN-Z gives [ZCode](https://zcode.z.ai) (z.ai's GLM coding harness) the PAN Wizard
|
|
4
4
|
workflow — the multi-phase lifecycle, the bot-army with a human merge gate, deterministic
|
|
5
5
|
state tracking — **without** cloning PAN's slash-commands or hooks (ZCode has neither).
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ ZCode through the one interface it speaks: **MCP**.
|
|
|
14
14
|
## How it fits
|
|
15
15
|
|
|
16
16
|
```text
|
|
17
|
-
ZCode harness (GLM
|
|
17
|
+
ZCode harness (GLM) primary Agent drives everything; ported subagents fan out
|
|
18
18
|
│ MCP · local stdio
|
|
19
19
|
pan-wizard-core/mcp (SHARED) a thin, zero-dep bridge — verbs → MCP tools/resources
|
|
20
20
|
│ spawn: node pan-tools.cjs <verb> --cwd <root>
|
|
@@ -28,13 +28,13 @@ registration pointing at that shared path. **Never fork a copy back under `pan-z
|
|
|
28
28
|
protocol layer, many consumers, or the two drift the way the per-runtime command trees did
|
|
29
29
|
before ADR-0028.
|
|
30
30
|
|
|
31
|
-
**Scope boundary (by design):** the bridge exposes `pan-tools` verbs as MCP tools/resources and nothing more. It intentionally does **not** carry rich agent *session state* — diffs, streaming, live thread lifecycle — because MCP can't faithfully represent it (the reason OpenAI built the Codex harness as a native Rust core rather than over MCP). Keep the bridge to tool/resource exposure; the CLI's JSON contract is the tool contract. See `KNOWN-BETA-RISKS.md`.
|
|
31
|
+
**Scope boundary (by design):** the bridge exposes `pan-tools` verbs as MCP tools/resources, plus the in-process `next-action` and merge-gate tools (M2), and nothing more. It intentionally does **not** carry rich agent *session state* — diffs, streaming, live thread lifecycle — because MCP can't faithfully represent it (the reason OpenAI built the Codex harness as a native Rust core rather than over MCP). Keep the bridge to tool/resource exposure; the CLI's JSON contract is the tool contract. See `KNOWN-BETA-RISKS.md`.
|
|
32
32
|
|
|
33
33
|
## Status — M1–M5 built (M0 is the human verify spike)
|
|
34
34
|
|
|
35
35
|
- **M1 — bridge core.** `pan-wizard-core/mcp/tool-registry.cjs` (pure verb→tool/resource map, with a hard
|
|
36
36
|
guardrail against exposing a force/reset/rebase/push verb) + `pan-wizard-core/mcp/server.cjs` (a
|
|
37
|
-
**zero-dependency** JSON-RPC 2.0 stdio MCP server;
|
|
37
|
+
**zero-dependency** JSON-RPC 2.0 stdio MCP server; read-only aggregators readable on any project → resources; reads that take an argument or fail without a roadmap, and actions → tools with
|
|
38
38
|
accurate hints; shell-less `execFile` spawn; `@file:` overflow protocol; strict per-arg
|
|
39
39
|
validation). **Dual-era** per the MCP 2026-07-28 stateless spec (ADR-0041): legacy clients
|
|
40
40
|
use the `initialize` handshake; modern clients declare their protocol version in each
|
|
@@ -73,6 +73,6 @@ implemented.
|
|
|
73
73
|
## Zero dependencies
|
|
74
74
|
|
|
75
75
|
Like the rest of PAN, this subsystem ships **no runtime dependencies**. The MCP protocol is
|
|
76
|
-
implemented directly
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
implemented directly, in the shared bridge under `pan-wizard-core/mcp/`, rather than via an
|
|
77
|
+
SDK; `pan-zcode/` holds no protocol code of its own, so a dependency added here would not
|
|
78
|
+
reach the bridge.
|
|
@@ -38,7 +38,7 @@ PAN-Z bridges PAN's engine to ZCode over MCP. Finish setup inside ZCode:
|
|
|
38
38
|
|
|
39
39
|
1. **Register the MCP server.** Add the contents of \`pan-mcp.json\` to ZCode's MCP
|
|
40
40
|
configuration (Settings → MCP), or point ZCode's MCP config at this file. This
|
|
41
|
-
exposes the \`pan_*\` tools (
|
|
41
|
+
exposes the \`pan_*\` tools (roadmap analysis, phase lookup and previews, model resolution, phase report, next-action, merge gate) and the \`pan://\` resources (state, phases, progress, health, links, cost, findings).
|
|
42
42
|
|
|
43
43
|
2. **Import the subagents.** The \`agents/\` folder holds PAN agents in ZCode subagent
|
|
44
44
|
form. Prefer ZCode's **Import from Claude Code** / Settings → Subagents to register
|
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
*
|
|
6
6
|
* plugin.json closed-schema manifest ($schema + name + metadata)
|
|
7
7
|
* skills/pan-<name>/SKILL.md every PAN command as an Agent Skill, from the
|
|
8
|
-
* ONE unified-skills compiler (ADR-0028)
|
|
8
|
+
* ONE unified-skills compiler (ADR-0028); a skill
|
|
9
|
+
* over Codex's 8,000-byte plugin cut is a pointer
|
|
10
|
+
* page plus references/instructions.md (S8)
|
|
9
11
|
* mcp.json the bundled bridge, launched as
|
|
10
12
|
* `node ${PLUGIN_ROOT}/pan-wizard-core/mcp/server.cjs`
|
|
11
13
|
* pan-wizard-core/ dispatcher + modules + workflows + templates +
|
|
@@ -74,9 +76,14 @@ function assertSafeToReplace(dir) {
|
|
|
74
76
|
throw new Error(`build-agent-plugin: refusing to replace ${dir} — it is non-empty and does not look like a previous bundle build (no Agent Plugins plugin.json)`);
|
|
75
77
|
}
|
|
76
78
|
|
|
77
|
-
/**
|
|
79
|
+
/**
|
|
80
|
+
* commands/pan/**.md → skills/pan-<name>/SKILL.md, mirroring the installer's recursion.
|
|
81
|
+
* A skill longer than Codex loads from a plugin (8,000 bytes) is split: a pointer
|
|
82
|
+
* SKILL.md plus references/instructions.md (lib.splitOversizedSkill, market-ideas S8).
|
|
83
|
+
*/
|
|
78
84
|
function emitSkills(srcDir, skillsDir, prefix) {
|
|
79
85
|
let count = 0;
|
|
86
|
+
let split = 0;
|
|
80
87
|
(function recurse(currentSrc, currentPrefix) {
|
|
81
88
|
for (const entry of fs.readdirSync(currentSrc, { withFileTypes: true })) {
|
|
82
89
|
const srcPath = path.join(currentSrc, entry.name);
|
|
@@ -88,11 +95,18 @@ function emitSkills(srcDir, skillsDir, prefix) {
|
|
|
88
95
|
let content = fs.readFileSync(srcPath, 'utf8');
|
|
89
96
|
content = lib.rewriteUnifiedSkillCommandContent(content, REWRITE);
|
|
90
97
|
content = lib.convertClaudeCommandToUnifiedSkill(content, skillName, { adapterNote: lib.agentPluginSkillAdapterNote() });
|
|
91
|
-
|
|
98
|
+
const { skill, reference } = lib.splitOversizedSkill(content, skillName);
|
|
99
|
+
fs.writeFileSync(path.join(skillDir, 'SKILL.md'), skill);
|
|
100
|
+
if (reference) {
|
|
101
|
+
const refPath = path.join(skillDir, ...lib.AGENT_PLUGIN_SKILL_REFERENCE.split('/'));
|
|
102
|
+
fs.mkdirSync(path.dirname(refPath), { recursive: true });
|
|
103
|
+
fs.writeFileSync(refPath, reference);
|
|
104
|
+
split++;
|
|
105
|
+
}
|
|
92
106
|
count++;
|
|
93
107
|
}
|
|
94
108
|
})(srcDir, prefix);
|
|
95
|
-
return count;
|
|
109
|
+
return { count, split };
|
|
96
110
|
}
|
|
97
111
|
|
|
98
112
|
/** pan-wizard-core → bundle, markdown rewritten, everything else verbatim. */
|
|
@@ -214,7 +228,7 @@ function main() {
|
|
|
214
228
|
const copilotAgents = emitCopilotNamespace(path.join(ROOT, 'agents'), path.join(OUT, lib.COPILOT_PLUGIN_NAMESPACE));
|
|
215
229
|
|
|
216
230
|
console.log('PAN Agent Plugins bundle built at', path.relative(ROOT, OUT) || OUT);
|
|
217
|
-
console.log(' skills:', skills);
|
|
231
|
+
console.log(' skills:', skills.count, `(${skills.split} as a short SKILL.md + ${lib.AGENT_PLUGIN_SKILL_REFERENCE})`);
|
|
218
232
|
console.log(' agent reference copies:', agents);
|
|
219
233
|
console.log(' hook scripts:', hookScripts.length);
|
|
220
234
|
console.log(` ${lib.COPILOT_PLUGIN_NAMESPACE}/agents:`, copilotAgents);
|
package/scripts/build-plugin.js
CHANGED
|
@@ -77,7 +77,9 @@ function rewriteContent(content) {
|
|
|
77
77
|
.replace(/~\/\.claude\/agents\//g, `${CONTENT_PREFIX}agents/`)
|
|
78
78
|
.replace(/\.\/\.claude\/agents\//g, `${CONTENT_PREFIX}agents/`)
|
|
79
79
|
.replace(/~\/\.claude\//g, CONTENT_PREFIX)
|
|
80
|
-
.replace(/\.\/\.claude\//g, CONTENT_PREFIX)
|
|
80
|
+
.replace(/\.\/\.claude\//g, CONTENT_PREFIX)
|
|
81
|
+
// No `pan-tools` bin is on PATH under a plugin either: invoke it via node.
|
|
82
|
+
.replace(/\bpan-tools\b(?=\s+[a-z])/g, `node ${CONTENT_PREFIX}pan-wizard-core/bin/pan-tools.cjs`);
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
function copyTree(srcDir, destDir, transformMd) {
|
|
@@ -222,6 +222,13 @@ def get_version() -> str:
|
|
|
222
222
|
# SKILLS-FULL-TEXT.md generator
|
|
223
223
|
# ---------------------------------------------------------------------------
|
|
224
224
|
|
|
225
|
+
def wrapper_fence(content: str) -> str:
|
|
226
|
+
"""A backtick fence longer than any fence inside the content, so the skill's own
|
|
227
|
+
code blocks cannot close the block that wraps it."""
|
|
228
|
+
longest = max((len(m.group(1)) for m in re.finditer(r"^ {0,3}(`{3,})", content, re.M)), default=0)
|
|
229
|
+
return "`" * max(3, longest + 1)
|
|
230
|
+
|
|
231
|
+
|
|
225
232
|
def generate_full_text(shipped: list[Skill], dev: list[Skill], version: str) -> str:
|
|
226
233
|
"""Generate the complete full-text document."""
|
|
227
234
|
lines = []
|
|
@@ -247,9 +254,10 @@ def generate_full_text(shipped: list[Skill], dev: list[Skill], version: str) ->
|
|
|
247
254
|
w("")
|
|
248
255
|
w(f"### {skill.command} ({skill.line_count} lines)")
|
|
249
256
|
w("")
|
|
250
|
-
|
|
257
|
+
fence = wrapper_fence(skill.content)
|
|
258
|
+
w(f"{fence}markdown")
|
|
251
259
|
w(skill.content.rstrip())
|
|
252
|
-
w(
|
|
260
|
+
w(fence)
|
|
253
261
|
w("")
|
|
254
262
|
|
|
255
263
|
w("")
|
|
@@ -265,9 +273,10 @@ def generate_full_text(shipped: list[Skill], dev: list[Skill], version: str) ->
|
|
|
265
273
|
w("")
|
|
266
274
|
w(f"### {skill.command} ({skill.line_count} lines)")
|
|
267
275
|
w("")
|
|
268
|
-
|
|
276
|
+
fence = wrapper_fence(skill.content)
|
|
277
|
+
w(f"{fence}markdown")
|
|
269
278
|
w(skill.content.rstrip())
|
|
270
|
-
w(
|
|
279
|
+
w(fence)
|
|
271
280
|
w("")
|
|
272
281
|
|
|
273
282
|
return "\n".join(lines)
|
package/scripts/test-surface.cjs
CHANGED
|
@@ -69,6 +69,10 @@ const EVENT_HOOKS = Object.freeze({
|
|
|
69
69
|
subagentStop: ['pan-cost-logger.js', 'pan-trace-logger.js'],
|
|
70
70
|
stop: ['pan-stop-guard.js'],
|
|
71
71
|
compact: ['pan-state-reinject.js'],
|
|
72
|
+
// Gemini and Copilot (market-ideas M33): the marker before a compaction, and the
|
|
73
|
+
// block on the next tool result — the same script in two modes.
|
|
74
|
+
compactMark: ['pan-state-reinject.js'],
|
|
75
|
+
compactInject: ['pan-state-reinject.js'],
|
|
72
76
|
});
|
|
73
77
|
|
|
74
78
|
// ─── Parsers (pure) ─────────────────────────────────────────────────────────
|