@juicesharp/rpiv-pi 2.12.0 → 2.13.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.
@@ -112,16 +112,25 @@ function isTerminalFailure(status: LaneStatus | undefined): boolean {
112
112
  return status === "failed" || status === "aborted" || status === "cancelled";
113
113
  }
114
114
 
115
+ /**
116
+ * Marks `terminal.rows` as an allocation rather than the screen height, so
117
+ * rpiv-ask-user-question skips its inline editor-slot cap (70% of the terminal) and uses
118
+ * the whole band. A registry symbol keeps this free of an import from that package.
119
+ */
120
+ const HOST_ALLOCATED_ROWS = Symbol.for("rpiv-ask-user-question:host-allocated-rows");
121
+
115
122
  /**
116
123
  * A TUI proxy that reports a capped `terminal.rows` (the embedded questionnaire's
117
124
  * allocated band) while forwarding everything else — requestRender, columns, cursor.
118
125
  * DialogView reads getTerminalRows() → tui.terminal.rows at render time, so this makes
119
- * the questionnaire self-window to its band with no ask-user-question change.
126
+ * the questionnaire self-window to its band; `HOST_ALLOCATED_ROWS` tells it the rows are
127
+ * already budgeted.
120
128
  */
121
129
  export function cappedTui(real: TUI, rows: () => number): TUI {
122
130
  const terminal = new Proxy(real.terminal as object, {
123
131
  get(t, p) {
124
132
  if (p === "rows") return Math.max(1, rows());
133
+ if (p === HOST_ALLOCATED_ROWS) return true;
125
134
  const v = Reflect.get(t, p, t);
126
135
  return typeof v === "function" ? v.bind(t) : v;
127
136
  },
@@ -69,6 +69,14 @@ const plan: UnitSpec = {
69
69
  },
70
70
  ],
71
71
  maxRounds: 3,
72
+ // When the surgical plan-fix loop can't converge in 3 rounds, escalate to
73
+ // acceptance (its immediate upstream) rather than halt terminally: that opens
74
+ // a fresh generation, so plan re-plans from scratch (a clean quick-plan, not
75
+ // another surgical patch of a plan that kept whack-a-moling defects) against
76
+ // an acceptance inventory the escalation lets acceptance revise. Mirrors
77
+ // implement→plan; bounded by the runner's absolute lap ceiling, which halts
78
+ // the run if escalation also fails to converge.
79
+ onExhausted: { escalateTo: "acceptance" },
72
80
  };
73
81
 
74
82
  const implement: UnitSpec = {
@@ -95,7 +103,7 @@ const implement: UnitSpec = {
95
103
  export const metaWorkflow = defineUnitGraph({
96
104
  name: "meta",
97
105
  description:
98
- "Graph of self-correcting units: research → acceptance → plan → implement → commit. Each unit loops produce → deterministic checks → parallel lens graders → scoped correction (max 3 rounds; identical failures twice stop early); an exhausted implement escalates to plan. No confirm/demote passes, no slicing; accepted runs feed their corrected failures forward as standing constraints (.rpiv/lessons). The A/B challenger to build.",
106
+ "Graph of self-correcting units: research → acceptance → plan → implement → commit. Each unit loops produce → deterministic checks → parallel lens graders → scoped correction (max 3 rounds; identical failures twice stop early); an exhausted plan escalates to acceptance and an exhausted implement escalates to plan — each opening a fresh generation rather than halting. No confirm/demote passes, no slicing; accepted runs feed their corrected failures forward as standing constraints (.rpiv/lessons). The A/B challenger to build.",
99
107
  units: [
100
108
  ["research", research],
101
109
  ["acceptance", acceptance],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juicesharp/rpiv-pi",
3
- "version": "2.12.0",
3
+ "version": "2.13.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",
@@ -51,7 +51,7 @@
51
51
  ]
52
52
  },
53
53
  "dependencies": {
54
- "@juicesharp/rpiv-config": "^2.12.0"
54
+ "@juicesharp/rpiv-config": "^2.13.0"
55
55
  },
56
56
  "peerDependencies": {
57
57
  "@earendil-works/pi-ai": "*",
@@ -34,11 +34,11 @@ You are one skeptic on a panel. You judge **one** target through **one** lens an
34
34
  - `high`: the target is broken as written.
35
35
  - `medium`: a real defect the rubric names.
36
36
  - `low`: a nit or a style issue. `low` never blocks.
37
- 4. Write the verdict, then print its path on the last line of your reply.
37
+ 4. Write the verdict with the Write tool; end your reply with `<lens>: PASS` or `<lens>: FAIL (<severity>)` — not the path, which the panel reads from disk.
38
38
 
39
39
  ## Verdict
40
40
 
41
- Write `<out>/<unit>__<lens>__r<round>g<generation>__<unix-ms>.json`:
41
+ Write `<out>/<unit>__<lens>__r<round>g<generation>.json` — the four identity flags verbatim, no timestamp.
42
42
 
43
43
  ```json
44
44
  {
@@ -172,6 +172,7 @@ For each phase in the plan:
172
172
  2. **Determine verdict** (`status` is always `ready` — written once):
173
173
  - `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).
174
174
  - `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).
175
+ - **A comment-only gap never forces the verdict** — the same comment-only class `grade` rates `low` (a Deviation or Potential Issue whose ONLY remedy is comment/doc text, even when the text is wrong): no executable line changes and no downstream stage fails as written. Report it under `#### Deviations from Plan:` / `#### Potential Issues:`, but it neither leaves a phase incomplete for `verdict: pass` nor forces `verdict: fail`.
175
176
  - When the plan carried a `risks:` array, add a `risk_rulings: [{ id, pass }]` field to the report frontmatter — one ruling per flag.
176
177
  - 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.
177
178