role-os 2.2.0 → 2.3.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 CHANGED
@@ -1,5 +1,49 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.3.0
4
+
5
+ ### Added
6
+
7
+ #### Dogfood Swarm Mission — Multi-Pass Health + Feature Convergence
8
+
9
+ - **Dogfood swarm mission** — 9th mission in the library. Three-stage health pass (bug/security → proactive → humanization) then iterative feature pass with exclusive file ownership, build gates, and user checkpoints. Moves a repo from "works" to "production-ready." Proven on claude-collaborate (35→129 tests, 106 findings fixed, v1.1.0 shipped).
10
+ - **7 new roles** — Swarm Coordinator, Swarm Backend Agent, Swarm Bridge Agent, Swarm Tests Agent, Swarm Infra Agent, Swarm Frontend Agent, Swarm Synthesizer (61 total roles)
11
+ - **Swarm team pack** — 10th pack, 8 roles (7 swarm + Critic Reviewer), with mismatch guards and trial evidence
12
+ - **Two new mission primitives**:
13
+ - `waveLoops` — iterative convergence with exit conditions, max iterations, build gates, and user approval flags
14
+ - `exclusiveOwnership` — strict domain file boundaries enforced by manifest
15
+ - **Dynamic domain dispatch** — scales agent count based on repo structure via `swarm-manifest.json`
16
+ - **`roleos swarm` CLI** — first-class entry point with subcommands: `swarm`, `swarm manifest`, `swarm manifest --generate`, `swarm status`, `swarm findings`, `swarm approve`, `swarm verify`
17
+ - **Domain detection** (`src/swarm/domain-detect.mjs`) — auto-detects repo type (CLI, web, desktop, MCP, monorepo) and generates domain manifests with non-overlapping file ownership
18
+ - **Build gate** (`src/swarm/build-gate.mjs`) — auto-detects build system (Node, Rust, Python, Go) and runs lint → typecheck → test verification after every wave
19
+ - **Evidence persistence bridge** (`src/swarm/persist-bridge.mjs`) — optional connection back to dogfood-labs, converts wave results to dogfood submission + audit DB payloads
20
+ - **7 artifact contracts** — `swarm-gate`, `wave-report` (×5 with domain-specific sections), `swarm-final-report`
21
+ - **Pack handoff contract** for swarm flow
22
+
23
+ ### Tests
24
+ - 97 new tests (swarm core, domain detection, build gate, persist bridge) — total: 1150
25
+
26
+ ## 2.2.1
27
+
28
+ ### Added
29
+ - **`roleos audit` CLI** — first-class entry point for deep audit with subcommands: `audit`, `audit manifest`, `audit manifest --generate`, `audit status`, `audit verify`
30
+ - **Shared state machine** (`src/state-machine.mjs`) — canonical step/run transitions shared by both runners
31
+ - **Shared tool profiles** (`src/tool-profiles.mjs`) — extracted from dispatch.mjs to break trial→dispatch coupling
32
+
33
+ ### Fixed
34
+ - **P3-1:** Cycle detection in composite execution (`detectCycles` + visited-set guard in `findUnreachable`)
35
+ - **P3-2:** Dual-active guard in `startNext`/`startNextStep` prevents two steps active simultaneously
36
+ - **P3-3:** Atomic persistence — `saveRun` writes to temp file then renames
37
+ - **P4-1:** Dependency Auditor has own artifact contract (`dependency-audit`), pack handoff corrected
38
+ - **P4-2:** `partitionBrief` returns topic-only for unknown roles instead of full brief
39
+ - **P4-3:** Atom kind normalization layer bridges scout `.kind` and atom `.claim_kind`
40
+ - **P4-4:** `/dev/stdin` → `readFileSync(0)` for Windows compatibility in all 5 hooks
41
+ - **P4-5:** TOOL_PROFILES extracted to shared module, eliminating trial→dispatch coupling
42
+ - Node 18 compatibility fix for `import.meta.dirname` in deep-audit-proof test
43
+
44
+ ### Tests
45
+ - 18 new tests (audit-cmd, audit-p5, deep-audit-proof) — total: 954
46
+
3
47
  ## 2.2.0
