@juicesharp/rpiv-pi 2.7.1 → 2.9.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 +8 -6
- package/docs/workflows.md +3 -3
- package/extensions/rpiv-core/agent-enablement.ts +164 -0
- package/extensions/rpiv-core/agents.ts +98 -12
- package/extensions/rpiv-core/built-in-workflows.ts +373 -142
- 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 +1 -0
- package/extensions/rpiv-core/built-ins/priors.ts +208 -38
- package/extensions/rpiv-core/built-ins/reconcile-directives.d.mts +29 -0
- package/extensions/rpiv-core/built-ins/reconcile-directives.mjs +338 -0
- package/extensions/rpiv-core/built-ins/reconcile.ts +88 -130
- package/extensions/rpiv-core/built-ins/slices.ts +5 -1
- package/extensions/rpiv-core/frontmatter.ts +22 -0
- package/extensions/rpiv-core/lane-relay-ui.ts +25 -1
- package/extensions/rpiv-core/models-config.ts +86 -6
- package/extensions/rpiv-core/outcome-derivation.ts +1 -0
- package/extensions/rpiv-core/package-checks.ts +13 -0
- package/extensions/rpiv-core/pipeline-pointer.ts +1 -1
- package/extensions/rpiv-core/workflow-execution-host.ts +3 -2
- package/package.json +3 -3
- package/skills/_shared/reconcile-lint.mjs +125 -0
- package/skills/acceptance/SKILL.md +123 -0
- package/skills/elaborate/SKILL.md +3 -3
- package/skills/grade/SKILL.md +8 -7
- package/skills/implement/SKILL.md +17 -2
- package/skills/quick-plan/SKILL.md +19 -2
- package/skills/research/SKILL.md +28 -1
- package/skills/slice/SKILL.md +4 -4
- package/skills/synthesize/SKILL.md +1 -1
- package/skills/validate/SKILL.md +11 -5
|
@@ -547,16 +547,34 @@ export const shipGatePasses = (state: RunView): boolean => {
|
|
|
547
547
|
};
|
|
548
548
|
|
|
549
549
|
/**
|
|
550
|
-
* Confirm-before-block: a dimension's
|
|
551
|
-
* current artifact gets ONE independent second judgment before it
|
|
552
|
-
* round
|
|
553
|
-
*
|
|
554
|
-
*
|
|
555
|
-
*
|
|
556
|
-
*
|
|
557
|
-
*
|
|
558
|
-
*
|
|
559
|
-
*
|
|
550
|
+
* Confirm-before-block, severity-gated: a dimension's FRESH blocking verdict
|
|
551
|
+
* against the current artifact gets ONE independent second judgment before it
|
|
552
|
+
* buys a fix round — but only when the second opinion is worth its price. Run
|
|
553
|
+
* telemetry over the whole runs corpus measured the confirm arms at ~13:1 and
|
|
554
|
+
* ~10:1 onward-to-fix vs overturn: ~90% of confirms added 4–7 minutes and an
|
|
555
|
+
* extra grade session before the fix that was going to happen anyway. So a
|
|
556
|
+
* fresh blocker (the dimension's previous fresh verdict, if any, did not
|
|
557
|
+
* block — a repeated block routes straight to the fix: confirmation is one
|
|
558
|
+
* extra opinion, not an unbounded re-roll) confirms only in the three shapes
|
|
559
|
+
* where the insurance has real expected value:
|
|
560
|
+
*
|
|
561
|
+
* - a HIGH-severity blocker — the expensive class: its fix round is the
|
|
562
|
+
* broadest, so a spurious high deserves one adversarial check before it
|
|
563
|
+
* buys that;
|
|
564
|
+
* - a RISK-ruling blocker (a `pass: false` ruling or a duty-demoted pass) —
|
|
565
|
+
* the confirm's uphold-or-refute-with-evidence contract is the designed
|
|
566
|
+
* remedy for an un-grounded ruling, and `amend` legitimately re-emits
|
|
567
|
+
* UNCHANGED for a demotions-only verdict, so routing that class to the
|
|
568
|
+
* fix instead would lap an unchanged plan against an unchanged lazy
|
|
569
|
+
* judgment until the backward-jump guard halted it;
|
|
570
|
+
* - a FLAP — the dimension previously passed and now blocks on the same
|
|
571
|
+
* artifact (a broad re-grade regressing a carried pass), i.e. the exact
|
|
572
|
+
* single-judge instability the confirm exists to adjudicate.
|
|
573
|
+
*
|
|
574
|
+
* A first-time MEDIUM finding-driven blocker routes straight to the fix:
|
|
575
|
+
* amend is surgical and cheap (observed under a minute), and the delta
|
|
576
|
+
* re-grade guard keeps the re-judgment narrow — a wrong medium now costs one
|
|
577
|
+
* lean fix lap instead of every medium costing a confirm session.
|
|
560
578
|
*
|
|
561
579
|
* No tier guard is needed: a blocking verdict is medium+ by the severity
|
|
562
580
|
* floor, and a medium+ severity already lifts `gateTier` out of light — every
|
|
@@ -571,7 +589,7 @@ const confirmDue = (
|
|
|
571
589
|
const roster = new Set(gateRoster(gateTier(state, verdictChannel), dimensions));
|
|
572
590
|
const fresh = freshVerdicts(state.named[verdictChannel], latestArtifactPath(state, channel));
|
|
573
591
|
const risks = planAuthoredRisks(state, channel);
|
|
574
|
-
const byDim = new Map<string, { blocking: boolean;
|
|
592
|
+
const byDim = new Map<string, { blocking: boolean; confirmWorthy: boolean; prevBlocking?: boolean }>();
|
|
575
593
|
for (const o of fresh) {
|
|
576
594
|
const v = o.data as { dimension?: string; pass?: boolean; severity?: string; findings?: unknown } | undefined;
|
|
577
595
|
if (typeof v?.dimension !== "string" || !roster.has(v.dimension)) continue;
|
|
@@ -579,13 +597,17 @@ const confirmDue = (
|
|
|
579
597
|
// severity-fold consumers (gateTier/dimensionsToRegrade/allDimensionsPass).
|
|
580
598
|
const floored = v.pass === true || v.severity === "low" || v.severity === "none" || anchorNitsOnly(v);
|
|
581
599
|
const riskFail = verdictRiskRulings(o).some((r) => !rulingEffectivePass(r, risks.get(r.id)));
|
|
600
|
+
const blocking = !floored || riskFail;
|
|
601
|
+
const prev = byDim.get(v.dimension);
|
|
582
602
|
byDim.set(v.dimension, {
|
|
583
|
-
blocking
|
|
584
|
-
|
|
603
|
+
blocking, // the latest verdict decides whether the dimension currently blocks
|
|
604
|
+
confirmWorthy: blocking && (v.severity === "high" || riskFail),
|
|
605
|
+
prevBlocking: prev?.blocking,
|
|
585
606
|
});
|
|
586
607
|
}
|
|
587
|
-
|
|
588
|
-
|
|
608
|
+
return [...byDim.values()].some(
|
|
609
|
+
(e) => e.blocking && e.prevBlocking !== true && (e.confirmWorthy || e.prevBlocking === false),
|
|
610
|
+
);
|
|
589
611
|
};
|
|
590
612
|
|
|
591
613
|
export {
|
|
@@ -605,6 +627,7 @@ export {
|
|
|
605
627
|
planAuthoredRisks,
|
|
606
628
|
planGatePasses,
|
|
607
629
|
procedureSatisfiesDuty,
|
|
630
|
+
type RiskRecord,
|
|
608
631
|
rulingEffectivePass,
|
|
609
632
|
SLICE_DIMENSIONS,
|
|
610
633
|
sliceGatePasses,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
type RunView,
|
|
13
13
|
type ScriptContext,
|
|
14
14
|
} from "@juicesharp/rpiv-workflow/registration";
|
|
15
|
-
import { latestFsArtifact, readArtifactFile } from "./shared.js";
|
|
15
|
+
import { haltPreflight, latestFsArtifact, readArtifactFile } from "./shared.js";
|
|
16
16
|
|
|
17
17
|
/** Bucket directory the goal capture writes into — build's verbatim-brief channel. */
|
|
18
18
|
const GOAL_DIR = ".rpiv/artifacts/goal";
|
|
@@ -35,6 +35,37 @@ const GOAL_DIR = ".rpiv/artifacts/goal";
|
|
|
35
35
|
* deterministic.
|
|
36
36
|
*/
|
|
37
37
|
const captureGoal = ({ state, cwd }: ScriptContext): Omit<Output, "meta"> => {
|
|
38
|
+
// Garbage-brief preflight — a placeholder brief ("do something") can only
|
|
39
|
+
// ground a GENERATIVE run against nothing, so halt BEFORE any fs side
|
|
40
|
+
// effect (no goal dir, no goal file, no baseline snapshot). originalInput
|
|
41
|
+
// arrives frozen and unnormalized, so the guard strips whitespace itself.
|
|
42
|
+
// The runner wraps every throw from a script run body as a halted stage.
|
|
43
|
+
// Build/ship ONLY: vet captures via `captureReviewScope` below — its input
|
|
44
|
+
// is a review-scope token ("staged", "working", a hash), legitimately
|
|
45
|
+
// shorter than any brief this floor would admit.
|
|
46
|
+
if (state.originalInput.replace(/\s/g, "").length < 12)
|
|
47
|
+
throw haltPreflight(
|
|
48
|
+
"goal",
|
|
49
|
+
"goal: the brief is too thin to ground a run",
|
|
50
|
+
"goal: the brief carries fewer than 12 non-whitespace characters — re-invoke with a fuller brief naming the ask, any constraints, and the observable outcome to expect.",
|
|
51
|
+
);
|
|
52
|
+
return writeGoalCapture(state, cwd);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Vet's goal capture — the SAME verbatim capture + baseline snapshot, minus
|
|
57
|
+
* the garbage-brief floor: vet's "brief" is the review scope `code-review`
|
|
58
|
+
* accepts ("staged", "working", a commit hash, an `A..B` range), and every
|
|
59
|
+
* documented invocation is shorter than the floor's 12 non-whitespace
|
|
60
|
+
* characters. Run 2026-08-28_17-06-39-18f1's adopted preflight would have
|
|
61
|
+
* turned `/wf vet staged` into a halt — the acceptance inventory never
|
|
62
|
+
* covered vet because the implementing brief never mentioned it (a
|
|
63
|
+
* goal-derived standard faithfully inherits its brief's blind spots).
|
|
64
|
+
*/
|
|
65
|
+
const captureReviewScope = ({ state, cwd }: ScriptContext): Omit<Output, "meta"> => writeGoalCapture(state, cwd);
|
|
66
|
+
|
|
67
|
+
/** The shared capture body — the verbatim goal file + run-start baseline. */
|
|
68
|
+
const writeGoalCapture = (state: ScriptContext["state"], cwd: string): Omit<Output, "meta"> => {
|
|
38
69
|
const stamp = new Date().toISOString().replace(/[:.]/g, "-");
|
|
39
70
|
const rel = join(GOAL_DIR, `goal-${stamp}.md`);
|
|
40
71
|
mkdirSync(join(cwd, GOAL_DIR), { recursive: true });
|
|
@@ -229,6 +260,14 @@ const scopeExcess = (dirty: readonly string[], baseline: readonly string[], decl
|
|
|
229
260
|
* publishes on a clean pass too, so every post-floor dispatch carries the flag
|
|
230
261
|
* and the skill's adjudication step (verdict read + unconditional
|
|
231
262
|
* quarantine-manifest check) decides what there is to rule.
|
|
263
|
+
*
|
|
264
|
+
* `--acceptance` threads the goal-derived acceptance inventory so validate
|
|
265
|
+
* EXECUTES each item's evidence command against the finished tree — the one
|
|
266
|
+
* executable standard NOT authored by the plan (the plan's own AV commands
|
|
267
|
+
* inherit the plan's scope; the inventory was frozen before planning). A
|
|
268
|
+
* failed executable item lands as a structured `blockers:` entry, so it is
|
|
269
|
+
* remediable by the validate-fix arm like any other blocker. Conditional —
|
|
270
|
+
* a graph without an acceptance stage simply carries no flag.
|
|
232
271
|
*/
|
|
233
272
|
const VALIDATE_GOAL_PROMPT: PromptFn = ({ state }) => {
|
|
234
273
|
const parts = ["/skill:validate"];
|
|
@@ -240,6 +279,8 @@ const VALIDATE_GOAL_PROMPT: PromptFn = ({ state }) => {
|
|
|
240
279
|
if (baseline) parts.push(`--baseline ${baseline}`);
|
|
241
280
|
const scope = latestFsArtifact(state, "implement-scope-check");
|
|
242
281
|
if (scope?.handle.kind === "fs") parts.push(`--scope ${handleToString(scope.handle)}`);
|
|
282
|
+
const acceptance = latestFsArtifact(state, "acceptance");
|
|
283
|
+
if (acceptance?.handle.kind === "fs") parts.push(`--acceptance ${handleToString(acceptance.handle)}`);
|
|
243
284
|
return parts.join(" ");
|
|
244
285
|
};
|
|
245
286
|
|
|
@@ -261,6 +302,7 @@ export type { GitStatusEntry };
|
|
|
261
302
|
export {
|
|
262
303
|
COMMIT_BASELINE_PROMPT,
|
|
263
304
|
captureGoal,
|
|
305
|
+
captureReviewScope,
|
|
264
306
|
gitDirtyEntries,
|
|
265
307
|
goalBaselinePath,
|
|
266
308
|
readGoalBaseline,
|
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
* The grade panels: the shared tiered panel factory, its build-lane instances,
|
|
3
3
|
* and ship's bespoke tier-independent panel and verdict channel.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
directoryPathCollector,
|
|
7
|
+
fanout,
|
|
8
|
+
handleToString,
|
|
9
|
+
jsonBodyParser,
|
|
10
|
+
type RunView,
|
|
11
|
+
} from "@juicesharp/rpiv-workflow/registration";
|
|
6
12
|
import {
|
|
7
13
|
dimensionsToRegrade,
|
|
8
14
|
freshVerdicts,
|
|
@@ -18,6 +24,45 @@ import {
|
|
|
18
24
|
import { isSurgicalFix, priorArtifact } from "./priors.js";
|
|
19
25
|
import { latestFsArtifact } from "./shared.js";
|
|
20
26
|
|
|
27
|
+
/**
|
|
28
|
+
* The dimension-scoped artifact flags every panel body composes — ONE
|
|
29
|
+
* construction site shared by the `gradePanelFanout` factory and ship's
|
|
30
|
+
* bespoke twin, so the twins' flag spellings can't drift. Each flag is empty
|
|
31
|
+
* when its channel carries no fs artifact (workflows without that stage
|
|
32
|
+
* simply emit no flag). Routing: `--context` → architecture-fit only,
|
|
33
|
+
* `--goal` → GOAL_DIMENSIONS, `--acceptance` → completeness only — the
|
|
34
|
+
* per-dimension keying stays at the prompt-composition sites.
|
|
35
|
+
*/
|
|
36
|
+
const dimensionArtifactFlags = (state: RunView): { contextFlag: string; goalFlag: string; acceptanceFlag: string } => {
|
|
37
|
+
const flag = (channel: string, name: string): string => {
|
|
38
|
+
const doc = latestFsArtifact(state, channel);
|
|
39
|
+
return doc?.handle.kind === "fs" ? ` --${name} ${handleToString(doc.handle)}` : "";
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
contextFlag: flag("research", "context"),
|
|
43
|
+
goalFlag: flag("goal", "goal"),
|
|
44
|
+
acceptanceFlag: flag("acceptance", "acceptance"),
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The deterministic citation floor's verdict as a `--cite-check` flag for the
|
|
50
|
+
* correctness unit — threaded whenever the floor has published, WHATEVER its
|
|
51
|
+
* result. A clean verdict is itself load-bearing evidence: it is the settled
|
|
52
|
+
* fact that every citation in the artifact mechanically resolves, so the
|
|
53
|
+
* correctness grader can skip the file-by-file re-resolution it otherwise
|
|
54
|
+
* duplicates (the single most expensive part of the most expensive dimension)
|
|
55
|
+
* and spend its spot-check budget on claim-vs-code semantics — the one thing
|
|
56
|
+
* the floor cannot judge. A findings-bearing verdict additionally carries the
|
|
57
|
+
* advisory leads the grader folds into its sample. Empty when the channel has
|
|
58
|
+
* no fs verdict (a workflow without the floor simply emits no flag).
|
|
59
|
+
*/
|
|
60
|
+
const citeCheckFlag = (state: RunView, citeChannel: string | undefined): string => {
|
|
61
|
+
if (citeChannel === undefined) return "";
|
|
62
|
+
const doc = latestFsArtifact(state, citeChannel);
|
|
63
|
+
return doc?.handle.kind === "fs" ? ` --cite-check ${handleToString(doc.handle)}` : "";
|
|
64
|
+
};
|
|
65
|
+
|
|
21
66
|
/**
|
|
22
67
|
* A grade panel: one `grade` session per dimension over the latest artifact on
|
|
23
68
|
* `channel`. Each unit's prompt is the `grade` skill's flags
|
|
@@ -53,25 +98,38 @@ import { latestFsArtifact } from "./shared.js";
|
|
|
53
98
|
* the latest-per-dimension fold). Only PENDING dimensions get the flag: in the
|
|
54
99
|
* degenerate full-roster fallback a carried passing verdict has nothing to
|
|
55
100
|
* adjudicate, and a first grade has no prior at all.
|
|
101
|
+
*
|
|
102
|
+
* Every panel wires `haltWhenAllFailed: true`: a generation in which EVERY
|
|
103
|
+
* dispatched dimension unit failed is a dead panel — nothing was collected, so
|
|
104
|
+
* there are no verdicts to fold — and the run halts at the panel's own close
|
|
105
|
+
* instead of routing the gate machinery over an empty verdict channel.
|
|
56
106
|
*/
|
|
57
107
|
const gradePanelFanout = (
|
|
58
108
|
channel: string,
|
|
59
109
|
dimensions: readonly string[],
|
|
60
110
|
verdictChannel: string,
|
|
61
|
-
{
|
|
111
|
+
{
|
|
112
|
+
confirm = false,
|
|
113
|
+
priorChannel,
|
|
114
|
+
citeChannel,
|
|
115
|
+
}: { confirm?: boolean; priorChannel?: string; citeChannel?: string } = {},
|
|
62
116
|
) =>
|
|
63
117
|
fanout({
|
|
64
118
|
source: channel,
|
|
65
119
|
unit: { by: "dimension-list", pattern: "dimensions" },
|
|
66
120
|
max: dimensions.length,
|
|
121
|
+
haltWhenAllFailed: true,
|
|
67
122
|
units: ({ state, cwd }) => {
|
|
68
123
|
const doc = latestFsArtifact(state, channel);
|
|
69
124
|
if (doc?.handle.kind !== "fs") return [];
|
|
70
125
|
const target = handleToString(doc.handle);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
126
|
+
// The goal-derived acceptance inventory threads to the completeness
|
|
127
|
+
// unit only: completeness anchors on the enumerated items instead of
|
|
128
|
+
// re-deriving the ask list from goal prose each round. Conditional —
|
|
129
|
+
// workflows without an acceptance stage (vet/polish, user-authored)
|
|
130
|
+
// simply emit no flag.
|
|
131
|
+
const { contextFlag, goalFlag, acceptanceFlag } = dimensionArtifactFlags(state);
|
|
132
|
+
const citeFlag = citeCheckFlag(state, citeChannel);
|
|
75
133
|
const roster = gateRoster(gateTier(state, verdictChannel), dimensions);
|
|
76
134
|
const latest = latestVerdictPerDimension(freshVerdicts(state.named[verdictChannel], target));
|
|
77
135
|
const risks = planAuthoredRisks(state, channel);
|
|
@@ -87,7 +145,9 @@ const gradePanelFanout = (
|
|
|
87
145
|
// (round 1 / first re-grade) the carry-forward applies unchanged. See
|
|
88
146
|
// `isSurgicalFix` for the fail-closed contract.
|
|
89
147
|
const surgical =
|
|
90
|
-
!confirm &&
|
|
148
|
+
!confirm &&
|
|
149
|
+
priorChannel !== undefined &&
|
|
150
|
+
isSurgicalFix(state, priorChannel, cwd, target, latest, pending, risks);
|
|
91
151
|
const priorPresent = priorChannel !== undefined && priorArtifact(state, priorChannel) !== undefined;
|
|
92
152
|
const priorFlag = (d: string): string => {
|
|
93
153
|
if (!confirm || !pending.includes(d)) return "";
|
|
@@ -100,7 +160,7 @@ const gradePanelFanout = (
|
|
|
100
160
|
// empty ⇒ single dimensionless grade fall-through).
|
|
101
161
|
const toGrade = surgical ? carryForward : priorPresent ? roster : carryForward;
|
|
102
162
|
return toGrade.map((d) => ({
|
|
103
|
-
prompt: `--dimension ${d} --artifact ${target}${d === "architecture-fit" ? contextFlag : ""}${GOAL_DIMENSIONS.has(d) ? goalFlag : ""}${priorFlag(d)}`,
|
|
163
|
+
prompt: `--dimension ${d} --artifact ${target}${d === "architecture-fit" ? contextFlag : ""}${GOAL_DIMENSIONS.has(d) ? goalFlag : ""}${d === "completeness" ? acceptanceFlag : ""}${d === "correctness" ? citeFlag : ""}${priorFlag(d)}`,
|
|
104
164
|
label: d,
|
|
105
165
|
id: `${channel}-dim-${d}`,
|
|
106
166
|
}));
|
|
@@ -110,12 +170,14 @@ const gradePanelFanout = (
|
|
|
110
170
|
const SLICE_DIMENSION_FANOUT = gradePanelFanout("slices", SLICE_DIMENSIONS, "slice-verdicts");
|
|
111
171
|
const PLAN_DIMENSION_FANOUT = gradePanelFanout("plans", PLAN_DIMENSIONS, "plan-verdicts", {
|
|
112
172
|
priorChannel: "plan-snapshot",
|
|
173
|
+
citeChannel: "plan-cite-check",
|
|
113
174
|
});
|
|
114
175
|
// The post-splice code gate re-grades the SAME `plans` artifact on its own
|
|
115
176
|
// `code-verdicts` channel, so its carry-forward reads the code gate's verdicts,
|
|
116
177
|
// never the pre-elaborate plan gate's.
|
|
117
178
|
const CODE_DIMENSION_FANOUT = gradePanelFanout("plans", PLAN_DIMENSIONS, "code-verdicts", {
|
|
118
179
|
priorChannel: "code-snapshot",
|
|
180
|
+
citeChannel: "code-cite-check",
|
|
119
181
|
});
|
|
120
182
|
// The confirm stages re-run the SAME panel machinery on the SAME verdict
|
|
121
183
|
// channel: with the failing dimensions the only ones pending, the panel emits
|
|
@@ -125,8 +187,14 @@ const CODE_DIMENSION_FANOUT = gradePanelFanout("plans", PLAN_DIMENSIONS, "code-v
|
|
|
125
187
|
// evidence) so a confirming pass records WHY the fail died instead of silently
|
|
126
188
|
// out-voting it at the latest-per-dimension fold.
|
|
127
189
|
// Distinct fanout instances (not aliases) so each stage owns its loop object.
|
|
128
|
-
const PLAN_CONFIRM_FANOUT = gradePanelFanout("plans", PLAN_DIMENSIONS, "plan-verdicts", {
|
|
129
|
-
|
|
190
|
+
const PLAN_CONFIRM_FANOUT = gradePanelFanout("plans", PLAN_DIMENSIONS, "plan-verdicts", {
|
|
191
|
+
confirm: true,
|
|
192
|
+
citeChannel: "plan-cite-check",
|
|
193
|
+
});
|
|
194
|
+
const CODE_CONFIRM_FANOUT = gradePanelFanout("plans", PLAN_DIMENSIONS, "code-verdicts", {
|
|
195
|
+
confirm: true,
|
|
196
|
+
citeChannel: "code-cite-check",
|
|
197
|
+
});
|
|
130
198
|
|
|
131
199
|
/**
|
|
132
200
|
* Ship's grade panel — a bespoke `fanout({...})` mirroring `gradePanelFanout`'s
|
|
@@ -139,33 +207,34 @@ const CODE_CONFIRM_FANOUT = gradePanelFanout("plans", PLAN_DIMENSIONS, "code-ver
|
|
|
139
207
|
* correctness), and the `freshVerdicts` / `latestVerdictPerDimension` /
|
|
140
208
|
* `dimensionsToRegrade` carry-forward so a re-grade emits only still-pending
|
|
141
209
|
* dimensions. Tier-independence is structural: the roster never shrinks, so a
|
|
142
|
-
* light run still grades `architecture-fit`.
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
210
|
+
* light run still grades `architecture-fit`. The correctness unit carries
|
|
211
|
+
* `--cite-check <verdict>` whenever the floor published (`citeCheckFlag` —
|
|
212
|
+
* a clean verdict settles citation resolution so the grader skips the
|
|
213
|
+
* mechanical re-resolution; a findings-bearing one is advisory by
|
|
214
|
+
* construction here, since a blocking finding STOPs at the cite gate before
|
|
215
|
+
* grade ever runs, and the grader adjudicates the leads rather than leaving
|
|
216
|
+
* them unread).
|
|
217
|
+
*
|
|
218
|
+
* `haltWhenAllFailed: true` mirrors the factory panels: an all-failed
|
|
219
|
+
* generation (every dimension session dead, nothing collected) halts the run
|
|
220
|
+
* at the panel's own close — one hop earlier than `shipGradeGate`, which was
|
|
221
|
+
* previously the first point to face the empty fold.
|
|
147
222
|
*/
|
|
148
223
|
export const SHIP_DIMENSION_FANOUT = fanout({
|
|
149
224
|
source: "plans",
|
|
150
225
|
unit: { by: "dimension-list", pattern: "dimensions" },
|
|
151
226
|
max: SHIP_DIMENSIONS.length,
|
|
227
|
+
haltWhenAllFailed: true,
|
|
152
228
|
units: ({ state }) => {
|
|
153
229
|
const doc = latestFsArtifact(state, "plans");
|
|
154
230
|
if (doc?.handle.kind !== "fs") return [];
|
|
155
231
|
const target = handleToString(doc.handle);
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
//
|
|
161
|
-
|
|
162
|
-
const cite = latestFsArtifact(state, "plan-cite-check");
|
|
163
|
-
const citeFindings = (state.named["plan-cite-check"]?.at(-1)?.data as { findings?: unknown[] } | undefined)
|
|
164
|
-
?.findings;
|
|
165
|
-
const citeFlag =
|
|
166
|
-
cite?.handle.kind === "fs" && Array.isArray(citeFindings) && citeFindings.length > 0
|
|
167
|
-
? ` --cite-check ${handleToString(cite.handle)}`
|
|
168
|
-
: "";
|
|
232
|
+
// The shared flag-composition site — the twins compose it rather than
|
|
233
|
+
// mirroring it (dimension keying below stays ship's own).
|
|
234
|
+
const { contextFlag, goalFlag, acceptanceFlag } = dimensionArtifactFlags(state);
|
|
235
|
+
// The floor's verdict threads whenever it exists — clean settles
|
|
236
|
+
// resolution, findings carry the advisory leads (see citeCheckFlag).
|
|
237
|
+
const citeFlag = citeCheckFlag(state, "plan-cite-check");
|
|
169
238
|
// Tier-independent roster: SHIP_DIMENSIONS verbatim — never gateRoster(gateTier(...)).
|
|
170
239
|
const roster = SHIP_DIMENSIONS;
|
|
171
240
|
const latest = latestVerdictPerDimension(freshVerdicts(state.named["ship-verdicts"], target));
|
|
@@ -173,7 +242,7 @@ export const SHIP_DIMENSION_FANOUT = fanout({
|
|
|
173
242
|
const pending = dimensionsToRegrade(roster, latest, risks);
|
|
174
243
|
const carryForward = pending.length > 0 ? pending : roster;
|
|
175
244
|
return carryForward.map((d) => ({
|
|
176
|
-
prompt: `--dimension ${d} --artifact ${target}${d === "architecture-fit" ? contextFlag : ""}${GOAL_DIMENSIONS.has(d) ? goalFlag : ""}${d === "correctness" ? citeFlag : ""}`,
|
|
245
|
+
prompt: `--dimension ${d} --artifact ${target}${d === "architecture-fit" ? contextFlag : ""}${GOAL_DIMENSIONS.has(d) ? goalFlag : ""}${d === "completeness" ? acceptanceFlag : ""}${d === "correctness" ? citeFlag : ""}`,
|
|
177
246
|
label: d,
|
|
178
247
|
id: `plans-dim-${d}`,
|
|
179
248
|
}));
|