@principles/core 1.124.0 → 1.125.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 (126) hide show
  1. package/dist/runtime-v2/__tests__/architecture-regression.test.js +5 -1
  2. package/dist/runtime-v2/__tests__/architecture-regression.test.js.map +1 -1
  3. package/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.js +115 -21
  4. package/dist/runtime-v2/__tests__/attack-e2e-pipeline-smoke.test.js.map +1 -1
  5. package/dist/runtime-v2/__tests__/golden-path-diagnostician-e2e.test.js.map +1 -1
  6. package/dist/runtime-v2/__tests__/pain-signal-bridge-retried.test.js +7 -6
  7. package/dist/runtime-v2/__tests__/pain-signal-bridge-retried.test.js.map +1 -1
  8. package/dist/runtime-v2/__tests__/pain-signal-bridge-short-circuit.test.js.map +1 -1
  9. package/dist/runtime-v2/__tests__/pain-signal-bridge-workspace-dir.test.js.map +1 -1
  10. package/dist/runtime-v2/cli/diagnose.d.ts +2 -2
  11. package/dist/runtime-v2/cli/diagnose.d.ts.map +1 -1
  12. package/dist/runtime-v2/config/__tests__/pd-config-contract.test.js +3 -3
  13. package/dist/runtime-v2/config/__tests__/pd-config-contract.test.js.map +1 -1
  14. package/dist/runtime-v2/config/pd-config-defaults.js +3 -3
  15. package/dist/runtime-v2/config/pd-config-defaults.js.map +1 -1
  16. package/dist/runtime-v2/diagnostician-prompt-builder.d.ts +1 -64
  17. package/dist/runtime-v2/diagnostician-prompt-builder.d.ts.map +1 -1
  18. package/dist/runtime-v2/diagnostician-prompt-builder.js +0 -186
  19. package/dist/runtime-v2/diagnostician-prompt-builder.js.map +1 -1
  20. package/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js +13 -7
  21. package/dist/runtime-v2/feature-flags/__tests__/feature-flag-contract.test.js.map +1 -1
  22. package/dist/runtime-v2/feature-flags/feature-flag-contract.js +3 -3
  23. package/dist/runtime-v2/feature-flags/feature-flag-contract.js.map +1 -1
  24. package/dist/runtime-v2/index.d.ts +8 -7
  25. package/dist/runtime-v2/index.d.ts.map +1 -1
  26. package/dist/runtime-v2/index.js +8 -5
  27. package/dist/runtime-v2/index.js.map +1 -1
  28. package/dist/runtime-v2/internalization/__tests__/diag-chain-e2e.test.js +108 -105
  29. package/dist/runtime-v2/internalization/__tests__/diag-chain-e2e.test.js.map +1 -1
  30. package/dist/runtime-v2/internalization/__tests__/runnerkind-seam.test.js +3 -3
  31. package/dist/runtime-v2/internalization/__tests__/runnerkind-seam.test.js.map +1 -1
  32. package/dist/runtime-v2/internalization/split-diagnostician-runner.d.ts.map +1 -1
  33. package/dist/runtime-v2/internalization/split-diagnostician-runner.js +121 -52
  34. package/dist/runtime-v2/internalization/split-diagnostician-runner.js.map +1 -1
  35. package/dist/runtime-v2/observer/__tests__/empathy-observer.real-e2e.test.js +28 -21
  36. package/dist/runtime-v2/observer/__tests__/empathy-observer.real-e2e.test.js.map +1 -1
  37. package/dist/runtime-v2/pain-signal-runtime-factory.d.ts +10 -1
  38. package/dist/runtime-v2/pain-signal-runtime-factory.d.ts.map +1 -1
  39. package/dist/runtime-v2/pain-signal-runtime-factory.js +42 -40
  40. package/dist/runtime-v2/pain-signal-runtime-factory.js.map +1 -1
  41. package/dist/runtime-v2/runner/__tests__/diagnose.test.js.map +1 -1
  42. package/package.json +1 -1
  43. package/dist/runtime-v2/__tests__/diagnostician-core-grounding.test.d.ts +0 -2
  44. package/dist/runtime-v2/__tests__/diagnostician-core-grounding.test.d.ts.map +0 -1
  45. package/dist/runtime-v2/__tests__/diagnostician-core-grounding.test.js +0 -122
  46. package/dist/runtime-v2/__tests__/diagnostician-core-grounding.test.js.map +0 -1
  47. package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.integration.test.d.ts +0 -2
  48. package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.integration.test.d.ts.map +0 -1
  49. package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.integration.test.js +0 -169
  50. package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.integration.test.js.map +0 -1
  51. package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.d.ts +0 -2
  52. package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.d.ts.map +0 -1
  53. package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.js +0 -462
  54. package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.js.map +0 -1
  55. package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-language.test.d.ts +0 -13
  56. package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-language.test.d.ts.map +0 -1
  57. package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-language.test.js +0 -97
  58. package/dist/runtime-v2/diagnostician/__tests__/diagnostician-prompt-language.test.js.map +0 -1
  59. package/dist/runtime-v2/runner/__tests__/diagnostician-runner.integration.test.d.ts +0 -2
  60. package/dist/runtime-v2/runner/__tests__/diagnostician-runner.integration.test.d.ts.map +0 -1
  61. package/dist/runtime-v2/runner/__tests__/diagnostician-runner.integration.test.js +0 -378
  62. package/dist/runtime-v2/runner/__tests__/diagnostician-runner.integration.test.js.map +0 -1
  63. package/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.d.ts +0 -2
  64. package/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.d.ts.map +0 -1
  65. package/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.js +0 -682
  66. package/dist/runtime-v2/runner/__tests__/diagnostician-runner.test.js.map +0 -1
  67. package/dist/runtime-v2/runner/__tests__/diagnostician-telemetry.test.d.ts +0 -2
  68. package/dist/runtime-v2/runner/__tests__/diagnostician-telemetry.test.d.ts.map +0 -1
  69. package/dist/runtime-v2/runner/__tests__/diagnostician-telemetry.test.js +0 -286
  70. package/dist/runtime-v2/runner/__tests__/diagnostician-telemetry.test.js.map +0 -1
  71. package/dist/runtime-v2/runner/__tests__/dual-track-e2e.test.d.ts +0 -2
  72. package/dist/runtime-v2/runner/__tests__/dual-track-e2e.test.d.ts.map +0 -1
  73. package/dist/runtime-v2/runner/__tests__/dual-track-e2e.test.js +0 -320
  74. package/dist/runtime-v2/runner/__tests__/dual-track-e2e.test.js.map +0 -1
  75. package/dist/runtime-v2/runner/__tests__/lease-expiration-recovery.integration.test.d.ts +0 -2
  76. package/dist/runtime-v2/runner/__tests__/lease-expiration-recovery.integration.test.d.ts.map +0 -1
  77. package/dist/runtime-v2/runner/__tests__/lease-expiration-recovery.integration.test.js +0 -261
  78. package/dist/runtime-v2/runner/__tests__/lease-expiration-recovery.integration.test.js.map +0 -1
  79. package/dist/runtime-v2/runner/__tests__/m5-05-e2e.test.d.ts +0 -2
  80. package/dist/runtime-v2/runner/__tests__/m5-05-e2e.test.d.ts.map +0 -1
  81. package/dist/runtime-v2/runner/__tests__/m5-05-e2e.test.js +0 -405
  82. package/dist/runtime-v2/runner/__tests__/m5-05-e2e.test.js.map +0 -1
  83. package/dist/runtime-v2/runner/__tests__/m6-06-e2e.test.d.ts +0 -2
  84. package/dist/runtime-v2/runner/__tests__/m6-06-e2e.test.d.ts.map +0 -1
  85. package/dist/runtime-v2/runner/__tests__/m6-06-e2e.test.js +0 -347
  86. package/dist/runtime-v2/runner/__tests__/m6-06-e2e.test.js.map +0 -1
  87. package/dist/runtime-v2/runner/__tests__/m6-06-legacy.test.d.ts +0 -2
  88. package/dist/runtime-v2/runner/__tests__/m6-06-legacy.test.d.ts.map +0 -1
  89. package/dist/runtime-v2/runner/__tests__/m6-06-legacy.test.js +0 -186
  90. package/dist/runtime-v2/runner/__tests__/m6-06-legacy.test.js.map +0 -1
  91. package/dist/runtime-v2/runner/__tests__/m6-06-real-path.test.d.ts +0 -2
  92. package/dist/runtime-v2/runner/__tests__/m6-06-real-path.test.d.ts.map +0 -1
  93. package/dist/runtime-v2/runner/__tests__/m6-06-real-path.test.js +0 -355
  94. package/dist/runtime-v2/runner/__tests__/m6-06-real-path.test.js.map +0 -1
  95. package/dist/runtime-v2/runner/__tests__/m8-02-e2e.test.d.ts +0 -2
  96. package/dist/runtime-v2/runner/__tests__/m8-02-e2e.test.d.ts.map +0 -1
  97. package/dist/runtime-v2/runner/__tests__/m8-02-e2e.test.js +0 -486
  98. package/dist/runtime-v2/runner/__tests__/m8-02-e2e.test.js.map +0 -1
  99. package/dist/runtime-v2/runner/__tests__/m9-adapter-integration.test.d.ts +0 -2
  100. package/dist/runtime-v2/runner/__tests__/m9-adapter-integration.test.d.ts.map +0 -1
  101. package/dist/runtime-v2/runner/__tests__/m9-adapter-integration.test.js +0 -171
  102. package/dist/runtime-v2/runner/__tests__/m9-adapter-integration.test.js.map +0 -1
  103. package/dist/runtime-v2/runner/__tests__/m9-e2e.test.d.ts +0 -2
  104. package/dist/runtime-v2/runner/__tests__/m9-e2e.test.d.ts.map +0 -1
  105. package/dist/runtime-v2/runner/__tests__/m9-e2e.test.js +0 -175
  106. package/dist/runtime-v2/runner/__tests__/m9-e2e.test.js.map +0 -1
  107. package/dist/runtime-v2/runner/__tests__/max-attempts-exceeded.integration.test.d.ts +0 -2
  108. package/dist/runtime-v2/runner/__tests__/max-attempts-exceeded.integration.test.d.ts.map +0 -1
  109. package/dist/runtime-v2/runner/__tests__/max-attempts-exceeded.integration.test.js +0 -276
  110. package/dist/runtime-v2/runner/__tests__/max-attempts-exceeded.integration.test.js.map +0 -1
  111. package/dist/runtime-v2/runner/__tests__/retry-wait-recovery.integration.test.d.ts +0 -2
  112. package/dist/runtime-v2/runner/__tests__/retry-wait-recovery.integration.test.d.ts.map +0 -1
  113. package/dist/runtime-v2/runner/__tests__/retry-wait-recovery.integration.test.js +0 -272
  114. package/dist/runtime-v2/runner/__tests__/retry-wait-recovery.integration.test.js.map +0 -1
  115. package/dist/runtime-v2/runner/__tests__/start-run-input.test.d.ts +0 -2
  116. package/dist/runtime-v2/runner/__tests__/start-run-input.test.d.ts.map +0 -1
  117. package/dist/runtime-v2/runner/__tests__/start-run-input.test.js +0 -67
  118. package/dist/runtime-v2/runner/__tests__/start-run-input.test.js.map +0 -1
  119. package/dist/runtime-v2/runner/diagnostician-runner-options.d.ts +0 -57
  120. package/dist/runtime-v2/runner/diagnostician-runner-options.d.ts.map +0 -1
  121. package/dist/runtime-v2/runner/diagnostician-runner-options.js +0 -21
  122. package/dist/runtime-v2/runner/diagnostician-runner-options.js.map +0 -1
  123. package/dist/runtime-v2/runner/diagnostician-runner.d.ts +0 -89
  124. package/dist/runtime-v2/runner/diagnostician-runner.d.ts.map +0 -1
  125. package/dist/runtime-v2/runner/diagnostician-runner.js +0 -470
  126. package/dist/runtime-v2/runner/diagnostician-runner.js.map +0 -1
