role-os 2.1.0 → 2.2.1

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,59 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.2.1
4
+
5
+ ### Added
6
+ - **`roleos audit` CLI** — first-class entry point for deep audit with subcommands: `audit`, `audit manifest`, `audit manifest --generate`, `audit status`, `audit verify`
7
+ - **Shared state machine** (`src/state-machine.mjs`) — canonical step/run transitions shared by both runners
8
+ - **Shared tool profiles** (`src/tool-profiles.mjs`) — extracted from dispatch.mjs to break trial→dispatch coupling
9
+
10
+ ### Fixed
11
+ - **P3-1:** Cycle detection in composite execution (`detectCycles` + visited-set guard in `findUnreachable`)
12
+ - **P3-2:** Dual-active guard in `startNext`/`startNextStep` prevents two steps active simultaneously
13
+ - **P3-3:** Atomic persistence — `saveRun` writes to temp file then renames
14
+ - **P4-1:** Dependency Auditor has own artifact contract (`dependency-audit`), pack handoff corrected
15
+ - **P4-2:** `partitionBrief` returns topic-only for unknown roles instead of full brief
16
+ - **P4-3:** Atom kind normalization layer bridges scout `.kind` and atom `.claim_kind`
17
+ - **P4-4:** `/dev/stdin` → `readFileSync(0)` for Windows compatibility in all 5 hooks
18
+ - **P4-5:** TOOL_PROFILES extracted to shared module, eliminating trial→dispatch coupling
19
+ - Node 18 compatibility fix for `import.meta.dirname` in deep-audit-proof test
20
+
21
+ ### Tests
22
+ - 18 new tests (audit-cmd, audit-p5, deep-audit-proof) — total: 954
23
+
24
+ ## 2.2.0
25
+
26
+ ### Added
27
+
28
+ #### Deep Audit Mission — Runner-Native Componentized Repo Audit
29
+
30
+ - **Deep audit mission** — 8th mission in the library. Decomposes a repo into bounded components, dispatches one auditor per component, inspects seams from the dependency graph, assesses test truth, then synthesizes into a ranked verdict and action plan.
31
+ - **Dynamic dispatch** — missions with `dynamicDispatch` field now expand from a manifest at runtime. `createRun("deep-audit", task, { manifest })` creates N + M + K + 3 steps from the repo graph instead of a fixed static chain. A 6-component / 8-boundary repo produces 23 steps; a 10-component / 5-boundary repo produces 28.
32
+ - **4 new audit roles** — Component Auditor, Seam Auditor, Test Truth Auditor, Audit Synthesizer. Each with full artifact contracts, tool profiles, and role definitions in starter-pack.
33
+ - **Deep-audit pack** — 9th team pack with scaling chain order, dispatch defaults, and mismatch guards.
34
+ - **Artifact validation at execution boundaries** — `validateArtifact()` now runs on every step completion in both `run.mjs` and `mission-run.mjs`. Validation results are attached to the step object. Warn, don't block.
35
+ - **Proof run test suite** — `test/deep-audit-proof.test.mjs` proves the full runner-native lifecycle against the real audit-manifest.json: step creation, parcel identity, validation, escalation, partial failure, scaling formula, and report generation.
36
+
37
+ ### Fixed
38
+
39
+ - **Critical: "approve" vs "accept" verdict mismatch** — `evidence.mjs:195` checked `!== "approve"` but the enum defines `"accept"`. Every accept verdict generated a spurious warning. Tests masked it via substring matching. Fixed to `"accept"` with hardened exact-assertion tests.
40
+ - **Dead imports removed** — `TEAM_PACKS` and `ROLE_ARTIFACT_CONTRACTS` in mission-run.mjs, `TEAM_PACKS` in run.mjs, `scoreRole` and `MIN_SCORE_THRESHOLD` in trial.mjs were imported but never used.
41
+ - **Warning message terminology** — all evidence warning messages now use "accept" instead of "approve" consistently.
42
+
43
+ ### Changed
44
+
45
+ - Mission count: 7 → 8
46
+ - Role count: 50 → 54 (4 deep audit roles)
47
+ - Pack count: 8 → 9
48
+ - Artifact contract count: 30 → 34 (4 new audit role contracts)
49
+ - Test count: 905 → 936
50
+
51
+ ### Evidence
52
+
53
+ - Self-audit dogfood: 128 findings (1 critical, 11 high, 39 medium) across 6 component parcels, 8 boundary seams, and 31 test files
54
+ - Runner-native proof run: 23 dynamic steps from real manifest, full lifecycle, all green
55
+ - Scaling formula verified: 2N + K + 3 holds for manifests of 3, 6, 10, and 15 components
56
+
3
57
  ## 2.1.0