4
48
 
5
49
  ### Added
package/README.md CHANGED
@@ -13,7 +13,7 @@
13
13
  <a href="https://mcp-tool-shop-org.github.io/role-os/"><img src="https://img.shields.io/badge/Landing_Page-live-brightgreen" alt="Landing Page"></a>
14
14
  </p>
15
15
 
16
- A multi-Claude operating system that staffs, routes, validates, and runs work through 54 specialized role contracts. Creates task packets, assembles the right team from scored role matching, detects broken chains before execution, auto-routes recovery when work is blocked or rejected, and requires structured evidence in every verdict. Includes dynamic dispatch for manifest-scaled missions — a 10-component repo automatically becomes 28 auditor steps, not 6.
16
+ A multi-Claude operating system that staffs, routes, validates, and runs work through 61 specialized role contracts. Creates task packets, assembles the right team from scored role matching, detects broken chains before execution, auto-routes recovery when work is blocked or rejected, and requires structured evidence in every verdict. Includes dynamic dispatch for manifest-scaled missions — a 10-component repo automatically becomes 28 auditor steps, not 6. The dogfood swarm mission runs multi-pass convergence: three health stages then iterative feature delivery with exclusive file ownership and build gates.
17
17
 
18
18
  ## What it does
19
19
 
@@ -44,9 +44,9 @@ roleos start "something completely novel"
44
44
 
45
45
  **The fallback ladder:**
46
46
 
47
- 1. **Mission** — when the task matches a proven recurring workflow (bugfix, treatment, feature-ship, docs, security, research, brainstorm, deep-audit). Known role chain, artifact flow, escalation branches, and honest-partial definitions.
48
- 2. **Pack** — when the task is a known family but not a full mission shape. 9 calibrated team packs with auto-selection and mismatch guards.
49
- 3. **Free routing** — when the task is novel, mixed, or uncertain. Scores all 54 roles against packet content and assembles a dynamic chain.
47
+ 1. **Mission** — when the task matches a proven recurring workflow (bugfix, treatment, feature-ship, docs, security, research, brainstorm, deep-audit, dogfood-swarm). Known role chain, artifact flow, escalation branches, and honest-partial definitions.
48
+ 2. **Pack** — when the task is a known family but not a full mission shape. 10 calibrated team packs with auto-selection and mismatch guards.
49
+ 3. **Free routing** — when the task is novel, mixed, or uncertain. Scores all 61 roles against packet content and assembles a dynamic chain.
50
50
 
51
51
  The system never forces work through the wrong abstraction. It explains why it chose each level and offers alternatives.
52
52
 
@@ -103,7 +103,7 @@ Full treatment is a canonical 7-phase protocol defined in Claude project memory
103
103
 
104
104
  Order: Shipcheck first, then full treatment. No v1.0.0 without passing hard gates.
105
105
 
106
- ## 54 roles across 9 packs
106
+ ## 61 roles across 10 packs
107
107
 
108
108
  | Pack | Roles |
109
109
  |------|-------|
@@ -116,6 +116,7 @@ Order: Shipcheck first, then full treatment. No v1.0.0 without passing hard gate
116
116
  | **Research** (4) | UX Researcher, Competitive Analyst, Trend Researcher, User Interview Synthesizer |
117
117
  | **Growth** (4) | Launch Strategist, Content Strategist, Community Manager, Support Triage Lead |
118
118
  | **Deep Audit** (4) | Component Auditor, Test Truth Auditor, Seam Auditor, Audit Synthesizer |
119
+ | **Swarm** (7) | Swarm Coordinator, Swarm Backend Agent, Swarm Bridge Agent, Swarm Tests Agent, Swarm Infra Agent, Swarm Frontend Agent, Swarm Synthesizer |
119
120
 
