The code writer
ROLES.md describes this role in section 21.
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. The choice of harness is a setting of the deploy. The package does not make it.
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.
On the lifecycle map, the code writer holds the Code stage (agenticdevelopment.ai).
1. The requests
These exchanges are the role's primary interface, stated here, with no entry of its own (Agent Roles §14.3). Implementing them alone does not grant the role.
- Write the scripts. The writer is given 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. What it does
- It writes scripts and nothing else. The code writer does 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.
- 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 reported. It is not held against the writer, because fixing it means writing a test.
- An open question a test depends on is reported as a conflict. The writer does 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.
- 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.
- A prototype is always rewritten. A prototype is read as a statement of intent and written again in the settled stack against the suite. The writer does not deliver the prototype's files as its own.
- Every round is recorded. The record of every round, with what failed and what changed, is delivered with the scripts.
3. The record
The record is 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. How a holder is checked
The test is 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 can record the results of the check as evidence, so a role holder's reputation in the bureau reflects whether it does the job the role defines.
5. Held through a hand-off
Any coding agent may hold this role, not only an agent made for it: a hosted or local coding session such as Claude Code, Codex or Cursor, or a person at a keyboard. That is safe for the same reason the role is safe at all, which is that none of the check is the writer's. Such a holder is given a hand-off instead of a job message, and its delivery comes back through the same check. A code writer the lifecycle hosts takes the same hand-off, so a person who has no coding agent loses nothing.
- The hand-off is a build folder on a branch. The host writes the build folder as one commit on a branch of a repository the holder can work in, and opens a pull request titled "Write the scripts". The folder holds the agent's declarations, the suite under test/, every script the statement names under scripts/ (the released script where there is one, otherwise a stub that exports what the suite imports), every other file the package carries at its own path, and the local check under .adlc/.
- The house rules are written in the folder. AGENTS.md states the rules above for whoever reads it: write only under scripts/; change no test and no declaration; report a test that cannot pass without breaking the statement instead of changing it; stay in the settled stack; reach a model only through the shared caller and its declared settings; write no address and no credential into a script; and reach no network from a test run. It names the local check,
node .adlc/check.mjs, which runs the same check the host runs, and exit 0 means the work is ready to hand back. - The fence is a lock of digests. build.lock.json carries the digest of every pinned file. The host compares the delivery against the digests it kept when it issued the hand-off, never against the copy in the folder, which the holder could change. Only scripts/ may change, and a new test file may be added. A changed or removed test, or a changed declaration, sends the work back to the spec and test stages.
- The check runs as the pull request's checks. When the holder marks the pull request ready, the host runs the check on its newest commit and posts each part as a check, with its findings as a comment the holder can read and fix. The parts are the fence; a static review of the files the holder may change, for credential values, hidden characters and addresses the statement does not declare; and the suite, then the suite once per script with that script blanked. The suite runs in the account's own sandbox and never where the host keeps credentials, because it is the first time code nobody has reviewed is executed. A folder the fence or the static review refuses is not run at all.
- A green check is not acceptance. A passing check moves nothing on its own. A person's OK accepts the delivery, and only on the commit the check passed. The package maker then packs from the merged commit, never from an archive the holder made, and the record names the holder of the Code stage.
The commits on the branch are the record of every round. A holder through a hand-off is checked as section 4 says, with the harness reading the pull request in place of the job folder. agenticdevelopment.ai gives the hand-off contract to use with your own coding agent.
v1.7 (2026-10-30): any coding agent, or a person, may hold the role through the hand-off: a build folder on a branch with a "Write the scripts" pull request, the house rules in AGENTS.md, the fence in build.lock.json, the check as the pull request's checks, then a person's OK and packing from the merged commit.
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.