4
58
 
5
59
  ### 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 50 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.
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.
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). 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. 7 calibrated team packs with auto-selection and mismatch guards.
49
- 3. **Free routing** — when the task is novel, mixed, or uncertain. Scores all 31 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). 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.
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
- ## 50 roles across 8 packs
106
+ ## 54 roles across 9 packs
107
107
 
108
108
  | Pack | Roles |
109
109
  |------|-------|
@@ -115,6 +115,7 @@ Order: Shipcheck first, then full treatment. No v1.0.0 without passing hard gate
115
115
  | **Product** (3) | Feedback Synthesizer, Roadmap Prioritizer, Spec Writer |
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
+ | **Deep Audit** (4) | Component Auditor, Test Truth Auditor, Seam Auditor, Audit Synthesizer |
118
119
 
119
120
  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.
120
121
 
@@ -133,6 +134,12 @@ roleos complete artifact.md # Complete with artifact
133
134
  roleos explain # Show full state
134
135
  roleos report # Completion report
135
136
 
137
+ # Deep audit:
138
+ roleos audit manifest --generate # Create audit-manifest.json
139
+ roleos audit # Start component-level deep audit
140
+ roleos audit status # Check audit progress
141
+ roleos audit verify # Verify manifest and outputs
142
+
136
143
  # Or go manual:
137
144
  roleos start "fix the crash" # Entry decision only (no run)
138
145
  roleos packet new feature
@@ -206,18 +213,21 @@ role-os/
206
213
  entry-cmd.mjs ← `roleos start` CLI command
207
214
  run.mjs ← Persistent run engine: create → step → pause → resume → report
208
215
  run-cmd.mjs ← `roleos run/resume/next/explain/complete/fail` + interventions
209
- mission.mjs ← 7 named mission types (feature, bugfix, treatment, docs, security, research, brainstorm)
216
+ mission.mjs ← 8 named mission types (feature, bugfix, treatment, docs, security, research, brainstorm, deep-audit)
210
217
  mission-run.mjs ← Mission runner: create → step → complete → report
211
218
  mission-cmd.mjs ← `roleos mission` CLI commands
212
- route.mjs 31-role routing + dynamic chain builder
213
- packs.mjs ← 7 calibrated team packs + auto-selection
219
+ audit-cmd.mjs `roleos audit` deep audit entry point with manifest generation
220
+ route.mjs ← 54-role routing + dynamic chain builder
221
+ packs.mjs ← 9 calibrated team packs + auto-selection
214
222
  conflicts.mjs ← 4-pass conflict detection
215
223
  escalation.mjs ← Auto-routing for blocked/rejected/split
216
224
  evidence.mjs ← Structured evidence + role-aware requirements
217
225
  dispatch.mjs ← Runtime dispatch manifests for multi-claude
218
- artifacts.mjs 30 per-role artifact contracts + 7 pack handoffs
226
+ tool-profiles.mjs Per-role tool sandboxing (shared by dispatch + trial)
227
+ state-machine.mjs ← Canonical step/run transition maps
228
+ artifacts.mjs ← Per-role artifact contracts + pack handoffs
219
229
  decompose.mjs ← Composite task detection + splitting
220
- composite.mjs ← Dependency-ordered execution + recovery
230
+ composite.mjs ← Dependency-ordered execution + recovery + cycle detection
221
231
  replan.mjs ← Mid-run adaptive replanning
222
232
  calibration.mjs ← Outcome recording + weight tuning
223
233
  hooks.mjs ← 5 lifecycle hooks for runtime enforcement
@@ -225,7 +235,7 @@ role-os/
225
235
  brainstorm.mjs ← Evidence modes, request validation, finding/synthesis/judge schemas
226
236
  brainstorm-roles.mjs ← Role-native schemas, input partitioning, blindspot enforcement, cross-exam
227
237
  brainstorm-render.mjs ← Two-layer rendering: lexical bans, render schemas, debate transcript
228
- test/ ← 894 tests across 30 test files
238
+ test/ ← 954 tests across 33 test files
229
239
  starter-pack/ ← Drop-in role contracts, policies, schemas, workflows