120
121
  Every role has a full contract: mission, use when, do not use when, expected inputs, required outputs, quality bar, and escalation triggers. Every role is routable — `roleos route` can recommend any of them based on packet content.
121
122
 
@@ -134,6 +135,19 @@ roleos complete artifact.md # Complete with artifact
134
135
  roleos explain # Show full state
135
136
  roleos report # Completion report
136
137
 
138
+ # Deep audit:
139
+ roleos audit manifest --generate # Create audit-manifest.json
140
+ roleos audit # Start component-level deep audit
141
+ roleos audit status # Check audit progress
142
+ roleos audit verify # Verify manifest and outputs
143
+
144
+ # Dogfood swarm:
145
+ roleos swarm manifest --generate # Auto-detect domains from repo structure
146
+ roleos swarm # Start multi-pass convergence swarm
147
+ roleos swarm status # Check swarm progress by stage
148
+ roleos swarm findings # List findings by severity
149
+ roleos swarm approve # Approve feature gate
150
+
137
151
  # Or go manual:
138
152
  roleos start "fix the crash" # Entry decision only (no run)
139
153
  roleos packet new feature
@@ -207,18 +221,23 @@ role-os/
207
221
  entry-cmd.mjs ← `roleos start` CLI command
208
222
  run.mjs ← Persistent run engine: create → step → pause → resume → report
209
223
  run-cmd.mjs ← `roleos run/resume/next/explain/complete/fail` + interventions
210
- mission.mjs ← 7 named mission types (feature, bugfix, treatment, docs, security, research, brainstorm)
224
+ mission.mjs ← 9 named mission types (feature, bugfix, treatment, docs, security, research, brainstorm, deep-audit, dogfood-swarm)
211
225
  mission-run.mjs ← Mission runner: create → step → complete → report
212
226
  mission-cmd.mjs ← `roleos mission` CLI commands
213
- route.mjs 54-role routing + dynamic chain builder
214
- packs.mjs 9 calibrated team packs + auto-selection
227
+ audit-cmd.mjs `roleos audit` deep audit entry point with manifest generation
228
+ swarm-cmd.mjs `roleos swarm` dogfood swarm entry point with domain detection
229
+ swarm/ ← Domain detection, build gate, evidence persistence bridge
230
+ route.mjs ← 61-role routing + dynamic chain builder
231
+ packs.mjs ← 10 calibrated team packs + auto-selection
215
232
  conflicts.mjs ← 4-pass conflict detection
216
233
  escalation.mjs ← Auto-routing for blocked/rejected/split
217
234
  evidence.mjs ← Structured evidence + role-aware requirements
218
235
  dispatch.mjs ← Runtime dispatch manifests for multi-claude
236
+ tool-profiles.mjs ← Per-role tool sandboxing (shared by dispatch + trial)
237
+ state-machine.mjs ← Canonical step/run transition maps
219
238
  artifacts.mjs ← Per-role artifact contracts + pack handoffs
220
239
  decompose.mjs ← Composite task detection + splitting
221
- composite.mjs ← Dependency-ordered execution + recovery
240
+ composite.mjs ← Dependency-ordered execution + recovery + cycle detection
222
241
  replan.mjs ← Mid-run adaptive replanning
223
242
  calibration.mjs ← Outcome recording + weight tuning
224
243
  hooks.mjs ← 5 lifecycle hooks for runtime enforcement
@@ -226,7 +245,7 @@ role-os/
226
245
  brainstorm.mjs ← Evidence modes, request validation, finding/synthesis/judge schemas
227
246
  brainstorm-roles.mjs ← Role-native schemas, input partitioning, blindspot enforcement, cross-exam
228
247
  brainstorm-render.mjs ← Two-layer rendering: lexical bans, render schemas, debate transcript
229
- test/ ← 936 tests across 31 test files
248
+ test/ ← 1150 tests across 37 test files
230
249
  starter-pack/ ← Drop-in role contracts, policies, schemas, workflows
