@principles/pd-cli 1.115.0 → 1.117.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/dist/commands/candidate.d.ts +23 -0
- package/dist/commands/candidate.d.ts.map +1 -1
- package/dist/commands/candidate.js +89 -3
- package/dist/commands/candidate.js.map +1 -1
- package/dist/commands/diagnose.d.ts.map +1 -1
- package/dist/commands/diagnose.js +153 -132
- package/dist/commands/diagnose.js.map +1 -1
- package/dist/commands/runtime-features.d.ts.map +1 -1
- package/dist/commands/runtime-features.js +2 -7
- package/dist/commands/runtime-features.js.map +1 -1
- package/dist/commands/runtime-internalization-integrity-repair.d.ts.map +1 -1
- package/dist/commands/runtime-internalization-integrity-repair.js +15 -31
- package/dist/commands/runtime-internalization-integrity-repair.js.map +1 -1
- package/dist/commands/runtime-internalization-run-once.d.ts.map +1 -1
- package/dist/commands/runtime-internalization-run-once.js +246 -326
- package/dist/commands/runtime-internalization-run-once.js.map +1 -1
- package/dist/commands/runtime-recovery.d.ts.map +1 -1
- package/dist/commands/runtime-recovery.js +9 -8
- package/dist/commands/runtime-recovery.js.map +1 -1
- package/dist/services/__tests__/cli-output.test.d.ts +18 -0
- package/dist/services/__tests__/cli-output.test.d.ts.map +1 -0
- package/dist/services/__tests__/cli-output.test.js +103 -0
- package/dist/services/__tests__/cli-output.test.js.map +1 -0
- package/dist/services/__tests__/runtime-adapter-resolver.test.d.ts +18 -0
- package/dist/services/__tests__/runtime-adapter-resolver.test.d.ts.map +1 -0
- package/dist/services/__tests__/runtime-adapter-resolver.test.js +651 -0
- package/dist/services/__tests__/runtime-adapter-resolver.test.js.map +1 -0
- package/dist/services/cli-output.d.ts +61 -0
- package/dist/services/cli-output.d.ts.map +1 -0
- package/dist/services/cli-output.js +72 -0
- package/dist/services/cli-output.js.map +1 -0
- package/dist/services/runtime-adapter-resolver.d.ts +105 -0
- package/dist/services/runtime-adapter-resolver.d.ts.map +1 -0
- package/dist/services/runtime-adapter-resolver.js +188 -0
- package/dist/services/runtime-adapter-resolver.js.map +1 -0
- package/package.json +1 -1
- package/src/commands/candidate.ts +92 -3
- package/src/commands/diagnose.ts +146 -138
- package/src/commands/runtime-features.ts +2 -6
- package/src/commands/runtime-internalization-integrity-repair.ts +16 -28
- package/src/commands/runtime-internalization-run-once.ts +242 -353
- package/src/commands/runtime-recovery.ts +9 -7
- package/src/services/__tests__/cli-output.test.ts +130 -0
- package/src/services/__tests__/runtime-adapter-resolver.test.ts +772 -0
- package/src/services/cli-output.ts +95 -0
- package/src/services/runtime-adapter-resolver.ts +339 -0
- package/tests/commands/candidate-internalization-backfill.test.ts +43 -3
- package/tests/commands/candidate-internalize-lineage.test.ts +521 -0
- package/tests/commands/candidate-internalize.test.ts +31 -5
- package/tests/commands/diagnose.test.ts +7 -3
- package/tests/commands/runtime-internalization-run-once.test.ts +11 -0
- package/tests/commands/runtime-recovery.test.ts +27 -4
- package/tests/services/rulehost-pipeline-e2e.test.ts +40 -7
|
@@ -60,7 +60,7 @@ function makeCapabilityOnConfig(workspaceDir: string): object {
|
|
|
60
60
|
prompt: { enabled: true, category: 'core' },
|
|
61
61
|
code_tool_hook: { enabled: true, category: 'core' },
|
|
62
62
|
defer_archive: { enabled: true, category: 'core' },
|
|
63
|
-
code_rule_capability: { enabled: true, category: '
|
|
63
|
+
code_rule_capability: { enabled: true, category: 'core' },
|
|
64
64
|
},
|
|
65
65
|
workspace: { default: workspaceDir },
|
|
66
66
|
runtimeProfiles: {
|
|
@@ -190,7 +190,7 @@ describe('runRuleHost production-wiring (PRI-429) — deterministic, no LLM', ()
|
|
|
190
190
|
expect(process.exitCode).toBeUndefined();
|
|
191
191
|
});
|
|
192
192
|
|
|
193
|
-
it('keeps code_rule_capability
|
|
193
|
+
it('keeps code_rule_capability ON even when the feature flag is omitted (PRI-435: core flag)', async () => {
|
|
194
194
|
process.env.TEST_RULEHOST_API_KEY = 'sk-test-key-12345';
|
|
195
195
|
const workspace = makeWorkspace((dir) => {
|
|
196
196
|
const config = makeCapabilityOnConfig(dir);
|
|
@@ -200,12 +200,45 @@ describe('runRuleHost production-wiring (PRI-429) — deterministic, no LLM', ()
|
|
|
200
200
|
return config;
|
|
201
201
|
});
|
|
202
202
|
|
|
203
|
-
await handleRunRuleHost({ workspace, painId: 'pain-flag-
|
|
203
|
+
await handleRunRuleHost({ workspace, painId: 'pain-flag-default', dryRun: true, json: true });
|
|
204
204
|
|
|
205
205
|
const output = parseJsonOutput();
|
|
206
|
-
|
|
207
|
-
expect(output
|
|
208
|
-
expect(
|
|
206
|
+
// PRI-435 (CodeRabbit P3): narrow unknown before property access
|
|
207
|
+
expect(typeof output).toBe('object');
|
|
208
|
+
expect(output).not.toBeNull();
|
|
209
|
+
const obj = output as { status: string; codeRuleCapability?: { enabled: boolean; disabledReason?: string }; capabilityStatus?: string };
|
|
210
|
+
expect(obj.status).toBe('dry_run');
|
|
211
|
+
// PRI-435: code_rule_capability is now a core flag — defaults ON even when omitted from config.
|
|
212
|
+
// It cannot be disabled by config. The capability is ON when artificer+evaluator are configured.
|
|
213
|
+
expect(obj.codeRuleCapability).toEqual(expect.objectContaining({ enabled: true }));
|
|
214
|
+
expect(obj.codeRuleCapability?.disabledReason).toBeUndefined();
|
|
215
|
+
expect(String(obj.capabilityStatus)).toContain('ON');
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
it('PRI-435: explicit emergency disable via code_rule_capability.enabled=false is observable', async () => {
|
|
219
|
+
process.env.TEST_RULEHOST_API_KEY = 'sk-test-key-12345';
|
|
220
|
+
const workspace = makeWorkspace((dir) => {
|
|
221
|
+
const config = makeCapabilityOnConfig(dir);
|
|
222
|
+
const features = Reflect.get(config, 'features');
|
|
223
|
+
if (features === null || typeof features !== 'object') throw new Error('features fixture missing');
|
|
224
|
+
// Explicitly disable the flag for emergency disable
|
|
225
|
+
Reflect.set(features, 'code_rule_capability', { enabled: false, category: 'core' });
|
|
226
|
+
return config;
|
|
227
|
+
});
|
|
228
|
+
|
|
229
|
+
await handleRunRuleHost({ workspace, painId: 'pain-emergency-disable', dryRun: true, json: true });
|
|
230
|
+
|
|
231
|
+
const output = parseJsonOutput();
|
|
232
|
+
// PRI-435 (CodeRabbit P3): narrow unknown before property access
|
|
233
|
+
expect(typeof output).toBe('object');
|
|
234
|
+
expect(output).not.toBeNull();
|
|
235
|
+
const obj = output as { status: string; codeRuleCapability?: { enabled: boolean; disabledReason?: string }; capabilityStatus?: string };
|
|
236
|
+
expect(obj.status).toBe('dry_run');
|
|
237
|
+
// PRI-435: Emergency disable via code_rule_capability.enabled=false is preserved.
|
|
238
|
+
// The capability is OFF with a structured reason.
|
|
239
|
+
expect(obj.codeRuleCapability).toEqual(expect.objectContaining({ enabled: false }));
|
|
240
|
+
expect(String(obj.codeRuleCapability?.disabledReason)).toContain('feature flag');
|
|
241
|
+
expect(String(obj.capabilityStatus)).toContain('OFF');
|
|
209
242
|
});
|
|
210
243
|
|
|
211
244
|
it('reports the resolved runtime profile for every executed agent', async () => {
|
|
@@ -316,7 +349,7 @@ describe('runRuleHost production-wiring (PRI-429) — deterministic, no LLM', ()
|
|
|
316
349
|
prompt: { enabled: true, category: 'core' },
|
|
317
350
|
code_tool_hook: { enabled: true, category: 'core' },
|
|
318
351
|
defer_archive: { enabled: true, category: 'core' },
|
|
319
|
-
code_rule_capability: { enabled: true, category: '
|
|
352
|
+
code_rule_capability: { enabled: true, category: 'core' },
|
|
320
353
|
},
|
|
321
354
|
workspace: { default: dir },
|
|
322
355
|
runtimeProfiles: {
|