All changes must complete 7 sequential quality gates before archival.
proposal → discovery → design → planning → execution → acceptance → release
| # | Gate ID | Description | Triggered By | Artifact |
|---|---|---|---|---|
| 1 | proposal |
Problem statement confirmed | /adv-proposal |
problem-statement.md |
| 2 | discovery |
Context gathered, objectives agreed | /adv-discover |
agreement.md |
| 3 | design |
Architecture decisions validated | /adv-design |
design.md |
| 4 | planning |
Task graph synthesized | /adv-prep |
Task graph in change.json |
| 5 | execution |
Deliverables produced via TDD | /adv-apply (all tasks done) |
Code, docs, ops deliverables |
| 6 | acceptance |
User accepts deliverables | /adv-review |
User sign-off |
| 7 | release |
Final quality pass and archive | /adv-harden + /adv-archive |
Spec deltas applied, git finalized |
| Value | Meaning |
|---|---|
pending |
Not yet started |
in_progress |
A workflow phase is actively running for this gate |
awaiting_approval |
Phase output is staged; waiting for explicit user approval |
stuck |
Surfaced blocker; gate cannot advance until the blocker is resolved or re-entered |
done |
Completed with timestamp + actor evidence |
skipped |
Explicitly skipped with documented reason |
The signal-driven model exposes per-gate state transitions via dedicated signals:
gateInProgressSignal, gateAwaitingApprovalSignal, gateStuckSignal, gateCompletedSignal,
gateReenteredSignal. Gate state is queried via getGateStatusQuery.
- Sequential: Gates MUST be completed in order (cannot skip ahead)
- Blocking: Archive/Complete BLOCKS unless all 7 gates satisfied
- Cancelled Tasks: At
executiongate, cancelled tasks need user approval
Owner: /adv-proposal | Pauses for: proposal confirmation
Produces problem-statement.md — the confirmed problem statement with success criteria and constraints. This is the entry point for all changes.
Owner: /adv-discover | Pauses for: agreement sign-off (user-facing outcome questions only)
Produces agreement.md — context analysis, objectives, and constraints agreed with the user. /adv-discover Phase 4 (the agreement phase) includes a mandatory clarification loop that triages all open questions from discovery: technical questions are resolved autonomously via LBP research, while user-facing questions (priorities, behavior, downsides, AC boundaries) are presented to the user. No question may be silently deferred. Phase 4.5.1 adds an explicit Acceptance Criteria Checkpoint before agreement.md is persisted and the discovery gate completes, offering approve, /adv-clarify handoff, or write-in edit outcomes; if the user selects /adv-clarify, discovery stops and resumes only after the user reruns /adv-discover. The discovery and planning gates evaluate the full change including completed tasks — completed work is evidence to validate, not acceptance proof. Follow-up tasks are added where gaps are found.
Owner: /adv-design | Pauses for: design approval when real tradeoffs depend on user values, when the design validator returns CONFLICT, or when the agent identifies contract-compromise risk (rq-designval04); auto-continues for straightforward deterministic designs with no compromise risk
Produces design.md — validated architecture decisions and implementation strategy. Design decisions are frozen after this gate completes.
Owner: /adv-prep | Auto-continues when clean (no user approval needed)
Produces the task graph in change.json. After this gate completes, metadata.tdd_intent is frozen on all tasks. Genuine scope changes are handled via adv_change_reenter rather than mid-execution mutation.
Owner: /adv-apply | Auto-continues when clean (pauses only for doom-loop recovery or cancellations)
All tasks must be done (or properly cancelled with user approval). /adv-apply stops if discovery, design, or planning gates are pending — it MUST NOT complete pre-implementation gates. The execution gate implies every non-cancelled task with file changes is checkpointed via adv_task_checkpoint. Checkpoint commits are verified local rollback/audit points scoped to the change worktree; archive remains the separate publication path and worktree cleanup is blocked until integration.
Owner: /adv-review | Pauses for: user acceptance of delivered work
Absorbs the old review + signoff gates. /adv-review emits a REVIEW_FINDINGS block (blocker, issue, suggestion, question), presents the acceptance criteria checklist, and completes the acceptance gate after user confirmation.
Owner: /adv-harden + /adv-archive | Pauses for: archive sign-off only
Absorbs the old harden gate. Before running quality scanners, /adv-harden performs pre-flight checks:
- Acceptance gate prerequisite — acceptance gate must be complete
- Cancellation & cross-repo audit — all cancelled tasks need approval, cross-repo tasks must be done
- Review findings audit — validated in-scope findings must be resolved (no report-only, future-work, or accepted-debt path)
- Merge compatibility check — non-destructive dry-run merge against the default branch (
git merge --no-commit --no-ff); blocks on conflicts
/adv-archive runs Phase 9 Git Finalization: stage → commit → detect default branch → refresh basis → choose --ff-only / reconcile / PR path → verify → cleanup worktree → remove temp artifacts. During archive, durable convention/pattern wisdom can also be promoted to project-level wisdom so lessons survive beyond a single change.
Gates are normally forward-only, but scope expansion during execution requires routing new objectives back through the workflow. The adv_change_reenter tool enables this by reopening a gate and cascading the reset downstream.
When adv_change_reenter(changeId, fromGate, reason, scopeDelta?, approvalEvidence?) is called:
- The target gate (
fromGate) and all downstream gates are reset topending - All upstream gates (before
fromGate) remaindone - Existing tasks and completed work are preserved — only gate state is reset
- After reset, the planning gate is
pending, soadv_task_addis unblocked for new tasks - Optional audit evidence may be recorded when re-entry follows an explicit user instruction
Example: reopening from discovery resets discovery + design + planning + execution + acceptance + release to pending. The proposal gate remains done.
Each re-entry appends to reentry_history[] on the change, recording:
from_gate— which gate was reopenedreason— why re-entry was neededscope_delta— what new scope is being added (optional)reopened_by— actor who triggered re-entryapproval_evidence— optional audit evidence when re-entry follows an explicit user instructionreopened_at— timestampgates_reset— list of gates that were reset to pending
| Situation | Action |
|---|---|
| New acceptance criteria discovered during execution | adv_change_reenter from earliest affected gate |
| Architecture assumptions invalidated by findings | adv_change_reenter from design |
| User requests scope expansion affecting agreement | adv_change_reenter from discovery |
| Bug fix within existing scope | Normal task workflow (no re-entry needed) |
| Minor wording fix to docs | Edit directly (no re-entry needed) |
| Clarification that doesn't change objectives | adv_change_update (no re-entry needed) |
- Cannot reopen a gate that is already
pending - After re-entry, walk the reopened gates normally before resuming execution
/adv-applystops if any pre-implementation gate is pending (standard prerequisite check)
# View gate status for a change
adv_gate_status({ changeId: "my-change" })
# Complete a gate
adv_gate_complete({ changeId: "my-change", gateId: "proposal" })