maestro-flow 0.5.41 → 0.5.42

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 (67) hide show
  1. package/.agents/skills/maestro-analyze/SKILL.md +0 -42
  2. package/.agents/skills/maestro-blueprint/SKILL.md +0 -22
  3. package/.agents/skills/maestro-brainstorm/SKILL.md +4 -24
  4. package/.agents/skills/maestro-execute/SKILL.md +1 -1
  5. package/.agents/skills/maestro-grill/SKILL.md +0 -16
  6. package/.agents/skills/maestro-milestone-audit/SKILL.md +0 -15
  7. package/.agents/skills/maestro-plan/SKILL.md +5 -62
  8. package/.agents/skills/maestro-roadmap/SKILL.md +0 -8
  9. package/.agents/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -248
  10. package/.agents/skills/team-coordinate/specs/role-spec-template.md +197 -198
  11. package/.agents/skills/team-roadmap-dev/SKILL.md +164 -164
  12. package/.agents/skills/team-roadmap-dev/specs/team-config.json +1 -1
  13. package/.agents/skills/team-swarm/roles/analyst/role.md +172 -176
  14. package/.agy/skills/maestro-analyze/SKILL.md +0 -42
  15. package/.agy/skills/maestro-blueprint/SKILL.md +0 -22
  16. package/.agy/skills/maestro-brainstorm/SKILL.md +4 -24
  17. package/.agy/skills/maestro-execute/SKILL.md +1 -1
  18. package/.agy/skills/maestro-grill/SKILL.md +0 -16
  19. package/.agy/skills/maestro-milestone-audit/SKILL.md +0 -15
  20. package/.agy/skills/maestro-plan/SKILL.md +5 -62
  21. package/.agy/skills/maestro-roadmap/SKILL.md +0 -8
  22. package/.agy/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -248
  23. package/.agy/skills/team-coordinate/specs/role-spec-template.md +197 -198
  24. package/.agy/skills/team-roadmap-dev/SKILL.md +141 -153
  25. package/.agy/skills/team-roadmap-dev/specs/team-config.json +1 -1
  26. package/.agy/skills/team-swarm/roles/analyst/role.md +172 -176
  27. package/.claude/commands/maestro-analyze.md +0 -42
  28. package/.claude/commands/maestro-blueprint.md +0 -22
  29. package/.claude/commands/maestro-brainstorm.md +4 -24
  30. package/.claude/commands/maestro-execute.md +1 -1
  31. package/.claude/commands/maestro-grill.md +0 -16
  32. package/.claude/commands/maestro-milestone-audit.md +0 -15
  33. package/.claude/commands/maestro-plan.md +5 -62
  34. package/.claude/commands/maestro-roadmap.md +0 -8
  35. package/.claude/skills/team-adversarial-swarm/workflows/wf-swarm-synthesize.js +248 -248
  36. package/.claude/skills/team-coordinate/specs/role-spec-template.md +197 -198
  37. package/.claude/skills/team-roadmap-dev/SKILL.md +169 -169
  38. package/.claude/skills/team-roadmap-dev/specs/team-config.json +1 -1
  39. package/.claude/skills/team-swarm/roles/analyst/role.md +181 -185
  40. package/dashboard/dist-server/src/commands/install-backend.js +31 -16
  41. package/dashboard/dist-server/src/commands/install-backend.js.map +1 -1
  42. package/dashboard/dist-server/src/core/component-defs.js +25 -0
  43. package/dashboard/dist-server/src/core/component-defs.js.map +1 -1
  44. package/dashboard/dist-server/src/tools/spec-loader.js +7 -3
  45. package/dashboard/dist-server/src/tools/spec-loader.js.map +1 -1
  46. package/dist/src/commands/install-backend.d.ts.map +1 -1
  47. package/dist/src/commands/install-backend.js +31 -16
  48. package/dist/src/commands/install-backend.js.map +1 -1
  49. package/dist/src/core/component-defs.d.ts.map +1 -1
  50. package/dist/src/core/component-defs.js +25 -0
  51. package/dist/src/core/component-defs.js.map +1 -1
  52. package/dist/src/tools/spec-loader.d.ts.map +1 -1
  53. package/dist/src/tools/spec-loader.js +7 -3
  54. package/dist/src/tools/spec-loader.js.map +1 -1
  55. package/dist/src/utils/update-notices.js +11 -0
  56. package/dist/src/utils/update-notices.js.map +1 -1
  57. package/package.json +1 -1
  58. package/workflows/agy-instructions.md +147 -161
  59. package/workflows/claude-instructions.md +100 -48
  60. package/workflows/codex-instructions.md +147 -161
  61. package/workflows/execute.md +4 -3
  62. package/workflows/explore-usage.md +41 -81
  63. package/workflows/grill.md +11 -0
  64. package/workflows/milestone-audit.md +8 -0
  65. package/workflows/odyssey-base-codex.md +115 -116
  66. package/workflows/odyssey-base.md +89 -91
  67. package/workflows/plan.md +6 -0
