hard invariant #2
The queue contract: no direct outbound actions
The second hard invariant: "NEVER sends external legal correspondence (letters, NDA counters, signature requests) directly -- all outbound queued as status=queued for human operator approval." This applies specifically to three skills:
| skill | what it produces | what it never does |
|---|---|---|
legal:legal-response | Draft formal response (status=queued) | Never sends the letter directly |
legal:signature-request | Signature request envelope (status=queued) | Never triggers DocuSign/e-sign directly |
legal:triage-nda | Classification + triage report | Never sends a counter-NDA directly |
Queue state machine
Every task the legal-coworker handles follows a strict FSM:
| state | meaning |
|---|---|
pending | Task is in the queue, not yet claimed |
claim | Coworker has atomically claimed the task |
in_progress | Coworker is executing the skill |
complete | Skill execution done, outcome being written |
completed | AgentOutcome envelope written, task closed |
Also possible: block (needs human input), fail (unrecoverable error), retry (transient error, will reattempt).
One task per session tick
The coworker claims exactly one task per tick, completes it atomically, and stops. This prevents partial-state bugs where two tasks are in-progress simultaneously and one's outcome overwrites the other's queue entry.
queue: cowork/data/queues/legal.jsonl