@juicesharp/rpiv-pi 2.13.10 → 2.14.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.
@@ -236,10 +236,13 @@ export const planAuthoredRisks = (state: RunView, channel: string): Map<string,
236
236
  * regex carries the `/g` flag, so `.test()` is stateful across calls
237
237
  * (`lastIndex` advances) and would
238
238
  * intermittently miss a present citation. An id with no authored mechanics
239
- * risk carries no evidence duty ⇒ returns `true`.
239
+ * risk, or one deferred with `verify-at-implement`, carries no evidence duty ⇒
240
+ * returns `true`.
240
241
  */
241
242
  export const evidenceCitesFileLine = (r: RiskRuling, authored?: RiskRecord): boolean => {
242
- if (authored?.claim_type !== "mechanics") return true;
243
+ // A deferred claim may concern code the plan has not written yet, so its
244
+ // procedure + owner are the duty instead.
245
+ if (authored?.claim_type !== "mechanics" || authored.disposition === "verify-at-implement") return true;
243
246
  return typeof r.evidence === "string" && r.evidence.match(FILE_LINE_CITATION_RE) !== null;
244
247
  };
245
248
 
@@ -260,8 +263,8 @@ export const procedureSatisfiesDuty = (r: RiskRuling, authored?: RiskRecord): bo
260
263
 
261
264
  /**
262
265
  * The single gate-fold authority: a ruling is effective-pass iff it is a bare
263
- * `pass` AND (when the plan authored a mechanics risk for its id) its evidence
264
- * cites a `file:line` AND (when the plan authored a verify-at-implement risk
266
+ * `pass` AND (when the plan authored a mechanics risk for its id that it did not
267
+ * defer) its evidence cites a `file:line` AND (when the plan authored a verify-at-implement risk
265
268
  * for its id) its procedure+owner discharge the verify duty. `allRiskFlagsPass`,
266
269
  * `dimensionsToRegrade` clause 3, and `confirmDue`'s `riskFail` ALL consult this
267
270
  * — so the three risk folds agree on what "passing" means and a demoted
@@ -73,8 +73,8 @@ const codeSnapshot = snapshotLatestPlan("code-snapshot");
73
73
  * A duty demotion stamped onto a verdict's on-disk JSON — the legible record
74
74
  * that a risk ruling the panel marked `pass: true` was demoted to effective-
75
75
  * fail by the evidence or verify-at-implement duty. One entry per FAILING
76
- * duty (a ruling authored as BOTH mechanics AND verify-at-implement can carry
77
- * two). `reason` is decision-code-free prose (no run/phase ids, no absolute
76
+ * duty (a verify-at-implement flag carries only the procedure-owner duty, even
77
+ * when also authored as mechanics). `reason` is decision-code-free prose (no run/phase ids, no absolute
78
78
  * line numbers) naming the duty that failed, so disk readers (amend, confirm
79
79
  * `--prior`) can tell a grader-side demotion from a genuine `pass: false`.
80
80
  */
@@ -74,8 +74,12 @@ const VERDICT_FAIL_SCORE = 0;
74
74
  * (`(?<![\w.])`), and a dotless start only at a word boundary (`(?<!\w)`), so a
75
75
  * prose ellipsis (`...packages/x.ts:5`) still yields `packages/x.ts`, never
76
76
  * `...packages/x.ts`.
77
+ *
78
+ * The extension is 1–10 chars, so `.csproj`, `.cshtml`, `.config` and
79
+ * `.gradle` count; the adjacent `:NN` keeps dotted identifiers out without a
80
+ * tighter length cap.
77
81
  */
78
- const FILE_LINE_CITATION_RE = /((?:(?<![\w.])\.)?(?<!\w)[\w][\w./-]*\.[a-zA-Z][a-zA-Z0-9]{0,4}):(\d+)(?:-(\d+))?/g;
82
+ const FILE_LINE_CITATION_RE = /((?:(?<![\w.])\.)?(?<!\w)[\w][\w./-]*\.[a-zA-Z][a-zA-Z0-9]{0,9}):(\d+)(?:-(\d+))?/g;
79
83
 
