@principles/core 1.240.21 → 1.242.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 (105) hide show
  1. package/dist/runtime-v2/feature-flags/__tests__/artifact-summary-redundancy-flag.test.d.ts +15 -0
  2. package/dist/runtime-v2/feature-flags/__tests__/artifact-summary-redundancy-flag.test.d.ts.map +1 -0
  3. package/dist/runtime-v2/feature-flags/__tests__/artifact-summary-redundancy-flag.test.js +90 -0
  4. package/dist/runtime-v2/feature-flags/__tests__/artifact-summary-redundancy-flag.test.js.map +1 -0
  5. package/dist/runtime-v2/feature-flags/feature-flag-contract.d.ts.map +1 -1
  6. package/dist/runtime-v2/feature-flags/feature-flag-contract.js +6 -0
  7. package/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
  8. package/dist/runtime-v2/internalization/__tests__/artifact-content-hash.property.test.d.ts +11 -0
  9. package/dist/runtime-v2/internalization/__tests__/artifact-content-hash.property.test.d.ts.map +1 -0
  10. package/dist/runtime-v2/internalization/__tests__/artifact-content-hash.property.test.js +124 -0
  11. package/dist/runtime-v2/internalization/__tests__/artifact-content-hash.property.test.js.map +1 -0
  12. package/dist/runtime-v2/internalization/__tests__/artifact-summary.property.test.d.ts +12 -0
  13. package/dist/runtime-v2/internalization/__tests__/artifact-summary.property.test.d.ts.map +1 -0
  14. package/dist/runtime-v2/internalization/__tests__/artifact-summary.property.test.js +253 -0
  15. package/dist/runtime-v2/internalization/__tests__/artifact-summary.property.test.js.map +1 -0
  16. package/dist/runtime-v2/internalization/__tests__/candidate-lineage.property.test.d.ts +15 -0
  17. package/dist/runtime-v2/internalization/__tests__/candidate-lineage.property.test.d.ts.map +1 -0
  18. package/dist/runtime-v2/internalization/__tests__/candidate-lineage.property.test.js +301 -0
  19. package/dist/runtime-v2/internalization/__tests__/candidate-lineage.property.test.js.map +1 -0
  20. package/dist/runtime-v2/internalization/__tests__/philosopher-toggle-characterization.test.d.ts +2 -0
  21. package/dist/runtime-v2/internalization/__tests__/philosopher-toggle-characterization.test.d.ts.map +1 -0
  22. package/dist/runtime-v2/internalization/__tests__/philosopher-toggle-characterization.test.js +279 -0
  23. package/dist/runtime-v2/internalization/__tests__/philosopher-toggle-characterization.test.js.map +1 -0
  24. package/dist/runtime-v2/internalization/__tests__/progressive-disclosure-scope-regression.test.d.ts +22 -0
  25. package/dist/runtime-v2/internalization/__tests__/progressive-disclosure-scope-regression.test.d.ts.map +1 -0
  26. package/dist/runtime-v2/internalization/__tests__/progressive-disclosure-scope-regression.test.js +92 -0
  27. package/dist/runtime-v2/internalization/__tests__/progressive-disclosure-scope-regression.test.js.map +1 -0
  28. package/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.d.ts +165 -0
  29. package/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.d.ts.map +1 -0
  30. package/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.js +657 -0
  31. package/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.js.map +1 -0
  32. package/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.test.d.ts +22 -0
  33. package/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.test.d.ts.map +1 -0
  34. package/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.test.js +229 -0
  35. package/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.test.js.map +1 -0
  36. package/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike.test.d.ts +2 -0
  37. package/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike.test.d.ts.map +1 -0
  38. package/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike.test.js +1039 -0
  39. package/dist/runtime-v2/internalization/__tests__/progressive-disclosure-spike.test.js.map +1 -0
  40. package/dist/runtime-v2/internalization/__tests__/summary-chain-flow.property.test.d.ts +22 -0
  41. package/dist/runtime-v2/internalization/__tests__/summary-chain-flow.property.test.d.ts.map +1 -0
  42. package/dist/runtime-v2/internalization/__tests__/summary-chain-flow.property.test.js +280 -0
  43. package/dist/runtime-v2/internalization/__tests__/summary-chain-flow.property.test.js.map +1 -0
  44. package/dist/runtime-v2/internalization/__tests__/summary-envelope-writer.property.test.d.ts +25 -0
  45. package/dist/runtime-v2/internalization/__tests__/summary-envelope-writer.property.test.d.ts.map +1 -0
  46. package/dist/runtime-v2/internalization/__tests__/summary-envelope-writer.property.test.js +413 -0
  47. package/dist/runtime-v2/internalization/__tests__/summary-envelope-writer.property.test.js.map +1 -0
  48. package/dist/runtime-v2/internalization/__tests__/summary-freshness.property.test.d.ts +12 -0
  49. package/dist/runtime-v2/internalization/__tests__/summary-freshness.property.test.d.ts.map +1 -0
  50. package/dist/runtime-v2/internalization/__tests__/summary-freshness.property.test.js +176 -0
  51. package/dist/runtime-v2/internalization/__tests__/summary-freshness.property.test.js.map +1 -0
  52. package/dist/runtime-v2/internalization/artifact-content-hash.d.ts +19 -0
  53. package/dist/runtime-v2/internalization/artifact-content-hash.d.ts.map +1 -0
  54. package/dist/runtime-v2/internalization/artifact-content-hash.js +116 -0
  55. package/dist/runtime-v2/internalization/artifact-content-hash.js.map +1 -0
  56. package/dist/runtime-v2/internalization/artifact-summary.d.ts +106 -0
  57. package/dist/runtime-v2/internalization/artifact-summary.d.ts.map +1 -0
  58. package/dist/runtime-v2/internalization/artifact-summary.js +331 -0
  59. package/dist/runtime-v2/internalization/artifact-summary.js.map +1 -0
  60. package/dist/runtime-v2/internalization/artificer-runner.d.ts.map +1 -1
  61. package/dist/runtime-v2/internalization/artificer-runner.js +29 -1
  62. package/dist/runtime-v2/internalization/artificer-runner.js.map +1 -1
  63. package/dist/runtime-v2/internalization/attach-summary-envelope.d.ts +60 -0
  64. package/dist/runtime-v2/internalization/attach-summary-envelope.d.ts.map +1 -0
  65. package/dist/runtime-v2/internalization/attach-summary-envelope.js +126 -0
  66. package/dist/runtime-v2/internalization/attach-summary-envelope.js.map +1 -0
  67. package/dist/runtime-v2/internalization/candidate-lineage.d.ts +136 -0
  68. package/dist/runtime-v2/internalization/candidate-lineage.d.ts.map +1 -0
  69. package/dist/runtime-v2/internalization/candidate-lineage.js +230 -0
  70. package/dist/runtime-v2/internalization/candidate-lineage.js.map +1 -0
  71. package/dist/runtime-v2/internalization/diag-distiller-runner.d.ts +1 -1
  72. package/dist/runtime-v2/internalization/diag-distiller-runner.d.ts.map +1 -1
  73. package/dist/runtime-v2/internalization/diag-distiller-runner.js +19 -2
  74. package/dist/runtime-v2/internalization/diag-distiller-runner.js.map +1 -1
  75. package/dist/runtime-v2/internalization/diag-rootcause-runner.d.ts.map +1 -1
  76. package/dist/runtime-v2/internalization/diag-rootcause-runner.js +5 -1
  77. package/dist/runtime-v2/internalization/diag-rootcause-runner.js.map +1 -1
  78. package/dist/runtime-v2/internalization/diag-router-runner.d.ts +1 -1
  79. package/dist/runtime-v2/internalization/diag-router-runner.d.ts.map +1 -1
  80. package/dist/runtime-v2/internalization/diag-router-runner.js +25 -1
  81. package/dist/runtime-v2/internalization/diag-router-runner.js.map +1 -1
  82. package/dist/runtime-v2/internalization/dreamer-runner.d.ts +9 -1
  83. package/dist/runtime-v2/internalization/dreamer-runner.d.ts.map +1 -1
  84. package/dist/runtime-v2/internalization/dreamer-runner.js +28 -6
  85. package/dist/runtime-v2/internalization/dreamer-runner.js.map +1 -1
  86. package/dist/runtime-v2/internalization/evaluator-runner.d.ts.map +1 -1
  87. package/dist/runtime-v2/internalization/evaluator-runner.js +35 -2
  88. package/dist/runtime-v2/internalization/evaluator-runner.js.map +1 -1
  89. package/dist/runtime-v2/internalization/philosopher-runner.d.ts.map +1 -1
  90. package/dist/runtime-v2/internalization/philosopher-runner.js +25 -1
  91. package/dist/runtime-v2/internalization/philosopher-runner.js.map +1 -1
  92. package/dist/runtime-v2/internalization/scribe-runner.d.ts.map +1 -1
  93. package/dist/runtime-v2/internalization/scribe-runner.js +23 -1
  94. package/dist/runtime-v2/internalization/scribe-runner.js.map +1 -1
  95. package/dist/runtime-v2/runner/base-peer-runner.d.ts +30 -0
  96. package/dist/runtime-v2/runner/base-peer-runner.d.ts.map +1 -1
  97. package/dist/runtime-v2/runner/base-peer-runner.js +106 -0
  98. package/dist/runtime-v2/runner/base-peer-runner.js.map +1 -1
  99. package/dist/runtime-v2/runner/peer-runner-types.d.ts +12 -0
  100. package/dist/runtime-v2/runner/peer-runner-types.d.ts.map +1 -1
  101. package/dist/runtime-v2/store/commit/diagnostician-committer.d.ts +15 -0
  102. package/dist/runtime-v2/store/commit/diagnostician-committer.d.ts.map +1 -1
  103. package/dist/runtime-v2/store/commit/diagnostician-committer.js +19 -1
  104. package/dist/runtime-v2/store/commit/diagnostician-committer.js.map +1 -1
  105. package/package.json +2 -1
