role-os 2.3.1 → 2.5.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.
- package/CHANGELOG.md +472 -437
- package/README.es.md +319 -319
- package/README.fr.md +319 -319
- package/README.hi.md +319 -319
- package/README.it.md +319 -319
- package/README.ja.md +319 -319
- package/README.md +387 -387
- package/README.pt-BR.md +319 -319
- package/README.zh.md +322 -322
- package/bin/roleos.mjs +230 -225
- package/package.json +51 -51
- package/src/artifacts.mjs +693 -647
- package/src/brainstorm-render.mjs +462 -462
- package/src/brainstorm-roles.mjs +817 -817
- package/src/brainstorm.mjs +778 -778
- package/src/citation-panel.mjs +249 -0
- package/src/dispatch.mjs +265 -265
- package/src/mission.mjs +655 -655
- package/src/packs.mjs +467 -467
- package/src/route.mjs +766 -766
- package/src/run-cmd.mjs +408 -408
- package/src/run.mjs +1000 -1000
- package/src/swarm/persist-bridge.mjs +4 -4
- package/src/verify-citations-cmd.mjs +138 -0
- package/src/verify-citations.mjs +522 -0
- package/starter-pack/agents/engineering/caption-auditor.md +61 -0
- package/starter-pack/agents/engineering/monster-taxonomy-verifier.md +62 -0
- package/starter-pack/agents/engineering/red-teamer.md +75 -0
- package/starter-pack/policy/tool-permissions.md +19 -0
package/src/artifacts.mjs
CHANGED
|
@@ -1,647 +1,693 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Artifact Spine — Phase Q (v1.6.0)
|
|
3
|
-
*
|
|
4
|
-
* Every important role produces a declared artifact with a known shape.
|
|
5
|
-
* Downstream roles never guess what they received.
|
|
6
|
-
*
|
|
7
|
-
* 1. Per-role artifact contracts (required sections, evidence, references)
|
|
8
|
-
* 2. Structural validation (completeness, not semantic perfection)
|
|
9
|
-
* 3. Pack-level handoff contracts (expected artifact flow between steps)
|
|
10
|
-
* 4. Composite artifact ledger integration
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
// ── Per-role artifact contracts ───────────────────────────────────────────────
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Each contract defines what a role MUST produce for its handoff to be valid.
|
|
17
|
-
* Not every role needs a contract — only chain-critical roles that hand off
|
|
18
|
-
* to other roles.
|
|
19
|
-
*/
|
|
20
|
-
export const ROLE_ARTIFACT_CONTRACTS = {
|
|
21
|
-
"Product Strategist": {
|
|
22
|
-
artifactType: "strategy-brief",
|
|
23
|
-
requiredSections: ["problem-framing", "scope", "non-goals", "tradeoffs"],
|
|
24
|
-
optionalSections: ["user-value", "risks", "success-criteria"],
|
|
25
|
-
requiredEvidence: [],
|
|
26
|
-
consumedBy: ["Spec Writer", "Orchestrator"],
|
|
27
|
-
completionRule: "All 4 required sections must be present and non-empty.",
|
|
28
|
-
},
|
|
29
|
-
"Spec Writer": {
|
|
30
|
-
artifactType: "implementation-spec",
|
|
31
|
-
requiredSections: ["acceptance-criteria", "edge-cases", "interface-spec"],
|
|
32
|
-
optionalSections: ["data-schema", "nfrs", "open-questions"],
|
|
33
|
-
requiredEvidence: ["strategy-brief"],
|
|
34
|
-
consumedBy: ["Backend Engineer", "Frontend Developer"],
|
|
35
|
-
completionRule: "At least 3 acceptance criteria. Edge cases identified. Interface shape defined.",
|
|
36
|
-
},
|
|
37
|
-
"Backend Engineer": {
|
|
38
|
-
artifactType: "change-plan",
|
|
39
|
-
requiredSections: ["files-to-change", "implementation-approach", "risk-notes"],
|
|
40
|
-
optionalSections: ["test-strategy", "migration-notes"],
|
|
41
|
-
requiredEvidence: ["implementation-spec"],
|
|
42
|
-
consumedBy: ["Test Engineer", "Critic Reviewer"],
|
|
43
|
-
completionRule: "Files named. Approach described. Risks surfaced.",
|
|
44
|
-
},
|
|
45
|
-
"Frontend Developer": {
|
|
46
|
-
artifactType: "change-plan",
|
|
47
|
-
requiredSections: ["files-to-change", "implementation-approach", "risk-notes"],
|
|
48
|
-
optionalSections: ["component-structure", "accessibility-notes"],
|
|
49
|
-
requiredEvidence: ["implementation-spec"],
|
|
50
|
-
consumedBy: ["Test Engineer", "Critic Reviewer"],
|
|
51
|
-
completionRule: "Files named. Approach described. Risks surfaced.",
|
|
52
|
-
},
|
|
53
|
-
"Test Engineer": {
|
|
54
|
-
artifactType: "test-package",
|
|
55
|
-
requiredSections: ["test-plan", "test-cases", "false-confidence-assessment"],
|
|
56
|
-
optionalSections: ["edge-case-coverage", "regression-defense"],
|
|
57
|
-
requiredEvidence: ["change-plan"],
|
|
58
|
-
consumedBy: ["Critic Reviewer"],
|
|
59
|
-
completionRule: "Test plan present. At least 3 test cases. False confidence assessment honest.",
|
|
60
|
-
},
|
|
61
|
-
"Security Reviewer": {
|
|
62
|
-
artifactType: "security-findings",
|
|
63
|
-
requiredSections: ["findings", "severity-assessment", "recommendations"],
|
|
64
|
-
optionalSections: ["threat-model", "exploitation-scenarios"],
|
|
65
|
-
requiredEvidence: ["change-plan"],
|
|
66
|
-
consumedBy: ["Backend Engineer", "Critic Reviewer"],
|
|
67
|
-
completionRule: "Each finding has severity + recommendation. No finding without remediation path.",
|
|
68
|
-
},
|
|
69
|
-
"Coverage Auditor": {
|
|
70
|
-
artifactType: "coverage-report",
|
|
71
|
-
requiredSections: ["well-defended", "poorly-defended", "false-confidence", "priority-recommendations"],
|
|
72
|
-
optionalSections: ["missing-defenses", "regression-vectors"],
|
|
73
|
-
requiredEvidence: [],
|
|
74
|
-
consumedBy: ["Test Engineer", "Critic Reviewer"],
|
|
75
|
-
completionRule: "Coverage honestly assessed. False confidence identified. Priorities ranked.",
|
|
76
|
-
},
|
|
77
|
-
"Docs Architect": {
|
|
78
|
-
artifactType: "doc-map",
|
|
79
|
-
requiredSections: ["page-structure", "content-gaps", "navigation-design"],
|
|
80
|
-
optionalSections: ["getting-started-flow", "search-requirements"],
|
|
81
|
-
requiredEvidence: [],
|
|
82
|
-
consumedBy: ["Metadata Curator", "Release Engineer"],
|
|
83
|
-
completionRule: "Pages listed. Gaps identified. Navigation designed.",
|
|
84
|
-
},
|
|
85
|
-
"Launch Strategist": {
|
|
86
|
-
artifactType: "launch-brief",
|
|
87
|
-
requiredSections: ["launch-sequence", "proof-packaging", "channel-selection", "success-criteria"],
|
|
88
|
-
optionalSections: ["risk-assessment", "what-not-to-say"],
|
|
89
|
-
requiredEvidence: [],
|
|
90
|
-
consumedBy: ["Launch Copywriter"],
|
|
91
|
-
completionRule: "Sequence defined. Proof mapped. Channels selected. Success measurable.",
|
|
92
|
-
},
|
|
93
|
-
"Launch Copywriter": {
|
|
94
|
-
artifactType: "copy-package",
|
|
95
|
-
requiredSections: ["release-notes", "short-announcement"],
|
|
96
|
-
optionalSections: ["npm-description", "social-variants", "messaging-angle"],
|
|
97
|
-
requiredEvidence: ["launch-brief"],
|
|
98
|
-
consumedBy: ["Critic Reviewer"],
|
|
99
|
-
completionRule: "Release notes present. At least one announcement variant.",
|
|
100
|
-
},
|
|
101
|
-
"Repo Researcher": {
|
|
102
|
-
artifactType: "repo-map",
|
|
103
|
-
requiredSections: ["entrypoints", "module-map", "build-test-commands"],
|
|
104
|
-
optionalSections: ["seams", "dependencies"],
|
|
105
|
-
requiredEvidence: [],
|
|
106
|
-
consumedBy: ["Backend Engineer", "Coverage Auditor", "Security Reviewer"],
|
|
107
|
-
completionRule: "Entrypoints listed. Module responsibilities described. Commands documented.",
|
|
108
|
-
},
|
|
109
|
-
"Dependency Auditor": {
|
|
110
|
-
artifactType: "dependency-audit",
|
|
111
|
-
requiredSections: ["vulnerability-summary", "outdated-inventory"],
|
|
112
|
-
optionalSections: ["supply-chain-risks", "update-recommendations", "license-audit"],
|
|
113
|
-
requiredEvidence: [],
|
|
114
|
-
consumedBy: ["Critic Reviewer", "Security Reviewer"],
|
|
115
|
-
completionRule: "Vulnerabilities triaged. Outdated deps inventoried with severity.",
|
|
116
|
-
},
|
|
117
|
-
"Metadata Curator": {
|
|
118
|
-
artifactType: "metadata-audit",
|
|
119
|
-
requiredSections: ["manifest-audit", "registry-alignment"],
|
|
120
|
-
optionalSections: ["badge-verification", "discovery-surface", "recommendations"],
|
|
121
|
-
requiredEvidence: [],
|
|
122
|
-
consumedBy: ["Release Engineer"],
|
|
123
|
-
completionRule: "Package.json audited. Registry alignment checked.",
|
|
124
|
-
},
|
|
125
|
-
"Release Engineer": {
|
|
126
|
-
artifactType: "release-plan",
|
|
127
|
-
requiredSections: ["version-decision", "changelog-draft", "pre-publish-checklist"],
|
|
128
|
-
optionalSections: ["packaging-check", "release-steps"],
|
|
129
|
-
requiredEvidence: [],
|
|
130
|
-
consumedBy: ["Deployment Verifier", "Critic Reviewer"],
|
|
131
|
-
completionRule: "Version decided with rationale. Changelog written. Checklist present.",
|
|
132
|
-
},
|
|
133
|
-
"Deployment Verifier": {
|
|
134
|
-
artifactType: "deployment-report",
|
|
135
|
-
requiredSections: ["live-state-assessment"],
|
|
136
|
-
optionalSections: ["npm-verification", "github-verification", "badge-verification", "translation-check"],
|
|
137
|
-
requiredEvidence: [],
|
|
138
|
-
consumedBy: ["Critic Reviewer"],
|
|
139
|
-
completionRule: "All deployed surfaces checked. Stale/mismatched items named.",
|
|
140
|
-
},
|
|
141
|
-
"Critic Reviewer": {
|
|
142
|
-
artifactType: "verdict",
|
|
143
|
-
requiredSections: ["verdict", "evidence", "required-corrections"],
|
|
144
|
-
optionalSections: ["notes", "next-owner", "chain-assessment"],
|
|
145
|
-
requiredEvidence: [],
|
|
146
|
-
consumedBy: [],
|
|
147
|
-
completionRule: "Verdict stated. Evidence cited. Corrections listed if not accept.",
|
|
148
|
-
},
|
|
149
|
-
"UX Researcher": {
|
|
150
|
-
artifactType: "ux-evaluation",
|
|
151
|
-
requiredSections: ["friction-inventory", "severity-ranking", "recommendations"],
|
|
152
|
-
optionalSections: ["flow-analysis", "heuristic-evaluation"],
|
|
153
|
-
requiredEvidence: [],
|
|
154
|
-
consumedBy: ["Product Strategist", "UI Designer"],
|
|
155
|
-
completionRule: "Friction points identified. Severity ranked. Evidence-based recommendations.",
|
|
156
|
-
},
|
|
157
|
-
"Competitive Analyst": {
|
|
158
|
-
artifactType: "landscape-analysis",
|
|
159
|
-
requiredSections: ["competitor-inventory", "differentiation", "honest-disadvantages"],
|
|
160
|
-
optionalSections: ["positioning-gaps", "recommendations"],
|
|
161
|
-
requiredEvidence: [],
|
|
162
|
-
consumedBy: ["Product Strategist"],
|
|
163
|
-
completionRule: "Competitors listed. Differentiation clear. Disadvantages honest.",
|
|
164
|
-
},
|
|
165
|
-
"Feedback Synthesizer": {
|
|
166
|
-
artifactType: "signal-synthesis",
|
|
167
|
-
requiredSections: ["theme-extraction", "theme-ranking", "confidence-assessment"],
|
|
168
|
-
optionalSections: ["contradictions", "complaint-to-action"],
|
|
169
|
-
requiredEvidence: [],
|
|
170
|
-
consumedBy: ["Product Strategist"],
|
|
171
|
-
completionRule: "Themes extracted. Ranking justified. Confidence assessed.",
|
|
172
|
-
},
|
|
173
|
-
"Refactor Engineer": {
|
|
174
|
-
artifactType: "refactor-plan",
|
|
175
|
-
requiredSections: ["structural-assessment", "module-boundaries", "migration-path"],
|
|
176
|
-
optionalSections: ["duplication-inventory", "proposed-structure"],
|
|
177
|
-
requiredEvidence: [],
|
|
178
|
-
consumedBy: ["Test Engineer", "Critic Reviewer"],
|
|
179
|
-
completionRule: "Current structure assessed. Target boundaries defined. Migration preserves tests.",
|
|
180
|
-
},
|
|
181
|
-
"Support Triage Lead": {
|
|
182
|
-
artifactType: "triage-report",
|
|
183
|
-
requiredSections: ["classification", "priority-assignment", "routing"],
|
|
184
|
-
optionalSections: ["recurring-patterns", "systemic-recommendations"],
|
|
185
|
-
requiredEvidence: [],
|
|
186
|
-
consumedBy: ["Feedback Synthesizer", "Docs Architect"],
|
|
187
|
-
completionRule: "Each item classified. Priority assigned. Route to owner named.",
|
|
188
|
-
},
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
optionalSections: [],
|
|
215
|
-
requiredEvidence: [
|
|
216
|
-
consumedBy: ["
|
|
217
|
-
completionRule:
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
]
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
{
|
|
434
|
-
{
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
{ role: "
|
|
481
|
-
{ role: "
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
{ role: "
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
{ role: "
|
|
495
|
-
{ role: "
|
|
496
|
-
{ role: "
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
{ role: "
|
|
504
|
-
{ role: "
|
|
505
|
-
{ role: "
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
{ role: "
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
{ role: "
|
|
518
|
-
{ role: "
|
|
519
|
-
{ role: "
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
}
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
}
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
*
|
|
574
|
-
*
|
|
575
|
-
* @param {string}
|
|
576
|
-
* @returns {object
|
|
577
|
-
*/
|
|
578
|
-
export function
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Artifact Spine — Phase Q (v1.6.0)
|
|
3
|
+
*
|
|
4
|
+
* Every important role produces a declared artifact with a known shape.
|
|
5
|
+
* Downstream roles never guess what they received.
|
|
6
|
+
*
|
|
7
|
+
* 1. Per-role artifact contracts (required sections, evidence, references)
|
|
8
|
+
* 2. Structural validation (completeness, not semantic perfection)
|
|
9
|
+
* 3. Pack-level handoff contracts (expected artifact flow between steps)
|
|
10
|
+
* 4. Composite artifact ledger integration
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
// ── Per-role artifact contracts ───────────────────────────────────────────────
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Each contract defines what a role MUST produce for its handoff to be valid.
|
|
17
|
+
* Not every role needs a contract — only chain-critical roles that hand off
|
|
18
|
+
* to other roles.
|
|
19
|
+
*/
|
|
20
|
+
export const ROLE_ARTIFACT_CONTRACTS = {
|
|
21
|
+
"Product Strategist": {
|
|
22
|
+
artifactType: "strategy-brief",
|
|
23
|
+
requiredSections: ["problem-framing", "scope", "non-goals", "tradeoffs"],
|
|
24
|
+
optionalSections: ["user-value", "risks", "success-criteria"],
|
|
25
|
+
requiredEvidence: [],
|
|
26
|
+
consumedBy: ["Spec Writer", "Orchestrator"],
|
|
27
|
+
completionRule: "All 4 required sections must be present and non-empty.",
|
|
28
|
+
},
|
|
29
|
+
"Spec Writer": {
|
|
30
|
+
artifactType: "implementation-spec",
|
|
31
|
+
requiredSections: ["acceptance-criteria", "edge-cases", "interface-spec"],
|
|
32
|
+
optionalSections: ["data-schema", "nfrs", "open-questions"],
|
|
33
|
+
requiredEvidence: ["strategy-brief"],
|
|
34
|
+
consumedBy: ["Backend Engineer", "Frontend Developer"],
|
|
35
|
+
completionRule: "At least 3 acceptance criteria. Edge cases identified. Interface shape defined.",
|
|
36
|
+
},
|
|
37
|
+
"Backend Engineer": {
|
|
38
|
+
artifactType: "change-plan",
|
|
39
|
+
requiredSections: ["files-to-change", "implementation-approach", "risk-notes"],
|
|
40
|
+
optionalSections: ["test-strategy", "migration-notes"],
|
|
41
|
+
requiredEvidence: ["implementation-spec"],
|
|
42
|
+
consumedBy: ["Test Engineer", "Critic Reviewer"],
|
|
43
|
+
completionRule: "Files named. Approach described. Risks surfaced.",
|
|
44
|
+
},
|
|
45
|
+
"Frontend Developer": {
|
|
46
|
+
artifactType: "change-plan",
|
|
47
|
+
requiredSections: ["files-to-change", "implementation-approach", "risk-notes"],
|
|
48
|
+
optionalSections: ["component-structure", "accessibility-notes"],
|
|
49
|
+
requiredEvidence: ["implementation-spec"],
|
|
50
|
+
consumedBy: ["Test Engineer", "Critic Reviewer"],
|
|
51
|
+
completionRule: "Files named. Approach described. Risks surfaced.",
|
|
52
|
+
},
|
|
53
|
+
"Test Engineer": {
|
|
54
|
+
artifactType: "test-package",
|
|
55
|
+
requiredSections: ["test-plan", "test-cases", "false-confidence-assessment"],
|
|
56
|
+
optionalSections: ["edge-case-coverage", "regression-defense"],
|
|
57
|
+
requiredEvidence: ["change-plan"],
|
|
58
|
+
consumedBy: ["Critic Reviewer"],
|
|
59
|
+
completionRule: "Test plan present. At least 3 test cases. False confidence assessment honest.",
|
|
60
|
+
},
|
|
61
|
+
"Security Reviewer": {
|
|
62
|
+
artifactType: "security-findings",
|
|
63
|
+
requiredSections: ["findings", "severity-assessment", "recommendations"],
|
|
64
|
+
optionalSections: ["threat-model", "exploitation-scenarios"],
|
|
65
|
+
requiredEvidence: ["change-plan"],
|
|
66
|
+
consumedBy: ["Backend Engineer", "Critic Reviewer"],
|
|
67
|
+
completionRule: "Each finding has severity + recommendation. No finding without remediation path.",
|
|
68
|
+
},
|
|
69
|
+
"Coverage Auditor": {
|
|
70
|
+
artifactType: "coverage-report",
|
|
71
|
+
requiredSections: ["well-defended", "poorly-defended", "false-confidence", "priority-recommendations"],
|
|
72
|
+
optionalSections: ["missing-defenses", "regression-vectors"],
|
|
73
|
+
requiredEvidence: [],
|
|
74
|
+
consumedBy: ["Test Engineer", "Critic Reviewer"],
|
|
75
|
+
completionRule: "Coverage honestly assessed. False confidence identified. Priorities ranked.",
|
|
76
|
+
},
|
|
77
|
+
"Docs Architect": {
|
|
78
|
+
artifactType: "doc-map",
|
|
79
|
+
requiredSections: ["page-structure", "content-gaps", "navigation-design"],
|
|
80
|
+
optionalSections: ["getting-started-flow", "search-requirements"],
|
|
81
|
+
requiredEvidence: [],
|
|
82
|
+
consumedBy: ["Metadata Curator", "Release Engineer"],
|
|
83
|
+
completionRule: "Pages listed. Gaps identified. Navigation designed.",
|
|
84
|
+
},
|
|
85
|
+
"Launch Strategist": {
|
|
86
|
+
artifactType: "launch-brief",
|
|
87
|
+
requiredSections: ["launch-sequence", "proof-packaging", "channel-selection", "success-criteria"],
|
|
88
|
+
optionalSections: ["risk-assessment", "what-not-to-say"],
|
|
89
|
+
requiredEvidence: [],
|
|
90
|
+
consumedBy: ["Launch Copywriter"],
|
|
91
|
+
completionRule: "Sequence defined. Proof mapped. Channels selected. Success measurable.",
|
|
92
|
+
},
|
|
93
|
+
"Launch Copywriter": {
|
|
94
|
+
artifactType: "copy-package",
|
|
95
|
+
requiredSections: ["release-notes", "short-announcement"],
|
|
96
|
+
optionalSections: ["npm-description", "social-variants", "messaging-angle"],
|
|
97
|
+
requiredEvidence: ["launch-brief"],
|
|
98
|
+
consumedBy: ["Critic Reviewer"],
|
|
99
|
+
completionRule: "Release notes present. At least one announcement variant.",
|
|
100
|
+
},
|
|
101
|
+
"Repo Researcher": {
|
|
102
|
+
artifactType: "repo-map",
|
|
103
|
+
requiredSections: ["entrypoints", "module-map", "build-test-commands"],
|
|
104
|
+
optionalSections: ["seams", "dependencies"],
|
|
105
|
+
requiredEvidence: [],
|
|
106
|
+
consumedBy: ["Backend Engineer", "Coverage Auditor", "Security Reviewer"],
|
|
107
|
+
completionRule: "Entrypoints listed. Module responsibilities described. Commands documented.",
|
|
108
|
+
},
|
|
109
|
+
"Dependency Auditor": {
|
|
110
|
+
artifactType: "dependency-audit",
|
|
111
|
+
requiredSections: ["vulnerability-summary", "outdated-inventory"],
|
|
112
|
+
optionalSections: ["supply-chain-risks", "update-recommendations", "license-audit"],
|
|
113
|
+
requiredEvidence: [],
|
|
114
|
+
consumedBy: ["Critic Reviewer", "Security Reviewer"],
|
|
115
|
+
completionRule: "Vulnerabilities triaged. Outdated deps inventoried with severity.",
|
|
116
|
+
},
|
|
117
|
+
"Metadata Curator": {
|
|
118
|
+
artifactType: "metadata-audit",
|
|
119
|
+
requiredSections: ["manifest-audit", "registry-alignment"],
|
|
120
|
+
optionalSections: ["badge-verification", "discovery-surface", "recommendations"],
|
|
121
|
+
requiredEvidence: [],
|
|
122
|
+
consumedBy: ["Release Engineer"],
|
|
123
|
+
completionRule: "Package.json audited. Registry alignment checked.",
|
|
124
|
+
},
|
|
125
|
+
"Release Engineer": {
|
|
126
|
+
artifactType: "release-plan",
|
|
127
|
+
requiredSections: ["version-decision", "changelog-draft", "pre-publish-checklist"],
|
|
128
|
+
optionalSections: ["packaging-check", "release-steps"],
|
|
129
|
+
requiredEvidence: [],
|
|
130
|
+
consumedBy: ["Deployment Verifier", "Critic Reviewer"],
|
|
131
|
+
completionRule: "Version decided with rationale. Changelog written. Checklist present.",
|
|
132
|
+
},
|
|
133
|
+
"Deployment Verifier": {
|
|
134
|
+
artifactType: "deployment-report",
|
|
135
|
+
requiredSections: ["live-state-assessment"],
|
|
136
|
+
optionalSections: ["npm-verification", "github-verification", "badge-verification", "translation-check"],
|
|
137
|
+
requiredEvidence: [],
|
|
138
|
+
consumedBy: ["Critic Reviewer"],
|
|
139
|
+
completionRule: "All deployed surfaces checked. Stale/mismatched items named.",
|
|
140
|
+
},
|
|
141
|
+
"Critic Reviewer": {
|
|
142
|
+
artifactType: "verdict",
|
|
143
|
+
requiredSections: ["verdict", "evidence", "required-corrections"],
|
|
144
|
+
optionalSections: ["notes", "next-owner", "chain-assessment"],
|
|
145
|
+
requiredEvidence: [],
|
|
146
|
+
consumedBy: [],
|
|
147
|
+
completionRule: "Verdict stated. Evidence cited. Corrections listed if not accept.",
|
|
148
|
+
},
|
|
149
|
+
"UX Researcher": {
|
|
150
|
+
artifactType: "ux-evaluation",
|
|
151
|
+
requiredSections: ["friction-inventory", "severity-ranking", "recommendations"],
|
|
152
|
+
optionalSections: ["flow-analysis", "heuristic-evaluation"],
|
|
153
|
+
requiredEvidence: [],
|
|
154
|
+
consumedBy: ["Product Strategist", "UI Designer"],
|
|
155
|
+
completionRule: "Friction points identified. Severity ranked. Evidence-based recommendations.",
|
|
156
|
+
},
|
|
157
|
+
"Competitive Analyst": {
|
|
158
|
+
artifactType: "landscape-analysis",
|
|
159
|
+
requiredSections: ["competitor-inventory", "differentiation", "honest-disadvantages"],
|
|
160
|
+
optionalSections: ["positioning-gaps", "recommendations"],
|
|
161
|
+
requiredEvidence: [],
|
|
162
|
+
consumedBy: ["Product Strategist"],
|
|
163
|
+
completionRule: "Competitors listed. Differentiation clear. Disadvantages honest.",
|
|
164
|
+
},
|
|
165
|
+
"Feedback Synthesizer": {
|
|
166
|
+
artifactType: "signal-synthesis",
|
|
167
|
+
requiredSections: ["theme-extraction", "theme-ranking", "confidence-assessment"],
|
|
168
|
+
optionalSections: ["contradictions", "complaint-to-action"],
|
|
169
|
+
requiredEvidence: [],
|
|
170
|
+
consumedBy: ["Product Strategist"],
|
|
171
|
+
completionRule: "Themes extracted. Ranking justified. Confidence assessed.",
|
|
172
|
+
},
|
|
173
|
+
"Refactor Engineer": {
|
|
174
|
+
artifactType: "refactor-plan",
|
|
175
|
+
requiredSections: ["structural-assessment", "module-boundaries", "migration-path"],
|
|
176
|
+
optionalSections: ["duplication-inventory", "proposed-structure"],
|
|
177
|
+
requiredEvidence: [],
|
|
178
|
+
consumedBy: ["Test Engineer", "Critic Reviewer"],
|
|
179
|
+
completionRule: "Current structure assessed. Target boundaries defined. Migration preserves tests.",
|
|
180
|
+
},
|
|
181
|
+
"Support Triage Lead": {
|
|
182
|
+
artifactType: "triage-report",
|
|
183
|
+
requiredSections: ["classification", "priority-assignment", "routing"],
|
|
184
|
+
optionalSections: ["recurring-patterns", "systemic-recommendations"],
|
|
185
|
+
requiredEvidence: [],
|
|
186
|
+
consumedBy: ["Feedback Synthesizer", "Docs Architect"],
|
|
187
|
+
completionRule: "Each item classified. Priority assigned. Route to owner named.",
|
|
188
|
+
},
|
|
189
|
+
"Red-Teamer": {
|
|
190
|
+
artifactType: "red-team-report",
|
|
191
|
+
requiredSections: [
|
|
192
|
+
"subject-under-test",
|
|
193
|
+
"attack-vectors",
|
|
194
|
+
"attempted-violations",
|
|
195
|
+
"catch-rate",
|
|
196
|
+
"uncaught-breaks",
|
|
197
|
+
"recommendations",
|
|
198
|
+
],
|
|
199
|
+
optionalSections: ["attack-taxonomy", "severity-ranking", "diff-from-prior-run"],
|
|
200
|
+
requiredEvidence: [],
|
|
201
|
+
consumedBy: ["Critic Reviewer"],
|
|
202
|
+
completionRule:
|
|
203
|
+
"Subject under test named. At least 5 attack vectors across 4+ categories. Catch rate computed (caught/attempted). Uncaught breaks itemized with severity and minimal reproduction. Pipelines rejecting 0/N attacks flagged as suspect (probably untested rather than hardened).",
|
|
204
|
+
},
|
|
205
|
+
"Caption Auditor": {
|
|
206
|
+
artifactType: "caption-audit",
|
|
207
|
+
requiredSections: [
|
|
208
|
+
"dataset-scope",
|
|
209
|
+
"rule-compliance-summary",
|
|
210
|
+
"violations",
|
|
211
|
+
"sampling-strategy",
|
|
212
|
+
"recommendations",
|
|
213
|
+
],
|
|
214
|
+
optionalSections: ["strategy-distribution", "trigger-inventory", "duplicate-inventory"],
|
|
215
|
+
requiredEvidence: [],
|
|
216
|
+
consumedBy: ["Critic Reviewer"],
|
|
217
|
+
completionRule:
|
|
218
|
+
"Dataset scope named with manifest/path + record count + caption strategy in force. Per-rule compliance rate computed across declared sample. Each violation cites rule, record id, and minimal caption evidence. Sampling strategy declared (full | N-sampled | stratified) for reproducibility. Recommendations tied to specific rule violations and priority-ranked. Refuses to PASS if 100% compliance with sample size < 5.",
|
|
219
|
+
},
|
|
220
|
+
"Monster Taxonomy Verifier": {
|
|
221
|
+
artifactType: "taxonomy-audit",
|
|
222
|
+
requiredSections: [
|
|
223
|
+
"entries-audited",
|
|
224
|
+
"schema-compliance",
|
|
225
|
+
"missing-fields",
|
|
226
|
+
"lora-separability-assessment",
|
|
227
|
+
"recommendations",
|
|
228
|
+
],
|
|
229
|
+
optionalSections: ["lineage-coverage", "palette-consistency", "scale-distribution"],
|
|
230
|
+
requiredEvidence: [],
|
|
231
|
+
consumedBy: ["Critic Reviewer"],
|
|
232
|
+
completionRule:
|
|
233
|
+
"At least 5 entries audited (or all if fewer in scope). Schema compliance computed per required field with absolute counts and percentages. Missing fields enumerated per entry. LoRA-separability assessment declared explicitly (YES | NO | CONDITIONAL) with blockers named. Recommendations actionable. Entries declaring human_element: true in pure-monster scope are flagged as contamination risk.",
|
|
234
|
+
},
|
|
235
|
+
|
|
236
|
+
// ── Brainstorm mission roles (v0.4) ─────────────────────────────────────────
|
|
237
|
+
//
|
|
238
|
+
// Layer 1: Truth — role-native schemas, provenance atoms, dispute graph
|
|
239
|
+
// Layer 2: Render — human-legible presentation (opt-in, never consumed by synthesis)
|
|
240
|
+
//
|
|
241
|
+
"Context Analyst": {
|
|
242
|
+
artifactType: "context-map",
|
|
243
|
+
requiredSections: ["terms", "category-map", "lineage-claims", "boundary-claims"],
|
|
244
|
+
optionalSections: [],
|
|
245
|
+
requiredEvidence: ["brainstorm-frame"],
|
|
246
|
+
consumedBy: ["Normalizer"],
|
|
247
|
+
completionRule: "3+ terms with adjacency. 2+ categories with examples. 1+ lineage claims with precedent. 1+ boundary claims. No forbidden phrases (blindspot enforced). Rendered as Boundary Memo (taxonomist voice).",
|
|
248
|
+
},
|
|
249
|
+
"User Value Analyst": {
|
|
250
|
+
artifactType: "user-value-map",
|
|
251
|
+
requiredSections: ["jobs", "frictions", "unmet-desires", "willingness-signals"],
|
|
252
|
+
optionalSections: [],
|
|
253
|
+
requiredEvidence: ["brainstorm-frame"],
|
|
254
|
+
consumedBy: ["Normalizer"],
|
|
255
|
+
completionRule: "2+ jobs (actor/situation/outcome). 2+ frictions with severity. 1+ unmet desires. 1+ willingness signals. No forbidden phrases (blindspot enforced). Rendered as Field Notes (ethnographer voice).",
|
|
256
|
+
},
|
|
257
|
+
"Mechanics Analyst": {
|
|
258
|
+
artifactType: "mechanics-map",
|
|
259
|
+
requiredSections: ["loops", "dependencies", "failure-points", "irreducible-mechanisms"],
|
|
260
|
+
optionalSections: [],
|
|
261
|
+
requiredEvidence: ["brainstorm-frame"],
|
|
262
|
+
consumedBy: ["Normalizer"],
|
|
263
|
+
completionRule: "1+ named loops (input/transform/output). 1+ dependencies. 1+ failure points. 1+ irreducible mechanisms. No forbidden phrases (blindspot enforced). Rendered as System Sketch (whiteboard voice).",
|
|
264
|
+
},
|
|
265
|
+
"Positioning Analyst": {
|
|
266
|
+
artifactType: "positioning-map",
|
|
267
|
+
requiredSections: ["substitutes", "wedge-candidates", "category-frame"],
|
|
268
|
+
optionalSections: ["forbidden-claims"],
|
|
269
|
+
requiredEvidence: ["brainstorm-frame"],
|
|
270
|
+
consumedBy: ["Normalizer"],
|
|
271
|
+
completionRule: "1+ substitutes (name/overlap/gap). 1+ wedge candidates (claim/timing/risk). Category frame as single declarative sentence. No forbidden phrases (blindspot enforced). Rendered as Claim Brief (strategist voice).",
|
|
272
|
+
},
|
|
273
|
+
"Contrarian Analyst": {
|
|
274
|
+
artifactType: "challenge-set",
|
|
275
|
+
requiredSections: ["challenges"],
|
|
276
|
+
optionalSections: [],
|
|
277
|
+
requiredEvidence: ["provenance-atoms"],
|
|
278
|
+
consumedBy: ["Normalizer"],
|
|
279
|
+
completionRule: "1+ challenges targeting specific atom IDs. Each has challenge_type, argument, evidence_grade, confidence. Only challenges permitted by cross-exam matrix accepted. Rendered as Cross-Exam Transcript (litigator voice).",
|
|
280
|
+
},
|
|
281
|
+
"Normalizer": {
|
|
282
|
+
artifactType: "provenance-atoms",
|
|
283
|
+
requiredSections: ["atoms", "conflicts", "stats"],
|
|
284
|
+
optionalSections: ["unsupported-high-confidence-flags", "rebuttal-set"],
|
|
285
|
+
requiredEvidence: ["context-map", "user-value-map", "mechanics-map", "positioning-map"],
|
|
286
|
+
consumedBy: ["Contrarian Analyst", "Synthesizer"],
|
|
287
|
+
completionRule: "Every atom carries source_role, source_artifact_type, claim_kind, allowed_challengers. No claim kinds overlap between roles. Rebuttal set: each original analyst defends/narrows/retracts challenged claims.",
|
|
288
|
+
},
|
|
289
|
+
"Synthesizer": {
|
|
290
|
+
artifactType: "synthesis-report",
|
|
291
|
+
requiredSections: ["topic-model", "major-themes", "advancing-directions", "archived-directions"],
|
|
292
|
+
optionalSections: ["tensions", "incubation-directions"],
|
|
293
|
+
requiredEvidence: ["provenance-atoms", "challenge-set", "rebuttal-set"],
|
|
294
|
+
consumedBy: ["Product Expander"],
|
|
295
|
+
completionRule: "Exactly breadth advancing directions. Each cites >= 2 truth-layer atoms (never rendered prose). Tensions reference dispute graph outcomes. Archived directions have reasons.",
|
|
296
|
+
},
|
|
297
|
+
"Product Expander": {
|
|
298
|
+
artifactType: "expanded-concept",
|
|
299
|
+
requiredSections: ["product-shape"],
|
|
300
|
+
optionalSections: ["scenarios", "moat"],
|
|
301
|
+
requiredEvidence: ["synthesis-report"],
|
|
302
|
+
consumedBy: ["Judge"],
|
|
303
|
+
completionRule: "Product shape has target_user, core_mechanism, features, core_loop, smallest_proof. Each concept maps to a synthesis direction.",
|
|
304
|
+
},
|
|
305
|
+
"Judge": {
|
|
306
|
+
artifactType: "judge-report",
|
|
307
|
+
requiredSections: ["disposition", "per-direction", "reasons"],
|
|
308
|
+
optionalSections: ["revision-targets", "revision-guidance"],
|
|
309
|
+
requiredEvidence: ["expanded-concept", "synthesis-report", "brainstorm-frame"],
|
|
310
|
+
consumedBy: [],
|
|
311
|
+
completionRule: "Disposition is accept/revise_expand/revise_synthesize/reject. Verdicts: ready_to_advance/needs_incubation/not_active_now. Actions: build_now/hold_for_followon/archive_but_retain. Revise requires targets.",
|
|
312
|
+
},
|
|
313
|
+
|
|
314
|
+
// ── Deep Audit ──
|
|
315
|
+
"Component Auditor": {
|
|
316
|
+
artifactType: "component-audit-report",
|
|
317
|
+
requiredSections: ["findings", "what-i-could-not-verify", "adjacent-parcel-risks", "parcel-statistics"],
|
|
318
|
+
optionalSections: [],
|
|
319
|
+
requiredEvidence: ["component-parcel-definition"],
|
|
320
|
+
consumedBy: ["Audit Synthesizer"],
|
|
321
|
+
completionRule: "Every file in owned paths read. Findings use standardized schema with severity, confidence, category, file, evidence, impact. Adjacent parcel risks are specific, not generic.",
|
|
322
|
+
},
|
|
323
|
+
"Seam Auditor": {
|
|
324
|
+
artifactType: "seam-audit-report",
|
|
325
|
+
requiredSections: ["findings", "false-independence-risks", "content-code-drift", "dependency-direction-assessment"],
|
|
326
|
+
optionalSections: [],
|
|
327
|
+
requiredEvidence: ["boundary-cluster-definition", "component-graph"],
|
|
328
|
+
consumedBy: ["Audit Synthesizer"],
|
|
329
|
+
completionRule: "Every declared boundary inspected. Findings reference both sides. Content-code drift quotes both content claim and code reality.",
|
|
330
|
+
},
|
|
331
|
+
"Test Truth Auditor": {
|
|
332
|
+
artifactType: "test-truth-report",
|
|
333
|
+
requiredSections: ["findings", "untested-but-risky", "ceremonial-tests", "integration-gaps", "test-suite-health-summary"],
|
|
334
|
+
optionalSections: [],
|
|
335
|
+
requiredEvidence: ["test-file-paths", "implementation-file-paths"],
|
|
336
|
+
consumedBy: ["Audit Synthesizer"],
|
|
337
|
+
completionRule: "Distinguishes 'line executed' from 'behavior verified'. Lists source files with no test. Estimates real coverage with reasoning.",
|
|
338
|
+
},
|
|
339
|
+
"Audit Synthesizer": {
|
|
340
|
+
artifactType: "audit-summary",
|
|
341
|
+
requiredSections: ["verdict", "posture", "by-the-numbers", "structurally-sound", "fragile", "dangerous", "dead-weight", "cross-cutting-findings", "contradictions", "audit-gaps"],
|
|
342
|
+
optionalSections: [],
|
|
343
|
+
requiredEvidence: ["component-audit-report", "seam-audit-report", "test-truth-report"],
|
|
344
|
+
consumedBy: ["Critic Reviewer"],
|
|
345
|
+
completionRule: "Reconciles findings across parcels. Cross-cutting findings reference source parcels. Contradictions adjudicated. Action plan groups by root cause and leverage.",
|
|
346
|
+
},
|
|
347
|
+
|
|
348
|
+
// ── Dogfood Swarm ───────────────────────────────────────────────────────────
|
|
349
|
+
"Swarm Coordinator": {
|
|
350
|
+
artifactType: "swarm-gate",
|
|
351
|
+
requiredSections: ["phase", "stage", "wave-count", "findings-summary", "severity-breakdown", "exit-condition-status", "decision"],
|
|
352
|
+
optionalSections: ["build-gate-results", "user-approval-status"],
|
|
353
|
+
requiredEvidence: ["wave-report"],
|
|
354
|
+
consumedBy: ["Swarm Backend Agent", "Swarm Bridge Agent", "Swarm Tests Agent", "Swarm Infra Agent", "Swarm Frontend Agent", "Swarm Synthesizer"],
|
|
355
|
+
completionRule: "Exit condition evaluated against accumulated findings. Decision is one of: loop (re-run wave), advance (next stage), or halt (max iterations or build gate failure).",
|
|
356
|
+
},
|
|
357
|
+
"Swarm Backend Agent": {
|
|
358
|
+
artifactType: "wave-report",
|
|
359
|
+
requiredSections: ["findings", "remediations", "files-touched", "build-status"],
|
|
360
|
+
optionalSections: ["architecture-notes"],
|
|
361
|
+
requiredEvidence: [],
|
|
362
|
+
consumedBy: ["Swarm Coordinator"],
|
|
363
|
+
completionRule: "Every file in assigned scope inspected. Findings severity-triaged. Remediations applied in severity order. Build passes after changes.",
|
|
364
|
+
},
|
|
365
|
+
"Swarm Bridge Agent": {
|
|
366
|
+
artifactType: "wave-report",
|
|
367
|
+
requiredSections: ["findings", "remediations", "files-touched", "build-status"],
|
|
368
|
+
optionalSections: ["integration-notes"],
|
|
369
|
+
requiredEvidence: [],
|
|
370
|
+
consumedBy: ["Swarm Coordinator"],
|
|
371
|
+
completionRule: "Every file in assigned scope inspected. Findings severity-triaged. Remediations applied in severity order. Build passes after changes.",
|
|
372
|
+
},
|
|
373
|
+
"Swarm Tests Agent": {
|
|
374
|
+
artifactType: "wave-report",
|
|
375
|
+
requiredSections: ["findings", "remediations", "files-touched", "build-status", "coverage-delta"],
|
|
376
|
+
optionalSections: ["test-health-notes"],
|
|
377
|
+
requiredEvidence: [],
|
|
378
|
+
consumedBy: ["Swarm Coordinator"],
|
|
379
|
+
completionRule: "Test suite audited for gaps, ceremonial tests, and fixture quality. Coverage delta reported. Build passes after changes.",
|
|
380
|
+
},
|
|
381
|
+
"Swarm Infra Agent": {
|
|
382
|
+
artifactType: "wave-report",
|
|
383
|
+
requiredSections: ["findings", "remediations", "files-touched", "build-status"],
|
|
384
|
+
optionalSections: ["ci-notes", "doc-freshness"],
|
|
385
|
+
requiredEvidence: [],
|
|
386
|
+
consumedBy: ["Swarm Coordinator"],
|
|
387
|
+
completionRule: "CI workflows, config files, and docs inspected. Findings severity-triaged. Build passes after changes.",
|
|
388
|
+
},
|
|
389
|
+
"Swarm Frontend Agent": {
|
|
390
|
+
artifactType: "wave-report",
|
|
391
|
+
requiredSections: ["findings", "remediations", "files-touched", "build-status", "accessibility-issues"],
|
|
392
|
+
optionalSections: ["ux-improvements", "responsive-notes"],
|
|
393
|
+
requiredEvidence: [],
|
|
394
|
+
consumedBy: ["Swarm Coordinator"],
|
|
395
|
+
completionRule: "UI layer audited for bugs, accessibility, and UX. Accessibility issues listed separately. Build passes after changes.",
|
|
396
|
+
},
|
|
397
|
+
"Swarm Synthesizer": {
|
|
398
|
+
artifactType: "swarm-final-report",
|
|
399
|
+
requiredSections: ["executive-summary", "stage-results", "total-findings-fixed", "remaining-items", "test-verification", "recommendation"],
|
|
400
|
+
optionalSections: ["metrics-comparison", "evidence-links"],
|
|
401
|
+
requiredEvidence: ["swarm-gate", "wave-report"],
|
|
402
|
+
consumedBy: ["Critic Reviewer"],
|
|
403
|
+
completionRule: "All stages summarized. Total findings fixed vs remaining tallied. Final test suite run. Recommendation is ship, hold, or re-swarm.",
|
|
404
|
+
},
|
|
405
|
+
};
|
|
406
|
+
|
|
407
|
+
// ── Artifact validation ───────────────────────────────────────────────────────
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Validate an artifact against its role contract.
|
|
411
|
+
* Checks structural completeness, not semantic quality.
|
|
412
|
+
*
|
|
413
|
+
* @param {string} roleName
|
|
414
|
+
* @param {string} artifactContent - The artifact text
|
|
415
|
+
* @returns {{ valid: boolean, missing: string[], warnings: string[], contract: object|null }}
|
|
416
|
+
*/
|
|
417
|
+
export function validateArtifact(roleName, artifactContent) {
|
|
418
|
+
const contract = ROLE_ARTIFACT_CONTRACTS[roleName];
|
|
419
|
+
if (!contract) {
|
|
420
|
+
return { valid: true, missing: [], warnings: ["No artifact contract defined for this role."], contract: null };
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
const lower = artifactContent.toLowerCase();
|
|
424
|
+
const missing = [];
|
|
425
|
+
const warnings = [];
|
|
426
|
+
|
|
427
|
+
// Check required sections
|
|
428
|
+
for (const section of contract.requiredSections) {
|
|
429
|
+
// Look for the section as a heading or key phrase
|
|
430
|
+
const patterns = [
|
|
431
|
+
section.toLowerCase(),
|
|
432
|
+
section.replace(/-/g, " ").toLowerCase(),
|
|
433
|
+
`## ${section.replace(/-/g, " ")}`.toLowerCase(),
|
|
434
|
+
`### ${section.replace(/-/g, " ")}`.toLowerCase(),
|
|
435
|
+
];
|
|
436
|
+
const found = patterns.some(p => lower.includes(p));
|
|
437
|
+
if (!found) {
|
|
438
|
+
missing.push(section);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
// Check required evidence references
|
|
443
|
+
for (const evidence of contract.requiredEvidence) {
|
|
444
|
+
const patterns = [
|
|
445
|
+
evidence.toLowerCase(),
|
|
446
|
+
evidence.replace(/-/g, " ").toLowerCase(),
|
|
447
|
+
];
|
|
448
|
+
const found = patterns.some(p => lower.includes(p));
|
|
449
|
+
if (!found) {
|
|
450
|
+
warnings.push(`Expected reference to "${evidence}" from upstream role.`);
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
// Check minimum content length (not just headers)
|
|
455
|
+
const contentLines = artifactContent.split("\n").filter(l => l.trim() && !l.trim().startsWith("#"));
|
|
456
|
+
if (contentLines.length < 5) {
|
|
457
|
+
warnings.push("Artifact appears thin — fewer than 5 content lines.");
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
return {
|
|
461
|
+
valid: missing.length === 0,
|
|
462
|
+
missing,
|
|
463
|
+
warnings,
|
|
464
|
+
contract,
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
// ── Pack-level handoff contracts ──────────────────────────────────────────────
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Defines the expected artifact flow for each pack.
|
|
472
|
+
* Each step produces an artifact that the next step consumes.
|
|
473
|
+
*/
|
|
474
|
+
export const PACK_HANDOFF_CONTRACTS = {
|
|
475
|
+
feature: {
|
|
476
|
+
flow: [
|
|
477
|
+
{ role: "Product Strategist", produces: "strategy-brief", consumedBy: "Spec Writer" },
|
|
478
|
+
{ role: "Spec Writer", produces: "implementation-spec", consumedBy: "Backend Engineer" },
|
|
479
|
+
{ role: "Backend Engineer", produces: "change-plan", consumedBy: "Test Engineer" },
|
|
480
|
+
{ role: "Test Engineer", produces: "test-package", consumedBy: "Critic Reviewer" },
|
|
481
|
+
{ role: "Critic Reviewer", produces: "verdict", consumedBy: null },
|
|
482
|
+
],
|
|
483
|
+
},
|
|
484
|
+
bugfix: {
|
|
485
|
+
flow: [
|
|
486
|
+
{ role: "Repo Researcher", produces: "repo-map", consumedBy: "Backend Engineer" },
|
|
487
|
+
{ role: "Backend Engineer", produces: "change-plan", consumedBy: "Test Engineer" },
|
|
488
|
+
{ role: "Test Engineer", produces: "test-package", consumedBy: "Critic Reviewer" },
|
|
489
|
+
{ role: "Critic Reviewer", produces: "verdict", consumedBy: null },
|
|
490
|
+
],
|
|
491
|
+
},
|
|
492
|
+
security: {
|
|
493
|
+
flow: [
|
|
494
|
+
{ role: "Security Reviewer", produces: "security-findings", consumedBy: "Critic Reviewer" },
|
|
495
|
+
{ role: "Dependency Auditor", produces: "dependency-audit", consumedBy: "Critic Reviewer" },
|
|
496
|
+
{ role: "Critic Reviewer", produces: "verdict", consumedBy: null },
|
|
497
|
+
],
|
|
498
|
+
},
|
|
499
|
+
docs: {
|
|
500
|
+
flow: [
|
|
501
|
+
{ role: "Support Triage Lead", produces: "triage-report", consumedBy: "Feedback Synthesizer" },
|
|
502
|
+
{ role: "Feedback Synthesizer", produces: "signal-synthesis", consumedBy: "Docs Architect" },
|
|
503
|
+
{ role: "Docs Architect", produces: "doc-map", consumedBy: "Metadata Curator" },
|
|
504
|
+
{ role: "Metadata Curator", produces: "metadata-audit", consumedBy: "Critic Reviewer" },
|
|
505
|
+
{ role: "Critic Reviewer", produces: "verdict", consumedBy: null },
|
|
506
|
+
],
|
|
507
|
+
},
|
|
508
|
+
launch: {
|
|
509
|
+
flow: [
|
|
510
|
+
{ role: "Launch Strategist", produces: "launch-brief", consumedBy: "Launch Copywriter" },
|
|
511
|
+
{ role: "Launch Copywriter", produces: "copy-package", consumedBy: "Critic Reviewer" },
|
|
512
|
+
{ role: "Critic Reviewer", produces: "verdict", consumedBy: null },
|
|
513
|
+
],
|
|
514
|
+
},
|
|
515
|
+
research: {
|
|
516
|
+
flow: [
|
|
517
|
+
{ role: "Product Strategist", produces: "strategy-brief", consumedBy: "UX Researcher" },
|
|
518
|
+
{ role: "UX Researcher", produces: "ux-evaluation", consumedBy: "Competitive Analyst" },
|
|
519
|
+
{ role: "Competitive Analyst", produces: "landscape-analysis", consumedBy: "Feedback Synthesizer" },
|
|
520
|
+
{ role: "Feedback Synthesizer", produces: "signal-synthesis", consumedBy: "Critic Reviewer" },
|
|
521
|
+
{ role: "Critic Reviewer", produces: "verdict", consumedBy: null },
|
|
522
|
+
],
|
|
523
|
+
},
|
|
524
|
+
brainstorm: {
|
|
525
|
+
flow: [
|
|
526
|
+
{ role: "Context Scout", produces: "scout-finding", consumedBy: "Normalizer" },
|
|
527
|
+
{ role: "User Value Scout", produces: "scout-finding", consumedBy: "Normalizer" },
|
|
528
|
+
{ role: "Creative Leap Scout", produces: "scout-finding", consumedBy: "Normalizer" },
|
|
529
|
+
{ role: "Normalizer", produces: "normalized-finding-set", consumedBy: "Synthesizer" },
|
|
530
|
+
{ role: "Synthesizer", produces: "synthesis-report", consumedBy: "Product Expander" },
|
|
531
|
+
{ role: "Product Expander", produces: "expanded-concept", consumedBy: "Judge" },
|
|
532
|
+
{ role: "Judge", produces: "judge-report", consumedBy: null },
|
|
533
|
+
],
|
|
534
|
+
},
|
|
535
|
+
treatment: {
|
|
536
|
+
flow: [
|
|
537
|
+
{ role: "Repo Researcher", produces: "repo-map", consumedBy: "Security Reviewer" },
|
|
538
|
+
{ role: "Security Reviewer", produces: "security-findings", consumedBy: "Coverage Auditor" },
|
|
539
|
+
{ role: "Coverage Auditor", produces: "coverage-report", consumedBy: "Docs Architect" },
|
|
540
|
+
{ role: "Docs Architect", produces: "doc-map", consumedBy: "Metadata Curator" },
|
|
541
|
+
{ role: "Metadata Curator", produces: "metadata-audit", consumedBy: "Release Engineer" },
|
|
542
|
+
{ role: "Release Engineer", produces: "release-plan", consumedBy: "Deployment Verifier" },
|
|
543
|
+
{ role: "Deployment Verifier", produces: "deployment-report", consumedBy: "Critic Reviewer" },
|
|
544
|
+
{ role: "Critic Reviewer", produces: "verdict", consumedBy: null },
|
|
545
|
+
],
|
|
546
|
+
},
|
|
547
|
+
"deep-audit": {
|
|
548
|
+
flow: [
|
|
549
|
+
{ role: "Component Auditor", produces: "component-audit-report", consumedBy: "Audit Synthesizer" },
|
|
550
|
+
{ role: "Test Truth Auditor", produces: "test-truth-report", consumedBy: "Audit Synthesizer" },
|
|
551
|
+
{ role: "Seam Auditor", produces: "seam-audit-report", consumedBy: "Audit Synthesizer" },
|
|
552
|
+
{ role: "Audit Synthesizer", produces: "audit-summary", consumedBy: "Critic Reviewer" },
|
|
553
|
+
{ role: "Critic Reviewer", produces: "verdict", consumedBy: null },
|
|
554
|
+
],
|
|
555
|
+
},
|
|
556
|
+
swarm: {
|
|
557
|
+
flow: [
|
|
558
|
+
{ role: "Swarm Coordinator", produces: "swarm-gate", consumedBy: "Swarm Backend Agent" },
|
|
559
|
+
{ role: "Swarm Backend Agent", produces: "wave-report", consumedBy: "Swarm Coordinator" },
|
|
560
|
+
{ role: "Swarm Bridge Agent", produces: "wave-report", consumedBy: "Swarm Coordinator" },
|
|
561
|
+
{ role: "Swarm Tests Agent", produces: "wave-report", consumedBy: "Swarm Coordinator" },
|
|
562
|
+
{ role: "Swarm Infra Agent", produces: "wave-report", consumedBy: "Swarm Coordinator" },
|
|
563
|
+
{ role: "Swarm Frontend Agent", produces: "wave-report", consumedBy: "Swarm Coordinator" },
|
|
564
|
+
{ role: "Swarm Synthesizer", produces: "swarm-final-report", consumedBy: "Critic Reviewer" },
|
|
565
|
+
{ role: "Critic Reviewer", produces: "verdict", consumedBy: null },
|
|
566
|
+
],
|
|
567
|
+
},
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
/**
|
|
571
|
+
* Validate a pack's artifact chain — check that each step's output
|
|
572
|
+
* matches what the next step expects.
|
|
573
|
+
*
|
|
574
|
+
* @param {string} packName
|
|
575
|
+
* @param {Record<string, string>} artifacts - Map of role name → artifact content
|
|
576
|
+
* @returns {{ valid: boolean, steps: object[] }}
|
|
577
|
+
*/
|
|
578
|
+
export function validatePackChain(packName, artifacts) {
|
|
579
|
+
const contract = PACK_HANDOFF_CONTRACTS[packName];
|
|
580
|
+
if (!contract) {
|
|
581
|
+
return { valid: false, steps: [{ role: "unknown", status: "error", detail: `No handoff contract for pack "${packName}"` }] };
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
const steps = [];
|
|
585
|
+
let chainValid = true;
|
|
586
|
+
|
|
587
|
+
for (const step of contract.flow) {
|
|
588
|
+
const content = artifacts[step.role];
|
|
589
|
+
if (!content) {
|
|
590
|
+
steps.push({
|
|
591
|
+
role: step.role,
|
|
592
|
+
produces: step.produces,
|
|
593
|
+
status: "missing",
|
|
594
|
+
detail: `No artifact from ${step.role}.`,
|
|
595
|
+
});
|
|
596
|
+
chainValid = false;
|
|
597
|
+
continue;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
const validation = validateArtifact(step.role, content);
|
|
601
|
+
steps.push({
|
|
602
|
+
role: step.role,
|
|
603
|
+
produces: step.produces,
|
|
604
|
+
status: validation.valid ? "valid" : "incomplete",
|
|
605
|
+
missing: validation.missing,
|
|
606
|
+
warnings: validation.warnings,
|
|
607
|
+
detail: validation.valid
|
|
608
|
+
? `${step.produces} is structurally complete.`
|
|
609
|
+
: `Missing sections: ${validation.missing.join(", ")}`,
|
|
610
|
+
});
|
|
611
|
+
|
|
612
|
+
if (!validation.valid) chainValid = false;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
return { valid: chainValid, steps };
|
|
616
|
+
}
|
|
617
|
+
|
|
618
|
+
/**
|
|
619
|
+
* Get the artifact contract for a specific role.
|
|
620
|
+
*
|
|
621
|
+
* @param {string} roleName
|
|
622
|
+
* @returns {object|null}
|
|
623
|
+
*/
|
|
624
|
+
export function getArtifactContract(roleName) {
|
|
625
|
+
return ROLE_ARTIFACT_CONTRACTS[roleName] || null;
|
|
626
|
+
}
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Get the handoff contract for a specific pack.
|
|
630
|
+
*
|
|
631
|
+
* @param {string} packName
|
|
632
|
+
* @returns {object|null}
|
|
633
|
+
*/
|
|
634
|
+
export function getHandoffContract(packName) {
|
|
635
|
+
return PACK_HANDOFF_CONTRACTS[packName] || null;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* Format artifact validation result for display.
|
|
640
|
+
*
|
|
641
|
+
* @param {string} roleName
|
|
642
|
+
* @param {object} validation
|
|
643
|
+
* @returns {string}
|
|
644
|
+
*/
|
|
645
|
+
export function formatArtifactValidation(roleName, validation) {
|
|
646
|
+
const lines = [`Artifact validation — ${roleName}`];
|
|
647
|
+
|
|
648
|
+
if (validation.valid) {
|
|
649
|
+
lines.push(` ✓ Structurally complete`);
|
|
650
|
+
} else {
|
|
651
|
+
lines.push(` ✗ Incomplete — missing: ${validation.missing.join(", ")}`);
|
|
652
|
+
}
|
|
653
|
+
|
|
654
|
+
if (validation.warnings.length > 0) {
|
|
655
|
+
for (const w of validation.warnings) {
|
|
656
|
+
lines.push(` ! ${w}`);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
if (validation.contract) {
|
|
661
|
+
lines.push(` Contract: ${validation.contract.artifactType}`);
|
|
662
|
+
lines.push(` Consumed by: ${validation.contract.consumedBy.join(", ") || "terminal"}`);
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
return lines.join("\n");
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
/**
|
|
669
|
+
* Format pack chain validation for display.
|
|
670
|
+
*
|
|
671
|
+
* @param {string} packName
|
|
672
|
+
* @param {object} chainValidation
|
|
673
|
+
* @returns {string}
|
|
674
|
+
*/
|
|
675
|
+
export function formatPackChain(packName, chainValidation) {
|
|
676
|
+
const lines = [
|
|
677
|
+
`\nPack Chain Validation — ${packName}`,
|
|
678
|
+
`─────────────────────────────────`,
|
|
679
|
+
];
|
|
680
|
+
|
|
681
|
+
for (const step of chainValidation.steps) {
|
|
682
|
+
const icon = step.status === "valid" ? "✓" : step.status === "missing" ? "○" : "!";
|
|
683
|
+
lines.push(` ${icon} ${step.role} → ${step.produces}: ${step.detail}`);
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
lines.push(``);
|
|
687
|
+
lines.push(chainValidation.valid
|
|
688
|
+
? `Chain valid — all artifacts structurally complete.`
|
|
689
|
+
: `Chain incomplete — see above for missing artifacts.`
|
|
690
|
+
);
|
|
691
|
+
|
|
692
|
+
return lines.join("\n");
|
|
693
|
+
}
|