@@ -1,248 +1,248 @@
1
- export const meta = {
2
- name: 'wf-swarm-synthesize',
3
- description: 'Adversarial 3-perspective synthesis of swarm results with arbitrator',
4
- whenToUse: 'After swarm converges: synthesize best solution via 3 perspectives + arbitrated final report',
5
- phases: [
6
- { title: 'Analyze', detail: '3 parallel analysts: why-it-won, stability, caveats' },
7
- { title: 'Arbitrate', detail: 'Arbitrator synthesizes perspectives into best-solution report' },
8
- ],
9
- }
10
-
11
- const PERSPECTIVE_SCHEMA = {
12
- type: 'object',
13
- properties: {
14
- perspective: { type: 'string' },
15
- assessment: { type: 'string' },
16
- key_findings: {
17
- type: 'array',
18
- items: {
19
- type: 'object',
20
- properties: {
21
- finding: { type: 'string' },
22
- evidence: { type: 'string' },
23
- significance: { type: 'string', enum: ['critical', 'important', 'minor'] },
24
- },
25
- required: ['finding', 'evidence', 'significance'],
26
- },
27
- },
28
- confidence: { type: 'number', minimum: 0, maximum: 100 },
29
- verdict: { type: 'string' },
30
- },
31
- required: ['perspective', 'assessment', 'key_findings', 'confidence', 'verdict'],
32
- }
33
-
34
- const SYNTHESIS_SCHEMA = {
35
- type: 'object',
36
- properties: {
37
- title: { type: 'string' },
38
- best_solution: {
39
- type: 'object',
40
- properties: {
41
- path: { type: 'array', items: { type: 'string' } },
42
- score: { type: 'number' },
43
- iteration: { type: 'number' },
44
- ant_id: { type: 'string' },
45
- summary: { type: 'string' },
46
- evidence_chain: { type: 'array', items: { type: 'object', properties: { source: { type: 'string' }, finding: { type: 'string' } }, required: ['source', 'finding'] } },
47
- },
48
- required: ['summary'],
49
- },
50
- why_it_won: { type: 'string' },
51
- pivotal_decisions: {
52
- type: 'array',
53
- items: {
54
- type: 'object',
55
- properties: {
56
- decision: { type: 'string' },
57
- pheromone_guided: { type: 'boolean' },
58
- impact: { type: 'string' },
59
- },
60
- required: ['decision', 'impact'],
61
- },
62
- },
63
- runner_ups: {
64
- type: 'array',
65
- items: {
66
- type: 'object',
67
- properties: {
68
- ant_id: { type: 'string' },
69
- path: { type: 'array', items: { type: 'string' } },
70
- score: { type: 'number' },
71
- diff_from_best: { type: 'string' },
72
- },
73
- required: ['ant_id', 'score', 'diff_from_best'],
74
- },
75
- },
76
- convergence_story: { type: 'string' },
77
- caveats: { type: 'array', items: { type: 'string' } },
78
- adversarial_assessment: {
79
- type: 'object',
80
- properties: {
81
- stability_verdict: { type: 'string' },
82
- caveat_severity: { type: 'string', enum: ['none', 'minor', 'significant', 'critical'] },
83
- confidence_in_result: { type: 'number' },
84
- decisive_perspective: { type: 'string' },
85
- },
86
- required: ['stability_verdict', 'caveat_severity', 'confidence_in_result'],
87
- },
88
- executive_summary: { type: 'string' },
89
- },
90
- required: ['title', 'best_solution', 'why_it_won', 'runner_ups', 'convergence_story', 'caveats', 'adversarial_assessment', 'executive_summary'],
91
- }
92
-
93
- const best = args?.best || {}
94
- const topK = args?.top_k || []
95
- const convergenceStory = args?.convergence_story || ''
96
- const objective = args?.objective || ''
97
- const totalIterations = args?.total_iterations || 0
98
- const totalAnts = args?.total_ants || 0
99
-
100
- const bestDigest = `Best solution:
101
- Ant: ${best.ant_id || 'unknown'}
102
- Path: ${(best.path || []).join(' → ')}
103
- Score: ${best.score || 'unknown'}
104
- Iteration: ${best.iteration || 'unknown'}
105
- Summary: ${best.summary || 'none'}
106
- Evidence: ${(best.evidence || []).map(e => e.source + ': ' + e.finding).join('; ') || 'none'}`
107
-
108
- const topKDigest = topK.map((t, i) =>
109
- `#${i + 1}: ${t.ant_id} score=${t.score} path=${(t.path || []).join('→')}`
110
- ).join('\n')
111
-
112
- // Phase 1: 3 parallel perspective analysts
113
- phase('Analyze')
114
- log('Launching 3-perspective adversarial analysis...')
115
-
116
- const perspectives = await parallel([
117
- () => agent(
118
- `You are the WHY-IT-WON analyst. Explain why the best solution won.
119
-
120
- Objective: ${objective}
121
- ${bestDigest}
122
-
123
- Runner-ups:
124
- ${topKDigest || 'None available'}
125
-
126
- Convergence: ${convergenceStory}
127
- Total iterations: ${totalIterations}, Total ants: ${totalAnts}
128
-
129
- Focus:
130
- 1. Which path decisions were PIVOTAL — where did best diverge from runner-ups?
131
- 2. Which decisions followed pheromone hints vs deviated? Were deviations the key?
132
- 3. Is the evidence chain compelling or circumstantial?
133
- 4. Compare best vs #2: what SPECIFIC factor gave best the edge?
134
-
135
- Verdict: one sentence on the quality of the winning strategy.`,
136
- { label: 'analyst:why-won', phase: 'Analyze', schema: PERSPECTIVE_SCHEMA }
137
- ),
138
- () => agent(
139
- `You are the STABILITY analyst. Assess whether this result is robust or lucky.
140
-
141
- Objective: ${objective}
142
- ${bestDigest}
143
-
144
- Runner-ups:
145
- ${topKDigest || 'None available'}
146
-
147
- Convergence: ${convergenceStory}
148
- Total iterations: ${totalIterations}, Total ants: ${totalAnts}
149
-
150
- Focus:
151
- 1. Did MULTIPLE ants find similar solutions? (convergence = robust)
152
- 2. Is the best a lone outlier? (divergence from pack = possibly lucky)
153
- 3. Score gap between #1 and #2: large gap = clear winner, small gap = could flip
154
- 4. If the same swarm ran again, would it find the same answer?
155
- 5. Was convergence triggered by genuine consensus or just timeout?
156
-
157
- Verdict: "robust" / "fragile" / "uncertain" — with evidence.`,
158
- { label: 'analyst:stability', phase: 'Analyze', schema: PERSPECTIVE_SCHEMA }
159
- ),
160
- () => agent(
161
- `You are the CAVEATS analyst. Find every limitation and risk in this result.
162
-
163
- Objective: ${objective}
164
- ${bestDigest}
165
-
166
- Runner-ups:
167
- ${topKDigest || 'None available'}
168
-
169
- Convergence: ${convergenceStory}
170
- Total iterations: ${totalIterations}, Total ants: ${totalAnts}
171
-
172
- Focus:
173
- 1. Search space coverage: was the task space well-explored or did ants cluster?
174
- 2. Evidence quality: single-source claims vs multi-source verification?
175
- 3. Hallucination risk: how many ants were flagged for score inflation?
176
- 4. Solution actionability: can the result be directly applied, or needs more work?
177
- 5. What the swarm DIDN'T explore: are there obvious nodes/paths it missed?
178
- 6. Scaling: would a larger swarm / more iterations have found something better?
179
-
180
- Be THOROUGH — every result has caveats. Honest caveats are more valuable than false confidence.
181
- Verdict: overall risk level of relying on this result.`,
182
- { label: 'analyst:caveats', phase: 'Analyze', schema: PERSPECTIVE_SCHEMA }
183
- ),
184
- ])
185
-
186
- const validPerspectives = perspectives.filter(Boolean)
187
- const perspectiveDigest = validPerspectives.map(p =>
188
- `### ${p.perspective} (confidence: ${p.confidence}%)\n${p.assessment}\nKey findings:\n${p.key_findings.map(f => '- [' + f.significance + '] ' + f.finding).join('\n')}\nVerdict: ${p.verdict}`
189
- ).join('\n\n---\n\n')
190
-
191
- log(`${validPerspectives.length} perspective analyses completed`)
192
-
193
- // Phase 2: Arbitrator synthesizes
194
- phase('Arbitrate')
195
- log('Arbitrator synthesizing final report...')
196
-
197
- const synthesis = await agent(
198
- `You are the ARBITRATOR. Synthesize 3 analyst perspectives into a definitive swarm result report.
199
-
200
- === OBJECTIVE ===
201
- ${objective}
202
-
203
- === BEST SOLUTION ===
204
- ${bestDigest}
205
-
206
- === RUNNER-UPS ===
207
- ${topKDigest || 'None'}
208
-
209
- === 3 ANALYST PERSPECTIVES ===
210
- ${perspectiveDigest}
211
-
212
- === CONVERGENCE ===
213
- ${convergenceStory}
214
- Iterations: ${totalIterations}, Ants: ${totalAnts}
215
-
216
- SYNTHESIZE:
217
- 1. Build the best_solution record with full evidence chain
218
- 2. Write why_it_won from the first analyst's pivotal decision analysis
219
- 3. Extract pivotal_decisions with pheromone guidance flags
220
- 4. Format runner_ups with diff_from_best
221
- 5. Write convergence_story narrative
222
- 6. Compile ALL caveats from the caveats analyst — don't soften them
223
- 7. adversarial_assessment:
224
- - stability_verdict from stability analyst
225
- - caveat_severity: none/minor/significant/critical based on caveats count and severity
226
- - confidence_in_result: weighted from all 3 perspectives
227
- - decisive_perspective: which analyst's findings had the most impact
228
- 8. Write executive_summary (3-4 sentences): what was found, how confident, what to watch out for
229
- 9. Title: concise result title
230
-
231
- Max 150 lines in the generated content. Be sharp, not verbose.`,
232
- { label: 'arbitrate', phase: 'Arbitrate', schema: SYNTHESIS_SCHEMA }
233
- )
234
-
235
- return {
236
- perspectives: validPerspectives,
237
- synthesis: synthesis,
238
- metadata: {
239
- objective: objective,
240
- best_score: best.score,
241
- best_ant: best.ant_id,
242
- total_iterations: totalIterations,
243
- total_ants: totalAnts,
244
- stability_verdict: synthesis ? synthesis.adversarial_assessment.stability_verdict : null,
245
- caveat_severity: synthesis ? synthesis.adversarial_assessment.caveat_severity : null,
246
- confidence: synthesis ? synthesis.adversarial_assessment.confidence_in_result : null,
247
- },
248
- }
1
+ export const meta = {
2
+ name: 'wf-swarm-synthesize',
3
+ description: 'Adversarial 3-perspective synthesis of swarm results with arbitrator',
4
+ whenToUse: 'After swarm converges: synthesize best solution via 3 perspectives + arbitrated final report',
5
+ phases: [
6
+ { title: 'Analyze', detail: '3 parallel analysts: why-it-won, stability, caveats' },
7
+ { title: 'Arbitrate', detail: 'Arbitrator synthesizes perspectives into best-solution report' },
8
+ ],
9
+ }
10
+
11
+ const PERSPECTIVE_SCHEMA = {
12
+ type: 'object',
13
+ properties: {
14
+ perspective: { type: 'string' },
15
+ assessment: { type: 'string' },
16
+ key_findings: {
17
+ type: 'array',
18
+ items: {
19
+ type: 'object',
20
+ properties: {
21
+ finding: { type: 'string' },
22
+ evidence: { type: 'string' },
23
+ significance: { type: 'string', enum: ['critical', 'important', 'minor'] },
24
+ },
25
+ required: ['finding', 'evidence', 'significance'],
26
+ },
27
+ },
28
+ confidence: { type: 'number', minimum: 0, maximum: 100 },
29
+ verdict: { type: 'string' },
30
+ },
31
+ required: ['perspective', 'assessment', 'key_findings', 'confidence', 'verdict'],
32
+ }
33
+
34
+ const SYNTHESIS_SCHEMA = {
35
+ type: 'object',
36
+ properties: {
37
+ title: { type: 'string' },
38
+ best_solution: {
39
+ type: 'object',
40
+ properties: {
41
+ path: { type: 'array', items: { type: 'string' } },
42
+ score: { type: 'number' },
43
+ iteration: { type: 'number' },
44
+ ant_id: { type: 'string' },
45
+ summary: { type: 'string' },
46
+ evidence_chain: { type: 'array', items: { type: 'object', properties: { source: { type: 'string' }, finding: { type: 'string' } }, required: ['source', 'finding'] } },
47
+ },
48
+ required: ['summary'],
49
+ },
50
+ why_it_won: { type: 'string' },
51
+ pivotal_decisions: {
52
+ type: 'array',
53
+ items: {
54
+ type: 'object',
55
+ properties: {
56
+ decision: { type: 'string' },
57
+ pheromone_guided: { type: 'boolean' },
58
+ impact: { type: 'string' },
59
+ },
60
+ required: ['decision', 'impact'],
61
+ },
62
+ },
63
+ runner_ups: {
64
+ type: 'array',
65
+ items: {
66
+ type: 'object',
67
+ properties: {
68
+ ant_id: { type: 'string' },
69
+ path: { type: 'array', items: { type: 'string' } },
70
+ score: { type: 'number' },
71
+ diff_from_best: { type: 'string' },
72
+ },
73
+ required: ['ant_id', 'score', 'diff_from_best'],
74
+ },
75
+ },
76
+ convergence_story: { type: 'string' },
77
+ caveats: { type: 'array', items: { type: 'string' } },
78
+ adversarial_assessment: {
79
+ type: 'object',
80
+ properties: {
81
+ stability_verdict: { type: 'string' },
82
+ caveat_severity: { type: 'string', enum: ['none', 'minor', 'significant', 'critical'] },
83
+ confidence_in_result: { type: 'number' },
84
+ decisive_perspective: { type: 'string' },
85
+ },
86
+ required: ['stability_verdict', 'caveat_severity', 'confidence_in_result'],
87
+ },
88
+ executive_summary: { type: 'string' },
89
+ },
90
+ required: ['title', 'best_solution', 'why_it_won', 'runner_ups', 'convergence_story', 'caveats', 'adversarial_assessment', 'executive_summary'],
91
+ }
92
+
93
+ const best = args?.best || {}
94
+ const topK = args?.top_k || []
95
+ const convergenceStory = args?.convergence_story || ''
96
+ const objective = args?.objective || ''
97
+ const totalIterations = args?.total_iterations || 0
98
+ const totalAnts = args?.total_ants || 0
99
+
100
+ const bestDigest = `Best solution:
101
+ Ant: ${best.ant_id || 'unknown'}
102
+ Path: ${(best.path || []).join(' → ')}
103
+ Score: ${best.score || 'unknown'}
104
+ Iteration: ${best.iteration || 'unknown'}
105
+ Summary: ${best.summary || 'none'}
106
+ Evidence: ${(best.evidence || []).map(e => e.source + ': ' + e.finding).join('; ') || 'none'}`
107
+
108
+ const topKDigest = topK.map((t, i) =>
109
+ `#${i + 1}: ${t.ant_id} score=${t.score} path=${(t.path || []).join('→')}`
110
+ ).join('\n')
111
+
112
+ // Phase 1: 3 parallel perspective analysts
113
+ phase('Analyze')
114
+ log('Launching 3-perspective adversarial analysis...')
115
+
116
+ const perspectives = await parallel([
117
+ () => agent(
118
+ `You are the WHY-IT-WON analyst. Explain why the best solution won.
119
+
120
+ Objective: ${objective}
121
+ ${bestDigest}
122
+
123
+ Runner-ups:
124
+ ${topKDigest || 'None available'}
125
+
126
+ Convergence: ${convergenceStory}
127
+ Total iterations: ${totalIterations}, Total ants: ${totalAnts}
128
+
129
+ Focus:
130
+ 1. Which path decisions were PIVOTAL — where did best diverge from runner-ups?
131
+ 2. Which decisions followed pheromone hints vs deviated? Were deviations the key?
132
+ 3. Is the evidence chain compelling or circumstantial?
133
+ 4. Compare best vs #2: what SPECIFIC factor gave best the edge?
134
+
135
+ Verdict: one sentence on the quality of the winning strategy.`,
136
+ { label: 'analyst:why-won', phase: 'Analyze', schema: PERSPECTIVE_SCHEMA }
137
+ ),
138
+ () => agent(
139
+ `You are the STABILITY analyst. Assess whether this result is robust or lucky.
140
+
141
+ Objective: ${objective}
142
+ ${bestDigest}
143
+
144
+ Runner-ups:
145
+ ${topKDigest || 'None available'}
146
+
147
+ Convergence: ${convergenceStory}
148
+ Total iterations: ${totalIterations}, Total ants: ${totalAnts}
149
+
150
+ Focus:
151
+ 1. Did MULTIPLE ants find similar solutions? (convergence = robust)
152
+ 2. Is the best a lone outlier? (divergence from pack = possibly lucky)
153
+ 3. Score gap between #1 and #2: large gap = clear winner, small gap = could flip
154
+ 4. If the same swarm ran again, would it find the same answer?
155
+ 5. Was convergence triggered by genuine consensus or just timeout?
156
+
157
+ Verdict: "robust" / "fragile" / "uncertain" — with evidence.`,
158
+ { label: 'analyst:stability', phase: 'Analyze', schema: PERSPECTIVE_SCHEMA }
159
+ ),
160
+ () => agent(
161
+ `You are the CAVEATS analyst. Find every limitation and risk in this result.
162
+
163
+ Objective: ${objective}
164
+ ${bestDigest}
165
+
166
+ Runner-ups:
167
+ ${topKDigest || 'None available'}
168
+
169
+ Convergence: ${convergenceStory}
170
+ Total iterations: ${totalIterations}, Total ants: ${totalAnts}
171
+
172
+ Focus:
173
+ 1. Search space coverage: was the task space well-explored or did ants cluster?
174
+ 2. Evidence quality: single-source claims vs multi-source verification?
175
+ 3. Hallucination risk: how many ants were flagged for score inflation?
176
+ 4. Solution actionability: can the result be directly applied, or needs more work?
177
+ 5. What the swarm DIDN'T explore: are there obvious nodes/paths it missed?
178
+ 6. Scaling: would a larger swarm / more iterations have found something better?
179
+
180
+ Be THOROUGH — every result has caveats. Honest caveats are more valuable than false confidence.
181
+ Verdict: overall risk level of relying on this result.`,
182
+ { label: 'analyst:caveats', phase: 'Analyze', schema: PERSPECTIVE_SCHEMA }
183
+ ),
184
+ ])
185
+
186
+ const validPerspectives = perspectives.filter(Boolean)
187
+ const perspectiveDigest = validPerspectives.map(p =>
188
+ `### ${p.perspective} (confidence: ${p.confidence}%)\n${p.assessment}\nKey findings:\n${p.key_findings.map(f => '- [' + f.significance + '] ' + f.finding).join('\n')}\nVerdict: ${p.verdict}`
189
+ ).join('\n\n---\n\n')
190
+
191
+ log(`${validPerspectives.length} perspective analyses completed`)
192
+
193
+ // Phase 2: Arbitrator synthesizes
194
+ phase('Arbitrate')
195
+ log('Arbitrator synthesizing final report...')
196
+
197
+ const synthesis = await agent(
198
+ `You are the ARBITRATOR. Synthesize 3 analyst perspectives into a definitive swarm result report.
199
+
200
+ === OBJECTIVE ===
201
+ ${objective}
202
+
203
+ === BEST SOLUTION ===
204
+ ${bestDigest}
205
+
206
+ === RUNNER-UPS ===
207
+ ${topKDigest || 'None'}
208
+
209
+ === 3 ANALYST PERSPECTIVES ===
210
+ ${perspectiveDigest}
211
+
212
+ === CONVERGENCE ===
213
+ ${convergenceStory}
214
+ Iterations: ${totalIterations}, Ants: ${totalAnts}
215
+
216
+ SYNTHESIZE:
217
+ 1. Build the best_solution record with full evidence chain
218
+ 2. Write why_it_won from the first analyst's pivotal decision analysis
219
+ 3. Extract pivotal_decisions with pheromone guidance flags
220
+ 4. Format runner_ups with diff_from_best
221
+ 5. Write convergence_story narrative
222
+ 6. Compile ALL caveats from the caveats analyst — don't soften them
223
+ 7. adversarial_assessment:
224
+ - stability_verdict from stability analyst
225
+ - caveat_severity: none/minor/significant/critical based on caveats count and severity
226
+ - confidence_in_result: weighted from all 3 perspectives
227
+ - decisive_perspective: which analyst's findings had the most impact
228
+ 8. Write executive_summary (3-4 sentences): what was found, how confident, what to watch out for
229
+ 9. Title: concise result title
230
+
231
+ Be sharp, not verbose no prose padding; every section earns its place.`,
232
+ { label: 'arbitrate', phase: 'Arbitrate', schema: SYNTHESIS_SCHEMA }
233
+ )
234
+
235
+ return {
236
+ perspectives: validPerspectives,
237
+ synthesis: synthesis,
238
+ metadata: {
239
+ objective: objective,
240
+ best_score: best.score,
241
+ best_ant: best.ant_id,
242
+ total_iterations: totalIterations,
243
+ total_ants: totalAnts,
244
+ stability_verdict: synthesis ? synthesis.adversarial_assessment.stability_verdict : null,
245
+ caveat_severity: synthesis ? synthesis.adversarial_assessment.caveat_severity : null,
246
+ confidence: synthesis ? synthesis.adversarial_assessment.confidence_in_result : null,
247
+ },
248
+ }