@juicesharp/rpiv-pi 2.7.1 → 2.8.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.
@@ -29,9 +29,19 @@ contract:
29
29
  properties:
30
30
  n: { type: integer, minimum: 1 }
31
31
  title: { type: string }
32
+ acceptance:
33
+ type: array
34
+ items:
35
+ type: object
36
+ required: [id, disposition]
37
+ properties:
38
+ id: { type: string }
39
+ disposition: { enum: [implemented, deferred] }
40
+ phase: { type: integer, minimum: 1 }
41
+ reason: { type: string }
32
42
  consumes:
33
43
  meta:
34
- artifactKind: [research]
44
+ artifactKind: [research, acceptance]
35
45
  ---
36
46
 
37
47
  # Quick Plan
@@ -44,7 +54,7 @@ The expected shape is **one phase** (the small-task default). Add a phase only w
44
54
 
45
55
  `$ARGUMENTS` — one of four shapes (the skill is sound however the caller wires it):
46
56
 
47
- - **Flags (workflow dispatch)** — `--research <path> --goal <path>`. Read BOTH files FULLY (no limit/offset). The research doc is the grounding; the goal file is the verbatim brief — every ask it names is either implemented by a phase or deferred under `## Out of Scope`.
57
+ - **Flags (workflow dispatch)** — `--research <path> --goal <path> [--acceptance <path>]`. Read ALL files FULLY (no limit/offset). The research doc is the grounding; the goal file is the verbatim brief — every ask it names is either implemented by a phase or deferred under `## Out of Scope`. The acceptance file, when given, is the goal-derived inventory (`items:` frontmatter, ids `a1…`): the plan MUST record a per-item `acceptance:` disposition — `implemented` naming the phase, or `deferred` with a reason — every item, no omissions (the completeness gate anchors on the inventory, and validate executes each item's evidence command against the finished tree).
48
58
  - **Research artifact path** — a `.md` path under `.rpiv/artifacts/research/`. Read it FULLY (no limit/offset); it is the grounding for the plan.
49
59
  - **Injected research** — when dispatched by a workflow `reads: ["research"]` stage, the research doc is already in context; treat `$ARGUMENTS` as the task description / goal.
50
60
  - **Free-text** (standalone small task) — `$ARGUMENTS` is the task description; research is done or the shape is obvious.
@@ -71,6 +81,7 @@ Copy values verbatim. `<iso>` is the first tab-separated field (use as `date:`);
71
81
 
72
82
  - If a research artifact path was given, read it FULLY. Extract the task, the Code References (`file:line`), the Integration Points, and any Open Questions already resolved.
73
83
  - If a `--goal` file was given, read it FULLY and enumerate every ask it names; each is either implemented by a phase or deferred under `## Out of Scope` with a reason (when the research narrowed the brief, its rationale is the deferral reason).
84
+ - If an `--acceptance` file was given, read it FULLY and treat its `items:` as the enumeration of record — dispose of every item id (Step 3's `acceptance:` mapping). An item whose evidence command the plan's work would not make pass is either genuinely covered by a phase or deferred with a reason; never quietly reinterpret an item's statement.
74
85
  - Read the key source files the research points at — the anchors the plan will cite — so the phase's code blocks and `file:line` references are real and current.
75
86
  - Determine the goal (the `--goal` brief, the task description, or the research's stated goal).
76
87
 
@@ -106,6 +117,9 @@ status: ready
106
117
  phase_count: 1
107
118
  phases:
108
119
  - { n: 1, title: {Phase 1 title}, files: [{every repo-root-relative path Phase 1 creates/edits}], depends_on: [] }
120
+ acceptance:
121
+ - { id: a1, disposition: implemented, phase: 1 }
122
+ - { id: a2, disposition: deferred, reason: "{one-line reason}" }
109
123
  last_updated: {same <iso> as date:}
110
124
  ---
111
125
 
@@ -150,6 +164,8 @@ Populate each `phases[].files:` from that phase's `#### N.` / `**File**:` paths
150
164
 
151
165
  Populate `## Out of Scope` from the Step 1 goal-ask enumeration: one one-line deferral with a reason per goal ask no phase implements.
152
166
 
167
+ Populate `acceptance:` ONLY when an `--acceptance` file was given (omit the array entirely otherwise): one entry per inventory item, in item order — `disposition: implemented` with the covering `phase:` number, or `disposition: deferred` with a one-line `reason:` (and a matching `## Out of Scope` line). Every item id from the inventory appears exactly once; never invent an id the inventory doesn't carry.
168
+
153
169
  Then print the path and a one-line summary: `quick-plan written: {N} phase(s), {M} files`.
154
170
 
155
171
  ## Important Notes
@@ -160,6 +176,7 @@ Then print the path and a one-line summary: `quick-plan written: {N} phase(s), {
160
176
  - **At most ONE `codebase-pattern-finder` dispatch.** Never parallel, never `run_in_background` — a background completion cannot re-drive this session and the stage fails with no artifact. Skip the dispatch when research already surfaced the pattern.
161
177
  - **Non-interactive.** No `ask_user_question` checkpoint. A checkpoint without blueprint's dimension sweep is pure latency on a fast-path preset whose output is immediately grade-gated. Resolve ambiguity from the research and the real code; if a genuine fork can't be settled, make the most defensible call and let the grade panel catch it.
162
178
  - **Defer explicitly, never silently.** Every goal ask no phase implements gets a one-line `## Out of Scope` deferral with a reason — the completeness gate blocks on a named ask that is neither addressed nor deferred.
179
+ - **Dispose of every acceptance item.** With `--acceptance` given, the `acceptance:` mapping is the machine-readable form of that same rule: every inventory id, exactly once, `implemented` (with phase) or `deferred` (with reason). The completeness gate reads the inventory directly, so a missing or mislabeled disposition is a blocking gap — and validate will run each item's evidence command regardless of what the plan claims.
163
180
  - **Ground every citation.** Every `file:line` in prose or code comments uses a repo-root-relative path and is verifiable at the current revision — the plan passes the deterministic `plan-cite-check` floor.
164
181
  - **NEVER edit source files.** This skill produces a plan document, not implementation. Source editing is `implement`'s job.
165
182
  - **Drops blueprint's ceremony by design:** multi-slice decomposition, skeleton-then-fill, the per-slice `slice-verifier` loop, the dual post-finalization review (`artifact-code-reviewer` + `artifact-coverage-reviewer`), the 6-dimension sweep, and parallel research are all absent here — the workflow's own gates own that confidence.
@@ -71,6 +71,12 @@ The final artifact feeds design or blueprint.
71
71
 
72
72
  4. **Parse the agent's final message** as the questions artifact body. Extract: Discovery Summary (3-5 sentence file-landscape overview), Questions (numbered dense 3-6 sentence paragraphs).
73
73
 
74
+ Questions formulated — emit:
75
+
76
+ ```
77
+ [Questions]: {N} research questions formulated. Reading shared files and grouping before dispatch.
78
+ ```
79
+
74
80
  5. **Read key shared files** referenced across multiple questions into main context — especially shared utilities, type definitions, and integration points that multiple questions mention.
75
81
 
76
82
  6. **Analyze question overlap for grouping:**
@@ -89,6 +95,14 @@ The final artifact feeds design or blueprint.
89
95
 
90
96
  Spawn analysis agents using the Agent tool — all in a **single assistant message with multiple Agent calls** (concurrent, synchronous). **Never `run_in_background`**: its completion can't re-drive a workflow session, so the skill ends its turn before writing the document and the stage fails with no artifact.
91
97
 
98
+ **Launch marker** — in that SAME assistant message, as its text block (it adds no turn, so the one-message parallel dispatch shape stays intact), emit:
99
+
100
+ ```
101
+ [Dispatched]: {N} analysis agents in one batch{ + precedent sweep}. Waiting for returns.
102
+ ```
103
+
104
+ N counts every dispatched agent, including the git-gated precedent-locator when it joins; the ` + precedent sweep` suffix appears only when it does.
105
+
92
106
  **Default agent**: `codebase-analyzer` for all codebase questions. This agent has Read, Grep, Glob, LS — it can trace code paths, find patterns, and analyze integration points.
93
107
 
94
108
  **Exception**: External surfaces — third-party APIs, SDKs, libraries, services, protocols, or wire formats — that the codebase doesn't already use → `web-search-researcher`. Trigger on the surface itself, not on whether the question text literally names "docs" or "API".
@@ -129,8 +143,20 @@ Findings go into Precedents & Lessons. Otherwise skip and note "git history unav
129
143
 
130
144
  **Wait for ALL agents to complete** before proceeding.
131
145
 
146
+ Once every agent has returned, emit:
147
+
148
+ ```
149
+ [Returned]: {N}/{N} agents returned. Proceeding to synthesis.
150
+ ```
151
+
132
152
  ### Step 3: Synthesize and Checkpoint
133
153
 
154
+ Before compiling, emit:
155
+
156
+ ```
157
+ [Synthesizing]: compiling {N} agent reports.
158
+ ```
159
+
134
160
  1. **Compile findings:**
135
161
  - Match each agent's response to the question(s) it answered
136
162
  - Cross-reference findings across questions — look for patterns, conflicts, and connections
@@ -359,3 +385,4 @@ Please review and let me know if you have follow-up questions.
359
385
  - ALWAYS gather metadata before writing (Step 4)
360
386
  - NEVER write the document with placeholder values
361
387
  - **Frontmatter consistency**: Always include frontmatter, use snake_case fields
388
+ - **Progress markers are transcript text only**: the `[Questions]:` / `[Dispatched]:` / `[Returned]:` / `[Synthesizing]:` lines are one-line status for the lane console's live tail — never artifact content — and NEVER quote the research document's path in a marker, or anywhere else, before the file is written.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: slice
3
3
  description: Decompose a research artifact into independent vertical slices — each a self-contained, separately-designable unit — and write a slice map to .rpiv/artifacts/slices/ with a machine-readable `slices:` frontmatter array. A research artifact is required (it is the cut's grounding); confirms the decomposition with you before writing. Also runs in RE-SLICE mode (`--slices <map> --slice-verdicts <v>…`) to STRUCTURALLY re-cut a slice map that failed the design-readiness gate — splitting epics, completing under-cited footings, redistributing frozen coverage units, breaking dependency cycles, renumbering — which a surgical reviser cannot do. Feeds a per-slice design fanout.
4
- argument-hint: "<research-path> | --slices <map> --slice-verdicts <verdict>..."
4
+ argument-hint: "<research-path> | --research <path> | --slices <map> --slice-verdicts <verdict>..."
5
5
  shell-timeout: 10
6
6
  disable-model-invocation: true
7
7
  contract:
@@ -60,7 +60,7 @@ You decompose a feature into **independent vertical slices** and write a slice m
60
60
 
61
61
  `$ARGUMENTS` takes two forms:
62
62
 
63
- 1. **Fresh** — a path to a `.rpiv/artifacts/research/*.md` artifact (no flags). Decompose from scratch via Steps 1–6, grounded in that research. The research artifact is **required**: if the argument is missing, empty, or not a research path, print an error and stop — it's a dispatch error (the workflow runs `research` before `slice`).
63
+ 1. **Fresh** — a path to a `.rpiv/artifacts/research/*.md` artifact, positional or as `--research <path>` (the flag form is how the build workflow dispatches it — equivalent, same input). Decompose from scratch via Steps 1–6, grounded in that research. The research artifact is **required**: if the argument is missing, empty, or not a research path, print an error and stop — it's a dispatch error (the workflow runs `research` before `slice`).
64
64
  2. **Re-slice** (the re-slice loop) — `--slices <map-path> --slice-verdicts <verdict-path> … [--slice-check <structural-verdict-path> …]` (the `--slice-verdicts` and `--slice-check` flags repeat). **Re-cut the existing slice map** to clear the failures its verdicts name. Recognize this form by the `--slices` flag and follow **Re-slice mode** below — NOT the fresh Steps (no confirm). `--slice-check` carries the **deterministic** structural findings (dependency cycles, dropped coverage units, unbacked `file:line` citations) — treat them exactly like a verdict's findings; they are the un-gameable floor and MUST all be cleared.
65
65
 
66
66
  ## Metadata
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: validate
3
3
  description: Verify that an implementation plan was correctly executed by running each phase's success criteria against the working tree and producing a validation report. Use after the implement skill completes, when the user asks to "validate the plan", wants a post-implementation audit, or needs to confirm a feature is fully shipped per its plan.
4
- argument-hint: "[plan-path] [--goal <path>] [--baseline <path>] [--scope <path>]"
4
+ argument-hint: "[plan-path] [--goal <path>] [--baseline <path>] [--scope <path>] [--acceptance <path>]"
5
5
  allowed-tools: Read, Bash(git *), Bash(make *), Glob, Grep
6
6
  shell-timeout: 10
7
7
  disable-model-invocation: true
@@ -33,7 +33,7 @@ You are tasked with validating that an implementation plan was correctly execute
33
33
 
34
34
  User input (raw): `$ARGUMENTS`
35
35
 
36
- Expected shape: an optional plan path (usually under `.rpiv/artifacts/plans/`), optionally followed by `--goal <path>` (the user's original brief, captured verbatim at run start), `--baseline <path>` (the run-start snapshot of paths that were ALREADY dirty before the run touched anything — a JSON file with a `paths` array), and/or `--scope <path>` (the workflow scope floor's verdict JSON — `{ verdict, findings: [{ detail, where }] }` — recording writes outside the plan's declared write-set for you to adjudicate). Peel the `--goal`, `--baseline`, and `--scope` flags first; what remains is the plan path. Only if the user input above is empty, or no plan path remains after peeling, branch on the recent-plans list in the Metadata block.
36
+ Expected shape: an optional plan path (usually under `.rpiv/artifacts/plans/`), optionally followed by `--goal <path>` (the user's original brief, captured verbatim at run start), `--baseline <path>` (the run-start snapshot of paths that were ALREADY dirty before the run touched anything — a JSON file with a `paths` array), `--scope <path>` (the workflow scope floor's verdict JSON — `{ verdict, findings: [{ detail, where }] }` — recording writes outside the plan's declared write-set for you to adjudicate), and/or `--acceptance <path>` (the goal-derived acceptance inventory — `items:` frontmatter, ids `a1…`, each with a runnable evidence `command` or a `manual` procedure — frozen before planning; you EXECUTE it in Step 2.10). Peel the `--goal`, `--baseline`, `--scope`, and `--acceptance` flags first; what remains is the plan path. Only if the user input above is empty, or no plan path remains after peeling, branch on the recent-plans list in the Metadata block.
37
37
 
38
38
  ## Metadata
39
39
 
@@ -137,6 +137,12 @@ For each phase in the plan:
137
137
  - **For a `disposition: verify-at-implement` flag**, do not just Read/Grep — RUN its declared `procedure` (the named command/test the plan's `owner` phase promised) against the shipped code and rule `pass: false` if that procedure fails. This is the phase that discharges the deferral the plan-grade panel accepted on trust; a deferred risk whose procedure now fails is exactly the un-addressed-defect class this gate catches. A mechanics (`claim_type: mechanics`) flag is verified against its shipped `file:line` as above.
138
138
  - **Any `pass: false` ruling forces `verdict: fail`** and is reported under **Potential Issues**, quoting the flag's claim. A flagged risk that shipped unaddressed is exactly the class of defect this gate exists to catch.
139
139
 
140
+ 10. **Execute the acceptance inventory** (only when `--acceptance` was provided):
141
+ - Read the inventory fully. Its `items:` are the goal-derived standard of completion, frozen BEFORE planning — the one executable measure the plan did not author, so it catches what the plan's own criteria structurally cannot: an ask the planning narrowed away. Cross-reference the plan's `acceptance:` disposition mapping when it carries one.
142
+ - **An item the plan marked `deferred`** (with a reason, matching an `## Out of Scope` line): do not run its command; record the deferral under `#### Deviations from Plan:` as a non-blocking note quoting the reason — the deferral was legible and gate-approved. An item the plan never disposed of at all is judged exactly like an `implemented` one — silence does not defer.
143
+ - **An item with a `command`** (not deferred): RUN it as written from the repo root. Exit 0 ⇒ the item holds — record it met. Non-zero ⇒ the item fails: force **`verdict: fail`**, report it under **Deviations from Plan** quoting the item's `statement`, and add a `blockers:` entry for it (Step 3.2's shape — the item's `command` verbatim; attribute `file`/`line` to the in-delta file the command or the item's statement most directly names). A failing acceptance command with a sound premise is never "pre-existing debt" — the inventory is future-tense by construction. Only when the command itself is unrunnable as written (a path that never existed at any revision, a malformed invocation) rule the ITEM unmeasurable, non-blocking, under `#### Potential Issues:` — never silently rewrite the command into something weaker.
144
+ - **An item with only a `manual` procedure** (not deferred): record it under the report's manual-verification section with its procedure — homework for the human, never a blocker.
145
+
140
146
  ### Step 3: Write the Validation Report
141
147
 
142
148
  1. **Determine metadata** (from the Metadata block at the top of this skill):
@@ -149,10 +155,10 @@ For each phase in the plan:
149
155
  - `topic:` ← `"Validation of <plan topic>"`.
150
156
 
151
157
  2. **Determine verdict** (`status` is always `ready` — written once):
152
- - `verdict: pass` — every phase marked `- [x]` in the plan is verified against the code, every automated command passes (excluding whole-plan failures ruled pre-existing/non-blocking per Step 2.6), no Deviations from Plan and no Potential Issues require action, every plan `risks:` flag ruled `pass`, and every scope-floor finding and quarantine-manifest entry (Step 2.7) is explained.
153
- - `verdict: fail` — any phase fails verification, any automated command fails (excluding whole-plan failures ruled pre-existing/non-blocking per Step 2.6), any Deviations / Potential Issues list items that require action, **any plan risk flag ruled `pass: false`** (a flagged risk shipped unaddressed), or **any scope-floor finding or quarantined/refused file you could not rule benign** (Step 2.7).
158
+ - `verdict: pass` — every phase marked `- [x]` in the plan is verified against the code, every automated command passes (excluding whole-plan failures ruled pre-existing/non-blocking per Step 2.6), no Deviations from Plan and no Potential Issues require action, every plan `risks:` flag ruled `pass`, every scope-floor finding and quarantine-manifest entry (Step 2.7) is explained, and every non-deferred `--acceptance` item with a command passed (Step 2.10).
159
+ - `verdict: fail` — any phase fails verification, any automated command fails (excluding whole-plan failures ruled pre-existing/non-blocking per Step 2.6), any Deviations / Potential Issues list items that require action, **any plan risk flag ruled `pass: false`** (a flagged risk shipped unaddressed), **any scope-floor finding or quarantined/refused file you could not rule benign** (Step 2.7), or **any non-deferred acceptance item whose command fails** (Step 2.10).
154
160
  - When the plan carried a `risks:` array, add a `risk_rulings: [{ id, pass }]` field to the report frontmatter — one ruling per flag.
155
- - When any failure forcing `verdict: fail` is NOT already captured by a `pass: false` risk ruling — a whole-plan gate command, or a phase's automated command failing on files inside the run's delta — add a `blockers:` array to the report frontmatter, one entry per failing command: `blockers: [{ id: b1, command: "<the failing command, verbatim-runnable from the repo root>", file: "<in-delta file the failure attributes to>", line: <line> }]` (`file`/`line` come from Step 2.6's attribution; number ids `b1`, `b2`, …). These structured entries are the ONLY handles the workflow's remediation arm may act on — a blocking failure recorded only in the report prose is invisible to it, and the run stops at the validate gate instead of looping. Omit the field when every blocking failure already rides a failing ruling.
161
+ - When any failure forcing `verdict: fail` is NOT already captured by a `pass: false` risk ruling — a whole-plan gate command, a phase's automated command failing on files inside the run's delta, or a failing acceptance-item command (Step 2.10) — add a `blockers:` array to the report frontmatter, one entry per failing command: `blockers: [{ id: b1, command: "<the failing command, verbatim-runnable from the repo root>", file: "<in-delta file the failure attributes to>", line: <line> }]` (`file`/`line` come from Step 2.6's attribution, or Step 2.10's for an acceptance item; number ids `b1`, `b2`, …). These structured entries are the ONLY handles the workflow's remediation arm may act on — a blocking failure recorded only in the report prose is invisible to it, and the run stops at the validate gate instead of looping. Omit the field when every blocking failure already rides a failing ruling.
156
162
 
157
163
  3. **Write the artifact** using the Write tool (no Edit — this skill writes once per run). Read `templates/validation.md`, fill every `{placeholder}` with the values determined above and the observations gathered in Step 2, apply the section-omission rules in the template (omit `#### Pattern Conformance:` and `#### Potential Issues:` entirely when empty; keep all other sections and emit `None — …` literals when empty), and Write the result to the target path.
158
164