Execution Lifecycle
Execution lifecycle, from a request to a verified delivery and debt sweep.
Step by Step
The diagram in eight stages, in order; on the docs site each step highlights its part of the diagram above.
- Classify. A request is classified as a Spike, a Bounded fix (fewer than 2 files), or Architectural work, and each class takes its own path.
- Design. A spike ends in a report with recommendations, and architectural work brainstorms alternatives and trade-offs until the spec is locked. At Gate 1 a human approves the design or sends it back for revisions.
- Research. Deep research runs only when external information is required: an optional graphify preflight of the codebase, then search, fetch, and synthesize. When the codebase is enough, this stage is skipped.
- Plan. The visual implementation plan holds a Mermaid diagram, a to-do checklist, and
skip_ifconditions; a Bounded fix comes straight here. Gate 2 is a hard human approval gate: nothing executes until the plan is approved. - Execute. A feature or refactor goes to test-driven development, a bug to systematic debugging, and parallel work is cut into the smallest independently verifiable chunks. Chunks fan out to 2 to 4 subagents (at most 15) in isolated workspaces, their reports are gathered and re-verified, and a red chunk is re-chunked and re-dispatched alone.
- Verify. Completion needs fresh evidence: a fresh log, exit 0, passing tests, and the VCS diff. When the evidence is insufficient, Gate 3 sends the work back to TDD.
- Deliver and sweep. The work is committed and delivered as a pull request without co-author trailers. A session-close debt sweep harvests 3 to 5 ranked follow-ups and asks which to do; selected items run as real work, and the session ends with zero debt or a documented deferral.
- Continuity. Compaction or a context reset can come at any point: state, decisions, and evidence are persisted, and work resumes from the last verified checkpoint.
Test-Later Mode
The TDD step normally writes a failing test before any production code. Test-later mode reorders that step for feature work when the owner wants to see the result (a render, a preview, a build, a CLI run) and judge it by hand before any test exists. It moves the tests to the end of the change; it never removes them.
- Trigger. Only the owner's own words, such as "kilat", "test belakangan", or "test later". The agent never picks this mode itself. The design (or the plan) carries the line
Mode: test-later, and approving that gate approves the mode. - Scope. Feature work on the Bounded or Architectural path. Not a bug fix, and not an overnight run.
- Order.
- Code: implement the approved checklist without RED/GREEN cycles.
- Build and show: run the build, render, or preview and show the artifact in chat, not only the command.
- Manual check: the owner judges it at the
Manual checkgate, and each thing they report becomes a numbered criterion (MC1,MC2, ...) in their words. A wrong result loops back to step 1. - Tests from the notes: one test per
MCitem, with the expected value taken from the owner's observation. An item no test can reach stays as manual evidence named in the PR body. - RED against the base: the new tests run in a detached scratch worktree under
/tmpat the base commit and must fail there, then pass in the session worktree.
- Delivery. Verification is unchanged: the pull request still waits for green tests, and its body lists each
MCitem, its test, and the red run against the base.