231
250
  ```
232
251
 
@@ -238,14 +257,14 @@ Role OS operates **locally only**. It copies markdown templates and writes packe
238
257
 
239
258
  | Layer | What it does | Status |
240
259
  |-------|-------------|--------|
241
- | **Routing** | Scores all 54 roles against packet content, explains recommendations, assesses confidence | ✓ Shipped |
260
+ | **Routing** | Scores all 61 roles against packet content, explains recommendations, assesses confidence | ✓ Shipped |
242
261
  | **Chain builder** | Assembles phase-ordered chains from scored roles, packet-type biased not template-locked | ✓ Shipped |
243
262
  | **Conflict detection** | 4-pass validation: hard conflicts, sequence, redundancy, coverage gaps. Repair suggestions. | ✓ Shipped |
244
263
  | **Escalation** | Auto-routes blocked/rejected/split work to the right resolver with reason + required artifact | ✓ Shipped |
245
264
  | **Evidence** | Role-aware structured evidence in verdicts. Sufficiency checks. 12 evidence kinds. | ✓ Shipped |
246
265
  | **Dispatch** | Generates execution manifests for multi-claude. Per-role tool profiles, system prompts, budgets. | ✓ Shipped |
247
266
  | **Trials** | Full roster proven: 30/30 gold-task + 5/5 negative trials. 7 pack trials complete. | ✓ Complete |
248
- | **Team Packs** | 9 calibrated packs with auto-selection, mismatch guards, and free-routing fallback. | ✓ Shipped |
267
+ | **Team Packs** | 10 calibrated packs with auto-selection, mismatch guards, and free-routing fallback. | ✓ Shipped |
249
268
  | **Outcome calibration** | Records run outcomes, tunes pack/role weights from results, adjusts confidence thresholds. | ✓ Shipped |
250
269
  | **Mixed-task decomposition** | Detects composite work, splits into child packets, assigns packs, preserves dependencies. | ✓ Shipped |
251
270
  | **Composite execution** | Runs child packets in dependency order with artifact passing, branch recovery, and synthesis. | ✓ Shipped |
@@ -253,14 +272,15 @@ Role OS operates **locally only**. It copies markdown templates and writes packe
253
272
  | **Session spine** | `roleos init claude` scaffolds CLAUDE.md, /roleos-route, /roleos-review, /roleos-status. `roleos doctor` verifies wiring. Route cards prove engagement. | ✓ Shipped |
254
273
  | **Hook spine** | 5 lifecycle hooks (SessionStart, PromptSubmit, PreToolUse, SubagentStart, Stop). Advisory enforcement: route card reminders, write-tool gating, subagent role injection, completion audit. | ✓ Shipped |
255
274
  | **Artifact spine** | Per-role artifact contracts. Pack handoff contracts. Structural validation. Chain completeness checks. Downstream roles never guess what they received. | ✓ Shipped |
256
- | **Mission library** | 8 named missions (feature-ship, bugfix, treatment, docs-release, security-hardening, research-launch, brainstorm, deep-audit). Each declares pack, role chain, artifact flow, escalation branches, honest-partial definition. | ✓ Shipped |
275
+ | **Mission library** | 9 named missions (feature-ship, bugfix, treatment, docs-release, security-hardening, research-launch, brainstorm, deep-audit, dogfood-swarm). Each declares pack, role chain, artifact flow, escalation branches, honest-partial definition. | ✓ Shipped |
257
276
  | **Mission runner** | Create runs, step through with tracked state, complete/fail with honest reporting. Blocked-step propagation, out-of-chain escalation warnings, last-step re-opening. | ✓ Shipped |
258
277
  | **Unified entry** | `roleos start` decides mission vs pack vs free routing automatically. Fallback ladder with confidence scores, alternatives, and composite detection. | ✓ Shipped |
259
278
  | **Persistent runs** | `roleos run` creates disk-backed runs. `resume`, `next`, `explain`, `complete`, `fail`. Interventions: reroute, escalate, retry, block, reopen. Step-local guidance. Friction measurement. | ✓ Shipped |
260
279
  | **Brainstorm** | Two-layer architecture: truth (role-native schemas, provenance atoms, cross-exam dispute graph) + render (5 distinct voices, lexical bans, debate transcript). Trace links prove every rendered claim maps to a truth atom. Golden run proven. | ✓ Shipped |
261
280
  | **Deep Audit** | Manifest-scaled repo audit: decompose repo into components, dispatch N auditors + M test truth auditors + K seam auditors from dependency graph, synthesize into ranked verdict and action plan. Dynamic dispatch scales with repo size (2N + K + 3 formula). Runner-native with artifact validation at every step. | ✓ Shipped |
281
+ | **Dogfood Swarm** | Multi-pass convergence: three health stages (bug/security → proactive → humanization) then feature pass. Exclusive file ownership, build gates after every wave, user checkpoints. Domain auto-detection generates manifests. Evidence bridge to dogfood-labs. | ✓ Shipped |
262
282
 
263
- ## 8 missions
283
+ ## 9 missions
264
284
 
265
285
  | Mission | Pack | Roles | When to use |
266
286
  |---------|------|-------|-------------|
@@ -272,6 +292,7 @@ Role OS operates **locally only**. It copies markdown templates and writes packe
272
292
  | `research-launch` | research | 4 | Frame question, research, document findings, decide |
273
293
  | `brainstorm` | brainstorm | 9 | Structured multi-perspective inquiry with traceable disagreement and verdict |
274
294
  | `deep-audit` | deep-audit | 5 (scales) | Manifest-backed repo audit — worker count scales with repo graph via dynamic dispatch |
295
+ | `dogfood-swarm` | swarm | 8 (scales) | Multi-pass convergence: health-a → health-b → health-c → feature → final synthesis |
275
296
 
276
297
  Each mission includes honest-partial definitions — when work stalls, the system documents what was completed and what remains instead of bluffing completion.
277
298
 
@@ -315,6 +336,28 @@ roleos run "deep audit this repo" --manifest=audit-manifest.json
315
336
 
316
337
  **Proven:** Runner-native proof run — 18 tests against real manifest, full lifecycle verified including escalation re-opening and partial failure. Scaling formula verified for 3/6/10/15-component manifests.
317
338
 
339
+ ### Dogfood swarm mission
340
+
341
+ Not a one-pass linter. The dogfood swarm mission **runs a multi-pass convergence protocol that moves a repo from "works" to "production-ready" through three health stages and iterative feature delivery.**
342
+
343
+ ```bash
344
+ roleos swarm
345
+ # → MISSION: Dogfood Swarm (Multi-Pass Convergence)
346
+ # Stages: Health-A → Health-B → Health-C → Feature → Final
347
+ # Domain agents: 3-5 parallel per wave (exclusive file ownership)
348
+ ```
349
+
350
+ **What makes it different:**
351
+
352
+ - **Three-stage health pass** — Stage A fixes bugs and security issues (loop until 0 CRITICAL + 0 HIGH). Stage B applies proactive hardening (user reviews findings). Stage C humanizes the codebase — error messages that help users, reconnection feedback, loading states, accessibility. Each stage is a distinct lens, not the same scan repeated.
353
+ - **Exclusive file ownership** — every domain agent owns specific files via `swarm-manifest.json`. No two agents edit the same file. No merge conflicts. No coordination overhead.
354
+ - **Build gates** — lint + typecheck + test must pass after every wave. The system auto-detects the build system (Node, Rust, Python, Go) and runs the right commands.
355
+ - **User checkpoints** — Health-B and the feature pass require explicit user approval before execution. The system presents findings, the user decides what to build.
356
+ - **Iterative convergence** — stages loop with wave loops until exit conditions are met or max iterations reached. Each wave re-audits from scratch to catch regressions introduced by previous fixes.
357
+ - **Domain auto-detection** — `roleos swarm manifest --generate` detects repo type (CLI, web, desktop, MCP, monorepo) and generates non-overlapping domain assignments.
358
+
359
+ **Proven:** claude-collaborate (2026-03-28) — 35→129 tests, 106 health findings fixed, v1.1.0 shipped. Protocol v2.0 with 9 phases.
360
+
318
361
  ## Status
319
362
 
320
363
  - v0.1–v0.4: Foundation — trials, adoption, treatment pack, starter pack
@@ -333,6 +376,7 @@ roleos run "deep audit this repo" --manifest=audit-manifest.json
333
376
  - **v2.0.1**: Handbook audit, beginner docs, test count corrections. 617 tests.
334
377
  - **v2.1.0**: Brainstorm mission (v0.4) — specialized roles under law, traceable disagreement, verdict-bearing output. Two-layer architecture (truth + render), cross-exam permission matrix, dispute graph, golden run proof. 7 missions, 50 roles, 8 packs. 894 tests.
335
378
  - **v2.2.0**: Deep Audit mission — manifest-scaled repo audit with dynamic dispatch. 4 new audit roles (Component Auditor, Test Truth Auditor, Seam Auditor, Audit Synthesizer). Worker count scales with repo graph (2N + K + 3 formula). Artifact validation wired at both execution boundaries. Runner-native proof run green. accept/approve truth fix in evidence layer. 8 missions, 54 roles, 9 packs. 936 tests.
379
+ - **v2.3.0**: Dogfood Swarm mission — multi-pass convergence (health-a → health-b → health-c → feature → final). 7 new swarm roles (Swarm Coordinator, 5 domain agents, Swarm Synthesizer). Two new mission primitives: waveLoops (iterative convergence) and exclusiveOwnership (domain file boundaries). Dynamic domain dispatch, build gates, `roleos swarm` CLI, domain auto-detection, evidence persistence bridge. 9 missions, 61 roles, 10 packs. 1150 tests.
336
380
 
337
381
  ## License
338
382
 
package/bin/roleos.mjs CHANGED
@@ -12,6 +12,8 @@ import { packsCommand } from "../src/packs-cmd.mjs";
12
12
  import { scaffoldClaude, doctor, formatDoctor } from "../src/session.mjs";
13
13
  import { artifactsCommand } from "../src/artifacts-cmd.mjs";
14
14
  import { missionCommand } from "../src/mission-cmd.mjs";
15
+ import { auditCommand } from "../src/audit-cmd.mjs";
16
+ import { swarmCommand } from "../src/swarm-cmd.mjs";
15
17
  import { startCommand } from "../src/entry-cmd.mjs";
16
18
  import {
17
19
  runCommand, resumeCommand, nextCommand, explainCommand,
@@ -59,6 +61,18 @@ Usage:
59
61
  roleos artifacts show <role> Show artifact contract for a role
60
62
  roleos artifacts validate <role> <file> Validate a file against a contract
61
63
  roleos artifacts chain <pack> Show pack handoff flow
64
+ roleos audit Start a deep audit on the current repo
65
+ roleos audit manifest Show the audit manifest
66
+ roleos audit manifest --generate Generate a skeleton manifest from src/
67
+ roleos audit status Show audit run progress
68
+ roleos audit verify Verify manifest and audit outputs
69
+ roleos swarm Start a dogfood swarm on the current repo
70
+ roleos swarm manifest Show the swarm manifest
71
+ roleos swarm manifest --generate Auto-detect domains and generate manifest
72
+ roleos swarm status Show swarm run progress
73
+ roleos swarm findings List findings by severity
74
+ roleos swarm approve Approve the current feature gate
75
+ roleos swarm verify Verify manifest and run state
62
76
  roleos mission list List all missions
63
77
  roleos mission show <key> Show full mission detail
64
78
  roleos mission suggest <text> Suggest a mission for a task
@@ -181,6 +195,12 @@ try {
181
195
  case "friction":
182
196
  await frictionCommand(args);
183
197
  break;
198
+ case "audit":
199
+ await auditCommand(args);
200
+ break;
201
+ case "swarm":
202
+ await swarmCommand(args);
203
+ break;
184
204
  case "mission":
185
205
  await missionCommand(args);
186
206
  break;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "role-os",
3
- "version": "2.2.0",
4
- "description": "Role OS — a multi-Claude operating system where 54 specialized roles execute work through contracts, conflict detection, escalation, and structured evidence. 9 team packs, 8 missions including deep audit with manifest-scaled dynamic dispatch and brainstorm with traceable disagreement.",
3
+ "version": "2.3.0",
4
+ "description": "Role OS — a multi-Claude operating system where 61 specialized roles execute work through contracts, conflict detection, escalation, and structured evidence. 10 team packs, 9 missions including dogfood swarm (multi-pass convergence), deep audit with manifest-scaled dynamic dispatch, and brainstorm with traceable disagreement.",
5
5
  "homepage": "https://mcp-tool-shop-org.github.io/role-os/",
6
6
  "bugs": {
7
7
  "url": "https://github.com/mcp-tool-shop-org/role-os/issues"
package/src/artifacts.mjs CHANGED
@@ -106,6 +106,14 @@ export const ROLE_ARTIFACT_CONTRACTS = {
106
106
  consumedBy: ["Backend Engineer", "Coverage Auditor", "Security Reviewer"],
107
107
  completionRule: "Entrypoints listed. Module responsibilities described. Commands documented.",
108
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
+ },
109
117
  "Metadata Curator": {
110
118
  artifactType: "metadata-audit",
111
119
  requiredSections: ["manifest-audit", "registry-alignment"],
@@ -290,6 +298,64 @@ export const ROLE_ARTIFACT_CONTRACTS = {
290
298
  consumedBy: ["Critic Reviewer"],
291
299
  completionRule: "Reconciles findings across parcels. Cross-cutting findings reference source parcels. Contradictions adjudicated. Action plan groups by root cause and leverage.",
292
300
  },
301
+
302
+ // ── Dogfood Swarm ───────────────────────────────────────────────────────────
303
+ "Swarm Coordinator": {
304
+ artifactType: "swarm-gate",
305
+ requiredSections: ["phase", "stage", "wave-count", "findings-summary", "severity-breakdown", "exit-condition-status", "decision"],
306
+ optionalSections: ["build-gate-results", "user-approval-status"],
307
+ requiredEvidence: ["wave-report"],
308
+ consumedBy: ["Swarm Backend Agent", "Swarm Bridge Agent", "Swarm Tests Agent", "Swarm Infra Agent", "Swarm Frontend Agent", "Swarm Synthesizer"],
309
+ 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).",
310
+ },
311
+ "Swarm Backend Agent": {
312
+ artifactType: "wave-report",
313
+ requiredSections: ["findings", "remediations", "files-touched", "build-status"],
314
+ optionalSections: ["architecture-notes"],
315
+ requiredEvidence: [],
316
+ consumedBy: ["Swarm Coordinator"],
317
+ completionRule: "Every file in assigned scope inspected. Findings severity-triaged. Remediations applied in severity order. Build passes after changes.",
318
+ },
319
+ "Swarm Bridge Agent": {
320
+ artifactType: "wave-report",
321
+ requiredSections: ["findings", "remediations", "files-touched", "build-status"],
322
+ optionalSections: ["integration-notes"],
323
+ requiredEvidence: [],
324
+ consumedBy: ["Swarm Coordinator"],
325
+ completionRule: "Every file in assigned scope inspected. Findings severity-triaged. Remediations applied in severity order. Build passes after changes.",
326
+ },
327
+ "Swarm Tests Agent": {
328
+ artifactType: "wave-report",
329
+ requiredSections: ["findings", "remediations", "files-touched", "build-status", "coverage-delta"],
330
+ optionalSections: ["test-health-notes"],
331
+ requiredEvidence: [],
332
+ consumedBy: ["Swarm Coordinator"],
333
+ completionRule: "Test suite audited for gaps, ceremonial tests, and fixture quality. Coverage delta reported. Build passes after changes.",
334
+ },
335
+ "Swarm Infra Agent": {
336
+ artifactType: "wave-report",
337
+ requiredSections: ["findings", "remediations", "files-touched", "build-status"],
338
+ optionalSections: ["ci-notes", "doc-freshness"],
339
+ requiredEvidence: [],
340
+ consumedBy: ["Swarm Coordinator"],
341
+ completionRule: "CI workflows, config files, and docs inspected. Findings severity-triaged. Build passes after changes.",
342
+ },
343
+ "Swarm Frontend Agent": {
344
+ artifactType: "wave-report",
345
+ requiredSections: ["findings", "remediations", "files-touched", "build-status", "accessibility-issues"],
346
+ optionalSections: ["ux-improvements", "responsive-notes"],
347
+ requiredEvidence: [],
348
+ consumedBy: ["Swarm Coordinator"],
349
+ completionRule: "UI layer audited for bugs, accessibility, and UX. Accessibility issues listed separately. Build passes after changes.",
350
+ },
351
+ "Swarm Synthesizer": {
352
+ artifactType: "swarm-final-report",
353
+ requiredSections: ["executive-summary", "stage-results", "total-findings-fixed", "remaining-items", "test-verification", "recommendation"],
354
+ optionalSections: ["metrics-comparison", "evidence-links"],
355
+ requiredEvidence: ["swarm-gate", "wave-report"],
356
+ consumedBy: ["Critic Reviewer"],
357
+ completionRule: "All stages summarized. Total findings fixed vs remaining tallied. Final test suite run. Recommendation is ship, hold, or re-swarm.",
358
+ },
293
359
  };
294
360
 
295
361
  // ── Artifact validation ───────────────────────────────────────────────────────
@@ -380,7 +446,7 @@ export const PACK_HANDOFF_CONTRACTS = {
380
446
  security: {
381
447
  flow: [
382
448
  { role: "Security Reviewer", produces: "security-findings", consumedBy: "Critic Reviewer" },
383
- { role: "Dependency Auditor", produces: "metadata-audit", consumedBy: "Critic Reviewer" },
449
+ { role: "Dependency Auditor", produces: "dependency-audit", consumedBy: "Critic Reviewer" },
384
450
  { role: "Critic Reviewer", produces: "verdict", consumedBy: null },
385
451
  ],
386
452
  },
@@ -441,6 +507,18 @@ export const PACK_HANDOFF_CONTRACTS = {
441
507
  { role: "Critic Reviewer", produces: "verdict", consumedBy: null },
442
508
  ],
443
509
  },
510
+ swarm: {
511
+ flow: [
512
+ { role: "Swarm Coordinator", produces: "swarm-gate", consumedBy: "Swarm Backend Agent" },
513
+ { role: "Swarm Backend Agent", produces: "wave-report", consumedBy: "Swarm Coordinator" },
514
+ { role: "Swarm Bridge Agent", produces: "wave-report", consumedBy: "Swarm Coordinator" },
515
+ { role: "Swarm Tests Agent", produces: "wave-report", consumedBy: "Swarm Coordinator" },
516
+ { role: "Swarm Infra Agent", produces: "wave-report", consumedBy: "Swarm Coordinator" },
517
+ { role: "Swarm Frontend Agent", produces: "wave-report", consumedBy: "Swarm Coordinator" },
518
+ { role: "Swarm Synthesizer", produces: "swarm-final-report", consumedBy: "Critic Reviewer" },
519
+ { role: "Critic Reviewer", produces: "verdict", consumedBy: null },
520
+ ],
521
+ },
444
522
  };
445
523
 
446
524
  /**