@principles/pd-cli 1.152.6 → 1.152.8
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/dist/commands/__tests__/runtime-probe-config.test.js +2 -1
- package/dist/commands/__tests__/runtime-probe-config.test.js.map +1 -1
- package/dist/commands/__tests__/version.test.js +104 -0
- package/dist/commands/__tests__/version.test.js.map +1 -1
- package/dist/commands/diagnose.d.ts.map +1 -1
- package/dist/commands/diagnose.js +3 -6
- package/dist/commands/diagnose.js.map +1 -1
- package/dist/commands/pain-retry.d.ts.map +1 -1
- package/dist/commands/pain-retry.js +3 -6
- package/dist/commands/pain-retry.js.map +1 -1
- package/dist/commands/runtime-activation.d.ts.map +1 -1
- package/dist/commands/runtime-activation.js +9 -3
- package/dist/commands/runtime-activation.js.map +1 -1
- package/dist/commands/runtime-init.d.ts.map +1 -1
- package/dist/commands/runtime-init.js +4 -6
- package/dist/commands/runtime-init.js.map +1 -1
- package/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
- package/dist/commands/runtime-internalization-run-once.js +5 -11
- package/dist/commands/runtime-internalization-run-once.js.map +1 -1
- package/dist/commands/runtime-internalization-run-rulehost.d.ts +14 -0
- package/dist/commands/runtime-internalization-run-rulehost.d.ts.map +1 -1
- package/dist/commands/runtime-internalization-run-rulehost.js +67 -15
- package/dist/commands/runtime-internalization-run-rulehost.js.map +1 -1
- package/dist/index.js +0 -12
- package/dist/index.js.map +1 -1
- package/dist/services/__tests__/rulehost-readiness.test.js +0 -3
- package/dist/services/__tests__/rulehost-readiness.test.js.map +1 -1
- package/dist/services/pain-flood-simulation-runner.d.ts.map +1 -1
- package/dist/services/pain-flood-simulation-runner.js +0 -4
- package/dist/services/pain-flood-simulation-runner.js.map +1 -1
- package/dist/services/rulehost-pipeline-runner.d.ts +90 -21
- package/dist/services/rulehost-pipeline-runner.d.ts.map +1 -1
- package/dist/services/rulehost-pipeline-runner.js +328 -24
- package/dist/services/rulehost-pipeline-runner.js.map +1 -1
- package/dist/services/synthetic-baseline-runner.d.ts.map +1 -1
- package/dist/services/synthetic-baseline-runner.js +0 -4
- package/dist/services/synthetic-baseline-runner.js.map +1 -1
- package/dist/services/version-report.d.ts +16 -0
- package/dist/services/version-report.d.ts.map +1 -1
- package/dist/services/version-report.js +37 -2
- package/dist/services/version-report.js.map +1 -1
- package/package.json +1 -1
- package/src/commands/__tests__/runtime-probe-config.test.ts +2 -1
- package/src/commands/__tests__/version.test.ts +110 -0
- package/src/commands/diagnose.ts +3 -6
- package/src/commands/pain-retry.ts +3 -6
- package/src/commands/runtime-activation.ts +9 -3
- package/src/commands/runtime-init.ts +4 -6
- package/src/commands/runtime-internalization-run-once.ts +5 -11
- package/src/commands/runtime-internalization-run-rulehost.ts +69 -15
- package/src/index.ts +0 -13
- package/src/services/__tests__/rulehost-readiness.test.ts +0 -3
- package/src/services/pain-flood-simulation-runner.ts +0 -4
- package/src/services/rulehost-pipeline-runner.ts +368 -35
- package/src/services/synthetic-baseline-runner.ts +0 -4
- package/src/services/version-report.ts +52 -2
- package/tests/commands/config-doctor.test.ts +0 -2
- package/tests/commands/pain-evidence.test.ts +1 -1
- package/tests/commands/run-rulehost-handler.test.ts +43 -0
- package/tests/commands/runtime-features.test.ts +0 -1
- package/tests/commands/runtime-internalization-run-once-language.test.ts +0 -1
- package/tests/e2e/cross-package-acceptance.test.ts +13 -3
- package/tests/services/pd-config-loader.test.ts +0 -1
- package/tests/services/rulehost-pipeline-runner.test.ts +378 -12
- package/dist/commands/runtime-internalization-context-trace.d.ts +0 -25
- package/dist/commands/runtime-internalization-context-trace.d.ts.map +0 -1
- package/dist/commands/runtime-internalization-context-trace.js +0 -374
- package/dist/commands/runtime-internalization-context-trace.js.map +0 -1
- package/src/commands/runtime-internalization-context-trace.ts +0 -445
- package/tests/bdd/context-trace.steps.ts +0 -229
- package/tests/commands/runtime-internalization-context-trace.test.ts +0 -110
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Command-registration / parser tests for context-trace (PR 5 task 11.2, cli-7).
|
|
3
|
-
*
|
|
4
|
-
* Tests the real Commander program — exercises actual flag parsing, not just
|
|
5
|
-
* the handler. Verifies:
|
|
6
|
-
* - --task / --artifact / --workspace / --json parse correctly
|
|
7
|
-
* - --dry-run / --confirm do NOT exist (read-only command, cli-4)
|
|
8
|
-
* - no new feature flag is introduced (registry diff is empty)
|
|
9
|
-
*
|
|
10
|
-
* @see .kiro/specs/internalization-progressive-disclosure/design.md §6.7
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { describe, it, expect } from 'vitest';
|
|
14
|
-
import { Command } from 'commander';
|
|
15
|
-
import { DEFAULT_FEATURE_FLAGS } from '@principles/core/runtime-v2';
|
|
16
|
-
|
|
17
|
-
// Build a minimal program that mirrors the real registration.
|
|
18
|
-
function buildTestProgram(): Command {
|
|
19
|
-
const program = new Command();
|
|
20
|
-
const runtime = program.command('runtime');
|
|
21
|
-
const internalization = runtime.command('internalization', { hidden: true });
|
|
22
|
-
|
|
23
|
-
internalization
|
|
24
|
-
.command('context-trace')
|
|
25
|
-
.description('Trace the internalization context chain')
|
|
26
|
-
.requiredOption('-t, --task <taskId>', 'Task ID to trace')
|
|
27
|
-
.option('-a, --artifact <artifactId>', 'Specific artifact ID to start from')
|
|
28
|
-
.option('-w, --workspace <path>', 'Workspace directory')
|
|
29
|
-
.option('--json', 'Output raw JSON (default)')
|
|
30
|
-
.action(() => {});
|
|
31
|
-
|
|
32
|
-
return program;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
describe('context-trace command registration (cli-7)', () => {
|
|
36
|
-
it('parses --task correctly', () => {
|
|
37
|
-
const program = buildTestProgram();
|
|
38
|
-
program.parse(['node', 'pd', 'runtime', 'internalization', 'context-trace', '--task', 'task-123']);
|
|
39
|
-
const cmd = program.commands[0]?.commands[0]?.commands[0];
|
|
40
|
-
expect(cmd).toBeDefined();
|
|
41
|
-
expect(cmd?.opts().task).toBe('task-123');
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('parses --artifact correctly', () => {
|
|
45
|
-
const program = buildTestProgram();
|
|
46
|
-
program.parse(['node', 'pd', 'runtime', 'internalization', 'context-trace', '--task', 't1', '--artifact', 'art-1']);
|
|
47
|
-
const cmd = program.commands[0]?.commands[0]?.commands[0];
|
|
48
|
-
expect(cmd?.opts().artifact).toBe('art-1');
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it('parses --workspace correctly', () => {
|
|
52
|
-
const program = buildTestProgram();
|
|
53
|
-
program.parse(['node', 'pd', 'runtime', 'internalization', 'context-trace', '--task', 't1', '--workspace', '/tmp/pd']);
|
|
54
|
-
const cmd = program.commands[0]?.commands[0]?.commands[0];
|
|
55
|
-
expect(cmd?.opts().workspace).toBe('/tmp/pd');
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
it('parses --json flag', () => {
|
|
59
|
-
const program = buildTestProgram();
|
|
60
|
-
program.parse(['node', 'pd', 'runtime', 'internalization', 'context-trace', '--task', 't1', '--json']);
|
|
61
|
-
const cmd = program.commands[0]?.commands[0]?.commands[0];
|
|
62
|
-
expect(cmd?.opts().json).toBe(true);
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
it('requires --task (exits with error if missing)', () => {
|
|
66
|
-
const program = buildTestProgram();
|
|
67
|
-
// Commander calls process.exit on missing required option; stub it.
|
|
68
|
-
const originalExit = process.exit;
|
|
69
|
-
let exitCode: number | undefined;
|
|
70
|
-
process.exit = ((code?: number) => { exitCode = code; }) as never;
|
|
71
|
-
try {
|
|
72
|
-
program.parse(['node', 'pd', 'runtime', 'internalization', 'context-trace']);
|
|
73
|
-
} catch {
|
|
74
|
-
// Commander may throw after stubbed exit
|
|
75
|
-
} finally {
|
|
76
|
-
process.exit = originalExit;
|
|
77
|
-
}
|
|
78
|
-
expect(exitCode).toBe(1);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
it('does NOT have --dry-run option (read-only command, cli-4)', () => {
|
|
82
|
-
const program = buildTestProgram();
|
|
83
|
-
program.parse(['node', 'pd', 'runtime', 'internalization', 'context-trace', '--task', 't1']);
|
|
84
|
-
const cmd = program.commands[0]?.commands[0]?.commands[0];
|
|
85
|
-
expect(cmd?.opts().dryRun).toBeUndefined();
|
|
86
|
-
// Verify the option doesn't exist at all.
|
|
87
|
-
const dryRunOption = cmd?.options.find((o) => o.long === '--dry-run');
|
|
88
|
-
expect(dryRunOption).toBeUndefined();
|
|
89
|
-
});
|
|
90
|
-
|
|
91
|
-
it('does NOT have --confirm option (read-only command, cli-4)', () => {
|
|
92
|
-
const program = buildTestProgram();
|
|
93
|
-
program.parse(['node', 'pd', 'runtime', 'internalization', 'context-trace', '--task', 't1']);
|
|
94
|
-
const cmd = program.commands[0]?.commands[0]?.commands[0];
|
|
95
|
-
expect(cmd?.opts().confirm).toBeUndefined();
|
|
96
|
-
const confirmOption = cmd?.options.find((o) => o.long === '--confirm');
|
|
97
|
-
expect(confirmOption).toBeUndefined();
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it('context-trace does not introduce a new feature flag (registry diff empty)', () => {
|
|
101
|
-
// design §8: Layer 3 (CLI) does not add a new flag. The command is always
|
|
102
|
-
// available (read-only); it reads the EXISTING 3 flags.
|
|
103
|
-
const knownFlags = new Set(DEFAULT_FEATURE_FLAGS.map((f) => f.id));
|
|
104
|
-
expect(knownFlags.has('artifact_summary_redundancy')).toBe(true);
|
|
105
|
-
expect(knownFlags.has('context_manifest_budget')).toBe(true);
|
|
106
|
-
expect(knownFlags.has('progressive_evaluator')).toBe(true);
|
|
107
|
-
// No 'context_trace' flag should exist.
|
|
108
|
-
expect(knownFlags.has('context_trace')).toBe(false);
|
|
109
|
-
});
|
|
110
|
-
});
|