@@ -0,0 +1,279 @@
1
+ /**
2
+ * Characterization test — what actually happens when the philosopher agent
3
+ * toggle is OFF (spec `internalization-progressive-disclosure`, task 1.3,
4
+ * open question (a) in design §13.2).
5
+ *
6
+ * SCOPE: this test LOCKS IN CURRENT BEHAVIOR. It does not assert desired
7
+ * behavior. If any assertion here starts failing, the philosopher-disabled
8
+ * semantics changed and design §2.3 / Requirement 2.9 / 2.11 must be re-reviewed
9
+ * before the change lands.
10
+ *
11
+ * ── The three candidate behaviors (design §13.2 (a)) ──────────────────────────
12
+ * (1) orchestrator SKIPS the node (dreamer → scribe directly)
13
+ * (2) orchestrator REFUSES to enqueue it
14
+ * (3) it runs anyway and is merely hidden from the UI
15
+ *
16
+ * ── Verified answer: (3), with a caveat ──────────────────────────────────────
17
+ * The task graph and the orchestrator never read the toggle at all. They are
18
+ * toggle-blind:
19
+ * - `internalization-job-graph.ts` ALLOWED_EDGES has no dreamer→scribe edge.
20
+ * - `internalization-state-machine.ts` `createNextTaskProposal()` takes
21
+ * (task, artifacts, channel) — no config parameter exists.
22
+ * - `internalization-orchestrator.ts` `InternalizationOrchestratorDeps` is
23
+ * `{ stateManager }` only; `wakeOnce` / `proposeNextTask` /
24
+ * `commitNextTaskProposal` never load `.pd/config.yaml`.
25
+ * So a philosopher successor IS proposed, IS committed, and IS leasable while
26
+ * `internalAgents.agents.philosopher.enabled === false`.
27
+ *
28
+ * The toggle is only read outside core, at adapter-resolution time, and there
29
+ * it REFUSES the whole run rather than skipping the node:
30
+ * - `packages/principles-core/src/runtime-v2/config/pd-config-agent-binding.ts:168-176`
31
+ * → `{ ok: false, readiness: 'disabled' }` (no `profile`, so the caller
32
+ * cannot proceed without the agent).
33
+ * - `packages/pd-cli/src/commands/runtime-internalization-run-rulehost.ts:124-126`
34
+ * `resolvePiAiAgentAdapter(effective, 'philosopher', ...)` THROWS on
35
+ * `!binding.ok`; lines 417-428 turn that throw into
36
+ * `reason: 'agent_runtime_resolution_failed'` + `exitCode = 1` for the
37
+ * entire pain → dreamer → philosopher → scribe chain.
38
+ * - `packages/pd-cli/src/commands/runtime-internalization-run-once.ts` does
39
+ * not read the toggle at all: `--runner philosopher` executes the runner.
40
+ *
41
+ * ── Consequence for the spec ────────────────────────────────────────────────
42
+ * There is no "philosopher skipped" chain shape. Either philosopher runs (and
43
+ * its writer-side `predecessorSummary` forwarding carries dreamer's 5 dimensions
44
+ * to scribe, design §2.3), or the whole run is refused before scribe executes.
45
+ * Requirement 2.9 / 2.11 therefore holds.
46
+ *
47
+ * ERR entries considered:
48
+ * - ERR-088 (EP-09, non-unique test signal): every assertion below names a
49
+ * concrete observable — `decision`, `successorKind`, `readiness`, the exact
50
+ * `reason` string, the `createTask` argument — never "did not throw" and
51
+ * never a bare `undefined`. The enabled agents (dreamer / scribe) are
52
+ * asserted as `ok: true` in the same test so a blanket-failure regression in
53
+ * `resolveAgentRuntimeBinding` cannot masquerade as "philosopher disabled".
54
+ * - ERR-024 (EP-02, production wiring vs leaf-only testing): the toggle-blind
55
+ * claim is asserted against the real `InternalizationOrchestrator` +
56
+ * `createNextTaskProposal`, plus a source-text guard proving no core
57
+ * orchestration module references the agent-enabled config at all — not
58
+ * against a hand-rolled stand-in.
59
+ * - ERR-073 (EP-09, characterization tests that only prove the happy path):
60
+ * both sides of the toggle are covered — the disabled agent AND the enabled
61
+ * agents — so the characterization pins the difference, not just one case.
62
+ */
63
+ import { describe, it, expect, vi } from 'vitest';
64
+ import { readFileSync } from 'node:fs';
65
+ import { fileURLToPath } from 'node:url';
66
+ import { ALLOWED_EDGES, getAllowedSuccessors, validateEdge, } from '../internalization-job-graph.js';
67
+ import { createNextTaskProposal } from '../internalization-state-machine.js';
68
+ import { InternalizationOrchestrator } from '../internalization-orchestrator.js';
69
+ import { getDefaultInternalAgents } from '../../config/pd-config-defaults.js';
70
+ import { computeEffectivePdConfig } from '../../config/pd-config-effective.js';
71
+ import { resolveAgentRuntimeBinding } from '../../config/pd-config-agent-binding.js';
72
+ // ── Helpers ──────────────────────────────────────────────────────────────────
73
+ function makeRawTask(overrides) {
74
+ const now = new Date().toISOString();
75
+ return {
76
+ taskId: overrides.taskId,
77
+ taskKind: overrides.taskKind,
78
+ status: overrides.status,
79
+ createdAt: now,
80
+ updatedAt: now,
81
+ attemptCount: 0,
82
+ maxAttempts: 3,
83
+ diagnosticJson: JSON.stringify({
84
+ pi_metadata: {
85
+ dependencyTaskIds: overrides.dependencyTaskIds ?? [],
86
+ channel: 'prompt',
87
+ timeoutMs: 60_000,
88
+ inputArtifactRefs: [],
89
+ outputArtifactRefs: overrides.outputArtifactRefs ?? [],
90
+ },
91
+ }),
92
+ };
93
+ }
94
+ function makeSucceededDreamerPITask() {
95
+ const now = new Date().toISOString();
96
+ return {
97
+ taskId: 'dreamer-task-1',
98
+ taskKind: 'dreamer',
99
+ status: 'succeeded',
100
+ createdAt: now,
101
+ updatedAt: now,
102
+ attemptCount: 1,
103
+ maxAttempts: 3,
104
+ dependencyTaskIds: [],
105
+ channel: 'prompt',
106
+ timeoutMs: 60_000,
107
+ inputArtifactRefs: [],
108
+ outputArtifactRefs: [{ artifactType: 'principle', ref: 'pi-art-dreamer-1' }],
109
+ rejectionCount: 0,
110
+ };
111
+ }
112
+ function createMockStateManager() {
113
+ return {
114
+ listTasks: vi.fn(),
115
+ getTask: vi.fn(),
116
+ acquireLease: vi.fn(),
117
+ createTask: vi.fn(),
118
+ };
119
+ }
120
+ function readCoreSource(relativePath) {
121
+ return readFileSync(fileURLToPath(new URL(relativePath, import.meta.url)), 'utf-8');
122
+ }
123
+ // ── 1. Config layer: the toggle is OFF by default and resolves to 'disabled' ──
124
+ describe('philosopher toggle — config layer (characterization)', () => {
125
+ it('philosopher defaults to disabled while dreamer and scribe default to enabled', () => {
126
+ const agents = getDefaultInternalAgents().agents;
127
+ expect(agents.philosopher.enabled).toBe(false);
128
+ // Positive discrimination (ERR-088): the default table is not uniformly false.
129
+ expect(agents.dreamer.enabled).toBe(true);
130
+ expect(agents.scribe.enabled).toBe(true);
131
+ });
132
+ it('resolveAgentRuntimeBinding reports philosopher as disabled with a structured reason', () => {
133
+ const effective = computeEffectivePdConfig(null);
134
+ const philosopher = resolveAgentRuntimeBinding(effective, 'philosopher');
135
+ expect(philosopher.ok).toBe(false);
136
+ if (philosopher.ok)
137
+ throw new Error('expected philosopher binding to be unresolved');
138
+ expect(philosopher.readiness).toBe('disabled');
139
+ expect(philosopher.reason).toBe("Agent 'philosopher' is disabled");
140
+ expect(philosopher.nextAction).toContain('internalAgents.agents.philosopher.enabled');
141
+ });
142
+ it('a disabled binding carries no runtime profile, so callers cannot proceed without the agent', () => {
143
+ const effective = computeEffectivePdConfig(null);
144
+ const philosopher = resolveAgentRuntimeBinding(effective, 'philosopher');
145
+ if (philosopher.ok)
146
+ throw new Error('expected philosopher binding to be unresolved');
147
+ // There is no "skip this stage" signal in the contract — only 'disabled' /
148
+ // 'not_ready' / 'needs_setup', all of which lack `profile`. This is why the
149
+ // pd-cli mainline refuses the whole run instead of skipping the node.
150
+ expect(Object.hasOwn(philosopher, 'profile')).toBe(false);
151
+ expect(['disabled', 'not_ready', 'needs_setup']).toContain(philosopher.readiness);
152
+ });
153
+ it('enabled agents still resolve successfully under the same default config', () => {
154
+ const effective = computeEffectivePdConfig(null);
155
+ const dreamer = resolveAgentRuntimeBinding(effective, 'dreamer');
156
+ const scribe = resolveAgentRuntimeBinding(effective, 'scribe');
157
+ expect(dreamer.ok).toBe(true);
158
+ expect(scribe.ok).toBe(true);
159
+ if (!dreamer.ok || !scribe.ok)
160
+ throw new Error('expected dreamer and scribe bindings to resolve');
161
+ expect(dreamer.profileId).toBe('openclaw.default');
162
+ expect(scribe.profileId).toBe('openclaw.default');
163
+ });
164
+ });
165
+ // ── 2. Graph layer: philosopher is structurally mandatory, no bypass ─────────
166
+ describe('philosopher toggle — job graph has no bypass (characterization)', () => {
167
+ it('ALLOWED_EDGES has exactly 5 edges and no dreamer → scribe bypass', () => {
168
+ expect(ALLOWED_EDGES).toHaveLength(5);
169
+ expect(validateEdge('dreamer', 'scribe')).toBe(false);
170
+ expect(validateEdge('dreamer', 'philosopher')).toBe(true);
171
+ expect(validateEdge('philosopher', 'scribe')).toBe(true);
172
+ });
173
+ it("dreamer's only successor is philosopher", () => {
174
+ expect(getAllowedSuccessors('dreamer')).toEqual(['philosopher']);
175
+ });
176
+ });
177
+ // ── 3. Orchestration layer: toggle-blind — the node runs anyway ──────────────
178
+ describe('philosopher toggle — orchestration is toggle-blind (characterization)', () => {
179
+ it('createNextTaskProposal proposes philosopher after a succeeded dreamer, with no config input', () => {
180
+ const proposal = createNextTaskProposal(makeSucceededDreamerPITask(), []);
181
+ expect(proposal).not.toBeNull();
182
+ expect(proposal?.taskKind).toBe('philosopher');
183
+ expect(proposal?.parentTaskId).toBe('dreamer-task-1');
184
+ expect(proposal?.dependencyTaskIds).toEqual(['dreamer-task-1']);
185
+ expect(proposal?.inputArtifactRefs).toEqual([
186
+ { artifactType: 'principle', ref: 'pi-art-dreamer-1' },
187
+ ]);
188
+ });
189
+ it('commitNextTaskProposal creates a philosopher successor while the toggle is off', async () => {
190
+ // Precondition made explicit: the toggle is OFF in the canonical config.
191
+ expect(getDefaultInternalAgents().agents.philosopher.enabled).toBe(false);
192
+ const stateManager = createMockStateManager();
193
+ const dreamerTask = makeRawTask({
194
+ taskId: 'dreamer-task-1',
195
+ taskKind: 'dreamer',
196
+ status: 'succeeded',
197
+ outputArtifactRefs: [{ artifactType: 'principle', ref: 'pi-art-dreamer-1' }],
198
+ });
199
+ stateManager.getTask.mockResolvedValue(dreamerTask);
200
+ // findExistingSuccessor scans pending then retry_wait.
201
+ stateManager.listTasks.mockResolvedValue([]);
202
+ stateManager.createTask.mockImplementation((input) => Promise.resolve(input));
203
+ const orchestrator = new InternalizationOrchestrator({ stateManager: stateManager }, { owner: 'characterization-owner', runtimeKind: 'local-worker' });
204
+ const result = await orchestrator.commitNextTaskProposal('dreamer-task-1');
205
+ expect(result.decision).toBe('successor_created');
206
+ expect(result).toMatchObject({
207
+ decision: 'successor_created',
208
+ sourceTaskId: 'dreamer-task-1',
209
+ successorKind: 'philosopher',
210
+ successorTaskId: 'philosopher-dreamer-task-1-prompt',
211
+ });
212
+ // Side-effect assertion (ERR-088): the successor actually reached the store
213
+ // as a philosopher task — not merely "no error was returned".
214
+ expect(stateManager.createTask).toHaveBeenCalledOnce();
215
+ expect(stateManager.createTask.mock.calls[0]?.[0]).toMatchObject({
216
+ taskId: 'philosopher-dreamer-task-1-prompt',
217
+ taskKind: 'philosopher',
218
+ status: 'pending',
219
+ });
220
+ });
221
+ it('wakeOnce leases a pending philosopher task while the toggle is off', async () => {
222
+ expect(getDefaultInternalAgents().agents.philosopher.enabled).toBe(false);
223
+ const stateManager = createMockStateManager();
224
+ const philosopherTask = makeRawTask({
225
+ taskId: 'philosopher-task-1',
226
+ taskKind: 'philosopher',
227
+ status: 'pending',
228
+ });
229
+ stateManager.listTasks
230
+ .mockResolvedValueOnce([philosopherTask]) // pending
231
+ .mockResolvedValueOnce([]); // retry_wait
232
+ stateManager.acquireLease.mockResolvedValue({
233
+ ...philosopherTask,
234
+ status: 'leased',
235
+ attemptCount: 1,
236
+ });
237
+ const orchestrator = new InternalizationOrchestrator({ stateManager: stateManager }, { owner: 'characterization-owner', runtimeKind: 'local-worker' });
238
+ const result = await orchestrator.wakeOnce();
239
+ expect(result).toMatchObject({
240
+ decision: 'leased',
241
+ taskId: 'philosopher-task-1',
242
+ taskKind: 'philosopher',
243
+ attemptCount: 1,
244
+ });
245
+ expect(stateManager.acquireLease).toHaveBeenCalledWith({
246
+ taskId: 'philosopher-task-1',
247
+ owner: 'characterization-owner',
248
+ runtimeKind: 'local-worker',
249
+ });
250
+ });
251
+ it('no core orchestration module reads the agent-enabled config (source guard)', () => {
252
+ const modules = [
253
+ '../internalization-orchestrator.ts',
254
+ '../internalization-state-machine.ts',
255
+ '../internalization-task-guards.ts',
256
+ '../internalization-job-graph.ts',
257
+ ];
258
+ const forbidden = [
259
+ 'internalAgents',
260
+ 'resolveAgentRuntimeBinding',
261
+ 'checkAgentRuntimeReadiness',
262
+ 'InternalAgentName',
263
+ 'EffectivePdConfig',
264
+ ];
265
+ const hits = [];
266
+ for (const modulePath of modules) {
267
+ const src = readCoreSource(modulePath);
268
+ for (const token of forbidden) {
269
+ if (src.includes(token))
270
+ hits.push(`${modulePath} references ${token}`);
271
+ }
272
+ }
273
+ // Empty means: the toggle cannot influence enqueueing, leasing, or successor
274
+ // proposal. If this list becomes non-empty, behavior (2) "refuse to enqueue"
275
+ // or (1) "skip the node" was introduced and Requirement 2 must be re-reviewed.
276
+ expect(hits).toEqual([]);
277
+ });
278
+ });
279
+ //# sourceMappingURL=philosopher-toggle-characterization.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"philosopher-toggle-characterization.test.js","sourceRoot":"","sources":["../../../../src/runtime-v2/internalization/__tests__/philosopher-toggle-characterization.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AA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IAAI,GAAa,EAAE,CAAC;QAC1B,KAAK,MAAM,UAAU,IAAI,OAAO,EAAE,CAAC;YACjC,MAAM,GAAG,GAAG,cAAc,CAAC,UAAU,CAAC,CAAC;YACvC,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE,CAAC;gBAC9B,IAAI,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC;oBAAE,IAAI,CAAC,IAAI,CAAC,GAAG,UAAU,eAAe,KAAK,EAAE,CAAC,CAAC;YAC1E,CAAC;QACH,CAAC;QAED,6EAA6E;QAC7E,6EAA6E;QAC7E,+EAA+E;QAC/E,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Scope regression test (design §4.7.1, task 3.21).
3
+ *
4
+ * Guards the Layer 0 scope boundary: the three diagnostic stages
5
+ * (`diag_rootcause` / `diag_distiller` / `diag_router`) and `philosopher`
6
+ * participate in Layer 0 ONLY as writer-side summary producers/forwarders.
7
+ * They MUST NOT:
8
+ * - own a ContextManifest (manifests are exactly 4: dreamer / scribe /
9
+ * artificer / evaluator)
10
+ * - widen their export surface (philosopher stays de-surfaced from the
11
+ * internal barrel — PRI-458)
12
+ * - change their output schema or prompt text (Requirement 1.7)
13
+ *
14
+ * PR 1 has no manifest table yet (that lands in PR 2). This test asserts the
15
+ * negative today ("no diagnostic stage owns a manifest") and will be re-run
16
+ * unchanged once PR 2 introduces the manifest registry.
17
+ *
18
+ * @see .kiro/specs/internalization-progressive-disclosure/design.md §4.7, §4.7.1
19
+ * @see .kiro/specs/internalization-progressive-disclosure/requirements.md Requirements 1.7, 2.14
20
+ */
21
+ export {};
22
+ //# sourceMappingURL=progressive-disclosure-scope-regression.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progressive-disclosure-scope-regression.test.d.ts","sourceRoot":"","sources":["../../../../src/runtime-v2/internalization/__tests__/progressive-disclosure-scope-regression.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG"}
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Scope regression test (design §4.7.1, task 3.21).
3
+ *
4
+ * Guards the Layer 0 scope boundary: the three diagnostic stages
5
+ * (`diag_rootcause` / `diag_distiller` / `diag_router`) and `philosopher`
6
+ * participate in Layer 0 ONLY as writer-side summary producers/forwarders.
7
+ * They MUST NOT:
8
+ * - own a ContextManifest (manifests are exactly 4: dreamer / scribe /
9
+ * artificer / evaluator)
10
+ * - widen their export surface (philosopher stays de-surfaced from the
11
+ * internal barrel — PRI-458)
12
+ * - change their output schema or prompt text (Requirement 1.7)
13
+ *
14
+ * PR 1 has no manifest table yet (that lands in PR 2). This test asserts the
15
+ * negative today ("no diagnostic stage owns a manifest") and will be re-run
16
+ * unchanged once PR 2 introduces the manifest registry.
17
+ *
18
+ * @see .kiro/specs/internalization-progressive-disclosure/design.md §4.7, §4.7.1
19
+ * @see .kiro/specs/internalization-progressive-disclosure/requirements.md Requirements 1.7, 2.14
20
+ */
21
+ import { describe, it, expect } from 'vitest';
22
+ import { readFileSync } from 'node:fs';
23
+ import { resolve } from 'node:path';
24
+ import { SUMMARY_RUNNER_KINDS, } from '../artifact-summary.js';
25
+ import { SUMMARY_EDGE_PREDECESSOR } from '../attach-summary-envelope.js';
26
+ const DIAG_KINDS = ['diag_rootcause', 'diag_distiller', 'diag_router'];
27
+ describe('Layer 0 scope regression — diagnostic stages & philosopher (task 3.21)', () => {
28
+ it('SUMMARY_RUNNER_KINDS includes the 3 diagnostic stages (they produce summaries)', () => {
29
+ // design §4.7.1: diag stages ARE SummaryRunnerKinds (writer-side only).
30
+ for (const kind of DIAG_KINDS) {
31
+ expect(SUMMARY_RUNNER_KINDS).toContain(kind);
32
+ }
33
+ });
34
+ it('diag stages have NO manifest field/import anywhere in their runner source (design §4.7.1)', () => {
35
+ // A diagnostic stage owning a manifest would be a scope violation. Today
36
+ // (PR 1) no ContextManifest type exists in the codebase yet, so we assert
37
+ // the stronger negative: the diag runner source files do not reference any
38
+ // manifest symbol. When PR 2 lands the manifest registry, this same test
39
+ // guards against a diag kind sneaking in.
40
+ const diagFiles = [
41
+ 'diag-rootcause-runner.ts',
42
+ 'diag-distiller-runner.ts',
43
+ 'diag-router-runner.ts',
44
+ ];
45
+ for (const file of diagFiles) {
46
+ const src = readFileSync(resolve(__dirname, '..', file), 'utf-8');
47
+ // Must not reference ContextManifest, manifest, DREAMER_MANIFEST, etc.
48
+ expect(src, `${file} must not own a manifest`).not.toMatch(/\bContextManifest\b/);
49
+ expect(src, `${file} must not reference allocateContext`).not.toMatch(/\ballocateContext\b/);
50
+ // But it SHOULD reference the Layer 0 writer wiring (proves it only does
51
+ // writer-side summary, not manifest-driven injection).
52
+ expect(src, `${file} must wire buildArtifactContentJson (writer-side only)`).toMatch(/buildArtifactContentJson/);
53
+ }
54
+ });
55
+ it('diag-router predecessor is diag_distiller, NOT diag_rootcause (F17 edge-predecessor uniqueness)', () => {
56
+ // Even though diag_router loads BOTH rootcause and distiller in buildContext,
57
+ // only distiller is the edge predecessor. This is the single most important
58
+ // scope assertion for the diagnostic chain.
59
+ expect(SUMMARY_EDGE_PREDECESSOR.diag_router).toBe('diag_distiller');
60
+ expect(SUMMARY_EDGE_PREDECESSOR.diag_router).not.toBe('diag_rootcause');
61
+ });
62
+ it('dreamer predecessor is diag_router (F13/F14: diagnostic chain is dreamer\'s direct upstream)', () => {
63
+ expect(SUMMARY_EDGE_PREDECESSOR.dreamer).toBe('diag_router');
64
+ });
65
+ it('evaluator predecessor is artificer, NOT scribe (F17)', () => {
66
+ expect(SUMMARY_EDGE_PREDECESSOR.evaluator).toBe('artificer');
67
+ expect(SUMMARY_EDGE_PREDECESSOR.evaluator).not.toBe('scribe');
68
+ });
69
+ it('philosopher stays de-surfaced from internalization/index.ts barrel (PRI-458 MVP-Quiet)', () => {
70
+ // PRI-458: PhilosopherRunner is NOT exported from the internal barrel.
71
+ // Layer 0 does not re-add it. (It remains reachable via runtime-v2/index.ts
72
+ // for the rulehost pipeline — guarded separately by architecture-regression.test.ts.)
73
+ const src = readFileSync(resolve(__dirname, '..', 'index.ts'), 'utf-8');
74
+ expect(src).not.toContain("from './philosopher-runner.js'");
75
+ expect(src).not.toContain('PhilosopherRunner');
76
+ });
77
+ it('each SummaryRunnerKind has a defined edge predecessor (or null for the root)', () => {
78
+ // Every kind must resolve to a predecessor entry — no kind left un-mapped.
79
+ for (const kind of SUMMARY_RUNNER_KINDS) {
80
+ expect(Object.hasOwn(SUMMARY_EDGE_PREDECESSOR, kind)).toBe(true);
81
+ const pred = SUMMARY_EDGE_PREDECESSOR[kind];
82
+ // Either null (chain root = diag_rootcause) or a valid SummaryRunnerKind.
83
+ if (pred !== null) {
84
+ expect(SUMMARY_RUNNER_KINDS).toContain(pred);
85
+ }
86
+ }
87
+ // Exactly one root (null).
88
+ const roots = SUMMARY_RUNNER_KINDS.filter((k) => SUMMARY_EDGE_PREDECESSOR[k] === null);
89
+ expect(roots).toEqual(['diag_rootcause']);
90
+ });
91
+ });
92
+ //# sourceMappingURL=progressive-disclosure-scope-regression.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progressive-disclosure-scope-regression.test.js","sourceRoot":"","sources":["../../../../src/runtime-v2/internalization/__tests__/progressive-disclosure-scope-regression.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAEzE,MAAM,UAAU,GAAsB,CAAC,gBAAgB,EA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AM,CAAC,oBAAoB,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAC/C,CAAC;QACH,CAAC;QACD,2BAA2B;QAC3B,MAAM,KAAK,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,wBAAwB,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC;QACvF,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Phase 0 Spike fixtures — synthetic baseline chains for the
3
+ * internalization progressive-disclosure value verification.
4
+ *
5
+ * SPIKE-ONLY. This module is deliberately isolated:
6
+ * - it is imported by Spike tests only (task 1.1 self-check, task 1.2 driver);
7
+ * - it is NOT exported from any barrel (`internalization/index.ts` untouched);
8
+ * - it imports **types only**, so it adds no production runtime dependency;
9
+ * - it performs no I/O (core is pure logic — AGENTS.md `antipattern-core-io`).
10
+ *
11
+ * Why the chain starts at the diagnostician chain and not at dreamer
12
+ * (design §4.7.1 / F13): `diag_router` is dreamer's predecessor on the task
13
+ * graph edge, so it is the only data source for the `pain.summary.*` /
14
+ * `diagnosis.summary.*` fields the `pain_to_dreamer` diagnosis segment needs.
15
+ * A chain that started at dreamer could only exercise 2 of the 3 segments.
16
+ *
17
+ * Every `contentJson` shape below is taken from the real output type in the
18
+ * repo — no invented fields:
19
+ * diag_rootcause → `DiagRootCauseOutputV1` (diagnostician/diag-rootcause-output.ts)
20
+ * diag_distiller → `DiagDistillerOutputV1` (diagnostician/diag-distiller-output.ts)
21
+ * diag_router → `DiagnosticianOutputV1` (diagnostician-output.ts)
22
+ * dreamer → `DreamerOutputV1` (dreamer-output.ts)
23
+ * philosopher → `PhilosopherOutputV1` (philosopher-output.ts)
24
+ * scribe → `ScribeOutputV1` (scribe-output.ts)
25
+ * artificer → `ArtificerRuleOutput` (artificer-output.ts)
26
+ * evaluator → `EvaluatorOutputV2` (evaluator-output.ts)
27
+ *
28
+ * The evaluator hop carries only fields that exist today (V1 + optional
29
+ * `codeReview`). `painCoverage` / `compressionFidelity` are Layer 2 additions
30
+ * and are intentionally absent — the expected defect lives in fixture metadata
31
+ * (`expectedDefect`), never inside the LLM-shaped payload, so a Spike assertion
32
+ * cannot trivially read the answer out of the artifact it is judging (ERR-088).
33
+ *
34
+ * @see .kiro/specs/internalization-progressive-disclosure/design.md §12 Phase 0, §16.3
35
+ * @see Requirement 12.2
36
+ */
37
+ import type { DiagRootCauseOutputV1 } from '../../diagnostician/diag-rootcause-output.js';
38
+ import type { DiagDistillerOutputV1 } from '../../diagnostician/diag-distiller-output.js';
39
+ import type { DiagnosticianOutputV1 } from '../../diagnostician-output.js';
40
+ import type { DreamerOutputV1 } from '../dreamer-output.js';
41
+ import type { PhilosopherOutputV1 } from '../philosopher-output.js';
42
+ import type { ScribeOutputV1 } from '../scribe-output.js';
43
+ import type { ArtificerRuleOutput } from '../artificer-output.js';
44
+ import type { EvaluatorOutputV2 } from '../evaluator-output.js';
45
+ /** The 8 stages that carry a summary in Layer 0 (design §6.1). */
46
+ export type SpikeStageKind = 'diag_rootcause' | 'diag_distiller' | 'diag_router' | 'dreamer' | 'philosopher' | 'scribe' | 'artificer' | 'evaluator';
47
+ /**
48
+ * Stage order along the synthetic chain. Mirrors `DIAGNOSTICIAN_EDGES`
49
+ * followed by `ALLOWED_EDGES` (design F5 / F14).
50
+ */
51
+ export declare const SPIKE_STAGE_ORDER: readonly SpikeStageKind[];
52
+ export type SpikeChainId =
53
+ /** 缺陷链 A:scribe 原则文本完全丢失 dreamer 的 riskLevel 维度 */
54
+ 'defect_a_risk_level_dropped'
55
+ /** 缺陷链 B:scribe 把 dreamer 的具体动作模糊为抽象表述 */
56
+ | 'defect_b_action_abstracted'
57
+ /** 对照链:无缺陷,用于识别「任何输入都报缺失」的假阳性 */
58
+ | 'control_no_defect';
59
+ /** The 5 dreamer dimensions the pipeline is supposed to carry forward. */
60
+ export type DreamerDimension = 'badDecision' | 'betterDecision' | 'rationale' | 'riskLevel' | 'strategicPerspective';
61
+ /**
62
+ * The defect a chain encodes, stated independently of the artifacts.
63
+ *
64
+ * The Spike driver (task 1.2) compares the summary-level evaluator's finding
65
+ * against this — it is the expected answer, not an input to any stage.
66
+ */
67
+ export type SpikeExpectedDefect = {
68
+ readonly kind: 'none';
69
+ } | {
70
+ /** A dimension present at dreamer is absent from the scribe principle text. */
71
+ readonly kind: 'missing_dimension';
72
+ readonly segment: 'dreamer_to_scribe';
73
+ readonly dimension: DreamerDimension;
74
+ } | {
75
+ /** Concrete actions at dreamer became an abstract phrase at scribe. */
76
+ readonly kind: 'action_abstracted';
77
+ readonly segment: 'dreamer_to_scribe';
78
+ readonly concreteActions: readonly string[];
79
+ readonly abstractedAs: string;
80
+ };
81
+ /** One hop of a synthetic chain: artifact identity + the stage's contentJson. */
82
+ export interface SpikeChainHop<TContent> {
83
+ readonly stage: SpikeStageKind;
84
+ readonly artifactId: string;
85
+ readonly taskId: string;
86
+ /**
87
+ * Stage identity source of truth. Per F1, `artifactKind` cannot identify a
88
+ * stage (artificer writes `'principle'` too), so consumers must read this.
89
+ */
90
+ readonly taskKind: SpikeStageKind;
91
+ /**
92
+ * The artifact id of the predecessor **on the task graph edge**
93
+ * (design §6.1). `null` only at the chain head.
94
+ */
95
+ readonly edgePredecessorArtifactId: string | null;
96
+ readonly contentJson: TContent;
97
+ }
98
+ export interface SpikeChain {
99
+ readonly chainId: SpikeChainId;
100
+ /** Short human-readable label for Spike output. */
101
+ readonly label: string;
102
+ readonly expectedDefect: SpikeExpectedDefect;
103
+ readonly diagRootCause: SpikeChainHop<DiagRootCauseOutputV1>;
104
+ readonly diagDistiller: SpikeChainHop<DiagDistillerOutputV1>;
105
+ readonly diagRouter: SpikeChainHop<DiagnosticianOutputV1>;
106
+ readonly dreamer: SpikeChainHop<DreamerOutputV1>;
107
+ readonly philosopher: SpikeChainHop<PhilosopherOutputV1>;
108
+ readonly scribe: SpikeChainHop<ScribeOutputV1>;
109
+ readonly artificer: SpikeChainHop<ArtificerRuleOutput>;
110
+ readonly evaluator: SpikeChainHop<EvaluatorOutputV2>;
111
+ }
112
+ /** Ordered hops of a chain. `contentJson` stays `unknown` (rc-1). */
113
+ export declare function spikeChainHops(chain: SpikeChain): readonly SpikeChainHop<unknown>[];
114
+ /** The three concrete actions dreamer prescribes. Defect chain B loses these. */
115
+ export declare const CONCRETE_ACTIONS: readonly string[];
116
+ /** The abstract phrase defect chain B substitutes for the concrete actions. */
117
+ export declare const ABSTRACTED_PHRASE = "\u7406\u89E3\u67B6\u6784";
118
+ /** The dreamer risk level. Defect chain A loses this dimension entirely. */
119
+ export declare const DREAMER_RISK_LEVEL = "high";
120
+ /** 缺陷链 A:scribe 原则文本完全丢失 dreamer 的 `riskLevel` 维度。 */
121
+ export declare const SPIKE_CHAIN_DEFECT_A: SpikeChain;
122
+ /** 缺陷链 B:scribe 把 dreamer 的具体动作模糊为抽象表述。 */
123
+ export declare const SPIKE_CHAIN_DEFECT_B: SpikeChain;
124
+ /** 对照链:无缺陷。用于识别「任何输入都报缺失」的假阳性。 */
125
+ export declare const SPIKE_CHAIN_CONTROL: SpikeChain;
126
+ export declare const SPIKE_CHAINS: readonly SpikeChain[];
127
+ /** One inconsistency between a hop's lineage field and the hop it should name. */
128
+ export interface SpikeLineageViolation {
129
+ readonly chainId: SpikeChainId;
130
+ readonly stage: SpikeStageKind;
131
+ /** Dotted path of the offending field, e.g. `sourceTrace.scribeArtifactId`. */
132
+ readonly field: string;
133
+ readonly expected: string;
134
+ readonly actual: string;
135
+ }
136
+ /**
137
+ * Collect every lineage inconsistency in a chain.
138
+ *
139
+ * Only fields that actually exist on the real output types are checked, and each
140
+ * check names the concrete field and the hop it must point at — so a failure
141
+ * reports *which* field of *which* stage drifted, not merely "chain invalid"
142
+ * (ERR-088: the assertion signal must identify the intended path uniquely).
143
+ *
144
+ * Checked invariants:
145
+ * - `taskKind` equals `stage` (F1: stage identity comes from taskKind, never artifactKind)
146
+ * - each hop's `edgePredecessorArtifactId` is the previous hop on the task graph edge
147
+ * - `contentJson.taskId` equals the hop's own `taskId` (every stage except
148
+ * `diag_router`, whose output carries no `taskId` — PRI-272 removed it)
149
+ * - `diag_distiller.sourceRootCauseArtifactId` → rootcause artifact
150
+ * - `diag_router` carries Stage A's `rootCause`/`evidence` and Stage B's
151
+ * `confidence` (the invariants `diag-router-runner.postFetchTransform` injects)
152
+ * - `dreamer.contextRefs` contains the router artifact
153
+ * - `philosopher.sourceDreamerArtifactId` → dreamer artifact
154
+ * - scribe / artificer / evaluator top-level source ids and every
155
+ * `sourceTrace.*` id point at the actual upstream artifacts
156
+ */
157
+ export declare function findSpikeLineageViolations(chain: SpikeChain): readonly SpikeLineageViolation[];
158
+ /**
159
+ * Throw with a per-field report when a chain's lineage is inconsistent.
160
+ *
161
+ * Used by the fixture self-check test and available to the Spike driver so a
162
+ * corrupted fixture fails loud instead of silently weakening the Spike (rc-9).
163
+ */
164
+ export declare function assertSpikeChainLineageConsistent(chain: SpikeChain): void;
165
+ //# sourceMappingURL=progressive-disclosure-spike-fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"progressive-disclosure-spike-fixtures.d.ts","sourceRoot":"","sources":["../../../../src/runtime-v2/internalization/__tests__/progressive-disclosure-spike-fixtures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0B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