Run it
Set the project up as Installation describes, putbriefs/playbook.md, contracts/msa.md and judge.json from
examples/use-cases/business/ beside the file, sign in to Claude Code and
Codex, and run it. Without JUDGE=jev the judge replays the answers in
judge.json; with it, and a TypeSafe endpoint and key in the environment,
the judge is Jev:
Terminal
Output, from the offline proof
negotiate with the redlines and the positions in review/, and the
lawyer’s yes on the page finished it. A no goes to redline with the lawyer’s note as the finding.
The file
Write every rule you want applied inbriefs/playbook.md. Everything a seat
knows about what’s acceptable comes from that file, and only the rules
written there are applied. files: ["contracts/msa.md"] in the brief’s
front matter names the contract as a workspace file: every seat knows it
exists, and the review seat may not write it.
examples/use-cases/business/contract-playbook.ts (excerpt)
refine: judge(judgeSeat) asks the judge
whether another round is worth it each time the checker fails the set, and
the rounds end when the judge stops them or the checker passes the set. The
negotiating note keeps a plain count of three, so the two shapes sit side by
side:
examples/use-cases/business/contract-playbook.ts (excerpt)
gate. The package doesn’t
check them itself; it checks what each stage declares. A file in writes
that’s missing or empty fails the stage, a reviewed stage passes only when
its reviewer accepts, and a person stage waits until the person answers.
Full file
Full file
examples/use-cases/business/contract-playbook.ts
The team’s shape
When the loop stops
When the checker fails the set, the judge reads the use case from the brief, the findings and every round so far, and says whether another round is worth it. A finding the checker tags block, here a never-sign clause with no redline, goes to the judge too. The judge scores every finding the same way, from cosmetic to blocking, and a finding goes back when its score clears the send-back bar for its level, a lower bar for a blocking score. The loop goes round again while a finding goes back and stops when the judge’s answers end it. With no cap, a run ends when the judge stops it or the review passes. To bound the rounds as well, passjudge(judgeSeat, { cap: 3 }): it allows three
refinements, and the judge reads
the review of the last draft too. There, letting the redlines stand passes
the run, a product_decision buys exactly one more round for a change the
person asks for (an answer that sends nothing back lets the work stand),
and findings the judge still calls impactful grant one more round
while their count falls or pause the run for a person when they do not.
Anything else fails the run. The judge’s recorded answer
for the offline run is in judge.json.
A judge stops the loop has the questions
and the rule.
Next steps
- A person decides: the lawyer’s question as a step, and how the answer reaches a paused run.
- A judge stops the loop: the judge’s questions, and the same loop as plain graph nodes.
- A writer and a reviewer: the writer and checker pair on its own.