@principles/core 1.214.0 → 1.216.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.
@@ -2072,12 +2072,16 @@ describe('PRI-146: RuleHostWriter shadow activation boundary', () => {
2072
2072
  expect(src).not.toContain('eval(');
2073
2073
  expect(src).not.toContain('new Function');
2074
2074
  });
2075
- it('LIVE_AFTER_APPROVAL: rule-host-writer.ts uses live action for owner-approved activations', async () => {
2075
+ it('SHADOW_AFTER_APPROVAL: rule-host-writer.ts uses shadow action for owner-approved activations (PRI-489)', async () => {
2076
2076
  const { readFileSync } = await import('node:fs');
2077
2077
  const { resolve } = await import('node:path');
2078
2078
  const src = readFileSync(resolve(__dirname, '..', 'activation', 'writers', 'rule-host-writer.ts'), 'utf-8');
2079
- expect(src).toContain('code_tool_hook_live_activate');
2080
- expect(src).not.toContain('code_tool_hook_shadow_activate');
2079
+ // PRI-489: Owner approval creates a SHADOW activation first. The only
2080
+ // shadow -> live transition is `pd activation promote` (atomic action
2081
+ // rewrite in SqliteActivationStateStore.promoteActivation). Live action
2082
+ // must never appear as a return value from activate(), only in comments
2083
+ // documenting the promote path.
2084
+ expect(src).toContain("action: 'code_tool_hook_shadow_activate'");
2081
2085
  expect(src).toContain('accepted_shadow');
2082
2086
  });
2083
2087
  it('USES_GATE: rule-host-writer.ts imports evaluateRefinerRuleHostGate', async () => {