@juicesharp/rpiv-pi 2.7.0 → 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.
- package/README.md +2 -2
- package/docs/architecture.md +3 -3
- package/docs/skills.md +9 -7
- package/docs/workflows.md +3 -3
- package/extensions/rpiv-core/built-in-workflows.ts +273 -94
- package/extensions/rpiv-core/built-ins/gates.ts +38 -15
- package/extensions/rpiv-core/built-ins/goal-baseline.ts +43 -1
- package/extensions/rpiv-core/built-ins/grade-panel.ts +98 -29
- package/extensions/rpiv-core/built-ins/index.ts +2 -0
- package/extensions/rpiv-core/built-ins/priors.ts +208 -38
- package/extensions/rpiv-core/built-ins/remediation.ts +96 -0
- package/extensions/rpiv-core/built-ins/slices.ts +5 -1
- package/extensions/rpiv-core/lane-relay-ui.ts +25 -1
- package/extensions/rpiv-core/outcome-derivation.ts +1 -0
- package/extensions/rpiv-core/pipeline-pointer.ts +1 -1
- package/package.json +3 -3
- package/skills/acceptance/SKILL.md +123 -0
- package/skills/grade/SKILL.md +5 -4
- package/skills/quick-plan/SKILL.md +19 -2
- package/skills/remediate/SKILL.md +17 -15
- package/skills/research/SKILL.md +27 -0
- package/skills/slice/SKILL.md +2 -2
- package/skills/validate/SKILL.md +11 -4
package/skills/grade/SKILL.md
CHANGED
|
@@ -66,8 +66,9 @@ You grade ONE artifact against ONE quality dimension and emit a verdict JSON. Yo
|
|
|
66
66
|
- `--artifact <path>` **(required)** — the artifact under review.
|
|
67
67
|
- `--context <path>` *(optional)* — a supporting artifact (e.g. the research doc). **Required for `architecture-fit`.**
|
|
68
68
|
- `--goal <path>` *(optional)* — the user's original brief, captured verbatim at run start. **Read it only for `completeness` and `correctness`** — every other dimension ignores it. Absent, or the file is empty → grade the artifact on its own content as usual.
|
|
69
|
+
- `--acceptance <path>` *(optional, `completeness` only)* — the goal-derived acceptance inventory (`items:` frontmatter, ids `a1…`), frozen before planning. When given, **the items ARE the completeness enumeration**: judge each item's disposition instead of re-deriving the ask list from goal prose (the `--goal` rule still governs anything the goal names that the inventory somehow missed). Every other dimension ignores this flag. Missing or unreadable path → grade normally without it.
|
|
69
70
|
- `--prior <path>` *(optional)* — a prior round's verdict JSON for this same `(artifact, dimension)`, passed by a CONFIRM panel. Its presence puts you in **confirm mode** (see "Prior-round adjudication" below). If the path is missing or unreadable, grade normally without it — a stale prior is not a wiring error.
|
|
70
|
-
- `--cite-check <path>` *(optional, `correctness` only)* — the deterministic citation floor's verdict JSON for the same artifact,
|
|
71
|
+
- `--cite-check <path>` *(optional, `correctness` only)* — the deterministic citation floor's verdict JSON for the same artifact. It carries SETTLED FACTS in both directions. A clean verdict (empty `findings`) means every citation in the artifact **mechanically resolves** — file exists, reference locates — so do NOT re-resolve citations file-by-file: spend your spot-check entirely on the **semantic** half the floor cannot judge (does the cited code do what the artifact claims it does). A findings-bearing verdict lists the citations the floor could NOT settle (an unresolved path, citation ambiguity, or line drift — mechanical resolution results, not verdicts): treat its `findings[]` as **leads to fold into your spot-check sample**, not conclusions — the Citation-resolution rule (step 4) alone decides whether any becomes a finding of yours (an "unresolved" lead whose file genuinely does not exist anywhere IS one) — and citations the floor did NOT flag are resolution-settled exactly as in the clean case. Every other dimension ignores this flag; it never triggers confirm mode and never produces `finding_rulings`. Missing or unreadable path → grade normally without it (full mechanical + semantic spot-check).
|
|
71
72
|
|
|
72
73
|
**Plan-authored risk flags (the `correctness` dimension only).** When your `--dimension` is `correctness` and the `--artifact` carries a `risks:` frontmatter array (each `{ id, claim }`, described in the plan's `## Risk Flags` section), you are REQUIRED to rule on every flag — this is a first-class channel, not an optional prose aside. For each flag, verify its `claim` against the real codebase / the plan (Read/Grep the relevant `file:line`) and decide `pass` (the concern is unfounded or already handled) or `fail` (the risk is real and unaddressed). A `fail` ruling blocks the gate (the workflow folds these across the panel), so an assumption the plan flagged for review cannot ride a green pass into commit. Other dimensions ignore `risks:`.
|
|
73
74
|
|
|
@@ -104,7 +105,7 @@ Grade against the row matching `--dimension`. "Pass bar" is the line; meet it
|
|
|
104
105
|
|
|
105
106
|
| Dimension | What it checks | Where to look | Pass bar |
|
|
106
107
|
|---|---|---|---|
|
|
107
|
-
| `completeness` | The artifact covers the whole brief — no unresolved `TODO`/`TBD`/`?`/"unknown"/"figure out later" markers; every area it names is addressed; open questions are resolved or explicitly deferred with a reason. **When `--goal` is given, the brief IS the goal file**: every explicit ask and constraint in it is addressed or explicitly deferred with a reason — a requirement present in the goal but absent from the artifact is a blocking gap. | The artifact's own content, cross-checked against `--goal` when given. | No blocking gap — nothing a downstream stage would need is left undefined,
|
|
108
|
+
| `completeness` | The artifact covers the whole brief — no unresolved `TODO`/`TBD`/`?`/"unknown"/"figure out later" markers; every area it names is addressed; open questions are resolved or explicitly deferred with a reason. **When `--goal` is given, the brief IS the goal file**: every explicit ask and constraint in it is addressed or explicitly deferred with a reason — a requirement present in the goal but absent from the artifact is a blocking gap. **When `--acceptance` is also given, walk its `items:` id by id**: each is genuinely covered by the artifact (an `acceptance:` disposition naming a phase must be honest — the phase's work would actually make the item's evidence hold) or explicitly deferred with a reason; an item neither covered nor deferred, a dishonest `implemented` claim, or a silently dropped/reworded item is a blocking gap. | The artifact's own content, cross-checked against `--goal` and the `--acceptance` items when given. | No blocking gap — nothing a downstream stage would need is left undefined, no explicit `--goal` ask is silently dropped, and every `--acceptance` item is honestly disposed. |
|
|
108
109
|
| `correctness` | Claims match reality — cited files and symbols exist and the code does what the artifact claims; described current behavior matches the actual code; no internal contradictions. When `--goal` is given, no claim or decision contradicts an explicit constraint stated in it. | **Spot-check the live codebase**: resolve a sample of the artifact's references with Read/Grep — by file + named symbol, NOT by exact line number (line numbers are navigation hints); check decisions against `--goal` when given. | No false claim found in the sample; cited files/symbols exist; no explicit `--goal` constraint contradicted. |
|
|
109
110
|
| `actionability` | A competent implementer could execute it without guessing — concrete steps, named files/symbols, explicit success criteria; no hand-waving ("somehow", "handle appropriately", "etc."). | The artifact's own content. | Every section/slice is executable as written. |
|
|
110
111
|
| `architecture-fit` | The approach fits the existing architecture and the constraints surfaced in `--context` — respects module boundaries, dependency direction, established layering; introduces no boundary violation. | The artifact **and** `--context`, cross-checked against real module boundaries via Grep/Read. | No architectural conflict with the codebase or the research's constraints. |
|
|
@@ -114,9 +115,9 @@ Grade against the row matching `--dimension`. "Pass bar" is the line; meet it
|
|
|
114
115
|
## Steps
|
|
115
116
|
|
|
116
117
|
1. **Parse + validate flags.** Bail per the Input rules above if malformed.
|
|
117
|
-
2. **Read fully** (no limit/offset): `--artifact`, and `--context` / `--goal` / `--prior` / `--cite-check` if given (skip `--goal` unless your dimension is `completeness` or `correctness`; skip `--cite-check` unless your dimension is `correctness`).
|
|
118
|
+
2. **Read fully** (no limit/offset): `--artifact`, and `--context` / `--goal` / `--acceptance` / `--prior` / `--cite-check` if given (skip `--goal` unless your dimension is `completeness` or `correctness`; skip `--acceptance` unless your dimension is `completeness`; skip `--cite-check` unless your dimension is `correctness`).
|
|
118
119
|
3. **Select the single rubric row** for `--dimension`. Ignore every problem outside it.
|
|
119
|
-
4. **Evaluate.** For `correctness` / `architecture-fit` / `pattern-following` / `design-readiness`, spot-check against the real codebase — resolve references, compare conventions, check boundaries, expand each slice's true touch + dependency fan-out from its cited seeds to gauge whether the footing is bounded AND complete, and check each shared contract has a single owning slice. **Citation-resolution rule: resolve every `path:line` citation by opening the file and locating the named symbol/content — the line number is a navigation hint, not a claim. A line number that points near but not exactly at the cited symbol is NEVER a finding, at any severity — do not report it, do not mention it in feedback: downstream stages locate code by symbol, so drift wastes fix rounds without ever blocking anything. The only citation findings that exist: the file does not exist, the named symbol/content does not exist in it, or the code does not do what the artifact claims it does.** For `completeness` / `actionability`, judge the artifact's own content. **On `correctness`, also rule every plan-authored risk flag** (see "Plan-authored risk flags" above) — verify each `risks:` claim against the code and record a `risk_rulings` entry. **On `correctness` with `--cite-check`, fold each of
|
|
120
|
+
4. **Evaluate.** For `correctness` / `architecture-fit` / `pattern-following` / `design-readiness`, spot-check against the real codebase — resolve references, compare conventions, check boundaries, expand each slice's true touch + dependency fan-out from its cited seeds to gauge whether the footing is bounded AND complete, and check each shared contract has a single owning slice. **Citation-resolution rule: resolve every `path:line` citation by opening the file and locating the named symbol/content — the line number is a navigation hint, not a claim. A line number that points near but not exactly at the cited symbol is NEVER a finding, at any severity — do not report it, do not mention it in feedback: downstream stages locate code by symbol, so drift wastes fix rounds without ever blocking anything. The only citation findings that exist: the file does not exist, the named symbol/content does not exist in it, or the code does not do what the artifact claims it does.** For `completeness` / `actionability`, judge the artifact's own content. **On `correctness`, also rule every plan-authored risk flag** (see "Plan-authored risk flags" above) — verify each `risks:` claim against the code and record a `risk_rulings` entry. **On `correctness` with `--cite-check`, citation RESOLUTION is settled by the floor — do not re-resolve unflagged citations; sample them only for the semantic claim** (open the file, check the code does what the artifact says — never to re-check that it exists), **and fold each of the floor's findings into your spot-check sample** — the citation-resolution rule decides what, if anything, you report. **With `--prior`, also adjudicate every prior finding** (see "Prior-round adjudication" above) — verify each against artifact + code and record a `finding_rulings` entry. Collect findings — each is `{ detail, where }` (`where` = `path:line` or a section heading; for slice dimensions, cite the offending `## Slice N`). Where a `design-readiness` finding fires, the `feedback` must name the exact re-cut (which slice to split and along which seam, which under-cited grounding to add, or which overlap to separate) so the re-slice can act on it.
|
|
120
121
|
5. **Decide** `pass` (against the pass bar), `score` (0–100), `severity` (`none` | `low` | `medium` | `high` = the worst finding), and `feedback`. **`severity` is gate-load-bearing: the workflow treats any verdict whose worst finding is `low`/`none` as passing, even on `pass: false`, and only a `medium`+ finding blocks the gate.** So set `severity` to honestly reflect blocking weight — `low`/`none` for a cosmetic nit (a stylistic phrasing, a naming quibble that doesn't change behavior; line-number drift is not even a nit — per the citation-resolution rule it is never a finding), `medium`+ for a finding a downstream stage genuinely cannot proceed past (a cited file or symbol that does not exist, a missing step, an executable edit that would fail as written, a boundary violation), **or for a claim about behavior you verified is false that sits in text the implementer copies verbatim (a code block, JSDoc, or comment) — behavior that happens to be correct anyway does not make it a nit; the shipped false claim is itself the defect**. Do **not** mark a real blocker `low` to be lenient, and do **not** mark a cosmetic nit `medium`+ to force a re-run — the gate reads `severity`, so mis-rating it either ships a defect or stalls the loop. **Every string you emit (`feedback` and each `findings[].detail` / `where`) MUST be JSON-safe: a single line, no literal newlines or tabs, no backticks or code fences, double-quotes escaped as `\"`. Put `path:line` citations in `findings[].where` — never paste code snippets into `feedback`.**
|
|
121
122
|
- `pass: false` → `feedback` is a **surgical, concrete instruction set** telling `amend` exactly what to change to clear this dimension, citing `where`. This field is the only thing `amend` reads — make it sufficient but concise (≤ ~500 chars; lean on `findings[]` for specifics).
|
|
122
123
|
- `pass: false` on `design-readiness` where **every** finding's remedy is pure citation bookkeeping — add a named seed to a slice's `Draws on`, or move a named item to `Out of scope`, with **no** split/merge/renumber/re-fence needed: additionally emit top-level `"remedy": "cite"` and give **each** finding a `"requires": "<path>:<lines>"` naming the exact seed. The slice gate then verifies deterministically that the re-cut map satisfies every finding with the slice structure unchanged, and skips the re-grade panel. Emit `remedy` ONLY when those citation edits alone would flip your verdict to pass — any structural doubt, or any finding without a concrete `requires` seed, → omit it and the normal re-grade runs. (There is no "refresh a drifted line number" remedy — per the citation-resolution rule, drifted line numbers are not findings.)
|
|
@@ -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
|
|
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.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: remediate
|
|
3
|
-
description: Surgically repair a working tree whose validate run returned a failing verdict — re-run each failed verify-at-implement risk ruling's prescribed procedure, apply the minimal localized code fix grounded in the validation report, then confirm
|
|
3
|
+
description: Surgically repair a working tree whose validate run returned a failing verdict — re-run each failed verify-at-implement risk ruling's prescribed procedure and each structured blocker's failing command, apply the minimal localized code fix grounded in the validation report, then confirm it passes. Single-pass, no subagents, no self-review, no questions. Workflow-gated repair arm dispatched after a failing validate; use as a gate's repair stage.
|
|
4
4
|
argument-hint: "--plans <plan-path> --validation <report-path>"
|
|
5
5
|
allowed-tools: Read, Edit, Write, Bash(*), Glob, Grep
|
|
6
6
|
shell-timeout: 10
|
|
@@ -22,7 +22,7 @@ contract:
|
|
|
22
22
|
|
|
23
23
|
# Remediate
|
|
24
24
|
|
|
25
|
-
You surgically repair a **working tree** that a validate stage judged `verdict: fail`. You do **not** re-validate the whole plan, re-run the project's full build/test suite, or rewrite anything broadly — you clear exactly the localized defects the failing risk rulings prescribe, and re-run each
|
|
25
|
+
You surgically repair a **working tree** that a validate stage judged `verdict: fail`. You do **not** re-validate the whole plan, re-run the project's full build/test suite, or rewrite anything broadly — you clear exactly the localized defects the failing risk rulings and structured blockers prescribe, and re-run each item's own `procedure`/`command` to confirm it now passes. One pass, non-interactive, side-effect only: you mutate code, never emit an artifact. The workflow loops you straight back to the validate gate, which re-judges; that is the only validation, so you do **not** self-review or ask for approval.
|
|
26
26
|
|
|
27
27
|
You are the tools/contract twin of `implement` (`Bash(*)` + `code-mutation`, side-effect, not an artifact) and the body-discipline twin of `amend` (single-pass, surgical, no subagents, no self-review, no questions).
|
|
28
28
|
|
|
@@ -31,30 +31,32 @@ You are the tools/contract twin of `implement` (`Bash(*)` + `code-mutation`, sid
|
|
|
31
31
|
`$ARGUMENTS` — flags the orchestrator wires from the gate's channels. Parse flag-style (order-agnostic), exactly like `amend`:
|
|
32
32
|
|
|
33
33
|
- **`--plans <plan-path>`** — the plan under `.rpiv/artifacts/plans/`. Its frontmatter carries the `risks:` array; a ruling's `id` joins to a flag there.
|
|
34
|
-
- **`--validation <report-path>`** — the failing validation report under `.rpiv/artifacts/validation/`. Its frontmatter carries `verdict` + `risk_rulings: [{ id, pass }]`.
|
|
34
|
+
- **`--validation <report-path>`** — the failing validation report under `.rpiv/artifacts/validation/`. Its frontmatter carries `verdict` + `risk_rulings: [{ id, pass }]` and, when whole-plan gates failed, `blockers: [{ id, command, file, line }]`.
|
|
35
35
|
|
|
36
36
|
If `--plans` or `--validation` is missing, print an error and stop — it is a dispatch error, not a failing phase.
|
|
37
37
|
|
|
38
38
|
## Steps
|
|
39
39
|
|
|
40
|
-
1. **Read the plan and the report fully** (no limit/offset). From the report's frontmatter read `verdict` and the `
|
|
41
|
-
2. **Build the work-list — ONLY the report's failing risk rulings.** Take every `risk_rulings` entry with `pass === false`, and join each to the plan's `risks:` flag by `id`. A `pass: false` ruling whose `id` matches no plan flag has no `claim`/`procedure`/`owner` to ground a fix — treat it as a drift-escape (step 4). Never source work from the report body's Potential Issues / Deviations prose on its own: those tie to a
|
|
40
|
+
1. **Read the plan and the report fully** (no limit/offset). From the report's frontmatter read `verdict`, the `risk_rulings: [{ id, pass }]` array, and the `blockers: [{ id, command, file, line }]` array (absent ⇒ empty); from the plan's frontmatter read the `risks:` array (each flag is `{ id, claim, … }`).
|
|
41
|
+
2. **Build the work-list — ONLY the report's failing risk rulings + structured blockers.** Take every `risk_rulings` entry with `pass === false`, and join each to the plan's `risks:` flag by `id`. A `pass: false` ruling whose `id` matches no plan flag has no `claim`/`procedure`/`owner` to ground a fix — treat it as a drift-escape (step 4). Then append every `blockers:` entry — each is a whole-plan/automated-command failure validate attributed with a runnable `command` and an in-delta `file`; its `command` plays the role of a ruling's `procedure` and it joins no plan flag. Never source work from the report body's Potential Issues / Deviations prose on its own: those tie to a work item only when a `risk_rulings` or `blockers` entry names it.
|
|
42
42
|
3. **Partition the work-list into fixable vs drift-escape.** A failed ruling is **fixable** ONLY when its joined plan flag carries ALL of:
|
|
43
43
|
- `disposition: verify-at-implement` — the ruling the plan deferred to this exact repair arm;
|
|
44
44
|
- a concrete, non-empty `procedure` — the named command/test the ruling's own verification runs (the `owner` phase promised it);
|
|
45
45
|
- a numeric `owner` phase.
|
|
46
46
|
|
|
47
47
|
Every other failed ruling — a `claim_type: mechanics` flag (cited `file:line`, no `procedure`), a bare `{ id, claim }` flag, or a flag missing `owner` — is a **drift-escape**: it has no executable procedure a localized fix can discharge, so an open-ended repair would be guessing.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
- **
|
|
53
|
-
|
|
48
|
+
|
|
49
|
+
A `blockers` entry is **fixable** when it carries a concrete, non-empty `command` AND a `file` — the command is its procedure, the file its localization. An entry missing either is a **drift-escape**.
|
|
50
|
+
4. **Drift-escape gate (checked BEFORE any edit).** If the work-list is empty (`verdict: fail` with no `pass: false` risk ruling and no `blockers` entry at all), print `remediation not localized: no-prescribed-rulings`, edit nothing, and stop. If ANY failed ruling or blocker is non-fixable, print `remediation not localized: <item-id>` for each non-fixable item, edit nothing, and stop. Either way, do NOT print the success closing block.
|
|
51
|
+
5. **Repair pass — one cycle per fixable item (ruling or blocker), single-pass (no in-skill retry loop).** For each fixable item, in turn:
|
|
52
|
+
- **Run its verification command** via `Bash`, verbatim — a ruling's `flag.procedure`, a blocker's `command`. Capture pass/fail.
|
|
53
|
+
- **If it passes already** (the tree may have drifted since validate), the item is cleared — record it and move on (no edit).
|
|
54
|
+
- **If it fails**, Read/Grep the report body items tied to that item's `id` (Risk Flag Rulings, Potential Issues, Automated Verification Results) and its grounding — a ruling's plan-flag `claim` + cited `file:line`, a blocker's own `file`/`line` — then apply the **minimal localized code fix** — the smallest edit grounded in the current tree that makes the command pass. Then **re-run the command** and record the result. One fix attempt per item; never loop, never widen the edit, never `ask_user_question`.
|
|
55
|
+
6. **Emit the result.** If every fixable item's command now passes, print the success closing block (below) — the run is fully cleared. If an item's command still fails after its one localized fix, it is not localized either: print `remediation not localized: <item-id>` for each un-cleared item and OMIT the success closing block; the fixes already applied to cleared items stand (single-pass), and re-validate will catch what remains.
|
|
54
56
|
|
|
55
57
|
## Hard rules
|
|
56
58
|
|
|
57
|
-
- **Drift-escape, never an open-ended repair.** A failed ruling with no executable `procedure` (a `claim_type: mechanics` flag, a bare `{ id, claim }` flag), an empty work-list when `verdict: fail` has no `pass: false` risk ruling, or a fixable
|
|
59
|
+
- **Drift-escape, never an open-ended repair.** A failed ruling with no executable `procedure` (a `claim_type: mechanics` flag, a bare `{ id, claim }` flag), a `blockers` entry missing its `command` or `file`, an empty work-list when `verdict: fail` has no `pass: false` risk ruling and no `blockers` entry, or a fixable item whose command won't clear in one localized fix — each emits `remediation not localized: <item-id>` (or `remediation not localized: no-prescribed-rulings` for the empty case), and the success closing block is withheld. The upfront gate (non-fixable / empty) edits nothing and stops. Never `ask_user_question`, never widen into an un-prescribed repair, never re-run the project's whole build/test suite — that is the downstream validate gate's job.
|
|
58
60
|
- **Surgical, single-pass.** Touch only the code a fixable ruling's `procedure` gates; leave passing rulings' code and untouched files byte-for-byte. One fix attempt per ruling — no in-skill retry loop. The validate gate re-judges; that is the validation.
|
|
59
61
|
- **Fix the code, never the plan or any `.rpiv/artifacts/` document.** Remediate mutates the working tree only. Reading the plan/report to locate a ruling is required; editing the plan, the report, or any artifact is out of scope (that is amend's / revise's authority). The embedded code blocks in a spliced plan are the plan's own content too — remediate does not edit them either; it edits the repo files the ruling's `procedure` exercises.
|
|
60
62
|
- **Never touch code a passing ruling owns.** A `pass: true` ruling's cited area is verified-correct; editing it risks regressing a cleared dimension.
|
|
@@ -63,11 +65,11 @@ If `--plans` or `--validation` is missing, print an error and stop — it is a d
|
|
|
63
65
|
|
|
64
66
|
## Closing block
|
|
65
67
|
|
|
66
|
-
On a fully-cleared run (every failed ruling fixable, every
|
|
68
|
+
On a fully-cleared run (every failed ruling/blocker fixable, every command now passing), print:
|
|
67
69
|
|
|
68
70
|
```
|
|
69
|
-
Remediation complete: {N} failed
|
|
70
|
-
|
|
71
|
+
Remediation complete: {N} failed item(s) addressed, {M} file(s) changed, {C} command(s) re-run (all pass).
|
|
72
|
+
Items: {id1} ✓, {id2} ✓ …
|
|
71
73
|
Outstanding: none.
|
|
72
74
|
```
|
|
73
75
|
|
package/skills/research/SKILL.md
CHANGED
|
@@ -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.
|
package/skills/slice/SKILL.md
CHANGED
|
@@ -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 (
|
|
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
|
package/skills/validate/SKILL.md
CHANGED
|
@@ -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),
|
|
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,9 +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`,
|
|
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),
|
|
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.
|
|
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.
|
|
155
162
|
|
|
156
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.
|
|
157
164
|
|