@@ -1,462 +0,0 @@
1
- /**
2
- * DiagnosticianPromptBuilder unit tests.
3
- *
4
- * Tests DPB-01 (buildPrompt signature), DPB-02 (JSON-only output),
5
- * DPB-03 (JSON conforms to expected structure), DPB-04 (explicit fields),
6
- * DPB-05 (pure function — no DB calls).
7
- *
8
- * Phase: m6-03
9
- */
10
- import { describe, it, expect } from 'vitest';
11
- import { DiagnosticianPromptBuilder, buildDiagnosticProtocolInstruction } from '../../diagnostician-prompt-builder.js';
12
- import { DiagnosticianContextPayloadSchema, ContextPayloadSchema } from '../../context-payload.js';
13
- import { extractJsonObject } from '../../adapter/json-extractor.js';
14
- import { DefaultSchemaPromptAdapter } from '../../adapter/schema-prompt-adapter.js';
15
- import { DiagnosticianOutputV1Schema } from '../../diagnostician-output.js';
16
- import { Value } from '@sinclair/typebox/value';
17
- const MINIMAL_PAYLOAD = {
18
- contextId: 'ctx-1',
19
- contextHash: 'hash-abc123',
20
- taskId: 'task-xyz',
21
- workspaceDir: 'D:/work',
22
- sourceRefs: ['ref-1', 'ref-2'],
23
- diagnosisTarget: {
24
- painId: 'pain-1',
25
- reasonSummary: 'Agent failed to use tool',
26
- },
27
- conversationWindow: [
28
- { ts: '2026-04-24T10:00:00Z', role: 'user', text: 'Hello', toolName: undefined, toolResultSummary: undefined, eventType: undefined },
29
- { ts: '2026-04-24T10:00:01Z', role: 'assistant', text: 'I will help', toolName: undefined, toolResultSummary: undefined, eventType: undefined },
30
- ],
31
- };
32
- describe('DiagnosticianPromptBuilder', () => {
33
- describe('buildPrompt()', () => {
34
- // DPB-01: buildPrompt accepts DiagnosticianContextPayload, returns PromptBuildResult
35
- it('returns PromptBuildResult with message and promptInput fields', () => {
36
- const builder = new DiagnosticianPromptBuilder();
37
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
38
- expect(result).toHaveProperty('message');
39
- expect(result).toHaveProperty('promptInput');
40
- expect(typeof result.message).toBe('string');
41
- });
42
- // DPB-04: PromptInput.taskId matches payload.taskId
43
- it('maps taskId from payload to top-level PromptInput.taskId', () => {
44
- const builder = new DiagnosticianPromptBuilder();
45
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
46
- expect(result.promptInput.taskId).toBe(MINIMAL_PAYLOAD.taskId);
47
- expect(result.promptInput.taskId).toBe('task-xyz');
48
- });
49
- // DPB-04: PromptInput.contextHash matches payload.contextHash
50
- it('maps contextHash from payload to top-level PromptInput.contextHash', () => {
51
- const builder = new DiagnosticianPromptBuilder();
52
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
53
- expect(result.promptInput.contextHash).toBe(MINIMAL_PAYLOAD.contextHash);
54
- expect(result.promptInput.contextHash).toBe('hash-abc123');
55
- });
56
- // DPB-04: PromptInput.diagnosisTarget matches payload.diagnosisTarget
57
- it('maps diagnosisTarget from payload to top-level PromptInput.diagnosisTarget', () => {
58
- const builder = new DiagnosticianPromptBuilder();
59
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
60
- expect(result.promptInput.diagnosisTarget).toEqual(MINIMAL_PAYLOAD.diagnosisTarget);
61
- });
62
- // DPB-04: PromptInput.conversationWindow is set from payload.conversationWindow
63
- it('maps conversationWindow from payload to top-level PromptInput.conversationWindow', () => {
64
- const builder = new DiagnosticianPromptBuilder();
65
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
66
- expect(result.promptInput.conversationWindow).toEqual(MINIMAL_PAYLOAD.conversationWindow);
67
- expect(result.promptInput.conversationWindow).toHaveLength(2);
68
- });
69
- // DPB-04: PromptInput.sourceRefs matches payload.sourceRefs
70
- it('maps sourceRefs from payload to top-level PromptInput.sourceRefs', () => {
71
- const builder = new DiagnosticianPromptBuilder();
72
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
73
- expect(result.promptInput.sourceRefs).toEqual(MINIMAL_PAYLOAD.sourceRefs);
74
- expect(result.promptInput.sourceRefs).toEqual(['ref-1', 'ref-2']);
75
- });
76
- // DPB-06: PromptInput.context is the original DiagnosticianContextPayload
77
- it('nests the full DiagnosticianContextPayload in PromptInput.context', () => {
78
- const builder = new DiagnosticianPromptBuilder();
79
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
80
- expect(result.promptInput.context).toEqual(MINIMAL_PAYLOAD);
81
- expect(result.promptInput.context.contextId).toBe('ctx-1');
82
- });
83
- // DPB-02: message is valid JSON (no markdown, no file ops, no tool calls)
84
- it('message field is valid JSON (JSON.parse succeeds)', () => {
85
- const builder = new DiagnosticianPromptBuilder();
86
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
87
- expect(() => JSON.parse(result.message)).not.toThrow();
88
- });
89
- // DPB-04: taskId appears at top level of JSON message (not buried in nested context)
90
- it('taskId appears at top level of serialized JSON message', () => {
91
- const builder = new DiagnosticianPromptBuilder();
92
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
93
- const parsed = JSON.parse(result.message);
94
- expect(parsed.taskId).toBe('task-xyz');
95
- expect(parsed.context.taskId).toBe('task-xyz'); // also in nested context
96
- });
97
- // DPB-03: JSON must be structured so DiagnosticianOutputV1 can be validated downstream
98
- it('message JSON contains all required PromptInput fields at top level', () => {
99
- const builder = new DiagnosticianPromptBuilder();
100
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
101
- const parsed = JSON.parse(result.message);
102
- expect(parsed).toHaveProperty('taskId');
103
- expect(parsed).toHaveProperty('contextHash');
104
- expect(parsed).toHaveProperty('diagnosisTarget');
105
- expect(parsed).toHaveProperty('conversationWindow');
106
- expect(parsed).toHaveProperty('sourceRefs');
107
- expect(parsed).toHaveProperty('context');
108
- });
109
- // DPB-08: diagnosticInstruction contains the 5-phase protocol
110
- it('diagnosticInstruction is present and contains the 5-phase protocol keywords', () => {
111
- const builder = new DiagnosticianPromptBuilder();
112
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
113
- expect(result.promptInput.diagnosticInstruction).toBeDefined();
114
- expect(result.promptInput.diagnosticInstruction.length).toBeGreaterThan(100);
115
- expect(result.promptInput.diagnosticInstruction).toContain('PHASE');
116
- expect(result.promptInput.diagnosticInstruction).toContain('5 Whys');
117
- expect(result.promptInput.diagnosticInstruction).toContain('rootCause');
118
- expect(result.promptInput.diagnosticInstruction).toContain('confidence');
119
- expect(result.promptInput.diagnosticInstruction).toContain('Design');
120
- expect(result.promptInput.diagnosticInstruction).toContain('People');
121
- });
122
- // DPB-05: buildPrompt() is pure — no DB calls
123
- it('buildPrompt() is a pure function — same input produces same output', () => {
124
- const builder = new DiagnosticianPromptBuilder();
125
- const result1 = builder.buildPrompt(MINIMAL_PAYLOAD);
126
- const result2 = builder.buildPrompt(MINIMAL_PAYLOAD);
127
- expect(result1.message).toBe(result2.message);
128
- expect(result1.promptInput).toEqual(result2.promptInput);
129
- });
130
- // DPB-07: NO extraSystemPrompt field
131
- it('PromptBuildResult does NOT contain extraSystemPrompt field', () => {
132
- const builder = new DiagnosticianPromptBuilder();
133
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
134
- expect(result).not.toHaveProperty('extraSystemPrompt');
135
- const parsed = JSON.parse(result.message);
136
- expect(parsed).not.toHaveProperty('extraSystemPrompt');
137
- });
138
- // Edge case: empty sourceRefs array
139
- it('handles empty sourceRefs array', () => {
140
- const payload = { ...MINIMAL_PAYLOAD, sourceRefs: [] };
141
- const builder = new DiagnosticianPromptBuilder();
142
- const result = builder.buildPrompt(payload);
143
- expect(result.promptInput.sourceRefs).toEqual([]);
144
- const parsed = JSON.parse(result.message);
145
- expect(parsed.sourceRefs).toEqual([]);
146
- });
147
- // Edge case: empty conversationWindow
148
- it('handles empty conversationWindow array', () => {
149
- const payload = { ...MINIMAL_PAYLOAD, conversationWindow: [] };
150
- const builder = new DiagnosticianPromptBuilder();
151
- const result = builder.buildPrompt(payload);
152
- expect(result.promptInput.conversationWindow).toEqual([]);
153
- const parsed = JSON.parse(result.message);
154
- expect(parsed.conversationWindow).toEqual([]);
155
- });
156
- // workspaceDir is NOT at top level (only in nested context per OCRA-06)
157
- it('workspaceDir is NOT at top level — only in nested context', () => {
158
- const builder = new DiagnosticianPromptBuilder();
159
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
160
- // workspaceDir should be in nested context
161
- expect(result.promptInput.context.workspaceDir).toBe('D:/work');
162
- // workspaceDir should NOT be at top level
163
- const parsed = JSON.parse(result.message);
164
- expect(parsed).not.toHaveProperty('workspaceDir');
165
- });
166
- });
167
- // ── PRI-31: Recommendation taxonomy in prompt ────────────────────────────
168
- describe('recommendation taxonomy in prompt (PRI-31)', () => {
169
- it('prompt contains all 5 taxonomy kinds', () => {
170
- const builder = new DiagnosticianPromptBuilder();
171
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
172
- const instruction = result.promptInput.diagnosticInstruction;
173
- expect(instruction).toContain('"principle"');
174
- expect(instruction).toContain('"rule"');
175
- expect(instruction).toContain('"implementation"');
176
- expect(instruction).toContain('"prompt"');
177
- expect(instruction).toContain('"defer"');
178
- });
179
- it('prompt states rule requires triggerPattern+action', () => {
180
- const builder = new DiagnosticianPromptBuilder();
181
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
182
- const instruction = result.promptInput.diagnosticInstruction;
183
- expect(instruction).toMatch(/rule.*triggerPattern/i);
184
- expect(instruction).toMatch(/rule.*action/i);
185
- });
186
- it('prompt states principle requires abstractedPrinciple', () => {
187
- const builder = new DiagnosticianPromptBuilder();
188
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
189
- const instruction = result.promptInput.diagnosticInstruction;
190
- expect(instruction).toMatch(/principle.*abstractedPrinciple/i);
191
- });
192
- it('prompt does NOT say "Extract ONE highly abstracted principle"', () => {
193
- const builder = new DiagnosticianPromptBuilder();
194
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
195
- const instruction = result.promptInput.diagnosticInstruction;
196
- expect(instruction).not.toContain('Extract ONE highly abstracted principle');
197
- });
198
- it('prompt output example is a full DiagnosticianOutputV1 object', () => {
199
- const builder = new DiagnosticianPromptBuilder();
200
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
201
- const instruction = result.promptInput.diagnosticInstruction;
202
- // Must include top-level DiagnosticianOutputV1 fields in the output format
203
- expect(instruction).toContain('"valid"');
204
- expect(instruction).toContain('"diagnosisId"');
205
- expect(instruction).toContain('"confidence"');
206
- });
207
- it('prompt does not show principle as the only detailed example', () => {
208
- const builder = new DiagnosticianPromptBuilder();
209
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
210
- const instruction = result.promptInput.diagnosticInstruction;
211
- const taxonomyBlock = (/TAXONOMY[\s\S]*?CRITICAL/.exec(instruction))?.[0] ?? '';
212
- expect(taxonomyBlock).toContain('"rule"');
213
- expect(taxonomyBlock).toContain('"principle"');
214
- expect(taxonomyBlock).toContain('"implementation"');
215
- });
216
- });
217
- // ── PRI-71: Prompt clarity for structured output compliance ────────────────
218
- describe('prompt clarity for structured output compliance (PRI-71)', () => {
219
- it('explicitly states kind values must be lowercase', () => {
220
- const builder = new DiagnosticianPromptBuilder();
221
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
222
- const instruction = result.promptInput.diagnosticInstruction;
223
- const kindMatch = /kind:.*enum:\s*([^}]+)/.exec(instruction);
224
- expect(kindMatch).not.toBeNull();
225
- const enumValues = (kindMatch ?? ['', ''])[1].split('|').map(v => v.trim());
226
- expect(enumValues).toEqual(['principle', 'rule', 'implementation', 'prompt', 'defer']);
227
- expect(enumValues.every(v => v === v.toLowerCase())).toBe(true);
228
- });
229
- it('explicitly states confidence must be a number, not a string or percentage', () => {
230
- const builder = new DiagnosticianPromptBuilder();
231
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
232
- const instruction = result.promptInput.diagnosticInstruction;
233
- expect(instruction).toMatch(/confidence.*number/i);
234
- expect(instruction).toMatch(/NOT.*string.*NOT.*percentage/i);
235
- });
236
- it('shows separate recommendation examples per kind (5 distinct objects)', () => {
237
- const builder = new DiagnosticianPromptBuilder();
238
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
239
- const instruction = result.promptInput.diagnosticInstruction;
240
- // Should have 5 distinct recommendation objects in the OUTPUT FORMAT example
241
- const recMatches = instruction.match(/"kind":\s*"(principle|rule|implementation|prompt|defer)"/g);
242
- expect(recMatches).toHaveLength(5);
243
- // Each kind should appear exactly once in the recommendations example
244
- const kinds = (recMatches ?? []).map(m => /"kind":\s*"(.*?)"/.exec(m)?.[1] ?? '');
245
- expect(new Set(kinds).size).toBe(5);
246
- });
247
- it('uses a concrete numeric confidence value in the example (not range notation)', () => {
248
- const builder = new DiagnosticianPromptBuilder();
249
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
250
- const instruction = result.promptInput.diagnosticInstruction;
251
- const exampleSection = (/COMPLETE EXAMPLE OUTPUT[\s\S]*?CONSTRAINTS/.exec(instruction))?.[0] ?? '';
252
- expect(exampleSection).toMatch(/"confidence":\s*0\.\d+/);
253
- expect(exampleSection).not.toMatch(/"confidence":\s*0\.0-1\.0/);
254
- });
255
- });
256
- describe('prompt contract hardening (PRI-109)', () => {
257
- const adapter = new DefaultSchemaPromptAdapter();
258
- const instruction = buildDiagnosticProtocolInstruction({ adapter, schema: DiagnosticianOutputV1Schema });
259
- it('instruction contains CRITICAL JSON-only emphasis', () => {
260
- expect(instruction).toContain('CRITICAL');
261
- expect(instruction).toContain('ENTIRE response must be ONLY the JSON object');
262
- });
263
- it('instruction prohibits markdown code fences', () => {
264
- expect(instruction).toContain('Do NOT wrap the JSON in markdown code fences');
265
- });
266
- it('instruction prohibits prose before or after JSON', () => {
267
- expect(instruction).toContain('Do NOT include any text before or after the JSON');
268
- expect(instruction).toContain('Do NOT add explanatory prose');
269
- });
270
- it('instruction contains complete JSON example parseable by extractJsonObject', () => {
271
- const parsed = extractJsonObject(instruction);
272
- expect(parsed).not.toBeNull();
273
- });
274
- it('JSON example has all required DiagnosticianOutputV1 fields', () => {
275
- const example = extractJsonObject(instruction);
276
- expect(example).toHaveProperty('valid');
277
- expect(typeof example.valid).toBe('boolean');
278
- expect(example).toHaveProperty('diagnosisId');
279
- expect(example).toHaveProperty('summary');
280
- expect(example).toHaveProperty('rootCause');
281
- expect(example).toHaveProperty('violatedPrinciples');
282
- expect(Array.isArray(example.violatedPrinciples)).toBe(true);
283
- expect(example).toHaveProperty('evidence');
284
- expect(Array.isArray(example.evidence)).toBe(true);
285
- expect(example).toHaveProperty('recommendations');
286
- expect(Array.isArray(example.recommendations)).toBe(true);
287
- expect(example).toHaveProperty('confidence');
288
- expect(typeof example.confidence).toBe('number');
289
- expect(example.confidence).toBeGreaterThanOrEqual(0);
290
- expect(example.confidence).toBeLessThanOrEqual(1);
291
- });
292
- it('JSON example recommendations cover all 5 taxonomy kinds', () => {
293
- const example = extractJsonObject(instruction);
294
- const recs = example.recommendations;
295
- const kinds = recs.map(r => r.kind);
296
- expect(kinds).toContain('rule');
297
- expect(kinds).toContain('principle');
298
- expect(kinds).toContain('implementation');
299
- expect(kinds).toContain('prompt');
300
- expect(kinds).toContain('defer');
301
- });
302
- it('JSON example rule recommendation has triggerPattern and action', () => {
303
- const example = extractJsonObject(instruction);
304
- const recs = example.recommendations;
305
- const rule = recs.find(r => r.kind === 'rule');
306
- expect(rule).toBeDefined();
307
- expect(rule).toHaveProperty('triggerPattern');
308
- expect(rule).toHaveProperty('action');
309
- });
310
- it('JSON example principle recommendation has abstractedPrinciple', () => {
311
- const example = extractJsonObject(instruction);
312
- const recs = example.recommendations;
313
- const principle = recs.find(r => r.kind === 'principle');
314
- expect(principle).toBeDefined();
315
- expect(principle).toHaveProperty('abstractedPrinciple');
316
- });
317
- it('CONSTRAINTS section includes no code fences and no prose emphasis', () => {
318
- expect(instruction).toMatch(/no code fences/);
319
- expect(instruction).toMatch(/no prose before or after/);
320
- });
321
- });
322
- // ── PRI-283 Task 4: buildDiagnosticProtocolInstruction() ────────────────
323
- describe('buildDiagnosticProtocolInstruction()', () => {
324
- const adapter = new DefaultSchemaPromptAdapter();
325
- it('buildDiagnosticProtocolInstruction matches snapshot', () => {
326
- const instruction = buildDiagnosticProtocolInstruction({ adapter, schema: DiagnosticianOutputV1Schema });
327
- expect(instruction).toMatchSnapshot();
328
- });
329
- it('contains 5-phase protocol keywords', () => {
330
- const instruction = buildDiagnosticProtocolInstruction({ adapter, schema: DiagnosticianOutputV1Schema });
331
- expect(instruction).toContain('PHASE 1');
332
- expect(instruction).toContain('5 Whys');
333
- expect(instruction).toContain('Root Cause Classification');
334
- });
335
- it('contains taxonomy definitions', () => {
336
- const instruction = buildDiagnosticProtocolInstruction({ adapter, schema: DiagnosticianOutputV1Schema });
337
- expect(instruction).toContain('TAXONOMY DEFINITIONS');
338
- expect(instruction).toContain('"rule"');
339
- expect(instruction).toContain('"principle"');
340
- });
341
- it('contains schema-derived JSON example', () => {
342
- const instruction = buildDiagnosticProtocolInstruction({ adapter, schema: DiagnosticianOutputV1Schema });
343
- expect(instruction).toContain('COMPLETE EXAMPLE OUTPUT');
344
- const parsed = extractJsonObject(instruction);
345
- expect(parsed).not.toBeNull();
346
- });
347
- it('example passes Value.Check', () => {
348
- const instruction = buildDiagnosticProtocolInstruction({ adapter, schema: DiagnosticianOutputV1Schema });
349
- const parsed = extractJsonObject(instruction);
350
- expect(Value.Check(DiagnosticianOutputV1Schema, parsed)).toBe(true);
351
- });
352
- it('contains schema-derived constraints', () => {
353
- const instruction = buildDiagnosticProtocolInstruction({ adapter, schema: DiagnosticianOutputV1Schema });
354
- expect(instruction).toContain('CONSTRAINTS');
355
- expect(instruction).toContain('category prefix');
356
- });
357
- it('contains CRITICAL JSON-only emphasis', () => {
358
- const instruction = buildDiagnosticProtocolInstruction({ adapter, schema: DiagnosticianOutputV1Schema });
359
- expect(instruction).toContain('CRITICAL');
360
- expect(instruction).toContain('ONLY the JSON object');
361
- });
362
- });
363
- describe('DiagnosticianPromptBuilder with adapter+schema', () => {
364
- it('uses buildDiagnosticProtocolInstruction when adapter and schema are provided', () => {
365
- const adapter = new DefaultSchemaPromptAdapter();
366
- const builder = new DiagnosticianPromptBuilder(adapter, DiagnosticianOutputV1Schema);
367
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
368
- const instruction = result.promptInput.diagnosticInstruction;
369
- expect(instruction).toContain('COMPLETE EXAMPLE OUTPUT');
370
- expect(instruction).toContain('CONSTRAINTS');
371
- const parsed = extractJsonObject(instruction);
372
- expect(parsed).not.toBeNull();
373
- expect(Value.Check(DiagnosticianOutputV1Schema, parsed)).toBe(true);
374
- });
375
- it('uses default adapter and schema when no arguments provided', () => {
376
- const builder = new DiagnosticianPromptBuilder();
377
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
378
- const instruction = result.promptInput.diagnosticInstruction;
379
- expect(instruction).toContain('COMPLETE EXAMPLE OUTPUT');
380
- expect(instruction).toContain('CONSTRAINTS');
381
- const parsed = extractJsonObject(instruction);
382
- expect(parsed).not.toBeNull();
383
- expect(Value.Check(DiagnosticianOutputV1Schema, parsed)).toBe(true);
384
- });
385
- it('uses default schema when only adapter is provided', () => {
386
- const adapter = new DefaultSchemaPromptAdapter();
387
- const builder = new DiagnosticianPromptBuilder(adapter);
388
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
389
- const instruction = result.promptInput.diagnosticInstruction;
390
- expect(instruction).toContain('COMPLETE EXAMPLE OUTPUT');
391
- const parsed = extractJsonObject(instruction);
392
- expect(parsed).not.toBeNull();
393
- expect(Value.Check(DiagnosticianOutputV1Schema, parsed)).toBe(true);
394
- });
395
- });
396
- // ── PRI-352: eventSummaries removal (dangling field with no producer) ────
397
- describe('eventSummaries removal (PRI-352)', () => {
398
- const adapter = new DefaultSchemaPromptAdapter();
399
- it('buildDiagnosticProtocolInstruction() does NOT reference eventSummaries', () => {
400
- const instruction = buildDiagnosticProtocolInstruction({ adapter, schema: DiagnosticianOutputV1Schema });
401
- expect(instruction).not.toContain('eventSummaries');
402
- });
403
- it('DiagnosticianContextPayloadSchema does NOT contain eventSummaries field', () => {
404
- const schemaKeys = Object.keys(DiagnosticianContextPayloadSchema.properties);
405
- expect(schemaKeys).not.toContain('eventSummaries');
406
- });
407
- it('ContextPayloadSchema does NOT contain eventSummaries field', () => {
408
- const schemaKeys = Object.keys(ContextPayloadSchema.properties);
409
- expect(schemaKeys).not.toContain('eventSummaries');
410
- });
411
- it('buildPrompt() output JSON does NOT contain eventSummaries', () => {
412
- const builder = new DiagnosticianPromptBuilder();
413
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
414
- const parsed = JSON.parse(result.message);
415
- expect(parsed.context).not.toHaveProperty('eventSummaries');
416
- });
417
- });
418
- // ── PRI-342: Empty evidence degradation guard ────────────────────────────
419
- describe('empty evidence degradation guard (PRI-342)', () => {
420
- const adapter = new DefaultSchemaPromptAdapter();
421
- // 用例 1: prompt must contain explicit empty-evidence → confidence<0.3 + defer instruction
422
- it('contains empty evidence degradation instruction with confidence<0.3 and defer', () => {
423
- const instruction = buildDiagnosticProtocolInstruction({ adapter, schema: DiagnosticianOutputV1Schema });
424
- // Must reference diagnosisTarget.evidence emptiness
425
- expect(instruction).toContain('diagnosisTarget.evidence');
426
- expect(instruction).toMatch(/empty|length.*0|is empty/i);
427
- // Must require confidence < 0.3
428
- expect(instruction).toMatch(/confidence.*0\.3|0\.3.*confidence/i);
429
- // Must require kind = "defer"
430
- expect(instruction).toContain('"defer"');
431
- });
432
- // 用例 1b: must explicitly prohibit fabricating evidence
433
- it('prohibits fabricating evidence when input evidence is empty', () => {
434
- const instruction = buildDiagnosticProtocolInstruction({ adapter, schema: DiagnosticianOutputV1Schema });
435
- expect(instruction).toMatch(/MUST NOT.*fabricat|fabricat.*MUST NOT/i);
436
- });
437
- // 用例 2: truncation safety — guard text survives truncation
438
- it('key guard constraints survive prompt truncation', () => {
439
- const builder = new DiagnosticianPromptBuilder(adapter, DiagnosticianOutputV1Schema);
440
- const hugePayload = {
441
- ...MINIMAL_PAYLOAD,
442
- conversationWindow: Array.from({ length: 100 }, (_, i) => ({
443
- ts: `2026-04-24T10:${String(i).padStart(2, '0')}:00Z`,
444
- role: (i % 2 === 0 ? 'user' : 'assistant'),
445
- text: 'A'.repeat(2000), // max entry text
446
- toolName: undefined,
447
- toolResultSummary: undefined,
448
- eventType: undefined,
449
- })),
450
- };
451
- const limits = { maxConversationEntries: 100, maxEntryTextChars: 2000, maxMessageChars: 500 };
452
- const result = builder.buildPrompt(hugePayload, { limits });
453
- // Truncation should have occurred
454
- expect(result.promptInput.truncationWarnings).toBeDefined();
455
- expect(result.promptInput.truncationWarnings?.length).toBeTruthy();
456
- // Even after truncation, the instruction still contains key guard words
457
- expect(result.promptInput.diagnosticInstruction).toContain('"defer"');
458
- expect(result.promptInput.diagnosticInstruction).toMatch(/confidence|evidence/i);
459
- });
460
- });
461
- });
462
- //# sourceMappingURL=diagnostician-prompt-builder.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"diagnostician-prompt-builder.test.js","sourceRoot":"","sources":["../../../../src/runtime-v2/diagnostician/__tests__/diagnostician-prompt-builder.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,kCAAkC,EAAE,MAAM,uCAAuC,CAAC;AAEvH,OAAO,EAAE,iCAAiC,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AACnG,OAAO,EAAE,iBAAiB,E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AM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM;oBACrD,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC;oBAC1C,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,iBAAiB;oBACzC,QAAQ,EAAE,SAAS;oBACnB,iBAAiB,EAAE,SAAS;oBAC5B,SAAS,EAAE,SAAS;iBACrB,CAAC,CAAC;aACJ,CAAC;YACF,MAAM,MAAM,GAAG,EAAE,sBAAsB,EAAE,GAAG,EAAE,iBAAiB,EAAE,IAAI,EAAE,eAAe,EAAE,GAAG,EAAE,CAAC;YAC9F,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;YAE5D,kCAAkC;YAClC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,WAAW,EAAE,CAAC;YAC5D,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,UAAU,EAAE,CAAC;YACnE,wEAAwE;YACxE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;YACtE,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAC;QACnF,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * Tests for outputLanguage integration into DiagnosticianPromptBuilder (PRI-336).
3
- *
4
- * Validates:
5
- * - config → diagnostician prompt contains language directive
6
- * - zh-CN: prompt explicitly requests Chinese principle text
7
- * - en: prompt explicitly requests English principle text
8
- * - technical identifiers not translated instruction exists
9
- * - undefined outputLanguage: no language directive (backward compatible)
10
- * - lineage fields are not translated
11
- */
12
- export {};
13
- //# sourceMappingURL=diagnostician-prompt-language.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"diagnostician-prompt-language.test.d.ts","sourceRoot":"","sources":["../../../../src/runtime-v2/diagnostician/__tests__/diagnostician-prompt-language.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
@@ -1,97 +0,0 @@
1
- /**
2
- * Tests for outputLanguage integration into DiagnosticianPromptBuilder (PRI-336).
3
- *
4
- * Validates:
5
- * - config → diagnostician prompt contains language directive
6
- * - zh-CN: prompt explicitly requests Chinese principle text
7
- * - en: prompt explicitly requests English principle text
8
- * - technical identifiers not translated instruction exists
9
- * - undefined outputLanguage: no language directive (backward compatible)
10
- * - lineage fields are not translated
11
- */
12
- import { describe, it, expect } from 'vitest';
13
- import { DiagnosticianPromptBuilder, buildDiagnosticProtocolInstruction } from '../../diagnostician-prompt-builder.js';
14
- /** Trust-boundary helper: validate parsed prompt JSON before property access. */
15
- function parsePromptJson(raw) {
16
- const parsed = JSON.parse(raw);
17
- if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) {
18
- throw new Error(`parsePromptJson: expected object, got ${typeof parsed}`);
19
- }
20
- return parsed;
21
- }
22
- const MINIMAL_PAYLOAD = {
23
- contextId: 'ctx-1',
24
- contextHash: 'hash-abc123',
25
- taskId: 'task-xyz',
26
- workspaceDir: 'D:/work',
27
- sourceRefs: ['ref-1'],
28
- diagnosisTarget: {
29
- painId: 'pain-1',
30
- reasonSummary: 'Agent failed to use tool',
31
- },
32
- conversationWindow: [],
33
- };
34
- describe('DiagnosticianPromptBuilder — outputLanguage (PRI-336)', () => {
35
- it('includes Chinese language directive when outputLanguage is zh-CN', () => {
36
- const builder = new DiagnosticianPromptBuilder();
37
- const result = builder.buildPrompt(MINIMAL_PAYLOAD, { outputLanguage: 'zh-CN' });
38
- const parsed = parsePromptJson(result.message);
39
- expect(parsed.diagnosticInstruction).toContain('Simplified Chinese');
40
- expect(parsed.diagnosticInstruction).toContain('简体中文');
41
- expect(parsed.diagnosticInstruction).toContain('LANGUAGE DIRECTIVE');
42
- });
43
- it('includes English language directive when outputLanguage is en', () => {
44
- const builder = new DiagnosticianPromptBuilder();
45
- const result = builder.buildPrompt(MINIMAL_PAYLOAD, { outputLanguage: 'en' });
46
- const parsed = parsePromptJson(result.message);
47
- expect(parsed.diagnosticInstruction).toContain('English');
48
- expect(parsed.diagnosticInstruction).toContain('PRI-336');
49
- });
50
- it('does NOT include language directive when outputLanguage is undefined', () => {
51
- const builder = new DiagnosticianPromptBuilder();
52
- const result = builder.buildPrompt(MINIMAL_PAYLOAD);
53
- const parsed = parsePromptJson(result.message);
54
- expect(parsed.diagnosticInstruction).not.toContain('LANGUAGE DIRECTIVE');
55
- expect(parsed.diagnosticInstruction).not.toContain('PRI-336');
56
- });
57
- it('includes technical identifiers not translated instruction', () => {
58
- const builder = new DiagnosticianPromptBuilder();
59
- const result = builder.buildPrompt(MINIMAL_PAYLOAD, { outputLanguage: 'zh-CN' });
60
- const parsed = parsePromptJson(result.message);
61
- expect(parsed.diagnosticInstruction).toContain('taskId');
62
- expect(parsed.diagnosticInstruction).toContain('sourcePainId');
63
- expect(parsed.diagnosticInstruction).toContain('MUST NOT be translated');
64
- });
65
- it('includes lineage fields not translated instruction', () => {
66
- const builder = new DiagnosticianPromptBuilder();
67
- const result = builder.buildPrompt(MINIMAL_PAYLOAD, { outputLanguage: 'en' });
68
- const parsed = parsePromptJson(result.message);
69
- expect(parsed.diagnosticInstruction).toContain('Lineage and evidence fields MUST NOT be translated');
70
- });
71
- it('preserves all other prompt fields when outputLanguage is provided', () => {
72
- const builder = new DiagnosticianPromptBuilder();
73
- const resultWithout = builder.buildPrompt(MINIMAL_PAYLOAD);
74
- const resultWith = builder.buildPrompt(MINIMAL_PAYLOAD, { outputLanguage: 'zh-CN' });
75
- const parsedWithout = parsePromptJson(resultWithout.message);
76
- const parsedWith = parsePromptJson(resultWith.message);
77
- // Same fields except diagnosticInstruction
78
- expect(parsedWith.taskId).toBe(parsedWithout.taskId);
79
- expect(parsedWith.contextHash).toBe(parsedWithout.contextHash);
80
- expect(parsedWith.diagnosisTarget).toEqual(parsedWithout.diagnosisTarget);
81
- expect(parsedWith.conversationWindow).toEqual(parsedWithout.conversationWindow);
82
- expect(parsedWith.sourceRefs).toEqual(parsedWithout.sourceRefs);
83
- expect(parsedWith.context).toEqual(parsedWithout.context);
84
- });
85
- });
86
- describe('buildDiagnosticProtocolInstruction — outputLanguage (PRI-336)', () => {
87
- it('includes language directive when outputLanguage is provided', () => {
88
- const instruction = buildDiagnosticProtocolInstruction({ outputLanguage: 'zh-CN' });
89
- expect(instruction).toContain('LANGUAGE DIRECTIVE');
90
- expect(instruction).toContain('Simplified Chinese');
91
- });
92
- it('does not include language directive when outputLanguage is undefined', () => {
93
- const instruction = buildDiagnosticProtocolInstruction();
94
- expect(instruction).not.toContain('LANGUAGE DIRECTIVE');
95
- });
96
- });
97
- //# sourceMappingURL=diagnostician-prompt-language.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"diagnostician-prompt-language.test.js","sourceRoot":"","sources":["../../../../src/runtime-v2/diagnostician/__tests__/diagnostician-prompt-language.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,0BAA0B,EAAE,kCAAkC,EAAE,MAAM,uCAAuC,CAAC;AAGvH,iFAAiF;AACjF,SAAS,eAAe,CAAC,GAAW;IAClC,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACxC,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3E,MAAM,IAAI,KAAK,CAA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