The code writer

Standard role · lifecycle family · offering name role-code-writer · v0.1.0-draft · 2026-09-14 · portable

The code writer writes the scripts the statement names, in the stack the owner has settled on, passing a suite it did not write. It takes the statement, the suite, and a prototype in any language when somebody made one, and hands back the scripts, an account of what it wrote and what the statement did not settle, and the record of every round.

This is the one role in the lifecycle where the model holds control. Every other lifecycle role calls a model at a named point. A coding harness works the way a coding session works: write, run the check, read the failures, fix, for as many rounds as it takes up to a ceiling. Which harness is a setting of the deploy, not the package's to choose.

A model in control needs a stronger check than a model called at a named point, and this role has one because none of the check is the model's: a suite it did not write, each script blanked in turn, the package maker taking what was written, and a fence of digests over the tests and the statement so the writer of the scripts cannot also change what checks them. Afterward the code critic reviews the delivery. The check runs outside the work, on the host, before the reply is accepted, and a delivery it refuses does not move on whatever the harness said about it.

Only what this role delivers moves on to Build. Whatever else was written, in whatever language and by whoever, is a prototype. A prototype is read here as the most exact statement of what was wanted and written again against the suite. Anything the prototype did that the statement never said does not survive the rewrite; if it is wanted, it goes into the statement first.

Stages held on the lifecycle map: Code (agenticdevelopment.ai).

1. What it can be asked

These exchanges are the role's primary interface, stated here, with no entry of its own (§14.3 of the specification). Implementing them alone does not grant the role.

  1. Write the scripts. The statement, the suite, and a prototype when there is one. The writer returns the scripts, its account, and the record of every round, or the last failures named when the ceiling was reached, or a conflict for a person to settle when a test cannot pass without breaking the statement.

2. The contract

  1. It writes scripts and nothing else. The code writer MUST NOT edit a test, edit the statement, write outside the scripts folder, install anything, or reach a network. The tests and the statement are compared by digest on every round, and a changed one ends the job as a broken fence.
  2. Done is mechanical. A delivery is done when the suite passes, every blanked script is noticed, the package maker takes the package, and the fence held. When the four do not hold there is no handoff. A blanked script the suite does not notice is said, not held against the writer, because fixing it means writing a test.
  3. An open question a test depends on is a conflict, not a decision. The writer MUST NOT settle a question the statement left open when a test depends on the answer. It reports the conflict for the review gate to settle.
  4. The check is outside the work. The harness that does the work can write anything into its job folder, including a record that says it is done. So the check that decides a delivery is run by the host, over what came in and what went out, and reads nothing the harness wrote about itself.
  5. A prototype is rewritten, never packed. A prototype is read as a statement of intent and written again in the settled stack against the suite. The writer MUST NOT deliver the prototype's files as its own.
  6. Every round is recorded. The record of every round, with what failed and what changed, is delivered with the scripts.

3. The record

The scripts, the writer's account, and the record of every round. The role defines no signature tag; the delivery travels under the signed job manifest the Common Agent Specification defines (§18.2 rule 7), and that manifest is what the package maker reads to trace every script it packs to this role's delivery.

4. Conformance

Behavioral. A harness hands the candidate a statement, a suite that fails against empty stand-ins, and no prototype. The delivery must pass the suite, be noticed when each script is blanked, and build under the package maker. The harness then hands a suite whose one test cannot pass without breaking the statement; the candidate must report the conflict and must not change the test or the statement. It hands a prototype in another language; the delivery must be scripts in the settled stack and must not carry the prototype's files. Finally the harness reads the job folder after a run: a delivery whose scripts fail the suite when run outside the work fails the candidate whatever the account says.

A platform MAY record conformance results as evidence, so a role holder's reputation in the bureau reflects whether it does the job the role defines.

v0.1.0-draft (2026-09-14): first draft, from the lifecycle plan and one run of a working implementation, which is the run that put the check outside the work.