@principles/core 1.197.0 → 1.199.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.
@@ -23,6 +23,8 @@ const REQUIRED_SOURCE_FILES = [
23
23
  'internalization/rule-host-contracts.ts',
24
24
  'internalization/rule-host-helpers.ts',
25
25
  'internalization/index.ts',
26
+ // PRI-480 (RuleContext v2 — Phase 1 Core ABI)
27
+ 'internalization/rule-context-v2.ts',
26
28
  // PRI-43
27
29
  'internalization/internalization-route.ts',
28
30
  // PRI-44
@@ -310,7 +312,6 @@ const KNOWN_PLUGIN_CORE_FILES = new Set([
310
312
  'migration.ts',
311
313
  'file-store.ts',
312
314
  'pd-task-store.ts',
313
- 'evolution-migration.ts',
314
315
  'empathy-keyword-matcher.ts',
315
316
  'pain-lifecycle.ts',
316
317
  'session-tracker.ts',
@@ -395,7 +396,9 @@ describe('PRI-212 plugin core anti-growth guard', () => {
395
396
  // reading .principles/INTENT.md with TTL+mtime cache for prompt injection.
396
397
  // PRI-468: Added intent-doc-reader-adapter.ts (93 → 94) — plugin adapter
397
398
  // implementing core IntentDocReader port (pure type mapping, no new I/O).
398
- expect(KNOWN_PLUGIN_CORE_FILES.size).toBe(94);
399
+ // Stage-1 cleanup: Removed evolution-migration.ts (94 → 93) — dead code,
400
+ // zero production references after refactor to @principles/core.
401
+ expect(KNOWN_PLUGIN_CORE_FILES.size).toBe(93);
399
402
  });
400
403
  });
401
404
  const REQUIRED_TEST_FILES = [
@@ -607,13 +610,6 @@ describe('openclaw-plugin pain hook integration', () => {
607
610
  });
608
611
  // ── PRI-42: Internalization boundary guards ──────────────────────────────────
609
612
  describe('PRI-42 internalization boundary', () => {
610
- const CONTRACT_TYPES = [
611
- 'RuleHostInput',
612
- 'RuleHostResult',
613
- 'RuleHostDecision',
614
- 'RuleHostMeta',
615
- 'LoadedImplementation',
616
- ];
617
613
  it('core internalization has zero openclaw-plugin imports', async () => {
618
614
  const { existsSync, readdirSync, readFileSync } = await import('node:fs');
619
615
  const { resolve, join } = await import('node:path');
@@ -662,29 +658,6 @@ describe('PRI-42 internalization boundary', () => {
662
658
  expect(src).not.toContain('../../../openclaw-plugin');
663
659
  }
664
660
  });
665
- it('plugin does not re-define RuleHost contract types locally', async () => {
666
- const { existsSync, readFileSync } = await import('node:fs');
667
- const { resolve } = await import('node:path');
668
- const typesPath = resolve(__dirname, '../../../../openclaw-plugin/src/core/rule-host-types.ts');
669
- expect(existsSync(typesPath)).toBe(true);
670
- const src = readFileSync(typesPath, 'utf-8');
671
- // After PRI-42, rule-host-types.ts should re-export from core, not define interfaces
672
- for (const typeName of CONTRACT_TYPES) {
673
- expect(src).toContain(typeName);
674
- expect(src).toContain("from '@principles/core/runtime-v2'");
675
- }
676
- });
677
- it('plugin does not re-define RuleHostHelpers locally', async () => {
678
- const { existsSync, readFileSync } = await import('node:fs');
679
- const { resolve } = await import('node:path');
680
- const helpersPath = resolve(__dirname, '../../../../openclaw-plugin/src/core/rule-host-helpers.ts');
681
- expect(existsSync(helpersPath)).toBe(true);
682
- const src = readFileSync(helpersPath, 'utf-8');
683
- // After PRI-42, rule-host-helpers.ts should re-export from core, not define interface
684
- expect(src).toContain('RuleHostHelpers');
685
- expect(src).toContain('createRuleHostHelpers');
686
- expect(src).toContain("from '@principles/core/runtime-v2'");
687
- });
688
661
  it('plugin rule-host.ts imports contracts from core barrel', async () => {
689
662
  const { existsSync, readFileSync } = await import('node:fs');
690
663
  const { resolve } = await import('node:path');