@principles/pd-cli 1.112.0 → 1.113.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 (26) 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-internalization-run-rulehost.d.ts +23 -0
  6. package/dist/commands/runtime-internalization-run-rulehost.d.ts.map +1 -0
  7. package/dist/commands/runtime-internalization-run-rulehost.js +364 -0
  8. package/dist/commands/runtime-internalization-run-rulehost.js.map +1 -0
  9. package/dist/index.js +2 -0
  10. package/dist/index.js.map +1 -1
  11. package/dist/services/demo-rule-compiler.d.ts +24 -0
  12. package/dist/services/demo-rule-compiler.d.ts.map +1 -0
  13. package/dist/services/demo-rule-compiler.js +53 -0
  14. package/dist/services/demo-rule-compiler.js.map +1 -0
  15. package/dist/services/rulehost-pipeline-runner.d.ts +124 -0
  16. package/dist/services/rulehost-pipeline-runner.d.ts.map +1 -0
  17. package/dist/services/rulehost-pipeline-runner.js +334 -0
  18. package/dist/services/rulehost-pipeline-runner.js.map +1 -0
  19. package/package.json +1 -1
  20. package/src/commands/__tests__/run-rulehost-flag-wiring.test.ts +280 -0
  21. package/src/commands/runtime-internalization-run-rulehost.ts +417 -0
  22. package/src/index.ts +3 -0
  23. package/src/services/demo-rule-compiler.ts +71 -0
  24. package/src/services/rulehost-pipeline-runner.ts +585 -0
  25. package/tests/services/rulehost-pipeline-e2e.test.ts +477 -0
  26. package/tests/services/rulehost-pipeline-runner.test.ts +519 -0
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Parser-level tests for `pd runtime internalization run-rulehost` flags (PRI-429).
3
+ *
4
+ * CLI gate rule 7: "Test the real command wiring — when behavior depends on
5
+ * Commander options, add a command-registration or parser test that exercises
6
+ * the actual flags."
7
+ *
8
+ * Tests the real `registerRunRuleHostCommand` helper (single source of truth
9
+ * shared with `index.ts`). Flag typos in production surface here at
10
+ * parseAsync time, not at handler dispatch.
11
+ *
12
+ * Covers:
13
+ * - --dry-run and --confirm are registered
14
+ * - --dry-run and --confirm can both be parsed
15
+ * - --json is registered
16
+ * - --pain-id is required (Commander rejects missing required option)
17
+ * - --workspace / -w shorthand is registered
18
+ * - --no-dry-run / --no-confirm are NOT registered (no accidental negation)
19
+ * - mutual exclusivity is enforced at handler level (not parser level —
20
+ * Commander doesn't natively support .conflicts() for boolean flags
21
+ * without explicit registration; the handler validates this)
22
+ */
23
+ export {};
24
+ //# sourceMappingURL=run-rulehost-flag-wiring.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-rulehost-flag-wiring.test.d.ts","sourceRoot":"","sources":["../../../src/commands/__tests__/run-rulehost-flag-wiring.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG"}
@@ -0,0 +1,223 @@
1
+ /**
2
+ * Parser-level tests for `pd runtime internalization run-rulehost` flags (PRI-429).
3
+ *
4
+ * CLI gate rule 7: "Test the real command wiring — when behavior depends on
5
+ * Commander options, add a command-registration or parser test that exercises
6
+ * the actual flags."
7
+ *
8
+ * Tests the real `registerRunRuleHostCommand` helper (single source of truth
9
+ * shared with `index.ts`). Flag typos in production surface here at
10
+ * parseAsync time, not at handler dispatch.
11
+ *
12
+ * Covers:
13
+ * - --dry-run and --confirm are registered
14
+ * - --dry-run and --confirm can both be parsed
15
+ * - --json is registered
16
+ * - --pain-id is required (Commander rejects missing required option)
17
+ * - --workspace / -w shorthand is registered
18
+ * - --no-dry-run / --no-confirm are NOT registered (no accidental negation)
19
+ * - mutual exclusivity is enforced at handler level (not parser level —
20
+ * Commander doesn't natively support .conflicts() for boolean flags
21
+ * without explicit registration; the handler validates this)
22
+ */
23
+ import { describe, it, expect } from 'vitest';
24
+ import { Command } from 'commander';
25
+ import { registerRunRuleHostCommand } from '../runtime-internalization-run-rulehost.js';
26
+ function attachCapture(cmd, state) {
27
+ cmd.action(function captureAction(...args) {
28
+ let optsArg = null;
29
+ for (let i = args.length - 1; i >= 0; i--) {
30
+ const arg = args[i];
31
+ if (arg !== null && typeof arg === 'object' && !(arg instanceof Command)) {
32
+ optsArg = arg;
33
+ break;
34
+ }
35
+ }
36
+ if (optsArg !== null && typeof optsArg === 'object') {
37
+ state.opts = optsArg;
38
+ }
39
+ else {
40
+ state.opts = {};
41
+ }
42
+ });
43
+ }
44
+ function freshProgram() {
45
+ const program = new Command();
46
+ program.name('pd').exitOverride();
47
+ return program;
48
+ }
49
+ describe('pd runtime internalization run-rulehost — flag wiring (CLI gate rule 7)', () => {
50
+ // ── Option metadata ──────────────────────────────────────────────────────
51
+ it('registers --dry-run flag', () => {
52
+ const program = freshProgram();
53
+ const intCmd = program.command('internalization');
54
+ const runCmd = registerRunRuleHostCommand(intCmd);
55
+ const opt = runCmd.options.find((o) => o.long === '--dry-run');
56
+ expect(opt).toBeDefined();
57
+ expect(opt?.long).toBe('--dry-run');
58
+ });
59
+ it('registers --confirm flag', () => {
60
+ const program = freshProgram();
61
+ const intCmd = program.command('internalization');
62
+ const runCmd = registerRunRuleHostCommand(intCmd);
63
+ const opt = runCmd.options.find((o) => o.long === '--confirm');
64
+ expect(opt).toBeDefined();
65
+ expect(opt?.long).toBe('--confirm');
66
+ });
67
+ it('registers --json flag', () => {
68
+ const program = freshProgram();
69
+ const intCmd = program.command('internalization');
70
+ const runCmd = registerRunRuleHostCommand(intCmd);
71
+ const opt = runCmd.options.find((o) => o.long === '--json');
72
+ expect(opt).toBeDefined();
73
+ expect(opt?.long).toBe('--json');
74
+ });
75
+ it('registers --pain-id as required option', () => {
76
+ const program = freshProgram();
77
+ const intCmd = program.command('internalization');
78
+ const runCmd = registerRunRuleHostCommand(intCmd);
79
+ const opt = runCmd.options.find((o) => o.long === '--pain-id');
80
+ expect(opt).toBeDefined();
81
+ expect(opt?.long).toBe('--pain-id');
82
+ // requiredOption sets .required = true on the Option
83
+ expect(opt?.required).toBe(true);
84
+ });
85
+ it('registers -w shorthand for --workspace', () => {
86
+ const program = freshProgram();
87
+ const intCmd = program.command('internalization');
88
+ const runCmd = registerRunRuleHostCommand(intCmd);
89
+ const opt = runCmd.options.find((o) => o.short === '-w');
90
+ expect(opt).toBeDefined();
91
+ expect(opt?.long).toBe('--workspace');
92
+ });
93
+ it('does NOT register --no-dry-run (no accidental negation)', () => {
94
+ const program = freshProgram();
95
+ const intCmd = program.command('internalization');
96
+ const runCmd = registerRunRuleHostCommand(intCmd);
97
+ const noForm = runCmd.options.find((o) => o.long === '--no-dry-run');
98
+ expect(noForm).toBeUndefined();
99
+ });
100
+ it('does NOT register --no-confirm (no accidental negation)', () => {
101
+ const program = freshProgram();
102
+ const intCmd = program.command('internalization');
103
+ const runCmd = registerRunRuleHostCommand(intCmd);
104
+ const noForm = runCmd.options.find((o) => o.long === '--no-confirm');
105
+ expect(noForm).toBeUndefined();
106
+ });
107
+ // ── Parser-level tests (program.parseAsync) ───────────────────────────────
108
+ it('parses --dry-run as true', async () => {
109
+ const program = freshProgram();
110
+ const intCmd = program.command('internalization');
111
+ const runCmd = registerRunRuleHostCommand(intCmd);
112
+ const captured = { opts: null };
113
+ attachCapture(runCmd, captured);
114
+ await program.parseAsync(['node', 'pd', 'internalization', 'run-rulehost', '--pain-id', 'pain-1', '--dry-run']);
115
+ expect(captured.opts).not.toBeNull();
116
+ expect(captured.opts?.dryRun).toBe(true);
117
+ });
118
+ it('parses --confirm as true', async () => {
119
+ const program = freshProgram();
120
+ const intCmd = program.command('internalization');
121
+ const runCmd = registerRunRuleHostCommand(intCmd);
122
+ const captured = { opts: null };
123
+ attachCapture(runCmd, captured);
124
+ await program.parseAsync(['node', 'pd', 'internalization', 'run-rulehost', '--pain-id', 'pain-1', '--confirm']);
125
+ expect(captured.opts).not.toBeNull();
126
+ expect(captured.opts?.confirm).toBe(true);
127
+ });
128
+ it('parses both --dry-run and --confirm (handler enforces mutual exclusivity)', async () => {
129
+ // Commander parses both flags; the handler validates mutual exclusivity.
130
+ // This test proves the parser accepts both — the handler test in
131
+ // rulehost-pipeline-e2e.test.ts proves the handler rejects the combination.
132
+ const program = freshProgram();
133
+ const intCmd = program.command('internalization');
134
+ const runCmd = registerRunRuleHostCommand(intCmd);
135
+ const captured = { opts: null };
136
+ attachCapture(runCmd, captured);
137
+ await program.parseAsync(['node', 'pd', 'internalization', 'run-rulehost', '--pain-id', 'pain-1', '--dry-run', '--confirm']);
138
+ expect(captured.opts).not.toBeNull();
139
+ expect(captured.opts?.dryRun).toBe(true);
140
+ expect(captured.opts?.confirm).toBe(true);
141
+ });
142
+ it('defaults --dry-run and --confirm to undefined when neither is passed', async () => {
143
+ const program = freshProgram();
144
+ const intCmd = program.command('internalization');
145
+ const runCmd = registerRunRuleHostCommand(intCmd);
146
+ const captured = { opts: null };
147
+ attachCapture(runCmd, captured);
148
+ await program.parseAsync(['node', 'pd', 'internalization', 'run-rulehost', '--pain-id', 'pain-1']);
149
+ expect(captured.opts).not.toBeNull();
150
+ expect(captured.opts?.dryRun).toBeUndefined();
151
+ expect(captured.opts?.confirm).toBeUndefined();
152
+ });
153
+ it('parses --json as true', async () => {
154
+ const program = freshProgram();
155
+ const intCmd = program.command('internalization');
156
+ const runCmd = registerRunRuleHostCommand(intCmd);
157
+ const captured = { opts: null };
158
+ attachCapture(runCmd, captured);
159
+ await program.parseAsync(['node', 'pd', 'internalization', 'run-rulehost', '--pain-id', 'pain-1', '--json']);
160
+ expect(captured.opts).not.toBeNull();
161
+ expect(captured.opts?.json).toBe(true);
162
+ });
163
+ it('parses -w shorthand for --workspace', async () => {
164
+ const program = freshProgram();
165
+ const intCmd = program.command('internalization');
166
+ const runCmd = registerRunRuleHostCommand(intCmd);
167
+ const captured = { opts: null };
168
+ attachCapture(runCmd, captured);
169
+ await program.parseAsync(['node', 'pd', 'internalization', 'run-rulehost', '--pain-id', 'pain-1', '-w', '/tmp/test']);
170
+ expect(captured.opts).not.toBeNull();
171
+ expect(captured.opts?.workspace).toBe('/tmp/test');
172
+ });
173
+ it('rejects missing --pain-id (required option)', async () => {
174
+ const program = freshProgram();
175
+ const intCmd = program.command('internalization');
176
+ registerRunRuleHostCommand(intCmd);
177
+ // Commander should throw on missing required option
178
+ await expect(program.parseAsync(['node', 'pd', 'internalization', 'run-rulehost', '--dry-run'])).rejects.toThrow(/pain-id/);
179
+ });
180
+ it('parses --channel with custom value', async () => {
181
+ const program = freshProgram();
182
+ const intCmd = program.command('internalization');
183
+ const runCmd = registerRunRuleHostCommand(intCmd);
184
+ const captured = { opts: null };
185
+ attachCapture(runCmd, captured);
186
+ await program.parseAsync(['node', 'pd', 'internalization', 'run-rulehost', '--pain-id', 'pain-1', '--channel', 'prompt']);
187
+ expect(captured.opts).not.toBeNull();
188
+ expect(captured.opts?.channel).toBe('prompt');
189
+ });
190
+ it('defaults --channel to code_tool_hook', async () => {
191
+ const program = freshProgram();
192
+ const intCmd = program.command('internalization');
193
+ const runCmd = registerRunRuleHostCommand(intCmd);
194
+ const captured = { opts: null };
195
+ attachCapture(runCmd, captured);
196
+ await program.parseAsync(['node', 'pd', 'internalization', 'run-rulehost', '--pain-id', 'pain-1']);
197
+ expect(captured.opts).not.toBeNull();
198
+ expect(captured.opts?.channel).toBe('code_tool_hook');
199
+ });
200
+ it('parses --max-rounds as integer', async () => {
201
+ const program = freshProgram();
202
+ const intCmd = program.command('internalization');
203
+ const runCmd = registerRunRuleHostCommand(intCmd);
204
+ const captured = { opts: null };
205
+ attachCapture(runCmd, captured);
206
+ await program.parseAsync(['node', 'pd', 'internalization', 'run-rulehost', '--pain-id', 'pain-1', '--max-rounds', '2']);
207
+ expect(captured.opts).not.toBeNull();
208
+ expect(captured.opts?.maxRounds).toBe(2);
209
+ expect(typeof captured.opts?.maxRounds).toBe('number');
210
+ });
211
+ it('parses --timeout-ms as integer', async () => {
212
+ const program = freshProgram();
213
+ const intCmd = program.command('internalization');
214
+ const runCmd = registerRunRuleHostCommand(intCmd);
215
+ const captured = { opts: null };
216
+ attachCapture(runCmd, captured);
217
+ await program.parseAsync(['node', 'pd', 'internalization', 'run-rulehost', '--pain-id', 'pain-1', '--timeout-ms', '600000']);
218
+ expect(captured.opts).not.toBeNull();
219
+ expect(captured.opts?.timeoutMs).toBe(600000);
220
+ expect(typeof captured.opts?.timeoutMs).toBe('number');
221
+ });
222
+ });
223
+ //# sourceMappingURL=run-rulehost-flag-wiring.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-rulehost-flag-wiring.test.js","sourceRoot":"","sources":["../../../src/commands/__tests__/run-rulehost-flag-wiring.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AAQxF,SAAS,aAAa,CAAC,GAAY,EAAE,KAAqB;IACxD,GAAG,CAAC,MAAM,CAAC,SAAS,aAAa,CAAC,GAAG,IAAe;QAClD,IAAI,OAAO,GAAY,IAAI,CAAC;QAC5B,KAAK,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;YAC1C,MAAM,GAAG,GAAY,IAAI,CAAC,CAAC,CAAC,CAAC;YAC7B,IAAI,GAAG,KAAK,IAAI,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,CAAC,CAAC,GAAG,YAAY,OAAO,CAAC,EAAE,CAAC;gBACzE,OAAO,GAAG,GAAG,CAAC;gBACd,MAAM;YACR,CAAC;QACH,CAAC;QACD,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,OAAO,K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iB,EAAE,cAAc,EAAE,WAAW,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC;QAE7H,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;QACrC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9C,MAAM,CAAC,OAAO,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { Command } from 'commander';
2
+ export interface RunRuleHostOptions {
3
+ workspace?: string;
4
+ painId: string;
5
+ channel?: string;
6
+ maxRounds?: number;
7
+ timeoutMs?: number;
8
+ json?: boolean;
9
+ /** Dry-run mode (default). Validates inputs + config, reports capability status, does NOT run the pipeline. */
10
+ dryRun?: boolean;
11
+ /** Confirm mutation — actually run the pipeline. Mutually exclusive with --dry-run. */
12
+ confirm?: boolean;
13
+ }
14
+ export declare function handleRunRuleHost(opts: RunRuleHostOptions): Promise<void>;
15
+ /**
16
+ * Register the `pd runtime internalization run-rulehost` subcommand.
17
+ *
18
+ * Single source of truth for both production (`index.ts`) and parser tests.
19
+ * Extracted so parser-level tests can exercise the real flag wiring without
20
+ * triggering `program.parse()` at module load (CLI gate rule 7).
21
+ */
22
+ export declare function registerRunRuleHostCommand(internalizationCmd: Command): Command;
23
+ //# sourceMappingURL=runtime-internalization-run-rulehost.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-internalization-run-rulehost.d.ts","sourceRoot":"","sources":["../../src/commands/runtime-internalization-run-rulehost.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBzC,MAAM,WAAW,kBAAkB;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,+GAA+G;IAC/G,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uFAAuF;IACvF,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAyMD,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0I/E;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CAAC,kBAAkB,EAAE,OAAO,GAAG,OAAO,CAe/E"}