@pareto4/pp-core 1.17.1 → 1.18.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 +0 -11
- package/agents/pp-code-reviewer.md +1 -78
- package/agents/pp-executor.md +9 -23
- package/agents/pp-planner.md +11 -11
- package/agents/pp-vault-reviewer.md +43 -189
- package/agents/pp-verifier.md +0 -6
- package/commands/pp-ns-manage.md +1 -1
- package/commands/pp-ns-review.md +1 -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 +13 -355
- 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 +277 -2273
- package/pp-core/bin/lib/clusters.cjs +2 -2
- package/pp-core/bin/lib/compose-bindings.cjs +2 -2
- package/pp-core/bin/lib/config.cjs +3 -6
- 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 +7 -35
- 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 +3 -3
- package/pp-core/bin/lib/vault-index.cjs +27 -70
- 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 +1 -26
- package/pp-core/bin/lib/vault.cjs +120 -314
- package/pp-core/bin/pp-tools.cjs +5 -32
- package/pp-core/references/autonomous-best-effort.md +1 -1
- package/pp-core/references/planner-vault-standards.md +16 -25
- package/pp-core/templates/README.md +1 -1
- package/pp-core/templates/VAULT-REVIEW.md +24 -170
- package/pp-core/workflows/add-tests.md +3 -3
- package/pp-core/workflows/audit-fix.md +3 -3
- package/pp-core/workflows/code-review-fix.md +3 -3
- package/pp-core/workflows/code-review.md +1 -57
- package/pp-core/workflows/debug.md +2 -2
- package/pp-core/workflows/discovery-sprint/prototype.md +2 -2
- package/pp-core/workflows/discovery-sprint/vault-context.md +4 -10
- package/pp-core/workflows/execute-phase/steps/check-query-gate.md +11 -13
- package/pp-core/workflows/execute-phase/steps/execute-pre-dispatch.md +5 -25
- package/pp-core/workflows/execute-phase/steps/vault-fetch.md +6 -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 +2 -5
- package/pp-core/workflows/execute-plan.md +6 -8
- package/pp-core/workflows/help/modes/full.md +1 -1
- package/pp-core/workflows/quick.md +8 -8
- package/pp-core/workflows/validate-phase.md +3 -3
- package/pp-core/workflows/vault-review.md +64 -186
- package/pp-core/workflows/vault-write-back.md +73 -110
- package/pp-core/workflows/verify-work.md +1 -1
- 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 +0 -3
- 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
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
<purpose>
|
|
2
|
-
Retroactive
|
|
3
|
-
any
|
|
4
|
-
|
|
2
|
+
Retroactive review of a completed phase against the client vault's standards documents. Works on
|
|
3
|
+
any phase whose plans carry a `<vault_standards>` block. Produces `{padded}-VAULT-REVIEW.md` with one
|
|
4
|
+
verdict per standards document that governed the phase, and counts by verdict. This workflow
|
|
5
|
+
reports; it gates nothing.
|
|
5
6
|
</purpose>
|
|
6
7
|
|
|
7
|
-
<required_reading>
|
|
8
|
-
@~/.claude/pp-core/references/verifier-practice-verdicts.md
|
|
9
|
-
</required_reading>
|
|
10
|
-
|
|
11
8
|
<available_agent_types>
|
|
12
9
|
Valid pp-core subagent types (use exact names — do not fall back to 'general-purpose'):
|
|
13
|
-
- pp-vault-reviewer — Judges the
|
|
10
|
+
- pp-vault-reviewer — Judges whether the phase's changes conform to each governing standards document
|
|
14
11
|
</available_agent_types>
|
|
15
12
|
|
|
16
13
|
<process>
|
|
@@ -24,57 +21,30 @@ if [[ "$INIT" == @file:* ]]; then INIT=$(cat "${INIT#@file:}"); fi
|
|
|
24
21
|
AGENT_SKILLS_VAULT_REVIEWER=$(pp_run query agent-skills pp-vault-reviewer)
|
|
25
22
|
```
|
|
26
23
|
|
|
27
|
-
Parse: `phase_dir`, `phase_number`, `phase_name`, `
|
|
28
|
-
|
|
29
|
-
### 0a. The vault-off short-circuit — the first act of this workflow
|
|
24
|
+
Parse: `phase_dir`, `phase_number`, `phase_name`, `padded_phase`, `commit_docs`.
|
|
30
25
|
|
|
31
|
-
|
|
26
|
+
### 0a. Derive first, and stop when there is nothing to review
|
|
32
27
|
|
|
33
28
|
```bash
|
|
34
29
|
REVIEW_PAYLOAD=$(pp_run check vault-review "${PHASE_DIR}" --raw)
|
|
35
30
|
REVIEW_STATUS=$(printf '%s' "${REVIEW_PAYLOAD}" | node -e "let s='';process.stdin.on('data',d=>{s+=d}).on('end',()=>{try{console.log(JSON.parse(s).status||'')}catch{console.log('unparseable')}})")
|
|
36
31
|
```
|
|
37
32
|
|
|
38
|
-
|
|
39
|
-
Nothing below this line runs: no agent is spawned, no template is read, and no `VAULT-REVIEW.md` is
|
|
40
|
-
written. A project with the vault practices capability off is left byte-identical by this command
|
|
41
|
-
(the CLAUDE.md inertness rule).
|
|
42
|
-
|
|
43
|
-
**If `REVIEW_STATUS` is `not_applicable` or `bad-config`:** print the payload's `statement` field
|
|
44
|
-
verbatim and STOP: nothing below runs, no agent is spawned. `not_applicable` is standards mode
|
|
45
|
-
(`vault.mode = standards`): the practices review is parked, and the consulted documents are recorded
|
|
46
|
-
in each plan's `<vault_standards>` block and its SUMMARY's `Standards Consulted` section.
|
|
47
|
-
`bad-config` is a `vault.mode` the engine cannot read.
|
|
48
|
-
|
|
49
|
-
Why the branch is on the arm's output rather than on the config: **this workflow never reads
|
|
50
|
-
`vault.enabled` or `practices_enabled` itself.** Policy has one home — the CLI arm resolves both keys
|
|
51
|
-
through the shared reader and answers before it touches the vault, the trace or a git subprocess. The
|
|
52
|
-
arm's inert sentence is proven byte-identical between the two spellings of "off" (the key absent, and
|
|
53
|
-
the key present and explicitly `false`) by plan 06-04's integration suite, which compares the two
|
|
54
|
-
outputs byte for byte. Branching here on the arm's output is what makes that proof this workflow's
|
|
55
|
-
proof too; a second config read would be a second policy home that could disagree with the first.
|
|
56
|
-
|
|
57
|
-
**Capability-OFF is not the same input as an absent vault.** They are never collapsed:
|
|
58
|
-
|
|
59
|
-
| Input | What happens |
|
|
33
|
+
| `REVIEW_STATUS` | What happens |
|
|
60
34
|
|---|---|
|
|
61
|
-
| The
|
|
62
|
-
|
|
|
63
|
-
|
|
|
35
|
+
| `inert` | The vault is off for this project. Print the payload's `statement` and stop. Nothing is written. |
|
|
36
|
+
| `no-argument`, `usage`, `unresolved` | Print the `statement` and stop: the CLI could not use the phase argument. Re-run with the phase directory. |
|
|
37
|
+
| `no-records` | Print the `statement` and stop: no plan in this phase was governed by a standards document. |
|
|
38
|
+
| `ok` | Continue. |
|
|
64
39
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
an absence of gaps.
|
|
68
|
-
|
|
69
|
-
**If `REVIEW_STATUS` is `usage`, `no-argument` or `unresolved`:** print the payload's `statement`
|
|
70
|
-
verbatim and stop — the arm reviewed nothing and said which argument it could not use. Re-run with
|
|
71
|
-
the phase directory.
|
|
40
|
+
This workflow never reads `vault.enabled` itself; the CLI is the one place that decides whether the
|
|
41
|
+
vault applies.
|
|
72
42
|
|
|
73
43
|
Then display the banner:
|
|
74
44
|
|
|
75
45
|
```
|
|
76
46
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
77
|
-
pp-core ► VAULT
|
|
47
|
+
pp-core ► VAULT STANDARDS REVIEW — PHASE {N}: {name}
|
|
78
48
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
79
49
|
```
|
|
80
50
|
|
|
@@ -82,20 +52,17 @@ Then display the banner:
|
|
|
82
52
|
|
|
83
53
|
```bash
|
|
84
54
|
SUMMARY_FILES=$(ls "${PHASE_DIR}"/*-SUMMARY.md 2>/dev/null)
|
|
85
|
-
PLAN_FILES=$(ls "${PHASE_DIR}"/*-PLAN.md 2>/dev/null)
|
|
86
55
|
VAULT_REVIEW_FILE=$(ls "${PHASE_DIR}"/*-VAULT-REVIEW.md 2>/dev/null | head -1)
|
|
87
56
|
```
|
|
88
57
|
|
|
89
|
-
- **State A** (`VAULT_REVIEW_FILE` non-empty): a review already exists
|
|
90
|
-
|
|
91
|
-
- **State B** (`SUMMARY_FILES` non-empty): the phase is completed
|
|
92
|
-
- **State C** (`SUMMARY_FILES` empty): exit cleanly
|
|
93
|
-
`/pp:execute-phase {N}` first."
|
|
94
|
-
**any completed phase** eligible, traced or not; State C refuses only a phase that was never built,
|
|
95
|
-
because there is no work to review.
|
|
96
|
-
|
|
58
|
+
- **State A** (`VAULT_REVIEW_FILE` non-empty): a review already exists. Re-review, and append a dated
|
|
59
|
+
block to the artifact's Audit Trail rather than discarding the previous one.
|
|
60
|
+
- **State B** (`SUMMARY_FILES` non-empty): the phase is completed. Run the review.
|
|
61
|
+
- **State C** (`SUMMARY_FILES` empty): exit cleanly with "Phase {N} not executed. Run
|
|
62
|
+
`/pp:execute-phase {N}` first."
|
|
97
63
|
|
|
98
64
|
**Text mode (`workflow.text_mode: true` in config or `--text` flag):** Set `TEXT_MODE=true` if `--text` is present in `$ARGUMENTS` OR `text_mode` from init JSON is `true`. When TEXT_MODE is active, replace every `AskUserQuestion` call with a plain-text numbered list and ask the user to type their choice number. This is required for non-Claude runtimes (OpenAI Codex, Gemini CLI, etc.) where `AskUserQuestion` is not available.
|
|
65
|
+
|
|
99
66
|
**In State A**, use AskUserQuestion:
|
|
100
67
|
- header: "Existing Vault Review"
|
|
101
68
|
- question: "VAULT-REVIEW.md already exists for Phase {N}."
|
|
@@ -105,60 +72,20 @@ VAULT_REVIEW_FILE=$(ls "${PHASE_DIR}"/*-VAULT-REVIEW.md 2>/dev/null | head -1)
|
|
|
105
72
|
|
|
106
73
|
If "View": display the file, exit. If "Re-review": continue.
|
|
107
74
|
|
|
108
|
-
## 2.
|
|
109
|
-
|
|
110
|
-
Read one flag from the payload, and carry it to the spawn:
|
|
75
|
+
## 2. What the payload gives the reviewer
|
|
111
76
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
`predicate.vault.state: loaded`. A degraded block sets it **false**, and so does an absent one. Two
|
|
115
|
-
fields beside it say which case this is and why: `trace.state` is `loaded`, `degraded`, or `null`
|
|
116
|
-
when no block was found at all, and `trace.reason` names the artifact that failed and what it
|
|
117
|
-
recorded. Do not recompute the flag here — it is derived once, in the CLI, from data this workflow
|
|
118
|
-
never reads.
|
|
77
|
+
The payload is the CLI's derivation and is passed to the agent verbatim; this workflow does not
|
|
78
|
+
reinterpret it.
|
|
119
79
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
80
|
+
- `documents[]`: every standards document that governed a plan in this phase, with `cachePath` (the
|
|
81
|
+
cached copy to read; `null` when it is not cached) and `governed[]` (each plan it governed, the
|
|
82
|
+
planner's `reason`, and the executor's `consulted` status).
|
|
83
|
+
- `plans[]`: each plan's record files, its commit `range`, and the source `files` changed in that
|
|
84
|
+
range (`filesTruncated` when the list was capped).
|
|
85
|
+
- `gaps[]`: facts the CLI could not establish. Every gap goes into the artifact's `## Not Derived`
|
|
86
|
+
section; a gap is never silently dropped and never turned into a verdict.
|
|
125
87
|
|
|
126
|
-
## 3.
|
|
127
|
-
|
|
128
|
-
`pp-core/workflows/secure-phase.md` states the rule this step copies, in its own words:
|
|
129
|
-
|
|
130
|
-
> "Empty-by-no-planning must not rubber-stamp a clean SECURITY.md."
|
|
131
|
-
|
|
132
|
-
Restated for this tier: **an empty or absent trace must never produce a clean review. Reconstruct
|
|
133
|
-
first, then judge.**
|
|
134
|
-
|
|
135
|
-
| Provenance | What runs |
|
|
136
|
-
|---|---|
|
|
137
|
-
| `trace_present_and_loaded: true`, remainder empty | The derived rows are the whole review. Render them; the agent judges nothing because nothing was left unsettled. |
|
|
138
|
-
| `trace_present_and_loaded: true`, remainder non-empty | Spawn in **verify mode** — judge the supplied remainder only. |
|
|
139
|
-
| `trace_present_and_loaded: false` | Spawn in **RECONSTRUCT mode** — the applicable practice set was rebuilt by the CLI from this phase's real diff crossed with the vault's own practice list, and that reconstructed set is what gets judged. |
|
|
140
|
-
|
|
141
|
-
**Reconstruct is the primary path, not a degraded one.** A project with no `vault` config key has no
|
|
142
|
-
phase that has or can have a trace, so every review of its own history takes this arm. The payload
|
|
143
|
-
says so in its `statements[]`, and the artifact repeats it.
|
|
144
|
-
|
|
145
|
-
## 4. The derived payload
|
|
146
|
-
|
|
147
|
-
`REVIEW_PAYLOAD`, captured in step 0a, is the review's whole factual input and is consumed before the
|
|
148
|
-
spawn. It carries, already computed: `range`, `rangeSource`, `filesConsidered`, the input set, both
|
|
149
|
-
derived-`N-A` populations with their own labels and reasons, the partitioned remainder, the derived
|
|
150
|
-
`derivedCounts` / `derivedRateLine` (what those two describe, and what they are never written as,
|
|
151
|
-
is stated once in the contract block carried into the spawn prompt below),
|
|
152
|
-
`practiceEntries` (each practice's prose already fenced and defanged by the
|
|
153
|
-
shipped renderer), `statements[]`, `notes[]` and `refusesCleanRender`.
|
|
154
|
-
|
|
155
|
-
**The clean-render refusal is the CLI's, and this workflow honors it rather than reimplementing it.**
|
|
156
|
-
When `refusesCleanRender` is true (the range considered zero files), or when the payload records that
|
|
157
|
-
the vault was absent or unreadable, the review still renders — as a **loud gaps-only artifact**
|
|
158
|
-
through the template's not-derived sections — and never as a clean review. The rule lives in code, in
|
|
159
|
-
the shipped predicate; nothing here restates it as a second copy that could drift.
|
|
160
|
-
|
|
161
|
-
## 5. Spawn pp-vault-reviewer
|
|
88
|
+
## 3. Spawn pp-vault-reviewer
|
|
162
89
|
|
|
163
90
|
```bash
|
|
164
91
|
REVIEWER_MODEL=$(pp_run query resolve-model pp-vault-reviewer --raw)
|
|
@@ -168,59 +95,25 @@ REVIEWER_MODEL=$(pp_run query resolve-model pp-vault-reviewer --raw)
|
|
|
168
95
|
◆ Spawning vault reviewer... (runs in a subagent — no output until it returns, ~1–5 min; expected, not a freeze)
|
|
169
96
|
```
|
|
170
97
|
|
|
171
|
-
Build the prompt
|
|
172
|
-
already fenced by the shipped renderer — this workflow opens no vault file of its own:
|
|
173
|
-
|
|
174
|
-
```markdown
|
|
175
|
-
Read ~/.claude/agents/pp-vault-reviewer.md for instructions.
|
|
98
|
+
Build the prompt:
|
|
176
99
|
|
|
100
|
+
```
|
|
177
101
|
<objective>
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
<constraints>
|
|
182
|
-
{If trace_present_and_loaded: "This phase's trace is present and loaded. Judge the supplied
|
|
183
|
-
remainder only — the derived sets are complete and are reproduced, not recomputed."}
|
|
184
|
-
{If not trace_present_and_loaded: "RECONSTRUCT mode. This phase has no loaded trace, so the
|
|
185
|
-
applicable practice set below was rebuilt from the phase's changed files crossed with the vault's
|
|
186
|
-
practice list. Judge that reconstructed set. A missing trace is itself a finding: record it loudly."}
|
|
187
|
-
Every derived fact below was computed by `pp-tools check vault-review` and is not recomputable by
|
|
188
|
-
you (D-06-09). Copy the range statement and every derived row's supplied reason and arm label
|
|
189
|
-
verbatim; never recount them.
|
|
190
|
-
<!-- gen:practice-arithmetic-contract:start -->
|
|
191
|
-
**TWO COUNT POPULATIONS, and conflating them writes a false section.**
|
|
192
|
-
|
|
193
|
-
`derivedCounts` and `derivedRateLine` on the `check vault-review` payload describe the **derived rows
|
|
194
|
-
alone** — Arm A plus Arm B — which on the reconstruct path is usually none. They are never written as
|
|
195
|
-
the register's own two lines.
|
|
196
|
-
|
|
197
|
-
The register's rate and counts lines describe **the rows you write**, derived and judged together.
|
|
198
|
-
`validateReviewArtifact` recomputes them from exactly those rows and rejects a narrated figure with
|
|
199
|
-
`rate-line-arithmetic` or `counts-line-arithmetic`. Copying a supplied `0 of 0 practices judged …`
|
|
200
|
-
into the register states that nothing was judged over a register that judged something.
|
|
201
|
-
|
|
202
|
-
`judged = total − na`, and INCONCLUSIVE counts *inside* `judged` and is reported separately.
|
|
203
|
-
|
|
204
|
-
**Where a supplied figure disagrees with your rows, record the disagreement and overwrite neither
|
|
205
|
-
side.** Write it as PROSE that names it as the supplied figure — never as a bare line in the
|
|
206
|
-
register's own shape. A second bare shaped line makes the section contradict itself: two rate lines,
|
|
207
|
-
or two counts lines, stating different figures, with nothing in the register saying which of them the
|
|
208
|
-
rows you wrote support.
|
|
209
|
-
<!-- gen:practice-arithmetic-contract:end -->
|
|
210
|
-
ON THIS TIER the disagreement goes on the `| Disagreements between supplied counts and the rows |`
|
|
211
|
-
row of `## Not Derived`.
|
|
102
|
+
Review Phase {N}: {phase_name} against the client vault's standards documents. Give exactly one
|
|
103
|
+
verdict per document in the payload's documents[]: PASS, FAIL, N-A or INCONCLUSIVE, each non-PASS
|
|
104
|
+
verdict with a stated reason, and evidence as file:line references into the phase's changed files.
|
|
212
105
|
Write exactly one file: {phase_dir}/{padded_phase}-VAULT-REVIEW.md
|
|
213
|
-
</
|
|
106
|
+
</objective>
|
|
214
107
|
|
|
215
108
|
<review_payload>
|
|
216
109
|
{REVIEW_PAYLOAD verbatim}
|
|
217
110
|
</review_payload>
|
|
218
111
|
|
|
219
|
-
<
|
|
112
|
+
<required_reading>
|
|
220
113
|
- {summary_paths} (Execution summaries)
|
|
221
114
|
- {plan_paths} (Execution plans)
|
|
222
115
|
- {context_path} (User decisions, if it exists)
|
|
223
|
-
</
|
|
116
|
+
</required_reading>
|
|
224
117
|
|
|
225
118
|
${AGENT_SKILLS_VAULT_REVIEWER}
|
|
226
119
|
|
|
@@ -237,54 +130,44 @@ Agent(
|
|
|
237
130
|
prompt=vault_review_prompt,
|
|
238
131
|
subagent_type="pp-vault-reviewer",
|
|
239
132
|
model="{REVIEWER_MODEL}",
|
|
240
|
-
description="Vault
|
|
133
|
+
description="Vault standards review Phase {N}"
|
|
241
134
|
)
|
|
242
135
|
```
|
|
243
136
|
|
|
244
137
|
> **ORCHESTRATOR RULE — CODEX RUNTIME**: After calling Agent() above, stop working on this task immediately. Do not read more files, edit code, or run tests related to this task while the subagent is active. Wait for the subagent to return its result. This prevents duplicate work, conflicting edits, and wasted context. Only resume when the subagent result is available.
|
|
245
138
|
|
|
246
|
-
##
|
|
247
|
-
|
|
248
|
-
The agent returns `## REVIEWED`, `## DEGRADED` or `## ESCALATE`. It reads
|
|
249
|
-
`~/.claude/pp-core/templates/VAULT-REVIEW.md`, fills it, and writes
|
|
250
|
-
`${PHASE_DIR}/${PADDED_PHASE}-VAULT-REVIEW.md` (D-06-16).
|
|
139
|
+
## 4. Handle Return
|
|
251
140
|
|
|
252
|
-
|
|
141
|
+
The agent returns `## REVIEWED` or `## ESCALATE`. On `REVIEWED`, check what it wrote:
|
|
253
142
|
|
|
254
143
|
```bash
|
|
255
|
-
|
|
144
|
+
pp_run check vault-review "${PHASE_DIR}" --validate "${PHASE_DIR}/${PADDED_PHASE}-VAULT-REVIEW.md" --raw
|
|
256
145
|
```
|
|
257
146
|
|
|
258
|
-
`
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
Surface any reported problems to the operator as **repair items**, listed under the artifact's own
|
|
263
|
-
repair heading, and finish with exit 0 either way. A shape complaint is a defect in the artifact to be
|
|
264
|
-
repaired in the artifact — never by editing the validator, and never by deleting the row that produced
|
|
265
|
-
the complaint.
|
|
147
|
+
`valid: true` means every governing document has exactly one verdict row, each verdict is one of the
|
|
148
|
+
four, every non-PASS verdict states its reason, and the counts line agrees with the table. Otherwise
|
|
149
|
+
list each entry of `problems[]` to the operator as a repair item. A problem is repaired in the
|
|
150
|
+
artifact, never by deleting the row that produced it. Exit 0 either way.
|
|
266
151
|
|
|
267
|
-
`ESCALATE` means no artifact could be written
|
|
268
|
-
payload could not be obtained). Report what the agent said and stop; still exit 0.
|
|
152
|
+
`ESCALATE` means no artifact could be written. Report what the agent said and stop; still exit 0.
|
|
269
153
|
|
|
270
154
|
Display the summary:
|
|
271
155
|
|
|
272
156
|
```
|
|
273
157
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
274
|
-
pp-core ► VAULT
|
|
158
|
+
pp-core ► VAULT STANDARDS REVIEW COMPLETE
|
|
275
159
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
276
160
|
|
|
277
|
-
**Phase {N}: {Name}**
|
|
161
|
+
**Phase {N}: {Name}**
|
|
278
162
|
|
|
279
|
-
{the artifact's
|
|
280
|
-
{the artifact's register counts line — the one `validateReviewArtifact` recomputed and accepted}
|
|
163
|
+
{the artifact's counts line}
|
|
281
164
|
|
|
282
|
-
Gaps reported: {none. / the payload's
|
|
165
|
+
Gaps reported: {none. / the payload's gaps}
|
|
283
166
|
|
|
284
167
|
Full review: {path to VAULT-REVIEW.md}
|
|
285
168
|
|
|
286
169
|
This review reports and does not gate. No verdict above changes a phase status,
|
|
287
|
-
a
|
|
170
|
+
a gap or any gate.
|
|
288
171
|
|
|
289
172
|
───────────────────────────────────────────────────────────────
|
|
290
173
|
|
|
@@ -298,28 +181,23 @@ a score, a gap or any deterministic surface — see "Limits of This Review" in t
|
|
|
298
181
|
───────────────────────────────────────────────────────────────
|
|
299
182
|
```
|
|
300
183
|
|
|
301
|
-
The routing
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
`VERIFICATION.md` or any `SUMMARY.md`. The one file this command produces is the artifact.
|
|
184
|
+
The routing is offered on every path; a review with FAIL rows routes exactly like one without. No
|
|
185
|
+
step reads a verdict into a halt, an exit code or a block, and nothing here writes `ROADMAP.md`,
|
|
186
|
+
`STATE.md`, `VERIFICATION.md` or a `SUMMARY.md`. The one file this command produces is the artifact.
|
|
305
187
|
|
|
306
|
-
##
|
|
188
|
+
## 5. Commit (if configured)
|
|
307
189
|
|
|
308
190
|
```bash
|
|
309
|
-
pp_run query commit "docs(${PADDED_PHASE}): vault
|
|
191
|
+
pp_run query commit "docs(${PADDED_PHASE}): vault standards review" --files "${PHASE_DIR}/${PADDED_PHASE}-VAULT-REVIEW.md"
|
|
310
192
|
```
|
|
311
193
|
|
|
312
194
|
</process>
|
|
313
195
|
|
|
314
196
|
<success_criteria>
|
|
315
|
-
- [ ] Step 0a ran first and
|
|
316
|
-
- [ ]
|
|
317
|
-
- [ ]
|
|
318
|
-
- [ ] `
|
|
319
|
-
- [ ]
|
|
320
|
-
- [ ] Agent spawned with the CLI payload verbatim and the origin-dependent constraint
|
|
321
|
-
- [ ] `{padded}-VAULT-REVIEW.md` written in the phase directory; shape check run over it
|
|
322
|
-
- [ ] The payload's derived figures are never written as the register's lines; any difference is on the `| Disagreements between supplied counts and the rows |` row
|
|
323
|
-
- [ ] The register's own rate and counts lines agree with `validateReviewArtifact` over the rows written
|
|
197
|
+
- [ ] Step 0a ran first and stopped on every status other than `ok`
|
|
198
|
+
- [ ] Input state detected (A/B/C); State C exits cleanly
|
|
199
|
+
- [ ] Agent spawned with the CLI payload verbatim
|
|
200
|
+
- [ ] `{padded}-VAULT-REVIEW.md` written in the phase directory and validated with `check vault-review --validate`
|
|
201
|
+
- [ ] Every payload gap appears under Not Derived
|
|
324
202
|
- [ ] Routing offered unconditionally; no verdict reached any halt, block or status
|
|
325
203
|
</success_criteria>
|