DOCS · CONCEPTS
ALL DOCS FIG. 15 · DWG VC-015

Read–Write cadence

Why the lifecycle alternates read-only perception with write action, and how the runtime enforces the split.

Canonical source — docs/public/concepts/read-write-cadence.md

Read–Write cadence

The Vibecrafted lifecycle alternates two kinds of stages. WRITE stages change code and must prove it with commits and green gates. READ stages perceive — they assess, verify, and falsify — and must not mutate code at all. The alternation is the core of the framework: no write happens without a preceding read, and no read ends without handing a verdict to the next write.

The pipeline

#StagePhaseWhat it does
1scaffoldREADMap the ground truth and write the plan
2implementWRITEBuild the frame of the change
3reviewREADFindings-max assessment of each implementation
4workflowWRITEOrchestrated implementation passes
5followupREADAssess trajectory — is the direction healthy
6marblesWRITESwarm over-correction — flood every crack in deliberate excess
7auditREADFalsification — verify the claimed truth actually landed
8polarizeWRITEDecisive cut — one truth remains, the excess is shaken off
9douREADDefinition of Undone — measure distance to shippable
10hydrateWRITEPolish surfaces, packaging, onboarding
11releaseDeployment, publishing, signing — the operator-plane stage

The rhythm rule: every WRITE is bracketed by READ stages before and after. Strokes without looking produce rubble; looking without strokes leaves the block untouched.

How the split is enforced

This is not an honor system. The runtime enforces the READ/WRITE contract mechanically.

READ stages declare code_mutation

Every READ-stage worker receives its phase contract in the stage prompt and must declare in its report frontmatter whether it mutated code:

---
run_id: dou-<timestamp>-<id>
agent: codex
skill: vc-dou
status: completed
code_mutation: false
---

The declaration is checked against evidence, not taken on faith. The lifecycle runner attributes changes using the worker’s own claim plus the observed tree delta — a global delta caused by a concurrent Living Tree writer is not automatically blamed on the READ worker.

Violations are traced, not hidden

When a READ-stage worker did mutate code, the stage record carries a read_phase_violation flag in the lifecycle state. The supervisor sees it in vibecrafted ship status <run_id> --json and must resolve it before moving the baton — typically by forcing an audit or rewinding the stage.

WRITE stages must show receipts

A WRITE stage is not accepted on narrative. Before approving the baton to the next stage, the supervisor confirms that:

  • the promised commits actually exist on the working branch, and
  • the declared quality gates (tests, lint, security scan) actually ran green.
vibecrafted ship status <run_id> --json   # truth before any button
vibecrafted ship approve <run_id>         # baton moves only with cargo

Why the alternation exists

The bottleneck in AI-assisted coding is not intelligence — it is unbounded accumulation of entropy and hallucination in a growing system. A model that only writes will happily rewrite hundreds of lines to patch a small defect, and each blind write compounds the drift.

The cadence converts that failure mode into a controlled loop:

  1. Perception before action. A READ stage establishes what is actually there, so the next WRITE cuts with sight, not memory.
  2. Falsification after action. A READ stage after each WRITE asks the only question that matters: what is still wrong? Verdicts are earned by evidence; the default is UNVERIFIED, never PASS.
  3. Deliberate excess, then a decisive cut. The marbles stage over-applies fixes on purpose; audit verifies what landed; polarize strips the excess back to one axis of truth. The excess exists so there is something to shake off.

Convergence through counterexample is not one tool — it is an emergent property of this rhythm. Breaking the rhythm (writing without a prior read, or reading without handing a verdict forward) breaks the core.