@principles/pd-cli 1.112.0 → 1.114.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.
Files changed (35) hide show
  1. package/dist/commands/__tests__/run-rulehost-flag-wiring.test.d.ts +24 -0
  2. package/dist/commands/__tests__/run-rulehost-flag-wiring.test.d.ts.map +1 -0
  3. package/dist/commands/__tests__/run-rulehost-flag-wiring.test.js +223 -0
  4. package/dist/commands/__tests__/run-rulehost-flag-wiring.test.js.map +1 -0
  5. package/dist/commands/runtime-activation.d.ts +37 -0
  6. package/dist/commands/runtime-activation.d.ts.map +1 -1
  7. package/dist/commands/runtime-activation.js +416 -2
  8. package/dist/commands/runtime-activation.js.map +1 -1
  9. package/dist/commands/runtime-internalization-run-rulehost.d.ts +23 -0
  10. package/dist/commands/runtime-internalization-run-rulehost.d.ts.map +1 -0
  11. package/dist/commands/runtime-internalization-run-rulehost.js +364 -0
  12. package/dist/commands/runtime-internalization-run-rulehost.js.map +1 -0
  13. package/dist/index.js +56 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/services/demo-rule-compiler.d.ts +24 -0
  16. package/dist/services/demo-rule-compiler.d.ts.map +1 -0
  17. package/dist/services/demo-rule-compiler.js +53 -0
  18. package/dist/services/demo-rule-compiler.js.map +1 -0
  19. package/dist/services/rulehost-pipeline-runner.d.ts +132 -0
  20. package/dist/services/rulehost-pipeline-runner.d.ts.map +1 -0
  21. package/dist/services/rulehost-pipeline-runner.js +376 -0
  22. package/dist/services/rulehost-pipeline-runner.js.map +1 -0
  23. package/package.json +1 -1
  24. package/scripts/llm-dogfood.ts +419 -0
  25. package/src/commands/__tests__/run-rulehost-flag-wiring.test.ts +280 -0
  26. package/src/commands/runtime-activation.ts +459 -1
  27. package/src/commands/runtime-internalization-run-rulehost.ts +417 -0
  28. package/src/index.ts +60 -1
  29. package/src/services/demo-rule-compiler.ts +71 -0
  30. package/src/services/rulehost-pipeline-runner.ts +638 -0
  31. package/tests/commands/cli-command-tree.test.ts +14 -0
  32. package/tests/commands/runtime-activation.test.ts +553 -1
  33. package/tests/e2e/cross-package-acceptance.test.ts +549 -0
  34. package/tests/services/rulehost-pipeline-e2e.test.ts +477 -0
  35. package/tests/services/rulehost-pipeline-runner.test.ts +525 -0
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Demo Rule Compiler — Minimal bridge for Story A demo runner
3
+ *
4
+ * PURPOSE: Compile rule implementation code strings into typed evaluate
5
+ * functions for use in `evaluateInRefinerSandbox`. This allows the demo
6
+ * to perform REAL canActivate validation instead of always returning success.
7
+ *
8
+ * ARCHITECTURE: This intentionally duplicates the compilation logic from
9
+ * `openclaw-plugin/src/core/rule-implementation-runtime.ts` because pd-cli
10
+ * cannot depend on the bundled openclaw-plugin package. The compilation
11
+ * logic is identical: normalize exports → vm compile → extract evaluate.
12
+ *
13
+ * NOT for production use — the openclaw-plugin's RuleHost uses its own
14
+ * `loadRuleImplementationModule` for production code_tool_hook evaluation.
15
+ */
16
+ import type { ReplayEvaluateFn } from '@principles/core/runtime-v2';
17
+ /**
18
+ * Compile rule implementation code and return a typed evaluate function.
19
+ * Mirrors `createReplayEvaluateFromCode` in openclaw-plugin.
20
+ *
21
+ * @throws if the code fails to compile or does not define a function evaluate
22
+ */
23
+ export declare function compileDemoRule(code: string, sourceLabel: string): ReplayEvaluateFn;
24
+ //# sourceMappingURL=demo-rule-compiler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demo-rule-compiler.d.ts","sourceRoot":"","sources":["../../src/services/demo-rule-compiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAepE;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,gBAAgB,CA8BnF"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Demo Rule Compiler — Minimal bridge for Story A demo runner
3
+ *
4
+ * PURPOSE: Compile rule implementation code strings into typed evaluate
5
+ * functions for use in `evaluateInRefinerSandbox`. This allows the demo
6
+ * to perform REAL canActivate validation instead of always returning success.
7
+ *
8
+ * ARCHITECTURE: This intentionally duplicates the compilation logic from
9
+ * `openclaw-plugin/src/core/rule-implementation-runtime.ts` because pd-cli
10
+ * cannot depend on the bundled openclaw-plugin package. The compilation
11
+ * logic is identical: normalize exports → vm compile → extract evaluate.
12
+ *
13
+ * NOT for production use — the openclaw-plugin's RuleHost uses its own
14
+ * `loadRuleImplementationModule` for production code_tool_hook evaluation.
15
+ */
16
+ import * as vm from 'node:vm';
17
+ import { safeStringifyPreview } from '@principles/core/runtime-v2';
18
+ function normalizeSource(sourceCode) {
19
+ const withoutExports = sourceCode
20
+ .replace(/export\s+const\s+meta\s*=/, 'const meta =')
21
+ .replace(/export\s+function\s+evaluate\s*\(/, 'function evaluate(');
22
+ return `${withoutExports}
23
+ globalThis.__pdRuleModule = {
24
+ meta: typeof meta === 'undefined' ? undefined : meta,
25
+ evaluate: typeof evaluate === 'undefined' ? undefined : evaluate,
26
+ };`;
27
+ }
28
+ /**
29
+ * Compile rule implementation code and return a typed evaluate function.
30
+ * Mirrors `createReplayEvaluateFromCode` in openclaw-plugin.
31
+ *
32
+ * @throws if the code fails to compile or does not define a function evaluate
33
+ */
34
+ export function compileDemoRule(code, sourceLabel) {
35
+ const context = vm.createContext(Object.create(null));
36
+ const script = new vm.Script(normalizeSource(code), { filename: sourceLabel });
37
+ script.runInContext(context, { timeout: 1000, displayErrors: true });
38
+ const moduleExports = context
39
+ .__pdRuleModule;
40
+ delete context.__pdRuleModule;
41
+ if (!moduleExports || typeof moduleExports.evaluate !== 'function') {
42
+ throw new Error(`[compileDemoRule] ${sourceLabel}: compiled module has no evaluate function`);
43
+ }
44
+ const evaluateFn = moduleExports.evaluate;
45
+ return (input, helpers) => {
46
+ const result = evaluateFn(input, helpers);
47
+ if (typeof result !== 'object' || result === null || !Object.hasOwn(result, 'decision')) {
48
+ throw new Error(`[${sourceLabel}]: evaluate returned invalid RuleHostResult (got ${typeof result === 'object' && result !== null ? safeStringifyPreview(result) : String(result)})`);
49
+ }
50
+ return result;
51
+ };
52
+ }
53
+ //# sourceMappingURL=demo-rule-compiler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demo-rule-compiler.js","sourceRoot":"","sources":["../../src/services/demo-rule-compiler.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAI9B,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAEnE,SAAS,eAAe,CAAC,UAAkB;IACzC,MAAM,cAAc,GAAG,UAAU;SAC9B,OAAO,CAAC,2BAA2B,EAAE,cAAc,CAAC;SACpD,OAAO,CAAC,mCAAmC,EAAE,oBAAoB,CAAC,CAAC;IAEtE,OAAO,GAAG,cAAc;;;;GAIvB,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,WAAmB;IAC/D,MAAM,OAAO,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,IAAI,EAAE,CAAC,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC,CAAC;IAE/E,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;IAErE,MAAM,aAAa,GAAI,OAAuE;SAC3F,cAAc,CAAC;IAClB,OAAQ,OAAwC,CAAC,cAAc,CAAC;IAEhE,IAAI,CAAC,aAAa,IAAI,OAAO,aAAa,CAAC,QAAQ,KAAK,UAAU,EAAE,CAAC;QACnE,MAAM,IAAI,KAAK,CACb,qBAAqB,WAAW,4CAA4C,CAC7E,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAG,aAAa,CAAC,QAGd,CAAC;IAEpB,OAAO,CAAC,KAAoB,EAAE,OAAwB,EAAkB,EAAE;QACxE,MAAM,MAAM,GAAG,UAAU,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAC1C,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,CAAC;YACxF,MAAM,IAAI,KAAK,CACb,IAAI,WAAW,oDAAoD,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CACpK,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,132 @@
1
+ import type { AdversarialLoopResult, PDRuntimeAdapter, RefinerRuleHostGateDeps, PIArtifactStore } from '@principles/core/runtime-v2';
2
+ /**
3
+ * Code-rule capability (atomic: ArtificerL2 + Evaluator).
4
+ *
5
+ * Per the user correction (2026-06-18): ArtificerL2 and Evaluator are atomic —
6
+ * both must run or neither runs. When enabled, the adversarial loop runs with
7
+ * the artificerAdapter (L2 write-test-fix). When disabled or not provided, the
8
+ * pipeline degrades to text-principle-only.
9
+ *
10
+ * The caller (CLI handler) resolves per-agent config (enabled/runtimeProfile)
11
+ * and constructs the ArtificerL2Adapter when both artificer + evaluator are
12
+ * enabled. The pipeline runner branches on `enabled` — it does NOT do config
13
+ * resolution itself (separation of concerns: service vs I/O).
14
+ */
15
+ export interface CodeRuleCapability {
16
+ /** Whether the capability is enabled (atomic: both artificer + evaluator enabled in config). */
17
+ readonly enabled: boolean;
18
+ /**
19
+ * The ArtificerL2Adapter (or test-double) for the artificer stage. Required
20
+ * when enabled. When enabled, this adapter replaces the base runtimeAdapter
21
+ * for the ArtificerRunner only; EvaluatorRunner still uses the base adapter.
22
+ * Ignored when disabled (may be omitted or set to the base adapter).
23
+ */
24
+ readonly artificerAdapter?: PDRuntimeAdapter;
25
+ /** Structured reason when disabled (for degradation reporting). Required when disabled. */
26
+ readonly disabledReason?: string;
27
+ }
28
+ export interface RuleHostAgentAdapters {
29
+ readonly dreamer: PDRuntimeAdapter;
30
+ readonly philosopher: PDRuntimeAdapter;
31
+ readonly scribe: PDRuntimeAdapter;
32
+ readonly evaluator: PDRuntimeAdapter;
33
+ }
34
+ export interface RuleHostPipelineOptions {
35
+ /** Workspace directory containing .state/ (SQLite stores). */
36
+ readonly workspaceDir: string;
37
+ /** Pain ID whose internalization chain to drive. */
38
+ readonly painId: string;
39
+ /**
40
+ * Runtime adapter (LLM). Caller constructs it (PiAi / test-double) so the
41
+ * service stays runtime-agnostic. Mirrors full-chain-real-llm.test.ts.
42
+ *
43
+ * Used for: dreamer, philosopher, scribe, and evaluator (when capability ON).
44
+ * The artificer stage uses codeRuleCapability.artificerAdapter when enabled.
45
+ */
46
+ readonly runtimeAdapter: PDRuntimeAdapter;
47
+ /** Production per-agent adapters. Tests may omit this to use runtimeAdapter for every stage. */
48
+ readonly agentAdapters?: RuleHostAgentAdapters;
49
+ /**
50
+ * Code-rule capability (atomic: ArtificerL2 + Evaluator). When omitted, the
51
+ * capability is treated as OFF with reason 'code_rule_capability not provided'.
52
+ */
53
+ readonly codeRuleCapability?: CodeRuleCapability;
54
+ /** Internalization channel for created tasks (default 'code_tool_hook'). */
55
+ readonly channel?: 'prompt' | 'code_tool_hook' | 'defer_archive';
56
+ /** Max adversarial rounds (PRD cap = 2). */
57
+ readonly maxRounds?: number;
58
+ /** Per-LLM-call timeout (default 300_000). */
59
+ readonly timeoutMs?: number;
60
+ /** Runner poll interval (default 100). */
61
+ readonly pollIntervalMs?: number;
62
+ /**
63
+ * Max stage retry attempts for transient `retried` status (default 2).
64
+ * Each retry gets fresh state from the state manager (Runtime Contract Rule 7).
65
+ * When exhausted, the stage is marked 'degraded' with a structured reason.
66
+ */
67
+ readonly maxStageRetries?: number;
68
+ /** Correlation prefix for task IDs. */
69
+ readonly correlationId?: string;
70
+ /** Progress callback (stage start/complete). Optional. */
71
+ readonly onProgress?: (stage: string, status: 'start' | 'succeeded' | 'failed' | 'degraded' | 'skipped', detail?: string) => void;
72
+ /**
73
+ * Called once after the internal RuntimeStateManager + artifactStore are
74
+ * constructed, so the caller (e.g. a test-double adapter) can wire the store
75
+ * for artifactId resolution. Optional.
76
+ */
77
+ readonly onStoreReady?: (store: PIArtifactStore) => void;
78
+ }
79
+ export type RuleHostPipelineStageStatus = 'succeeded' | 'failed' | 'skipped' | 'degraded';
80
+ export interface RuleHostPipelineStage {
81
+ readonly name: 'pain_lookup' | 'dreamer' | 'philosopher' | 'scribe' | 'adversarial_loop';
82
+ readonly status: RuleHostPipelineStageStatus;
83
+ readonly taskId?: string;
84
+ readonly reason?: string;
85
+ }
86
+ /**
87
+ * Final pipeline decision.
88
+ *
89
+ * - `candidate_ready_for_owner_review`: adversarial loop approved. A validated
90
+ * rule artifact exists and is WAITING for owner review. This is NOT owner
91
+ * approval — it means the candidate is ready for the owner to review.
92
+ * - `text_principle_only`: code-rule capability OFF (artificer or evaluator
93
+ * disabled). No rule artifact; a text principle artifact is produced for
94
+ * prompt-channel fallback.
95
+ * - `generation_rejected`: pipeline failed (no dreamer task, stage failure, or
96
+ * evaluator rejected the candidate). No rule artifact.
97
+ */
98
+ export interface RuleHostPipelineResult {
99
+ readonly decision: 'candidate_ready_for_owner_review' | 'text_principle_only' | 'generation_rejected';
100
+ readonly painId: string;
101
+ readonly stages: RuleHostPipelineStage[];
102
+ /** Scribe task that fed the adversarial loop (or text-principle path). */
103
+ readonly scribeTaskId: string | null;
104
+ /** From the adversarial loop result, when reached. */
105
+ readonly adversarialLoop?: AdversarialLoopResult;
106
+ /** Rule artifact ID when candidate_ready_for_owner_review; null otherwise. */
107
+ readonly ruleArtifactId: string | null;
108
+ /** Principle artifact ID (always present when scribe ran). */
109
+ readonly principleArtifactId: string | null;
110
+ /**
111
+ * Approval ID when the candidate was auto-enqueued into the ApprovalQueue.
112
+ * Present when decision='candidate_ready_for_owner_review' and the pipeline
113
+ * successfully enqueued the candidate for owner review (P1 #1 fix).
114
+ * Null when the candidate was not enqueued (text_principle_only, rejected,
115
+ * or enqueue failed — check degradationReason for details).
116
+ */
117
+ readonly approvalId: string | null;
118
+ /** Structured reason when decision is not candidate_ready_for_owner_review. */
119
+ readonly degradationReason?: string;
120
+ }
121
+ /**
122
+ * Build the sandbox gate deps for adversarial replay.
123
+ *
124
+ * `compileDemoRule` is byte-equivalent to openclaw-plugin's
125
+ * `loadRuleImplementationModule` (same vm.createContext, same normalize, same
126
+ * evaluate-shape check). pd-cli cannot import openclaw-plugin (package
127
+ * boundary), so this duplicate is intentional and capability-identical, not a
128
+ * stripped demo. See demo-rule-compiler.ts header comment.
129
+ */
130
+ export declare function createSandboxGateDeps(): RefinerRuleHostGateDeps;
131
+ export declare function runRuleHostPipeline(opts: RuleHostPipelineOptions): Promise<RuleHostPipelineResult>;
132
+ //# sourceMappingURL=rulehost-pipeline-runner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rulehost-pipeline-runner.d.ts","sourceRoot":"","sources":["../../src/services/rulehost-pipeline-runner.ts"],"names":[],"mappings":"AA+CA,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAEhB,uBAAuB,EACvB,eAAe,EAEhB,MAAM,6BAA6B,CAAC;AAMrC;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,kBAAkB;IACjC,gGAAgG;IAChG,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAC7C,2FAA2F;IAC3F,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;CACl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+ * RuleHost Pipeline Runner — full-chain internalization driver (PRI-429).
3
+ *
4
+ * Drives a pain signal all the way to a validated rule artifact in ONE call:
5
+ * pain → dreamer → philosopher → scribe → artificer↔evaluator adversarial loop
6
+ *
7
+ * This is the "last mile" wiring that makes `runAdversarialLoop` reachable
8
+ * from a real host entry point (the PRI-428 pr-review finding: the loop had no
9
+ * production caller). Operators invoke it via
10
+ * `pd runtime internalization run-rulehost --pain-id <id>`
11
+ *
12
+ * Design:
13
+ * - Does NOT reuse the lease-based InternalizationOrchestrator. Instead it
14
+ * chains runners directly (mirrors full-chain-real-llm.test.ts), because
15
+ * the lease model is single-step + successor-proposal and cannot host a
16
+ * synchronous multi-round loop.
17
+ * - The artificer↔evaluator stage delegates to `runAdversarialLoop` (PRI-428),
18
+ * which never throws and degrades to { decision: 'rejected' } with a reason.
19
+ * - gateDeps (the sandbox adapter) is built from `compileDemoRule` +
20
+ * `evaluateInRefinerSandbox`. Per the Explore finding, `compileDemoRule` is
21
+ * byte-equivalent to openclaw-plugin's `loadRuleImplementationModule`; the
22
+ * duplication is a package-boundary necessity (pd-cli cannot import
23
+ * openclaw-plugin), not a capability gap.
24
+ *
25
+ * @see docs/plans/rulehost-mvp-activation.md
26
+ * @see runAdversarialLoop in @principles/core/runtime-v2
27
+ */
28
+ import { RuntimeStateManager, StoreEventEmitter, DreamerRunner, DefaultDreamerValidator, PhilosopherRunner, DefaultPhilosopherValidator, ScribeRunner, DefaultScribeValidator, ArtificerRunner, DefaultArtificerValidator, EvaluatorRunner, DefaultEvaluatorValidator, createPITaskDiagnosticJson, runAdversarialLoop, evaluateInRefinerSandbox, DEFAULT_MAX_ROUNDS, SqliteApprovalQueueStore, getChannelRiskLevel, } from '@principles/core/runtime-v2';
29
+ /* eslint-disable @typescript-eslint/no-use-before-define -- helpers declared after main, matching codebase convention */
30
+ import { compileDemoRule } from './demo-rule-compiler.js';
31
+ // ── gateDeps builder ─────────────────────────────────────────────────────────
32
+ /**
33
+ * Build the sandbox gate deps for adversarial replay.
34
+ *
35
+ * `compileDemoRule` is byte-equivalent to openclaw-plugin's
36
+ * `loadRuleImplementationModule` (same vm.createContext, same normalize, same
37
+ * evaluate-shape check). pd-cli cannot import openclaw-plugin (package
38
+ * boundary), so this duplicate is intentional and capability-identical, not a
39
+ * stripped demo. See demo-rule-compiler.ts header comment.
40
+ */
41
+ export function createSandboxGateDeps() {
42
+ return {
43
+ evaluateInSandbox: (code, goldenTrace, opts) => {
44
+ // compileDemoRule throws on bad code. The throw propagates out of
45
+ // evaluateInSandbox; EvaluatorRunner (and runAdversarialLoop's
46
+ // evaluator_run_threw catch) classifies it as a sandbox failure, so it
47
+ // surfaces as a rejected round rather than an uncaught exception.
48
+ // evaluateInRefinerSandbox separately catches its own runtime throws
49
+ // (from executing the evaluate function) and classifies them as
50
+ // validation_failed / runtime_error.
51
+ const evaluateCode = compileDemoRule(code, 'rulehost-pipeline');
52
+ return evaluateInRefinerSandbox(code, goldenTrace, { evaluateCode, ...opts });
53
+ },
54
+ };
55
+ }
56
+ // ── Pipeline ─────────────────────────────────────────────────────────────────
57
+ const DEFAULT_TIMEOUT_MS = 300_000;
58
+ const DEFAULT_POLL_MS = 100;
59
+ const DEFAULT_MAX_STAGE_RETRIES = 2;
60
+ export async function runRuleHostPipeline(opts) {
61
+ const channel = opts.channel ?? 'code_tool_hook';
62
+ const maxRounds = opts.maxRounds ?? DEFAULT_MAX_ROUNDS;
63
+ const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
64
+ const pollIntervalMs = opts.pollIntervalMs ?? DEFAULT_POLL_MS;
65
+ const maxStageRetries = opts.maxStageRetries ?? DEFAULT_MAX_STAGE_RETRIES;
66
+ const correlation = opts.correlationId ?? `rulehost-${opts.painId}`;
67
+ const onProgress = opts.onProgress ?? (() => { });
68
+ // ── Resolve code-rule capability (atomic: ArtificerL2 + Evaluator) ──
69
+ // Per user correction (2026-06-18): both must be enabled or neither runs.
70
+ // When OFF, degrade to text-principle-only after scribe. When ON, run the
71
+ // adversarial loop with the artificerAdapter (L2 write-test-fix).
72
+ const capability = opts.codeRuleCapability;
73
+ const capabilityEnabled = capability?.enabled === true;
74
+ const capabilityDisabledReason = capability?.enabled === false
75
+ ? (capability.disabledReason ?? 'code_rule_capability is disabled')
76
+ : 'code_rule_capability not provided — default OFF (set codeRuleCapability.enabled=true when both artificer + evaluator agents are enabled)';
77
+ const stages = [];
78
+ const stateManager = new RuntimeStateManager({ workspaceDir: opts.workspaceDir });
79
+ await stateManager.initialize();
80
+ try {
81
+ const artifactStore = stateManager.piArtifactStore;
82
+ const eventEmitter = new StoreEventEmitter();
83
+ // Allow the caller's adapter to resolve real artifactIds (needed by
84
+ // test-double adapters whose scripted outputs must match store-assigned IDs).
85
+ opts.onStoreReady?.(artifactStore);
86
+ const owner = 'rulehost-pipeline';
87
+ const agentAdapters = opts.agentAdapters ?? {
88
+ dreamer: opts.runtimeAdapter,
89
+ philosopher: opts.runtimeAdapter,
90
+ scribe: opts.runtimeAdapter,
91
+ evaluator: opts.runtimeAdapter,
92
+ };
93
+ const runnerOptsFor = (adapter) => ({ owner, runtimeKind: adapter.kind(), pollIntervalMs, timeoutMs });
94
+ // ── Stage: pain lookup ──
95
+ // Find a dreamer task already seeded for this pain (the pain→dreamer bridge
96
+ // runs via `pd pain record` → PainSignalBridge.onPainDetected). We need the
97
+ // dreamer task to start the chain. If none exists, the operator must run
98
+ // `pd pain record` first — fail loud with guidance.
99
+ //
100
+ // D fix (PRI-429): exact sourcePainId match via Object.hasOwn on parsed
101
+ // diagnosticJson. No substring matching (pain-1 must NOT match pain-10).
102
+ onProgress('pain_lookup', 'start', `painId=${opts.painId}`);
103
+ const dreamerLookup = await findDreamerTaskForPain(stateManager, opts.painId);
104
+ if (dreamerLookup.status === 'ambiguous') {
105
+ const reason = `ambiguous_dreamer_tasks_for_pain: ${dreamerLookup.taskIds.join(',')}`;
106
+ stages.push({ name: 'pain_lookup', status: 'failed', reason });
107
+ onProgress('pain_lookup', 'failed', reason);
108
+ return rejectedResult(opts.painId, stages, reason);
109
+ }
110
+ if (dreamerLookup.status === 'not_found') {
111
+ stages.push({ name: 'pain_lookup', status: 'failed', reason: 'no_dreamer_task_seeded_for_pain' });
112
+ onProgress('pain_lookup', 'failed', 'no dreamer task seeded');
113
+ return rejectedResult(opts.painId, stages, 'no_dreamer_task_seeded_for_pain: run `pd pain record` first');
114
+ }
115
+ const dreamerSeedTaskId = dreamerLookup.taskId;
116
+ stages.push({ name: 'pain_lookup', status: 'succeeded', taskId: dreamerSeedTaskId });
117
+ onProgress('pain_lookup', 'succeeded', `dreamerTaskId=${dreamerSeedTaskId}`);
118
+ // ── Stage: dreamer ──
119
+ onProgress('dreamer', 'start');
120
+ const dreamerRunner = new DreamerRunner({ stateManager, runtimeAdapter: agentAdapters.dreamer, eventEmitter, validator: new DefaultDreamerValidator(), artifactStore }, runnerOptsFor(agentAdapters.dreamer));
121
+ const dreamerResult = await runStage(dreamerRunner, dreamerSeedTaskId, { maxStageRetries, pollIntervalMs });
122
+ stages.push(stageFromResult('dreamer', dreamerSeedTaskId, dreamerResult));
123
+ if (dreamerResult.status !== 'succeeded') {
124
+ onProgress('dreamer', 'failed', dreamerResult.failureReason);
125
+ return rejectedResult(opts.painId, stages, `dreamer_failed: ${dreamerResult.failureReason ?? dreamerResult.status}`);
126
+ }
127
+ onProgress('dreamer', 'succeeded');
128
+ // ── Stage: philosopher ──
129
+ onProgress('philosopher', 'start');
130
+ const philosopherTaskId = `${correlation}-philosopher-${Date.now().toString(36)}`;
131
+ await createInternalizationTask(stateManager, philosopherTaskId, 'philosopher', [dreamerSeedTaskId], channel, timeoutMs);
132
+ const philosopherRunner = new PhilosopherRunner({ stateManager, runtimeAdapter: agentAdapters.philosopher, eventEmitter, validator: new DefaultPhilosopherValidator(), artifactStore }, runnerOptsFor(agentAdapters.philosopher));
133
+ const philosopherResult = await runStage(philosopherRunner, philosopherTaskId, { maxStageRetries, pollIntervalMs });
134
+ stages.push(stageFromResult('philosopher', philosopherTaskId, philosopherResult));
135
+ if (philosopherResult.status !== 'succeeded') {
136
+ onProgress('philosopher', 'failed', philosopherResult.failureReason);
137
+ return rejectedResult(opts.painId, stages, `philosopher_failed: ${philosopherResult.failureReason ?? philosopherResult.status}`);
138
+ }
139
+ onProgress('philosopher', 'succeeded');
140
+ // ── Stage: scribe ──
141
+ onProgress('scribe', 'start');
142
+ const scribeTaskId = `${correlation}-scribe-${Date.now().toString(36)}`;
143
+ await createInternalizationTask(stateManager, scribeTaskId, 'scribe', [philosopherTaskId], channel, timeoutMs);
144
+ const scribeRunner = new ScribeRunner({ stateManager, runtimeAdapter: agentAdapters.scribe, eventEmitter, validator: new DefaultScribeValidator(), artifactStore }, runnerOptsFor(agentAdapters.scribe));
145
+ const scribeResult = await runStage(scribeRunner, scribeTaskId, { maxStageRetries, pollIntervalMs });
146
+ stages.push(stageFromResult('scribe', scribeTaskId, scribeResult));
147
+ if (scribeResult.status !== 'succeeded') {
148
+ onProgress('scribe', 'failed', scribeResult.failureReason);
149
+ return rejectedResult(opts.painId, stages, `scribe_failed: ${scribeResult.failureReason ?? scribeResult.status}`);
150
+ }
151
+ onProgress('scribe', 'succeeded');
152
+ // ── Atomic capability branching ──
153
+ // Per user correction (2026-06-18): ArtificerL2 + Evaluator are atomic.
154
+ // When OFF (or not provided), skip the adversarial loop entirely and
155
+ // degrade to text-principle-only. The scribe's principle artifact remains
156
+ // for prompt-channel fallback.
157
+ if (!capabilityEnabled) {
158
+ stages.push({ name: 'adversarial_loop', status: 'skipped', reason: capabilityDisabledReason });
159
+ onProgress('adversarial_loop', 'skipped', capabilityDisabledReason);
160
+ return await textPrincipleOnlyResult({ painId: opts.painId, stages, scribeTaskId, disabledReason: capabilityDisabledReason, artifactStore });
161
+ }
162
+ // ── Stage: adversarial loop (artificer↔evaluator) ──
163
+ // Capability ON: use the artificerAdapter (L2 write-test-fix) for the
164
+ // artificer stage, and the base runtimeAdapter for the evaluator stage.
165
+ if (!capability?.artificerAdapter) {
166
+ // Contract violation: enabled but no adapter provided. Fail loud.
167
+ stages.push({ name: 'adversarial_loop', status: 'failed', reason: 'artificerAdapter not provided' });
168
+ onProgress('adversarial_loop', 'failed', 'artificerAdapter not provided');
169
+ return rejectedResult(opts.painId, stages, 'code_rule_capability enabled but artificerAdapter not provided');
170
+ }
171
+ onProgress('adversarial_loop', 'start');
172
+ const artificerRunner = new ArtificerRunner({ stateManager, runtimeAdapter: capability.artificerAdapter, eventEmitter, validator: new DefaultArtificerValidator(), artifactStore }, runnerOptsFor(capability.artificerAdapter));
173
+ const evaluatorRunner = new EvaluatorRunner({ stateManager, runtimeAdapter: agentAdapters.evaluator, eventEmitter, validator: new DefaultEvaluatorValidator(), artifactStore }, { ...runnerOptsFor(agentAdapters.evaluator), gateDeps: createSandboxGateDeps() });
174
+ const loopResult = await runAdversarialLoop({
175
+ artificerRunner,
176
+ evaluatorRunner,
177
+ stateManager,
178
+ artifactStore,
179
+ scribeTaskId,
180
+ maxRounds,
181
+ correlationId: correlation,
182
+ channel,
183
+ });
184
+ const loopStatus = loopResult.decision === 'approved' ? 'succeeded' : 'degraded';
185
+ stages.push({ name: 'adversarial_loop', status: loopStatus, taskId: loopResult.finalEvaluatorTaskId, reason: loopResult.degradationReason });
186
+ onProgress('adversarial_loop', loopResult.decision === 'approved' ? 'succeeded' : 'degraded', loopResult.degradationReason);
187
+ // Map adversarial loop decision to pipeline decision:
188
+ // 'approved' → candidate_ready_for_owner_review (NOT owner approval)
189
+ // 'rejected' → generation_rejected
190
+ const pipelineDecision = loopResult.decision === 'approved'
191
+ ? 'candidate_ready_for_owner_review'
192
+ : 'generation_rejected';
193
+ // P1 #1 fix: auto-enqueue the candidate into the ApprovalQueue so the
194
+ // owner can review it. Without this, the pipeline produces a candidate
195
+ // artifact but it never enters the approval queue — the production chain
196
+ // is broken at step 2→3. Tests manually called enqueue(); production did not.
197
+ let approvalId = null;
198
+ if (pipelineDecision === 'candidate_ready_for_owner_review' && loopResult.ruleArtifactId) {
199
+ try {
200
+ const approvalStore = new SqliteApprovalQueueStore(stateManager.connection);
201
+ const riskLevel = getChannelRiskLevel(channel);
202
+ const enqueuedRecord = await approvalStore.enqueue({
203
+ artifactId: loopResult.ruleArtifactId,
204
+ channel,
205
+ riskLevel,
206
+ summary: `RuleHost pipeline candidate for pain ${opts.painId}`,
207
+ triggerReason: `adversarial_loop_approved: pain=${opts.painId}, rule=${loopResult.ruleArtifactId}`,
208
+ }, new Date().toISOString());
209
+ const { approvalId: enqueuedApprovalId } = enqueuedRecord;
210
+ approvalId = enqueuedApprovalId;
211
+ onProgress('adversarial_loop', 'succeeded', `auto-enqueued as approval ${approvalId}`);
212
+ }
213
+ catch (err) {
214
+ // Enqueue failed — the candidate artifact exists but is not in the
215
+ // approval queue. Degrade gracefully with a structured reason (ERR-002).
216
+ const enqueueErr = err instanceof Error ? err.message : String(err);
217
+ const degradeReason = `candidate_approved_but_enqueue_failed: ${enqueueErr}. Manual enqueue required: pd runtime activation dispatch --artifact-id ${loopResult.ruleArtifactId} --channel ${channel}`;
218
+ return {
219
+ decision: pipelineDecision,
220
+ painId: opts.painId,
221
+ stages,
222
+ scribeTaskId,
223
+ adversarialLoop: loopResult,
224
+ ruleArtifactId: loopResult.ruleArtifactId,
225
+ principleArtifactId: loopResult.principleArtifactId,
226
+ approvalId: null,
227
+ degradationReason: degradeReason,
228
+ };
229
+ }
230
+ }
231
+ return {
232
+ decision: pipelineDecision,
233
+ painId: opts.painId,
234
+ stages,
235
+ scribeTaskId,
236
+ adversarialLoop: loopResult,
237
+ ruleArtifactId: loopResult.ruleArtifactId,
238
+ principleArtifactId: loopResult.principleArtifactId,
239
+ approvalId,
240
+ degradationReason: loopResult.degradationReason,
241
+ };
242
+ }
243
+ finally {
244
+ await stateManager.close();
245
+ }
246
+ }
247
+ async function findDreamerTaskForPain(stateManager, painId) {
248
+ const tasks = await stateManager.listTasks();
249
+ const dreamerTasks = tasks.filter((t) => t.taskKind === 'dreamer' && (t.status === 'pending' || t.status === 'retry_wait'));
250
+ const matches = [];
251
+ for (const t of dreamerTasks) {
252
+ if (typeof t.diagnosticJson !== 'string')
253
+ continue;
254
+ let parsed;
255
+ try {
256
+ parsed = JSON.parse(t.diagnosticJson);
257
+ }
258
+ catch {
259
+ // Malformed JSON — skip this task, don't crash (Runtime Contract Rule 9:
260
+ // graceful degradation with observable behavior — the task is simply not
261
+ // a match, and the caller will report no_dreamer_task_seeded_for_pain).
262
+ continue;
263
+ }
264
+ if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed))
265
+ continue;
266
+ if (!Object.hasOwn(parsed, 'sourcePainId'))
267
+ continue;
268
+ const stored = Reflect.get(parsed, 'sourcePainId');
269
+ if (typeof stored === 'string' && stored === painId) {
270
+ matches.push(t.taskId);
271
+ }
272
+ }
273
+ matches.sort();
274
+ if (matches.length === 0)
275
+ return { status: 'not_found' };
276
+ if (matches.length > 1)
277
+ return { status: 'ambiguous', taskIds: matches };
278
+ return { status: 'found', taskId: matches[0] };
279
+ }
280
+ // eslint-disable-next-line @typescript-eslint/max-params
281
+ async function createInternalizationTask(stateManager, taskId, taskKind, dependencyTaskIds, channel, timeoutMs) {
282
+ await stateManager.createTask({
283
+ taskId,
284
+ taskKind,
285
+ status: 'pending',
286
+ attemptCount: 0,
287
+ maxAttempts: 3,
288
+ diagnosticJson: createPITaskDiagnosticJson({
289
+ dependencyTaskIds,
290
+ channel,
291
+ timeoutMs,
292
+ inputArtifactRefs: [],
293
+ outputArtifactRefs: [],
294
+ }),
295
+ });
296
+ }
297
+ async function runStage(runner, taskId, opts) {
298
+ let attempt = 0;
299
+ // First attempt is not a retry — it's the initial run.
300
+ let result = await runner.run(taskId);
301
+ while (result.status === 'retried' && attempt < opts.maxStageRetries) {
302
+ attempt++;
303
+ // Brief wait before retry to allow transient conditions to clear.
304
+ // The state manager has already marked the task as retry_wait; the runner
305
+ // will re-read it on the next .run() call (fresh state per iteration).
306
+ await new Promise((resolve) => setTimeout(resolve, opts.pollIntervalMs));
307
+ result = await runner.run(taskId);
308
+ }
309
+ return result;
310
+ }
311
+ function stageFromResult(name, taskId, result) {
312
+ // `retried` after exhausting retries is a transient-exhausted state, not a
313
+ // hard failure. Mark as 'degraded' so the caller can distinguish "stage
314
+ // failed permanently" from "stage exhausted transient retries".
315
+ if (result.status === 'succeeded') {
316
+ return { name, taskId, status: 'succeeded' };
317
+ }
318
+ if (result.status === 'retried') {
319
+ return {
320
+ name,
321
+ taskId,
322
+ status: 'degraded',
323
+ reason: `transient_retry_exhausted: ${result.failureReason ?? result.status}`,
324
+ };
325
+ }
326
+ return {
327
+ name,
328
+ taskId,
329
+ status: 'failed',
330
+ reason: result.failureReason ?? result.status,
331
+ };
332
+ }
333
+ function rejectedResult(painId, stages, degradationReason) {
334
+ return {
335
+ decision: 'generation_rejected',
336
+ painId,
337
+ stages,
338
+ scribeTaskId: null,
339
+ ruleArtifactId: null,
340
+ principleArtifactId: null,
341
+ approvalId: null,
342
+ degradationReason,
343
+ };
344
+ }
345
+ async function textPrincipleOnlyResult(params) {
346
+ const { painId, stages, scribeTaskId, disabledReason, artifactStore } = params;
347
+ // Look up the principle artifact produced by the scribe stage.
348
+ try {
349
+ const arts = await artifactStore.listBySourceTaskId(scribeTaskId);
350
+ const principleArt = arts.find((a) => a.artifactKind === 'principle');
351
+ return {
352
+ decision: 'text_principle_only',
353
+ painId,
354
+ stages,
355
+ scribeTaskId,
356
+ ruleArtifactId: null,
357
+ principleArtifactId: principleArt?.artifactId ?? null,
358
+ approvalId: null,
359
+ degradationReason: `code_rule_capability_off: ${disabledReason}`,
360
+ };
361
+ }
362
+ catch (error) {
363
+ const message = error instanceof Error ? error.message : String(error);
364
+ return {
365
+ decision: 'text_principle_only',
366
+ painId,
367
+ stages,
368
+ scribeTaskId,
369
+ ruleArtifactId: null,
370
+ principleArtifactId: null,
371
+ approvalId: null,
372
+ degradationReason: `code_rule_capability_off: ${disabledReason}; principle_artifact_lookup_failed: ${message}`,
373
+ };
374
+ }
375
+ }
376
+ //# sourceMappingURL=rulehost-pipeline-runner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rulehost-pipeline-runner.js","sourceRoot":"","sources":["../../src/services/rulehost-pipeline-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,aAAa,EACb,uBAAuB,EACvB,iBAAiB,EACjB,2BAA2B,EAC3B,YAAY,EACZ,sBAAsB,EACtB,eAAe,EACf,yBAAyB,EACzB,eAAe,EACf,yBAAyB,EACzB,0BAA0B,EAC1B,kBAAkB,EAClB,wBAAwB,EACxB,kBAAkB,EAClB,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AASrC,yHAAyH;AACzH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAiI1D,gFAAgF;AAEhF;;;;;;;;GAQG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO;QACL,iBAAiB,EAAE,CAAC,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,EAAE;YAC7C,kEAAkE;YAClE,+DAA+D;YAC/D,uEAAuE;YACvE,kEAAkE;YAClE,qEAAqE;YACrE,gEAAgE;YAChE,qCAAqC;YACrC,MAAM,YAAY,GAAG,eAAe,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;YAChE,OAAO,wBAAwB,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,YAAY,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;QAChF,CAAC;KACF,CAAC;AACJ,CAAC;AAED,gFAAgF;AAEhF,MAAM,kBAAkB,GAAG,OAAO,CAAC;AACnC,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,yBAAyB,GAAG,CAAC,CAAC;AAEpC,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,IAA6B;IACrE,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,gBAA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QACxB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,OAAO;YACL,QAAQ,EAAE,qBAAqB;YAC/B,MAAM;YACN,MAAM;YACN,YAAY;YACZ,cAAc,EAAE,IAAI;YACpB,mBAAmB,EAAE,IAAI;YACzB,UAAU,EAAE,IAAI;YAChB,iBAAiB,EAAE,6BAA6B,cAAc,uCAAuC,OAAO,EAAE;SAC/G,CAAC;IACJ,CAAC;AAEH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@principles/pd-cli",
3
- "version": "1.112.0",
3
+ "version": "1.114.0",
4
4
  "description": "PD CLI — Pain recording, sample management, and evolution tasks",
5
5
  "type": "module",
6
6
  "bin": {