230
240
  ```
231
241
 
@@ -237,28 +247,29 @@ Role OS operates **locally only**. It copies markdown templates and writes packe
237
247
 
238
248
  | Layer | What it does | Status |
239
249
  |-------|-------------|--------|
240
- | **Routing** | Scores all 31 roles against packet content, explains recommendations, assesses confidence | ✓ Shipped |
250
+ | **Routing** | Scores all 54 roles against packet content, explains recommendations, assesses confidence | ✓ Shipped |
241
251
  | **Chain builder** | Assembles phase-ordered chains from scored roles, packet-type biased not template-locked | ✓ Shipped |
242
252
  | **Conflict detection** | 4-pass validation: hard conflicts, sequence, redundancy, coverage gaps. Repair suggestions. | ✓ Shipped |
243
253
  | **Escalation** | Auto-routes blocked/rejected/split work to the right resolver with reason + required artifact | ✓ Shipped |
244
254
  | **Evidence** | Role-aware structured evidence in verdicts. Sufficiency checks. 12 evidence kinds. | ✓ Shipped |
245
255
  | **Dispatch** | Generates execution manifests for multi-claude. Per-role tool profiles, system prompts, budgets. | ✓ Shipped |
246
256
  | **Trials** | Full roster proven: 30/30 gold-task + 5/5 negative trials. 7 pack trials complete. | ✓ Complete |
247
- | **Team Packs** | 7 calibrated packs with auto-selection, mismatch guards, and free-routing fallback. | ✓ Shipped |
257
+ | **Team Packs** | 9 calibrated packs with auto-selection, mismatch guards, and free-routing fallback. | ✓ Shipped |
248
258
  | **Outcome calibration** | Records run outcomes, tunes pack/role weights from results, adjusts confidence thresholds. | ✓ Shipped |
249
259
  | **Mixed-task decomposition** | Detects composite work, splits into child packets, assigns packs, preserves dependencies. | ✓ Shipped |
250
260
  | **Composite execution** | Runs child packets in dependency order with artifact passing, branch recovery, and synthesis. | ✓ Shipped |
251
261
  | **Adaptive replanning** | Mid-run scope changes, findings, or new requirements update the plan without restarting. | ✓ Shipped |
252
262
  | **Session spine** | `roleos init claude` scaffolds CLAUDE.md, /roleos-route, /roleos-review, /roleos-status. `roleos doctor` verifies wiring. Route cards prove engagement. | ✓ Shipped |
253
263
  | **Hook spine** | 5 lifecycle hooks (SessionStart, PromptSubmit, PreToolUse, SubagentStart, Stop). Advisory enforcement: route card reminders, write-tool gating, subagent role injection, completion audit. | ✓ Shipped |
254
- | **Artifact spine** | 30 per-role artifact contracts. 7 pack handoff contracts. Structural validation. Chain completeness checks. Downstream roles never guess what they received. | ✓ Shipped |
255
- | **Mission library** | 7 named missions (feature-ship, bugfix, treatment, docs-release, security-hardening, research-launch, brainstorm). Each declares pack, role chain, artifact flow, escalation branches, honest-partial definition. All 7 trial-proven. | ✓ Shipped |
264
+ | **Artifact spine** | Per-role artifact contracts. Pack handoff contracts. Structural validation. Chain completeness checks. Downstream roles never guess what they received. | ✓ Shipped |
265
+ | **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 |
256
266
  | **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 |
257
267
  | **Unified entry** | `roleos start` decides mission vs pack vs free routing automatically. Fallback ladder with confidence scores, alternatives, and composite detection. | ✓ Shipped |
258
268
  | **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 |
259
- | **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: 894 tests. | ✓ Shipped |
269
+ | **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 |
270
+ | **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 |
260
271
 
261
- ## 7 missions
272
+ ## 8 missions
262
273
 
263
274
  | Mission | Pack | Roles | When to use |
264
275
  |---------|------|-------|-------------|
@@ -269,6 +280,7 @@ Role OS operates **locally only**. It copies markdown templates and writes packe
269
280
  | `security-hardening` | security | 4 | Threat model, audit, fix vulnerabilities, re-audit, verify |
270
281
  | `research-launch` | research | 4 | Frame question, research, document findings, decide |
271
282
  | `brainstorm` | brainstorm | 9 | Structured multi-perspective inquiry with traceable disagreement and verdict |
283
+ | `deep-audit` | deep-audit | 5 (scales) | Manifest-backed repo audit — worker count scales with repo graph via dynamic dispatch |
272
284
 
273
285
  Each mission includes honest-partial definitions — when work stalls, the system documents what was completed and what remains instead of bluffing completion.
274
286
 
@@ -290,7 +302,27 @@ roleos run "explore product directions for a developer tool discovery platform"
290
302
 
291
303
  - **Chain of custody:** Every rendered sentence traces back to a truth-layer atom. Synthesis directions cite atoms. Cross-exam targets real claim IDs. The dispute graph is the product, not the prose.
292
304
 
293
- **Proven:** v0.4 golden run — 894 tests, full chain of custody verified. See [`examples/golden-run.md`](examples/golden-run.md) for the complete artifact chain.
305
+ **Proven:** v0.4 golden run — full chain of custody verified. See [`examples/golden-run.md`](examples/golden-run.md) for the complete artifact chain.
306
+
307
+ ### Deep audit mission
308
+
309
+ Not a surface scan. The deep audit mission **decomposes a repo into bounded components and dispatches specialist auditors at a scale determined by the repo's own dependency graph.**
310
+
311
+ ```bash
312
+ roleos run "deep audit this repo" --manifest=audit-manifest.json
313
+ # → MISSION: Deep Audit (Manifest-Scaled)
314
+ # Steps: Component Auditor ×6 + Test Truth Auditor ×6 + Seam Auditor ×8 + Synthesizer + Action Plan + Critic = 23 steps
315
+ ```
316
+
317
+ **What makes it different:**
318
+
319
+ - **Dynamic dispatch** — worker count is not fixed. A 10-component repo with 5 boundary clusters produces 28 steps (2×10 + 5 + 3). A 3-component repo produces 12. The scaling formula is `2N + K + 3` where N = components, K = boundaries.
320
+ - **Manifest-backed parcels** — an `audit-manifest.json` defines components (with file paths, line counts, descriptions) and boundaries (from/to with interface descriptions). Each auditor receives only its parcel.
321
+ - **Four role archetypes** — Component Auditor (code truth per module), Test Truth Auditor (tests that prove vs tests that exist), Seam Auditor (integration boundaries from the dependency graph), Audit Synthesizer (ranked verdict + action plan from all parcels).
322
+ - **Artifact validation at every step** — `validateArtifact()` fires on every step completion in both execution paths. Results attached to step objects. The system knows whether each artifact met its contract.
323
+ - **Honest partial** — when budget or scope blocks completion, per-component findings are individually valid. The system synthesizes from whatever completed, never bluffs full coverage.
324
+
325
+ **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.
294
326
 
295
327
  ## Status
296
328
 
@@ -309,6 +341,7 @@ roleos run "explore product directions for a developer tool discovery platform"
309
341
  - **v2.0.0**: Operator friction pass (Phase U) — `roleos run` creates persistent disk-backed runs. Resume, next, explain, complete, fail. Interventions: reroute, escalate, retry, block, reopen. Step-local guidance at every step. Friction measurement. 6 friction trials. 613 tests.
310
342
  - **v2.0.1**: Handbook audit, beginner docs, test count corrections. 617 tests.
311
343
  - **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.
344
+ - **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.
312
345
 
313
346
  ## License
314
347
 
package/bin/roleos.mjs CHANGED
@@ -12,6 +12,7 @@ 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";
15
16
  import { startCommand } from "../src/entry-cmd.mjs";
16
17
  import {
17
18
  runCommand, resumeCommand, nextCommand, explainCommand,
@@ -59,6 +60,11 @@ Usage:
59
60
  roleos artifacts show <role> Show artifact contract for a role
60
61
  roleos artifacts validate <role> <file> Validate a file against a contract
61
62
  roleos artifacts chain <pack> Show pack handoff flow
63
+ roleos audit Start a deep audit on the current repo
64
+ roleos audit manifest Show the audit manifest
65
+ roleos audit manifest --generate Generate a skeleton manifest from src/
66
+ roleos audit status Show audit run progress
67
+ roleos audit verify Verify manifest and audit outputs
62
68
  roleos mission list List all missions
63
69
  roleos mission show <key> Show full mission detail
64
70
  roleos mission suggest <text> Suggest a mission for a task
@@ -181,6 +187,9 @@ try {
181
187
  case "friction":
182
188
  await frictionCommand(args);
183
189
  break;
190
+ case "audit":
191
+ await auditCommand(args);
192
+ break;
184
193
  case "mission":
185
194
  await missionCommand(args);
186
195
  break;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "role-os",
3
- "version": "2.1.0",
4
- "description": "Role OS — a multi-Claude operating system where 50 specialized roles execute work through contracts, conflict detection, escalation, and structured evidence. 8 proven team packs, 7 missions including brainstorm with traceable disagreement and verdict-bearing output.",
3
+ "version": "2.2.1",
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.",
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"],
@@ -256,6 +264,40 @@ export const ROLE_ARTIFACT_CONTRACTS = {
256
264
  consumedBy: [],
257
265
  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.",
258
266
  },
267
+
268
+ // ── Deep Audit ──
269
+ "Component Auditor": {
270
+ artifactType: "component-audit-report",
271
+ requiredSections: ["findings", "what-i-could-not-verify", "adjacent-parcel-risks", "parcel-statistics"],
272
+ optionalSections: [],
273
+ requiredEvidence: ["component-parcel-definition"],
274
+ consumedBy: ["Audit Synthesizer"],
275
+ 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.",
276
+ },
277
+ "Seam Auditor": {
278
+ artifactType: "seam-audit-report",
279
+ requiredSections: ["findings", "false-independence-risks", "content-code-drift", "dependency-direction-assessment"],
280
+ optionalSections: [],
281
+ requiredEvidence: ["boundary-cluster-definition", "component-graph"],
282
+ consumedBy: ["Audit Synthesizer"],
283
+ completionRule: "Every declared boundary inspected. Findings reference both sides. Content-code drift quotes both content claim and code reality.",
284
+ },
285
+ "Test Truth Auditor": {
286
+ artifactType: "test-truth-report",
287
+ requiredSections: ["findings", "untested-but-risky", "ceremonial-tests", "integration-gaps", "test-suite-health-summary"],
288
+ optionalSections: [],
289
+ requiredEvidence: ["test-file-paths", "implementation-file-paths"],
290
+ consumedBy: ["Audit Synthesizer"],
291
+ completionRule: "Distinguishes 'line executed' from 'behavior verified'. Lists source files with no test. Estimates real coverage with reasoning.",
292
+ },
293
+ "Audit Synthesizer": {
294
+ artifactType: "audit-summary",
295
+ requiredSections: ["verdict", "posture", "by-the-numbers", "structurally-sound", "fragile", "dangerous", "dead-weight", "cross-cutting-findings", "contradictions", "audit-gaps"],
296
+ optionalSections: [],
297
+ requiredEvidence: ["component-audit-report", "seam-audit-report", "test-truth-report"],
298
+ consumedBy: ["Critic Reviewer"],
299
+ completionRule: "Reconciles findings across parcels. Cross-cutting findings reference source parcels. Contradictions adjudicated. Action plan groups by root cause and leverage.",
300
+ },
259
301
  };
260
302
 
261
303
  // ── Artifact validation ───────────────────────────────────────────────────────
@@ -346,7 +388,7 @@ export const PACK_HANDOFF_CONTRACTS = {
346
388
  security: {
347
389
  flow: [
348
390
  { role: "Security Reviewer", produces: "security-findings", consumedBy: "Critic Reviewer" },
349
- { role: "Dependency Auditor", produces: "metadata-audit", consumedBy: "Critic Reviewer" },
391
+ { role: "Dependency Auditor", produces: "dependency-audit", consumedBy: "Critic Reviewer" },
350
392
  { role: "Critic Reviewer", produces: "verdict", consumedBy: null },
351
393
  ],
352
394
  },
@@ -398,6 +440,15 @@ export const PACK_HANDOFF_CONTRACTS = {
398
440
  { role: "Critic Reviewer", produces: "verdict", consumedBy: null },
399
441
  ],
400
442
  },
443
+ "deep-audit": {
444
+ flow: [
445
+ { role: "Component Auditor", produces: "component-audit-report", consumedBy: "Audit Synthesizer" },
446
+ { role: "Test Truth Auditor", produces: "test-truth-report", consumedBy: "Audit Synthesizer" },
447
+ { role: "Seam Auditor", produces: "seam-audit-report", consumedBy: "Audit Synthesizer" },
448
+ { role: "Audit Synthesizer", produces: "audit-summary", consumedBy: "Critic Reviewer" },
449
+ { role: "Critic Reviewer", produces: "verdict", consumedBy: null },
450
+ ],
451
+ },
401
452
  };
402
453
 
403
454
  /**