# Dispatch — packs, roles, packets, recovery, price

Load when: composing a context pack, dispatching any role, packeting rows, recovering a dead or turn-capped agent, or pricing a run.

## The run folder

`.claude/state/polygraph/{YYYY-MM-DD-slug}/` is machine-local, never tracked, and deleted when the run closes:

```
partials/{doc}.psv      one per finder — its whole output, no header
findings.psv            the merge, header first — the working copy
malformed.txt           quarantined lines, kept
packets/{doc}.txt       one per applier: `doc: {path}` then row ids and bounce notes
verify-{group}.psv      id|check|confidence|citations|note
apply-{doc}.psv         id|outcome|note
packs/{doc}.md          the context pack each finder and applier reads
```

**Work items pass through files, never through a dispatch call's arguments** — a resumed agent may not carry its arguments, and one that dies on a missing argument dies before it reads anything.

## The context pack — the agent's whole reading list

Write one page per target document before the first dispatch. **Never point an agent at the charter, the backlog, the ownership index, or the findings file** — that hands it a 500 KB read to extract 2 KB of fact, and hands the same read to every other agent in the wave. The pack carries the 2 KB:

| Section | Content |
| --- | --- |
| Target | the doc path; for a plan target, the plan path and the Proposed Changes paths that intersect the files this doc speaks for |
| Code | the files the doc speaks for — the source files whose headers name it, and its `owns:` globs resolved to the files that exist |
| Precedent | the quotations from guardrails, accepted decisions, and doctrine that **name** a subject this doc covers — the naming words only, with `path:line` |
| Already tracked | backlog and register rows that name a subject this doc covers, as `path:line` |
| Rulings | owner answers that bind this subject, verbatim |
| Read budget | the two clauses below, verbatim |

Every pack carries these two clauses:

> Tree state: re-check every citation against today's tree before acting; a claim that fails to reproduce dies as *did not reproduce* — never becomes an edit. READ-ONLY everywhere except your one output file.

> Read budget: the pack is your reading list — read nothing outside it without naming in your return why the pack was insufficient. Grep before you read; never read a file over 20 KB without a line range; read a file once. Compose one shell block per question, not one call per file.

## The roles

| Role | Agent | Receives | Writes | Returns |
| --- | --- | --- | --- | --- |
| Finder | `polygraph-finder` | the pack path, the partial path | `partials/{doc}.psv` — one row per claim, ten fields, no header | ≤ 120 words: the file path, row count, up to three findings, limitations |
| Verifier | `polygraph-verifier` | a queue of `id`, `subject`, `claim` — no evidence, no verdict | `verify-{group}.psv` | ≤ 120 words: the file path and counts per check |
| Applier | `polygraph-applier` | the packet path, the pack path | the packet's docs; `apply-{doc}.psv` | ≤ 120 words: counts per outcome, docs touched, lint result, anything for the register |

Each agent definition carries its role's doctrine and its turn cap; a dispatch names the target and the paths and nothing else. **Findings go in the file, never in the return** — every word returned is re-billed on every later turn of the session.

Where the runtime has no such agent installed, dispatch an independent subagent on the cheapest capable tier with the agent file's body pasted in as its brief, and say so in the report.

## Packets — one doc, one applier

Compose packets by hand; routing is judgment. `audit.mjs` asserts the one mechanical invariant: **no document appears in two packets** — appliers run in parallel, and two agents in one file silently lose each other's edits.

- **Packet by the doc the fix belongs in, never the doc a row's evidence cites.** Citations say where the evidence lives; the fix usually belongs elsewhere, and a bounced row's `needs-cross-doc` note names where.
- **A row with no derivable doc goes to the owner** — never into a packet "to see what the agent makes of it".

| Rows | Destination |
| --- | --- |
| QUESTION, and any row with `depends_on` set | the owner, in your report |
| CONTESTED | you, with both sets of evidence |
| RESIDUE, and any row whose subject is a source file — a stale comment included | the register |
| everything else | the owning doc's packet |

## Verification — budgeted by what it caught

- **The applier re-check is the law** — it kills more false positives than every other mechanism combined.
- **Blind re-derivation is discretionary.** Send only a row *you* doubt, with claim and subject only. As a mandatory stage it refutes nothing: finders' self-doubt is conservative, and the errors sit in the confident pile, which is where your own read of the evidence looks. Disagreement makes the row CONTESTED; a verification never overwrites a verdict.

## Fold-back

After each applier returns, turn its outcomes into row state by your own edit, then run `audit.mjs` to check the arithmetic.

| Outcome | Row state |
| --- | --- |
| `applied` · `registered` · `exempt-frozen` | `resolved`, the resolution stamped with how |
| `refuted-on-apply` | `resolved`, resolution `did not reproduce` — a legitimate death; its count is the quality signal you report |
| `needs-cross-doc` · `blocked-on-question` · `skipped` | stays open — repacket, or hold for the answer |

COHERENT rows close when recorded; they carry no work.

## Recovery

**The file on disk is the recovery unit, never the wave.** A dead agent costs only its remainder: read what landed and relaunch that.

- **Partial at the turn cap:** resume the finder once from its partial; a second partial is accepted as that doc's sweep and named as such in the report.
- **Time bound:** every dispatch names its output file and a time bound. An agent past its bound with no file is dead — relaunch it, never wait on it, and never let one runaway agent hold the run.
- **Gates** — lint, links, ownership — run in your own seat.

## Price

**Before dispatching, state the price whenever a run exceeds ten documents or an owner directive names a tier:** the per-doc cost at the pinned tier, the wave count under the concurrency ceiling, and the total; for a stronger tier, the multiplier and both totals. The directive and the estimate go in the changelog entry.