80
84
  /** A structure-dimension finding — the shared shape the deterministic verdict
81
85
  * checks emit (`detail` is the actionable message, `where` locates the defect).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juicesharp/rpiv-pi",
3
- "version": "2.13.10",
3
+ "version": "2.14.0",
4
4
  "description": "A skill-based development workflow for Pi Agent. 30 contract-carrying skills (discover → research → design → plan → implement → validate → code-review → commit, and more), the 15 named subagents they dispatch, and four built-in /wf workflows that chain them end to end in detached parallel runs.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -52,7 +52,7 @@
52
52
  ]
53
53
  },
54
54
  "dependencies": {
55
- "@juicesharp/rpiv-config": "^2.13.10"
55
+ "@juicesharp/rpiv-config": "^2.14.0"
56
56
  },
57
57
  "peerDependencies": {
58
58
  "@earendil-works/pi-ai": "*",
@@ -78,7 +78,7 @@ The verdict shape for this dimension: `pass` is `true` only when every ruling is
78
78
  Two duties tighten what a `pass` means, and the gate enforces both (an un-grounded `pass` is demoted as if it were `fail`):
79
79
 
80
80
  - **Echo the flag's duty fields verbatim.** Copy `claim_type`, `disposition`, `procedure`, and `owner` from the plan's `risks:` entry into your ruling UNCHANGED. The duty itself is imposed by the plan's `risks:` frontmatter — the gate cross-references it by flag `id`, so dropping or mistyping `claim_type`/`disposition` in your ruling waives NOTHING: a mechanics `pass` is still demoted unless the ruling carries a `file:line` `evidence`, and a verify-at-implement `pass` is still demoted unless the ruling carries a concrete `procedure` and a numeric `owner`. Echo the fields anyway — the ruling stays self-describing for the audit trail and for `validate`, which runs the deferred `procedure` against the shipped code.
81
- - **Mechanics evidence duty (`claim_type: mechanics`).** A mechanics risk ruled `pass` MUST cite the `file:line` you actually checked in the ruling's `evidence` (e.g. `"packages/x/y.ts:42 — the helper returns early on undefined"`). A mechanics `pass` with no `evidence`, or whose `evidence` is not `file:line`-shaped, is demoted to `fail` — the gate refuses a confident-but-ungrounded mechanism assertion (the honest-lazy class: a confident pass that never opened a file). **The adjacency rule — what "`file:line`-shaped" means:** at least one site in the `evidence` string must be a dotted file path with its line number IMMEDIATELY adjacent (`path.ext:NN`, colon-number directly after the extension, no space — e.g. `packages/x/y.ts:1168`). Make the FIRST cited site that shape; later refs in the same string may be abbreviated bare `:NN`. `symbol :NN`, a bare `(:NN/:NN)` list, or a path with no adjacent `:NN` anywhere all fail the rule and demote the ruling. Rule `fail` outright if the mechanism does not hold.
81
+ - **Mechanics evidence duty (`claim_type: mechanics`).** A mechanics risk ruled `pass` MUST cite the `file:line` you actually checked in the ruling's `evidence` (e.g. `"packages/x/y.ts:42 — the helper returns early on undefined"`). A mechanics `pass` with no `evidence`, or whose `evidence` is not `file:line`-shaped, is demoted to `fail` — the gate refuses a confident-but-ungrounded mechanism assertion (the honest-lazy class: a confident pass that never opened a file). **The adjacency rule — what "`file:line`-shaped" means:** at least one site in the `evidence` string must be a dotted file path with its line number IMMEDIATELY adjacent (`path.ext:NN`, colon-number directly after the extension, no space — e.g. `packages/x/y.ts:1168`). Make the FIRST cited site that shape; later refs in the same string may be abbreviated bare `:NN`. `symbol :NN`, a bare `(:NN/:NN)` list, or a path with no adjacent `:NN` anywhere all fail the rule and demote the ruling. Rule `fail` outright if the mechanism does not hold. A mechanics flag that also carries `disposition: verify-at-implement` is deferred: the verify-at-implement rule below applies instead, and no `evidence` is required.
82
82
  - **Verify-at-implement rule (`disposition: verify-at-implement`).** You may defer a risk to the owner phase instead of ruling it finally here. Rule `pass` ONLY when the flag carries a concrete `procedure` (the named command/test the owner phase runs) AND a numeric `owner` phase AND you judge that phase actually carries that step; otherwise rule `fail` (a bare "verify later" with no procedure does not defer — it fails). When you defer, echo `procedure` and `owner` verbatim so `validate` can run the procedure against the shipped code.
83
83
 
84
84
  Emit these as a `risk_rulings: [{ id, pass, evidence?, claim_type?, disposition?, procedure?, owner? }]` array in your verdict — one ruling per declared flag, none omitted. `evidence` is REQUIRED on a mechanics `pass` (and must be `file:line`-shaped); `claim_type`/`disposition`/`procedure`/`owner` are echoed whenever the plan flag carries them.
@@ -108,7 +108,7 @@ Copy values verbatim. `<iso>` is the first tab-separated field; `<slug>` is the
108
108
  - **Integration** — wire the seams: an input that depends on another's interface must reference the real shape the other defines. In root mode, this is where each sub-plan's `exports` get connected.
109
109
  - **Conflict** — when two inputs make incompatible decisions, resolve to one, and record the resolution in Synthesis Notes (the grade panel's correctness/architecture-fit members will check it).
110
110
  - **Risk flags** — a decision you're not confident is correct (an unverified assumption, an edge case wanting a second opinion) goes in the frontmatter `risks:` array as a `{ id, claim }` entry (stable `id`; `claim` = the one-line assertion to rule on) plus a `## Risk Flags` line — **never** buried in prose. This is the first-class channel grade and validate are REQUIRED to rule on; flag anything you'd otherwise write "flagging this so the grade panel can weigh in" about. Two optional fields tighten what "passing" means, so the gate can refuse a confident-but-ungrounded assertion (the honest-lazy class — a confident pass that never opened a file):
111
- - **`claim_type: mechanics`** — the `claim` asserts a verified mechanism (a behavior that holds because code was checked). A grade panel ruling it `pass` MUST cite the checked `file:line` in that ruling's `evidence`, else the gate demotes the pass as un-grounded. Use it for risks like "the revert is byte-identical" or "the helper no-ops on absent fields" where the assertion is checkable against code right now.
111
+ - **`claim_type: mechanics`** — the `claim` asserts a verified mechanism (a behavior that holds because code was checked). A grade panel ruling it `pass` MUST cite the checked `file:line` in that ruling's `evidence`, else the gate demotes the pass as un-grounded. Use it for risks like "the revert is byte-identical" or "the helper no-ops on absent fields" where the assertion is checkable against code right now. Do not pair it with `verify-at-implement` for a claim about code a phase has not written yet; a deferred flag carries only the procedure duty.
112
112
  - **`disposition: verify-at-implement`** — the panel may defer the risk to a later phase rather than rule it in this panel. A deferred pass is accepted ONLY when the flag ALSO carries a concrete **`procedure`** (the named command/test the owner phase runs to discharge it) and an **`owner`** (the phase `n` that runs that step); a bare "verify later" with no procedure demotes. Use it for risks that genuinely need the shipped tree (a real `build` run, a coverage gate) the plan-grade panel cannot run.
113
113
  - Default (no `claim_type`, no `disposition`) stays the ordinary `{ id, claim }` shape — the panel rules it on the artifact as today, with no evidence or procedure duty.
114
114
  3. **Sequence phases** — one phase per slice (flat/partial) or carry the sub-plans' phases through (root), ordered so a phase never precedes one it `depends_on`. Tightly-coupled units may merge into one phase; note any merge. Populate each entry's `files:` from that phase's `### Changes` paths (every repo-root-relative path the phase creates or edits) and `depends_on` only for semantic ordering NOT visible in `files:` (a phase that needs an earlier phase to run first despite no shared file) — lower `n` only.