@pareto4/pp-core 1.17.1 → 1.19.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/.claude-plugin/plugin.json +1 -1
- package/README.md +5 -3
- package/agents/pp-code-fixer.md +9 -16
- package/agents/pp-code-reviewer.md +2 -78
- package/agents/pp-codebase-mapper.md +3 -0
- package/agents/pp-debugger.md +3 -2
- package/agents/pp-executor.md +25 -30
- package/agents/pp-integration-checker.md +1 -0
- package/agents/pp-phase-researcher.md +3 -1
- package/agents/pp-plan-checker.md +3 -0
- package/agents/pp-planner.md +16 -12
- package/agents/pp-research-synthesizer.md +1 -1
- package/agents/pp-ui-auditor.md +1 -0
- package/agents/pp-ui-researcher.md +3 -1
- package/agents/pp-vault-reviewer.md +43 -189
- package/agents/pp-verifier.md +10 -8
- package/commands/pp-add-tests.md +1 -1
- package/commands/pp-debug.md +1 -0
- package/commands/pp-init.md +4 -3
- package/commands/pp-ns-manage.md +1 -1
- package/commands/pp-ns-review.md +1 -1
- package/commands/pp-quick.md +3 -0
- package/commands/pp-review-backlog.md +2 -1
- package/commands/pp-vault-promote.md +7 -8
- package/commands/pp-vault-review.md +6 -7
- package/gemini-extension.json +1 -1
- package/package.json +3 -6
- package/pp-core/bin/lib/capability-registry.cjs +15 -357
- package/pp-core/bin/lib/capability-state.cjs +15 -79
- package/pp-core/bin/lib/capability-writer.cjs +2 -16
- package/pp-core/bin/lib/check-command-router.cjs +342 -2298
- package/pp-core/bin/lib/clusters.cjs +2 -2
- package/pp-core/bin/lib/commands.cjs +79 -4
- package/pp-core/bin/lib/compose-bindings.cjs +99 -16
- package/pp-core/bin/lib/config.cjs +3 -6
- package/pp-core/bin/lib/discovery-rollup.cjs +9 -6
- package/pp-core/bin/lib/discovery-screens.cjs +20 -2
- package/pp-core/bin/lib/discovery-sweep.cjs +12 -3
- package/pp-core/bin/lib/discovery-vault-check.cjs +37 -3
- package/pp-core/bin/lib/git-base-branch.cjs +10 -13
- package/pp-core/bin/lib/git-provider.cjs +5 -6
- package/pp-core/bin/lib/init-contract.cjs +55 -42
- package/pp-core/bin/lib/init-interactive.cjs +6 -20
- package/pp-core/bin/lib/io.cjs +2 -8
- package/pp-core/bin/lib/loop-resolver.cjs +8 -32
- package/pp-core/bin/lib/org-profile.cjs +16 -92
- package/pp-core/bin/lib/vault-command-router.cjs +174 -1206
- package/pp-core/bin/lib/vault-coordinates.cjs +4 -4
- package/pp-core/bin/lib/vault-index.cjs +44 -74
- package/pp-core/bin/lib/vault-seal.cjs +37 -122
- package/pp-core/bin/lib/vault-standards-promote.cjs +577 -0
- package/pp-core/bin/lib/vault-standards-review.cjs +293 -0
- package/pp-core/bin/lib/vault-standards.cjs +15 -16
- package/pp-core/bin/lib/vault-trace.cjs +40 -3016
- package/pp-core/bin/lib/vault-update.cjs +5 -26
- package/pp-core/bin/lib/vault.cjs +122 -316
- package/pp-core/bin/pp-tools.cjs +15 -36
- package/pp-core/org-profile.json +1 -1
- package/pp-core/references/autonomous-best-effort.md +4 -3
- package/pp-core/references/autonomous-lifecycle.md +1 -0
- package/pp-core/references/autonomous-smart-discuss.md +5 -1
- package/pp-core/references/discovery-id-conventions.md +35 -2
- package/pp-core/references/execute-mvp-tdd.md +3 -3
- package/pp-core/references/git-integration.md +57 -33
- package/pp-core/references/git-planning-commit.md +31 -9
- package/pp-core/references/phase-argument-parsing.md +1 -0
- package/pp-core/references/planner-gap-closure.md +1 -0
- package/pp-core/references/planner-revision.md +3 -1
- package/pp-core/references/planner-tdd.md +4 -4
- package/pp-core/references/planner-vault-standards.md +16 -25
- package/pp-core/references/planning-config.md +3 -3
- package/pp-core/references/shell-portability.md +28 -0
- package/pp-core/references/tdd.md +20 -16
- package/pp-core/references/worktree-path-safety.md +1 -0
- package/pp-core/templates/README.md +1 -1
- package/pp-core/templates/VAULT-REVIEW.md +24 -170
- package/pp-core/templates/milestone.md +5 -5
- package/pp-core/workflows/add-backlog.md +1 -1
- package/pp-core/workflows/add-tests.md +8 -5
- package/pp-core/workflows/add-todo.md +3 -1
- package/pp-core/workflows/ai-integration-phase.md +2 -1
- package/pp-core/workflows/audit-fix.md +7 -6
- package/pp-core/workflows/audit-milestone.md +1 -0
- package/pp-core/workflows/autonomous.md +6 -0
- package/pp-core/workflows/check-todos.md +2 -1
- package/pp-core/workflows/cleanup.md +3 -1
- package/pp-core/workflows/code-review-fix.md +15 -8
- package/pp-core/workflows/code-review.md +16 -58
- package/pp-core/workflows/complete-milestone.md +13 -3
- package/pp-core/workflows/debug.md +4 -2
- package/pp-core/workflows/diagnose-issues.md +1 -1
- package/pp-core/workflows/discovery-sprint/prototype.md +2 -2
- package/pp-core/workflows/discovery-sprint/session-13-gates.md +1 -1
- package/pp-core/workflows/discovery-sprint/sessions/01-kick-off.md +51 -7
- package/pp-core/workflows/discovery-sprint/sessions/02-as-is.md +5 -3
- package/pp-core/workflows/discovery-sprint/sessions/03-to-be.md +10 -8
- package/pp-core/workflows/discovery-sprint/sessions/04-ux-design.md +11 -2
- package/pp-core/workflows/discovery-sprint/sessions/05-architecture.md +5 -5
- package/pp-core/workflows/discovery-sprint/sessions/06-security.md +3 -3
- package/pp-core/workflows/discovery-sprint/sessions/07-identity.md +2 -2
- package/pp-core/workflows/discovery-sprint/sessions/08-integration.md +14 -2
- package/pp-core/workflows/discovery-sprint/sessions/09-qa.md +2 -2
- package/pp-core/workflows/discovery-sprint/sessions/10-infrastructure.md +10 -10
- package/pp-core/workflows/discovery-sprint/sessions/11-roadmap.md +11 -8
- package/pp-core/workflows/discovery-sprint/sessions/12-delivery-model.md +21 -18
- package/pp-core/workflows/discovery-sprint/sessions/13-wrap-up.md +5 -3
- package/pp-core/workflows/discovery-sprint/templates/context-template.md +9 -3
- package/pp-core/workflows/discovery-sprint/vault-context.md +17 -12
- package/pp-core/workflows/discovery-sprint.md +11 -8
- package/pp-core/workflows/discovery-to-build/steps/architecture-deliverables.md +1 -0
- package/pp-core/workflows/discuss-phase-assumptions.md +5 -3
- package/pp-core/workflows/discuss-phase.md +8 -3
- package/pp-core/workflows/docs-update.md +1 -0
- package/pp-core/workflows/eval-review.md +2 -1
- package/pp-core/workflows/execute-phase/steps/check-query-gate.md +13 -14
- package/pp-core/workflows/execute-phase/steps/cross-ai-delegation.md +1 -0
- package/pp-core/workflows/execute-phase/steps/execute-pre-dispatch.md +5 -25
- package/pp-core/workflows/execute-phase/steps/per-plan-worktree-gate.md +1 -0
- package/pp-core/workflows/execute-phase/steps/vault-fetch.md +18 -6
- package/pp-core/workflows/execute-phase/steps/vault-load-gate.md +6 -109
- package/pp-core/workflows/execute-phase/steps/verify-post-gate.md +1 -17
- package/pp-core/workflows/execute-phase.md +21 -12
- package/pp-core/workflows/execute-plan.md +24 -15
- package/pp-core/workflows/explore.md +1 -1
- package/pp-core/workflows/forensics.md +4 -2
- package/pp-core/workflows/health.md +1 -0
- package/pp-core/workflows/help/modes/full.md +1 -1
- package/pp-core/workflows/import.md +2 -1
- package/pp-core/workflows/ingest-docs.md +1 -0
- package/pp-core/workflows/init/steps/client-context-capture.md +1 -0
- package/pp-core/workflows/init/steps/github-provisioning.md +145 -0
- package/pp-core/workflows/init/steps/gitlab-provisioning.md +18 -4
- package/pp-core/workflows/init/steps/reachability-outcome.md +3 -1
- package/pp-core/workflows/init.md +56 -66
- package/pp-core/workflows/map-codebase.md +5 -1
- package/pp-core/workflows/milestone-summary.md +2 -1
- package/pp-core/workflows/mvp-phase.md +1 -0
- package/pp-core/workflows/new-milestone.md +9 -5
- package/pp-core/workflows/new-project.md +9 -8
- package/pp-core/workflows/new-workspace.md +1 -0
- package/pp-core/workflows/next.md +2 -1
- package/pp-core/workflows/pause-work.md +6 -4
- package/pp-core/workflows/plan-milestone-gaps.md +3 -1
- package/pp-core/workflows/plan-phase/steps/chunked-planning.md +1 -1
- package/pp-core/workflows/plan-phase.md +21 -6
- package/pp-core/workflows/plan-review-convergence.md +2 -0
- package/pp-core/workflows/plant-seed.md +4 -2
- package/pp-core/workflows/pr-branch.md +2 -0
- package/pp-core/workflows/progress.md +5 -0
- package/pp-core/workflows/quick.md +19 -12
- package/pp-core/workflows/reapply-patches.md +3 -0
- package/pp-core/workflows/remove-phase.md +1 -1
- package/pp-core/workflows/resume-project.md +3 -0
- package/pp-core/workflows/review.md +7 -1
- package/pp-core/workflows/secure-phase.md +2 -1
- package/pp-core/workflows/session-report.md +1 -0
- package/pp-core/workflows/ship.md +8 -1
- package/pp-core/workflows/sketch-wrap-up.md +1 -1
- package/pp-core/workflows/sketch.md +3 -2
- package/pp-core/workflows/spec-phase.md +2 -1
- package/pp-core/workflows/spike-wrap-up.md +1 -1
- package/pp-core/workflows/spike.md +4 -3
- package/pp-core/workflows/sync-skills.md +5 -2
- package/pp-core/workflows/thread.md +3 -2
- package/pp-core/workflows/transition.md +6 -0
- package/pp-core/workflows/ui-phase.md +3 -1
- package/pp-core/workflows/ui-review.md +2 -1
- package/pp-core/workflows/ultraplan-phase.md +1 -0
- package/pp-core/workflows/undo.md +14 -10
- package/pp-core/workflows/update.md +5 -0
- package/pp-core/workflows/validate-phase.md +9 -6
- package/pp-core/workflows/vault-review.md +65 -186
- package/pp-core/workflows/vault-write-back.md +78 -110
- package/pp-core/workflows/verify-phase.md +5 -0
- package/pp-core/workflows/verify-work.md +9 -2
- package/scripts/gen-capability-registry.cjs +12 -93
- package/scripts/lint-test-file-count.allowlist.json +1 -19
- package/scripts/lint-test-file-count.cjs +5 -6
- package/scripts/prompt-injection-scan.sh +1 -4
- package/scripts/sync-runtime-launcher.cjs +115 -5
- package/pp-core/bin/lib/practices-review-check.cjs +0 -944
- package/pp-core/bin/lib/vault-audit.cjs +0 -2594
- package/pp-core/bin/lib/vault-mode.cjs +0 -235
- package/pp-core/bin/lib/vault-practices.cjs +0 -2057
- package/pp-core/bin/lib/vault-review.cjs +0 -2102
- package/pp-core/bin/lib/vault-write-back.cjs +0 -905
- package/pp-core/references/planner-vault-practices.md +0 -95
- package/pp-core/references/practice-arithmetic-contract.md +0 -121
- package/pp-core/references/verifier-practice-verdicts.md +0 -263
- package/pp-core/templates/practices/README.md +0 -248
- package/pp-core/templates/practices/error-handling.md +0 -18
- package/pp-core/templates/practices/minimal-comments.md +0 -14
- package/pp-core/templates/practices/naming-convention.md +0 -18
- package/pp-core/templates/practices/practice-template.md +0 -23
- package/pp-core/workflows/execute-phase/steps/verifier-practice-payload.md +0 -165
- package/scripts/gen-practice-arithmetic-contract.cjs +0 -412
- package/scripts/practice-arithmetic-contract.allow.json +0 -35
- package/scripts/record-vault-mode-golden.cjs +0 -89
- package/scripts/vault-calibrate.cjs +0 -996
|
@@ -104,7 +104,7 @@ Extract from result: `removed`, `directory_deleted`, `renamed_directories`, `ren
|
|
|
104
104
|
Stage and commit the removal:
|
|
105
105
|
|
|
106
106
|
```bash
|
|
107
|
-
pp_run query commit "chore: remove phase {target} ({original-phase-name})" --files .planning/
|
|
107
|
+
pp_run query commit "chore(planning): remove phase {target} ({original-phase-name})" --files .planning/
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
The commit message preserves the historical record of what was removed.
|
|
@@ -68,6 +68,7 @@ cat .planning/PROJECT.md
|
|
|
68
68
|
Look for incomplete work that needs attention:
|
|
69
69
|
|
|
70
70
|
```bash
|
|
71
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
71
72
|
# Check for structured handoff (preferred — machine-readable)
|
|
72
73
|
cat .planning/HANDOFF.json 2>/dev/null || true
|
|
73
74
|
|
|
@@ -244,6 +245,7 @@ What would you like to do?
|
|
|
244
245
|
**Note:** When offering phase planning, check for CONTEXT.md existence first:
|
|
245
246
|
|
|
246
247
|
```bash
|
|
248
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
247
249
|
ls .planning/phases/XX-name/*-CONTEXT.md 2>/dev/null || true
|
|
248
250
|
```
|
|
249
251
|
|
|
@@ -297,6 +299,7 @@ Resume-specific exception: do **not** emit `/clear then:` here. Resume is alread
|
|
|
297
299
|
Before proceeding to routed workflow, record session continuity through the state verb, never by hand (a hand edit leaves the stored `stopped_at` behind, so `state json` and `state-snapshot` keep the older value):
|
|
298
300
|
|
|
299
301
|
```bash
|
|
302
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
300
303
|
pp_run query state.record-session --stopped-at "Session resumed, proceeding to [action]" ${GSD_WS}
|
|
301
304
|
```
|
|
302
305
|
|
|
@@ -181,6 +181,7 @@ Write to a temp file: `/tmp/pp-review-prompt-{phase}.md`
|
|
|
181
181
|
Also write individual section files so the budget tool can re-trim per reviewer:
|
|
182
182
|
|
|
183
183
|
```bash
|
|
184
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
184
185
|
# Write individual section files for per-reviewer budget trimming
|
|
185
186
|
# These are always written so reviewers with a budget can invoke prompt-budget
|
|
186
187
|
cp "$INSTRUCTIONS_BLOCK_FILE" "/tmp/pp-review-${PHASE}-instructions.md"
|
|
@@ -257,6 +258,7 @@ fi
|
|
|
257
258
|
|
|
258
259
|
**Codex:**
|
|
259
260
|
```bash
|
|
261
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
260
262
|
# $CODEX_BYPASS_FLAG is capability-gated above (#1115). Capture stderr to a .err
|
|
261
263
|
# file (not /dev/null) so a non-zero exit — e.g. a flag the installed codex-cli
|
|
262
264
|
# does not support — is diagnosable instead of a silent empty review.
|
|
@@ -353,6 +355,7 @@ Invocation specifics (verified agy 1.0.0, macOS arm64 and Linux amd64):
|
|
|
353
355
|
- No `-m` / `--model` flag — agy selects the model internally
|
|
354
356
|
|
|
355
357
|
```bash
|
|
358
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
356
359
|
# Pre-flight: snapshot the transcript watermark before invoking agy.
|
|
357
360
|
# Must run BEFORE agy -p — this is what prevents the fallback from reading a stale prior response.
|
|
358
361
|
_AGY_WS=$(git rev-parse --show-toplevel 2>/dev/null || pwd)
|
|
@@ -426,6 +429,7 @@ fi
|
|
|
426
429
|
Read host and model from config. All three local backends share the same `/v1/chat/completions` endpoint — only host and model differ. Use `jq --rawfile` to safely encode the multi-line prompt as JSON without shell-escaping issues.
|
|
427
430
|
|
|
428
431
|
```bash
|
|
432
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
429
433
|
# Shared helper: apply prompt-budget trimming for local reviewers
|
|
430
434
|
prepare_trimmed_prompt_for_reviewer() {
|
|
431
435
|
REVIEWER_KEY="$1"
|
|
@@ -508,6 +512,7 @@ fi
|
|
|
508
512
|
|
|
509
513
|
**LM Studio (local, OpenAI-compatible):**
|
|
510
514
|
```bash
|
|
515
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
511
516
|
# Resolve prompt budget for LM Studio: per-reviewer override > global default > null
|
|
512
517
|
LM_STUDIO_REVIEWER_BUDGET=$(pp_run query config-get review.max_prompt_tokens_per_reviewer.lm_studio 2>/dev/null | jq -r '.' 2>/dev/null || echo "null")
|
|
513
518
|
if [ -z "$LM_STUDIO_REVIEWER_BUDGET" ] || [ "$LM_STUDIO_REVIEWER_BUDGET" = "null" ]; then
|
|
@@ -561,6 +566,7 @@ fi
|
|
|
561
566
|
|
|
562
567
|
**llama.cpp (local, OpenAI-compatible):**
|
|
563
568
|
```bash
|
|
569
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
564
570
|
# Resolve prompt budget for llama.cpp: per-reviewer override > global default > null
|
|
565
571
|
LLAMA_CPP_REVIEWER_BUDGET=$(pp_run query config-get review.max_prompt_tokens_per_reviewer.llama_cpp 2>/dev/null | jq -r '.' 2>/dev/null || echo "null")
|
|
566
572
|
if [ -z "$LLAMA_CPP_REVIEWER_BUDGET" ] || [ "$LLAMA_CPP_REVIEWER_BUDGET" = "null" ]; then
|
|
@@ -728,7 +734,7 @@ trimmed_reviewers: # only present if at least one reviewer was trimmed
|
|
|
728
734
|
|
|
729
735
|
Commit:
|
|
730
736
|
```bash
|
|
731
|
-
pp_run query commit "docs: cross-AI review for phase {N}" --files {phase_dir}/{padded_phase}-REVIEWS.md
|
|
737
|
+
pp_run query commit "docs(planning): cross-AI review for phase {N}" --phase "{padded_phase}" --files {phase_dir}/{padded_phase}-REVIEWS.md
|
|
732
738
|
```
|
|
733
739
|
</step>
|
|
734
740
|
|
|
@@ -38,6 +38,7 @@ Display banner: `pp-core > SECURE PHASE {N}: {name}`
|
|
|
38
38
|
## 1. Detect Input State
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
41
42
|
SECURITY_FILE=$(ls "${PHASE_DIR}"/*-SECURITY.md 2>/dev/null | head -1)
|
|
42
43
|
PLAN_FILES=$(ls "${PHASE_DIR}"/*-PLAN.md 2>/dev/null)
|
|
43
44
|
SUMMARY_FILES=$(ls "${PHASE_DIR}"/*-SUMMARY.md 2>/dev/null)
|
|
@@ -151,7 +152,7 @@ Do NOT emit next-phase routing. Stop here.
|
|
|
151
152
|
## 7. Commit
|
|
152
153
|
|
|
153
154
|
```bash
|
|
154
|
-
pp_run query commit "docs(
|
|
155
|
+
pp_run query commit "docs(planning): add/update security threat verification" --phase "${PADDED_PHASE}"
|
|
155
156
|
```
|
|
156
157
|
|
|
157
158
|
## 8. Results + Routing
|
|
@@ -99,6 +99,7 @@ Verify the work is ready to ship:
|
|
|
99
99
|
```
|
|
100
100
|
|
|
101
101
|
```bash
|
|
102
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
102
103
|
SHIP_PRE_HOOKS_JSON=$(pp_run loop render-hooks ship:pre --raw)
|
|
103
104
|
printf '%s' "$SHIP_PRE_HOOKS_JSON" | node -e "let h=[];try{h=JSON.parse(require('fs').readFileSync(0,'utf-8')).activeHooks||[]}catch{}console.log('SHIP_PRE_HOOKS_JSON='+JSON.stringify({activeHooks:h}))"
|
|
104
105
|
SECURITY_FILE=$(ls "${PHASE_DIR}"/*-SECURITY.md 2>/dev/null | head -1)
|
|
@@ -173,11 +174,13 @@ Verify the work is ready to ship:
|
|
|
173
174
|
Push the current branch to remote:
|
|
174
175
|
|
|
175
176
|
```bash
|
|
177
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
176
178
|
git push origin ${CURRENT_BRANCH} 2>&1
|
|
177
179
|
```
|
|
178
180
|
|
|
179
181
|
If push fails (e.g., no upstream): set upstream:
|
|
180
182
|
```bash
|
|
183
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
181
184
|
git push --set-upstream origin ${CURRENT_BRANCH} 2>&1
|
|
182
185
|
```
|
|
183
186
|
|
|
@@ -370,6 +373,7 @@ If `REVIEW_CMD` is non-empty and not `"null"`, run the external review:
|
|
|
370
373
|
|
|
371
374
|
1. **Generate diff and stats:**
|
|
372
375
|
```bash
|
|
376
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
373
377
|
DIFF=$(git diff ${BASE_BRANCH}...HEAD)
|
|
374
378
|
DIFF_STATS=$(git diff --stat ${BASE_BRANCH}...HEAD)
|
|
375
379
|
```
|
|
@@ -382,6 +386,7 @@ If `REVIEW_CMD` is non-empty and not `"null"`, run the external review:
|
|
|
382
386
|
3. **Build review prompt and pipe to command via stdin:**
|
|
383
387
|
Construct a review prompt containing the diff, diff stats, and phase context, then pipe it to the configured command:
|
|
384
388
|
```bash
|
|
389
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
385
390
|
REVIEW_PROMPT="You are reviewing a pull request.\n\nDiff stats:\n${DIFF_STATS}\n\nPhase context:\n${STATE_STATUS}\n\nFull diff:\n${DIFF}\n\nRespond with JSON: { \"verdict\": \"APPROVED\" or \"REVISE\", \"confidence\": 0-100, \"summary\": \"...\", \"issues\": [{\"severity\": \"...\", \"file\": \"...\", \"line_range\": \"...\", \"description\": \"...\", \"suggestion\": \"...\"}] }"
|
|
386
391
|
PP_GATE_BIN=$(printf '%s\n' "${PP_TOOLS:+${PP_TOOLS%/*}:}$PATH" | tr : '\n' | while IFS= read -r d; do if [ -r "$d/portable-timeout.sh" ]; then printf %s "$d"; break; fi; done)
|
|
387
392
|
if [ -r "$PP_GATE_BIN/portable-timeout.sh" ]; then
|
|
@@ -399,6 +404,7 @@ If `REVIEW_CMD` is non-empty and not `"null"`, run the external review:
|
|
|
399
404
|
that disagreed. `is_timeout_exit` is not in scope in this block (the wrapper is sourced in
|
|
400
405
|
the block above), so the codes are tested numerically:
|
|
401
406
|
```bash
|
|
407
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
402
408
|
if [ "${REVIEW_EXIT}" -eq 124 ] || [ "${REVIEW_EXIT}" -eq 142 ]; then
|
|
403
409
|
echo "⚠ External review timed out after 120s (exit ${REVIEW_EXIT}) — advisory, not a failure"
|
|
404
410
|
elif [ "${REVIEW_EXIT}" -eq 127 ] || [ "${REVIEW_EXIT}" -eq 2 ]; then
|
|
@@ -455,6 +461,7 @@ AskUserQuestion:
|
|
|
455
461
|
|
|
456
462
|
**If "Request review":**
|
|
457
463
|
```bash
|
|
464
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
458
465
|
gh pr edit ${PR_NUMBER} --add-reviewer "${REVIEWER}"
|
|
459
466
|
```
|
|
460
467
|
|
|
@@ -472,7 +479,7 @@ pp_run query state.update "Status" "Phase ${PHASE_NUMBER} shipped — PR #${PR_N
|
|
|
472
479
|
|
|
473
480
|
If `commit_docs` is true:
|
|
474
481
|
```bash
|
|
475
|
-
pp_run query commit "docs(
|
|
482
|
+
pp_run query commit "docs(planning): ship phase ${PHASE_NUMBER} — PR #${PR_NUMBER}" --phase "${padded_phase}" --files .planning/STATE.md
|
|
476
483
|
```
|
|
477
484
|
</step>
|
|
478
485
|
|
|
@@ -233,7 +233,7 @@ If this routing line already exists (append mode), leave it as-is.
|
|
|
233
233
|
Commit all artifacts (if `COMMIT_DOCS` is true):
|
|
234
234
|
|
|
235
235
|
```bash
|
|
236
|
-
pp_run query commit "docs(
|
|
236
|
+
pp_run query commit "docs(planning): package [N] sketch findings into project skill" --files .planning/sketches/WRAP-UP-SUMMARY.md
|
|
237
237
|
```
|
|
238
238
|
</step>
|
|
239
239
|
|
|
@@ -94,6 +94,7 @@ mkdir -p .planning/sketches/themes
|
|
|
94
94
|
|
|
95
95
|
Check for existing sketches to determine numbering:
|
|
96
96
|
```bash
|
|
97
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
97
98
|
ls -d .planning/sketches/[0-9][0-9][0-9]-* 2>/dev/null | sort | tail -1
|
|
98
99
|
```
|
|
99
100
|
|
|
@@ -298,7 +299,7 @@ Iterate until satisfied.
|
|
|
298
299
|
|
|
299
300
|
**h.** Commit (if `COMMIT_DOCS` is true):
|
|
300
301
|
```bash
|
|
301
|
-
pp_run query commit "docs(
|
|
302
|
+
pp_run query commit "docs(planning): sketch NNN [winning direction] — [key visual insight]" --files .planning/sketches/NNN-descriptive-name/ .planning/sketches/MANIFEST.md
|
|
302
303
|
```
|
|
303
304
|
|
|
304
305
|
**i.** Report:
|
|
@@ -357,6 +358,6 @@ After all sketches complete:
|
|
|
357
358
|
- [ ] Winning variant selected and marked for each sketch
|
|
358
359
|
- [ ] All variants preserved (winner marked, not others deleted)
|
|
359
360
|
- [ ] MANIFEST.md is current
|
|
360
|
-
- [ ] Commits use `docs(
|
|
361
|
+
- [ ] Commits use `docs(planning): sketch NNN [winner]` format
|
|
361
362
|
- [ ] Summary presented with next-step routing
|
|
362
363
|
</success_criteria>
|
|
@@ -74,6 +74,7 @@ Exit.
|
|
|
74
74
|
|
|
75
75
|
**Check for existing SPEC.md:**
|
|
76
76
|
```bash
|
|
77
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
77
78
|
ls ${phase_dir}/*-SPEC.md 2>/dev/null | grep -v AI-SPEC | head -1 || true
|
|
78
79
|
```
|
|
79
80
|
|
|
@@ -447,7 +448,7 @@ Write to: `{phase_dir}/{padded_phase}-SPEC.md`
|
|
|
447
448
|
|
|
448
449
|
```bash
|
|
449
450
|
git add "${phase_dir}/${padded_phase}-SPEC.md"
|
|
450
|
-
git commit -m "
|
|
451
|
+
git commit -m "docs(planning): add SPEC.md for ${phase_name} — ${requirement_count} requirements" -m "Phase: ${padded_phase}"
|
|
451
452
|
```
|
|
452
453
|
|
|
453
454
|
If `commit_docs` is false: Skip commit. Note that SPEC.md was written but not committed.
|
|
@@ -247,7 +247,7 @@ Patterns and stack choices established across spike sessions. New spikes follow
|
|
|
247
247
|
Commit all artifacts (if `COMMIT_DOCS` is true):
|
|
248
248
|
|
|
249
249
|
```bash
|
|
250
|
-
pp_run query commit "docs(
|
|
250
|
+
pp_run query commit "docs(planning): package [N] spike findings into project skill" --files .planning/spikes/WRAP-UP-SUMMARY.md .planning/spikes/CONVENTIONS.md
|
|
251
251
|
```
|
|
252
252
|
</step>
|
|
253
253
|
|
|
@@ -91,6 +91,7 @@ mkdir -p .planning/spikes
|
|
|
91
91
|
|
|
92
92
|
Check for existing spikes to determine numbering:
|
|
93
93
|
```bash
|
|
94
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
94
95
|
ls -d .planning/spikes/[0-9][0-9][0-9]-* 2>/dev/null | sort | tail -1
|
|
95
96
|
```
|
|
96
97
|
|
|
@@ -335,7 +336,7 @@ tags: [tag1, tag2]
|
|
|
335
336
|
|
|
336
337
|
**i.** Commit (if `COMMIT_DOCS` is true):
|
|
337
338
|
```bash
|
|
338
|
-
pp_run query commit "docs(
|
|
339
|
+
pp_run query commit "docs(planning): spike NNN [VERDICT] — [key finding]" --files .planning/spikes/NNN-descriptive-name/ .planning/spikes/MANIFEST.md
|
|
339
340
|
```
|
|
340
341
|
|
|
341
342
|
**j.** Report:
|
|
@@ -389,7 +390,7 @@ Only include patterns that repeated across 2+ spikes or were explicitly chosen b
|
|
|
389
390
|
|
|
390
391
|
Commit (if `COMMIT_DOCS` is true):
|
|
391
392
|
```bash
|
|
392
|
-
pp_run query commit "docs(
|
|
393
|
+
pp_run query commit "docs(planning): update spike conventions" --files .planning/spikes/CONVENTIONS.md
|
|
393
394
|
```
|
|
394
395
|
</step>
|
|
395
396
|
|
|
@@ -448,6 +449,6 @@ pp_run query commit "docs(spikes): update conventions" --files .planning/spikes/
|
|
|
448
449
|
- [ ] CONVENTIONS.md created or updated with patterns that emerged
|
|
449
450
|
- [ ] Each spike README has complete frontmatter, Investigation Trail, and Results
|
|
450
451
|
- [ ] MANIFEST.md is current (with Type column and Requirements section)
|
|
451
|
-
- [ ] Commits use `docs(
|
|
452
|
+
- [ ] Commits use `docs(planning): spike NNN [VERDICT]` format
|
|
452
453
|
- [ ] Consolidated report presented with next-step routing
|
|
453
454
|
</success_criteria>
|
|
@@ -24,20 +24,21 @@ If neither `--dry-run` nor `--apply` is specified, dry-run is the default.
|
|
|
24
24
|
## Step 1: Parse Arguments
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
27
28
|
FROM_RUNTIME=""
|
|
28
29
|
TO_RUNTIMES=()
|
|
29
30
|
IS_APPLY=false
|
|
30
31
|
|
|
31
32
|
# Parse --from
|
|
32
33
|
if [[ "$@" == *"--from"* ]]; then
|
|
33
|
-
FROM_RUNTIME=$(echo "$@" | grep -
|
|
34
|
+
FROM_RUNTIME=$(echo "$@" | grep -oE -- '--from [^ ]+' | head -1 | sed 's/^--from //')
|
|
34
35
|
fi
|
|
35
36
|
|
|
36
37
|
# Parse --to
|
|
37
38
|
if [[ "$@" == *"--to all"* ]]; then
|
|
38
39
|
TO_RUNTIMES=(claude codex grok copilot cursor windsurf opencode gemini kilo augment trae qwen codebuddy cline antigravity)
|
|
39
40
|
elif [[ "$@" == *"--to"* ]]; then
|
|
40
|
-
TO_RUNTIMES=( $(echo "$@" | grep -
|
|
41
|
+
TO_RUNTIMES=( $(echo "$@" | grep -oE -- '--to [^ ]+' | sed 's/^--to //') )
|
|
41
42
|
fi
|
|
42
43
|
|
|
43
44
|
# Parse --apply
|
|
@@ -58,6 +59,7 @@ fi
|
|
|
58
59
|
Use `install.js --skills-root` to resolve paths — this reuses the single authoritative path table rather than duplicating it:
|
|
59
60
|
|
|
60
61
|
```bash
|
|
62
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
61
63
|
INSTALL_JS="$(dirname "$0")/../pp-core/bin/install.js"
|
|
62
64
|
# If running from a global install, resolve relative to the pp-core package
|
|
63
65
|
INSTALL_JS_GLOBAL="$HOME/.claude/pp-core/bin/install.js"
|
|
@@ -142,6 +144,7 @@ If `--dry-run` (or no flag): skip this step entirely and exit after printing the
|
|
|
142
144
|
For each destination with changes:
|
|
143
145
|
|
|
144
146
|
```bash
|
|
147
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
145
148
|
mkdir -p "$DEST_ROOT"
|
|
146
149
|
|
|
147
150
|
for SKILL in $CREATE_LIST $UPDATE_LIST; do
|
|
@@ -22,6 +22,7 @@ Create, list, close, or resume persistent context threads for cross-session work
|
|
|
22
22
|
**LIST / LIST-OPEN / LIST-RESOLVED mode:**
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
25
26
|
ls .planning/threads/*.md 2>/dev/null
|
|
26
27
|
```
|
|
27
28
|
|
|
@@ -74,7 +75,7 @@ When SUBCMD=close and SLUG is set (already sanitized):
|
|
|
74
75
|
|
|
75
76
|
3. Commit:
|
|
76
77
|
```bash
|
|
77
|
-
pp_run query commit "docs: resolve thread — {SLUG}" --files ".planning/threads/{SLUG}.md"
|
|
78
|
+
pp_run query commit "docs(planning): resolve thread — {SLUG}" --files ".planning/threads/{SLUG}.md"
|
|
78
79
|
```
|
|
79
80
|
|
|
80
81
|
4. Print:
|
|
@@ -186,7 +187,7 @@ updated: {today ISO date}
|
|
|
186
187
|
|
|
187
188
|
5. Commit:
|
|
188
189
|
```bash
|
|
189
|
-
pp_run query commit "docs: create thread — ${ARGUMENTS}" --files ".planning/threads/${SLUG}.md"
|
|
190
|
+
pp_run query commit "docs(planning): create thread — ${ARGUMENTS}" --files ".planning/threads/${SLUG}.md"
|
|
190
191
|
```
|
|
191
192
|
|
|
192
193
|
6. Report:
|
|
@@ -59,6 +59,7 @@ Note accumulated context that may need updating after transition.
|
|
|
59
59
|
Check current phase has all plan summaries:
|
|
60
60
|
|
|
61
61
|
```bash
|
|
62
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
62
63
|
(ls .planning/phases/XX-current/*-PLAN.md 2>/dev/null || true) | sort
|
|
63
64
|
(ls .planning/phases/XX-current/*-SUMMARY.md 2>/dev/null || true) | sort
|
|
64
65
|
```
|
|
@@ -81,6 +82,7 @@ cat .planning/config.json 2>/dev/null || true
|
|
|
81
82
|
**Check for verification debt in this phase:**
|
|
82
83
|
|
|
83
84
|
```bash
|
|
85
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
84
86
|
# Count outstanding items in current phase
|
|
85
87
|
OUTSTANDING=""
|
|
86
88
|
for f in .planning/phases/XX-current/*-UAT.md .planning/phases/XX-current/*-VERIFICATION.md; do
|
|
@@ -155,6 +157,7 @@ Wait for user decision.
|
|
|
155
157
|
Check for lingering handoffs:
|
|
156
158
|
|
|
157
159
|
```bash
|
|
160
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
158
161
|
ls .planning/phases/XX-current/.continue-here*.md 2>/dev/null || true
|
|
159
162
|
```
|
|
160
163
|
|
|
@@ -196,6 +199,7 @@ Evolve PROJECT.md to reflect learnings from completed phase.
|
|
|
196
199
|
**Read phase summaries:**
|
|
197
200
|
|
|
198
201
|
```bash
|
|
202
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
199
203
|
cat .planning/phases/XX-current/*-SUMMARY.md
|
|
200
204
|
```
|
|
201
205
|
|
|
@@ -385,6 +389,7 @@ After (if database indexing was addressed in Phase 2):
|
|
|
385
389
|
Record the transition in STATE.md's Session Continuity through the state verb, never by hand: it writes the `Stopped at:` line, the `Last session` timestamp and the frontmatter `stopped_at` together. A hand edit leaves the stored `stopped_at` behind, and `state json`, `state-snapshot` and later writes keep the older value.
|
|
386
390
|
|
|
387
391
|
```bash
|
|
392
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
388
393
|
pp_run query state.record-session --stopped-at "Phase [X] complete, ready to plan Phase [X+1]" --resume-file "None" ${GSD_WS}
|
|
389
394
|
```
|
|
390
395
|
|
|
@@ -452,6 +457,7 @@ Read ROADMAP.md to get the next phase's name and goal.
|
|
|
452
457
|
**Check if next phase has CONTEXT.md:**
|
|
453
458
|
|
|
454
459
|
```bash
|
|
460
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
455
461
|
ls .planning/phases/*[X+1]*/*-CONTEXT.md 2>/dev/null || true
|
|
456
462
|
```
|
|
457
463
|
|
|
@@ -32,6 +32,7 @@ Parse JSON for: `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded
|
|
|
32
32
|
|
|
33
33
|
Detect sketch findings:
|
|
34
34
|
```bash
|
|
35
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
35
36
|
SKETCH_FINDINGS_PATH=$(ls ./.claude/skills/sketch-findings-*/SKILL.md 2>/dev/null | head -1 || true)
|
|
36
37
|
```
|
|
37
38
|
|
|
@@ -113,6 +114,7 @@ Continue (non-blocking).
|
|
|
113
114
|
## 4. Check Existing UI-SPEC
|
|
114
115
|
|
|
115
116
|
```bash
|
|
117
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
116
118
|
UI_SPEC_FILE=$(ls "${PHASE_DIR}"/*-UI-SPEC.md 2>/dev/null | head -1)
|
|
117
119
|
```
|
|
118
120
|
|
|
@@ -320,7 +322,7 @@ Dimensions: 6/6 passed
|
|
|
320
322
|
## 11. Commit (if configured)
|
|
321
323
|
|
|
322
324
|
```bash
|
|
323
|
-
pp_run query commit "docs(
|
|
325
|
+
pp_run query commit "docs(planning): UI design contract" --phase "${padded_phase}" --files "${PHASE_DIR}/${PADDED_PHASE}-UI-SPEC.md"
|
|
324
326
|
```
|
|
325
327
|
|
|
326
328
|
## 12. Update State
|
|
@@ -38,6 +38,7 @@ Display banner:
|
|
|
38
38
|
## 1. Detect Input State
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
41
42
|
SUMMARY_FILES=$(ls "${PHASE_DIR}"/*-SUMMARY.md 2>/dev/null)
|
|
42
43
|
UI_SPEC_FILE=$(ls "${PHASE_DIR}"/*-UI-SPEC.md 2>/dev/null | head -1)
|
|
43
44
|
UI_REVIEW_FILE=$(ls "${PHASE_DIR}"/*-UI-REVIEW.md 2>/dev/null | head -1)
|
|
@@ -177,7 +178,7 @@ tools is detected at runtime.
|
|
|
177
178
|
## 5. Commit (if configured)
|
|
178
179
|
|
|
179
180
|
```bash
|
|
180
|
-
pp_run query commit "docs(
|
|
181
|
+
pp_run query commit "docs(planning): UI audit review" --phase "${padded_phase}" --files "${PHASE_DIR}/${PADDED_PHASE}-UI-REVIEW.md"
|
|
181
182
|
```
|
|
182
183
|
|
|
183
184
|
</process>
|
|
@@ -29,6 +29,7 @@ Use /pp:plan-phase for stable local planning.
|
|
|
29
29
|
Check that the session is running inside Claude Code:
|
|
30
30
|
|
|
31
31
|
```bash
|
|
32
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
32
33
|
if [ "$CLAUDECODE" = "1" ] || [ -n "$CLAUDE_CODE_ENTRYPOINT" ]; then
|
|
33
34
|
CC_VERSION="$(claude --version 2>/dev/null | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+' | head -n1)"
|
|
34
35
|
if [ -n "$CC_VERSION" ] && [ "$(printf '%s\n' "2.1.91" "$CC_VERSION" | sort -V | head -n1)" = "2.1.91" ]; then
|
|
@@ -50,17 +50,18 @@ Based on MODE, gather candidate commits.
|
|
|
50
50
|
|
|
51
51
|
Run:
|
|
52
52
|
```bash
|
|
53
|
-
|
|
53
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
54
|
+
git log --no-merges -${COUNT} --format='%h %s [Phase: %(trailers:key=Phase,valueonly,separator=%x2C)]'
|
|
54
55
|
```
|
|
55
56
|
|
|
56
|
-
Filter for
|
|
57
|
+
Filter for conventional commits matching `type(scope): message` or `type: message` (e.g., `feat(auth):`, `docs(planning):`, `fix:`). The scope names a part of the codebase; the phase or plan a commit belongs to is its `Phase:` trailer, shown in brackets (empty when the commit has none).
|
|
57
58
|
|
|
58
59
|
Display a numbered list of matching commits:
|
|
59
60
|
```
|
|
60
61
|
Recent pp-core commits:
|
|
61
|
-
1. abc1234 feat(
|
|
62
|
-
2. def5678 docs(
|
|
63
|
-
3. ghi9012 fix(
|
|
62
|
+
1. abc1234 feat(auth): implement auth endpoint [Phase: 04-01]
|
|
63
|
+
2. def5678 docs(planning): complete plan summary [Phase: 03-02]
|
|
64
|
+
3. ghi9012 fix(validation): correct validation logic [Phase: 02-03]
|
|
64
65
|
```
|
|
65
66
|
|
|
66
67
|
|
|
@@ -82,9 +83,10 @@ If the file exists and `manifest.phases?.[TARGET_PHASE]?.commits` is a non-empty
|
|
|
82
83
|
|
|
83
84
|
If the file does not exist, or `manifest.phases?.[TARGET_PHASE]` is missing:
|
|
84
85
|
- Display: "Manifest has no entry for phase ${TARGET_PHASE} (or file missing), falling back to git log search"
|
|
85
|
-
- Fallback: run git log and filter for the target phase
|
|
86
|
+
- Fallback: run git log and filter for commits whose `Phase:` trailer is the target phase or one of its plans (a `type(<phase>):` subject from before the trailer convention also matches):
|
|
86
87
|
```bash
|
|
87
|
-
git log --
|
|
88
|
+
git log --no-merges --all --format='%h %s [Phase: %(trailers:key=Phase,valueonly,separator=%x2C)]' \
|
|
89
|
+
| grep -E "\[Phase: 0*${TARGET_PHASE}(-[0-9]+)?\]|\(0*${TARGET_PHASE}(-[0-9]+)?\):" | head -50
|
|
88
90
|
```
|
|
89
91
|
- Use matching commits as COMMITS
|
|
90
92
|
|
|
@@ -94,7 +96,8 @@ If the file does not exist, or `manifest.phases?.[TARGET_PHASE]` is missing:
|
|
|
94
96
|
|
|
95
97
|
Run:
|
|
96
98
|
```bash
|
|
97
|
-
git log --
|
|
99
|
+
git log --no-merges --all --format='%h %s [Phase: %(trailers:key=Phase,valueonly,separator=%x2C)]' \
|
|
100
|
+
| grep -E "\[Phase: ${TARGET_PLAN}\]|\(${TARGET_PLAN}\):" | head -50
|
|
98
101
|
```
|
|
99
102
|
|
|
100
103
|
Use matching commits as COMMITS.
|
|
@@ -214,6 +217,7 @@ Sort COMMITS in reverse chronological order (newest first). If commits came from
|
|
|
214
217
|
|
|
215
218
|
For each commit hash in COMMITS:
|
|
216
219
|
```bash
|
|
220
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
217
221
|
git revert --no-commit ${HASH}
|
|
218
222
|
```
|
|
219
223
|
|
|
@@ -246,12 +250,12 @@ After all reverts are staged successfully, create a single commit:
|
|
|
246
250
|
|
|
247
251
|
For MODE=phase:
|
|
248
252
|
```bash
|
|
249
|
-
git commit -m "revert
|
|
253
|
+
git commit -m "revert: undo phase ${TARGET_PHASE} — ${REVERT_REASON}" -m "Phase: ${TARGET_PHASE}"
|
|
250
254
|
```
|
|
251
255
|
|
|
252
256
|
For MODE=plan:
|
|
253
257
|
```bash
|
|
254
|
-
git commit -m "revert
|
|
258
|
+
git commit -m "revert: undo plan ${TARGET_PLAN} — ${REVERT_REASON}" -m "Phase: ${TARGET_PLAN}"
|
|
255
259
|
```
|
|
256
260
|
|
|
257
261
|
For MODE=last:
|
|
@@ -18,6 +18,7 @@ First, derive `PREFERRED_CONFIG_DIR` and `PREFERRED_RUNTIME` from the invoking p
|
|
|
18
18
|
Then resolve the install context via the deterministic projection (#498). **Do NOT re-derive scope, runtime, or version by hand** — `update-context` owns that cascade in tested code (`pp-core/bin/lib/update-context.cjs`), the same way `check-latest-version` owns the package name (#2992):
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
21
22
|
# Resolve pp-tools.cjs WITHOUT yet knowing GSD_DIR. The running workflow lives
|
|
22
23
|
# at <PREFERRED_CONFIG_DIR>/pp-core/workflows/update.md, so its sibling
|
|
23
24
|
# bin/pp-tools.cjs is the authoritative tool for THIS install. Fall back to a
|
|
@@ -79,6 +80,7 @@ If multiple runtime installs are detected and the invoking runtime cannot be det
|
|
|
79
80
|
Determine the release channel from `$ARGUMENTS`. This selects which npm dist-tag the entire update flow targets — `latest` (stable) by default, or `next` (the RC channel established by ADR #660) when the user opts in with `--next`/`--rc`:
|
|
80
81
|
|
|
81
82
|
```bash
|
|
83
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
82
84
|
case " $ARGUMENTS " in
|
|
83
85
|
*" --next "*|*" --rc "*)
|
|
84
86
|
TAG="next"
|
|
@@ -102,6 +104,7 @@ The `GSD_DIR` value emitted by `get_installed_version` (line 4) resolves to the
|
|
|
102
104
|
`LATEST_RESULT` is a JSON document with the documented shape `{ ok: bool, version: string, reason: string, detail?: string }`. Parse via `jq` ONLY when the script actually ran. When `GSD_DIR` is empty (scope `UNKNOWN`), skip the check entirely and seed the parsed fields with their no-op values so downstream logic does not mistake an unset `LATEST_RESULT` for a failed network check (#2993 CR feedback):
|
|
103
105
|
|
|
104
106
|
```bash
|
|
107
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
105
108
|
if [ -z "$GSD_DIR" ]; then
|
|
106
109
|
# No install detected — fall through to install step; version-check is skipped.
|
|
107
110
|
LATEST_RESULT=""
|
|
@@ -312,6 +315,7 @@ Back up each custom file to `$RUNTIME_DIR/pp-user-files-backup/` before the
|
|
|
312
315
|
installer wipes the directories:
|
|
313
316
|
|
|
314
317
|
```bash
|
|
318
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
315
319
|
BACKUP_DIR="$RUNTIME_DIR/pp-user-files-backup"
|
|
316
320
|
mkdir -p "$BACKUP_DIR"
|
|
317
321
|
|
|
@@ -377,6 +381,7 @@ Capture output. If install fails, show error and exit.
|
|
|
377
381
|
Clear the update cache so statusline indicator disappears:
|
|
378
382
|
|
|
379
383
|
```bash
|
|
384
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
380
385
|
expand_home() {
|
|
381
386
|
case "$1" in
|
|
382
387
|
"~/"*) printf '%s/%s\n' "$HOME" "${1#~/}" ;;
|
|
@@ -53,11 +53,12 @@ case "$VAULT_ADMIT" in on) echo "VAULT_ADMIT=on" ;; off|inert) : ;; *) pp_run va
|
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
**If the fence printed no `VAULT_ADMIT=on` line** (`off` and `inert` print nothing): skip the rest of this block silently. Otherwise run the load
|
|
56
|
-
gate on the `execute:pre` payload, filtered in the fence to the `vault`
|
|
57
|
-
|
|
56
|
+
gate on the `execute:pre` payload, filtered in the fence to the `vault`
|
|
57
|
+
capability (D-30):
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
|
-
|
|
60
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
61
|
+
VP_EXECUTE_PRE_HOOKS_JSON=$(pp_run loop render-hooks execute:pre --raw | node -e "const d=require('fs').readFileSync(0,'utf-8');try{const j=JSON.parse(d);j.activeHooks=(j.activeHooks||[]).filter((x)=>x&&x.capId==='vault');process.stdout.write(JSON.stringify(j));}catch{process.stdout.write('');}")
|
|
61
62
|
printf '%s' "$VP_EXECUTE_PRE_HOOKS_JSON" | node -e "let h=[];try{h=JSON.parse(require('fs').readFileSync(0,'utf-8')).activeHooks||[]}catch{}console.log('VP_EXECUTE_PRE_HOOKS_JSON='+JSON.stringify({activeHooks:h}))"
|
|
62
63
|
```
|
|
63
64
|
|
|
@@ -72,6 +73,7 @@ it owns the halt.
|
|
|
72
73
|
## 1. Detect Input State
|
|
73
74
|
|
|
74
75
|
```bash
|
|
76
|
+
[ -z "${ZSH_VERSION:-}" ] || emulate -R sh
|
|
75
77
|
VALIDATION_FILE=$(ls "${PHASE_DIR}"/*-VALIDATION.md 2>/dev/null | head -1)
|
|
76
78
|
SUMMARY_FILES=$(ls "${PHASE_DIR}"/*-SUMMARY.md 2>/dev/null)
|
|
77
79
|
```
|
|
@@ -188,9 +190,10 @@ Handle return:
|
|
|
188
190
|
|
|
189
191
|
```bash
|
|
190
192
|
git add {test_files}
|
|
191
|
-
|
|
193
|
+
# {area}: the part of the codebase the tests cover; drop "({area})" when no single area fits
|
|
194
|
+
git commit -m "test({area}): add Nyquist validation tests" -m "Phase: ${PADDED_PHASE}"
|
|
192
195
|
|
|
193
|
-
pp_run query commit "docs(
|
|
196
|
+
pp_run query commit "docs(planning): add/update validation strategy" --phase "${PADDED_PHASE}"
|
|
194
197
|
```
|
|
195
198
|
|
|
196
199
|
Vault door record (D-12), only when Step 5 ran: after the door's last source commit, set `DOOR_DIR="${PHASE_DIR}"`,
|
|
@@ -205,7 +208,7 @@ The verb writes a `## Vault Door Record` (mode, vault ref and sha, governing pha
|
|
|
205
208
|
recorded and the end commit; the agent never types a sha) into a fresh per-run artifact, because it refuses a second record
|
|
206
209
|
in one file (D-57) and a rewritten report would drop the earlier run's coverage (D-79). It prints
|
|
207
210
|
nothing and writes nothing unless `vault admission` answers `on`. When it wrote the file and
|
|
208
|
-
`commit_docs` is true, commit the `artifact` path it printed: `pp_run query commit "docs(
|
|
211
|
+
`commit_docs` is true, commit the `artifact` path it printed: `pp_run query commit "docs(planning): vault door record for validate-phase" --phase "${PADDED_PHASE}" --files "<that artifact>"`.
|
|
209
212
|
|
|
210
213
|
(A per-run `-VALIDATION.md` name would be read as the phase's validation strategy by the `*-VALIDATION.md`
|
|
211
214
|
globs, so validate-phase's record uses the `-ADD-TESTS.md` suffix: what it records is the tests it added.)
|