57 lines
4.9 KiB
Plaintext
57 lines
4.9 KiB
Plaintext
{
|
|
schema_version = 1;
|
|
name = "coder-review";
|
|
initial = "implement";
|
|
|
|
states = {
|
|
implement = {
|
|
instructions = "Inspect the assigned Workdir Git state before editing. Reuse a suitable restored `work/<ticket-id>-<slug>` branch, or create a collision-safe work branch from detached HEAD; never overwrite an existing branch. For this assigned Ticket Workdir, you are explicitly authorized to create or switch the local work branch and to use `git add` and `git commit`. Implement and validate the Ticket in coherent commits. Publish the committed source ref to the Ticket repository remote without force, verify that the remote selector resolves to the exact local HEAD, and open the Merge Request with immutable `selector_from` / `selector_to` evidence. Do not request review from a dirty Workdir or an unpublished source ref. Do not merge, force-rewrite a submitted revision, delete branches, or discard pre-existing changes. A Flow transition is never Ticket completion authority.";
|
|
transitions = {
|
|
review = {
|
|
target = "review";
|
|
condition = "The requested implementation is present on the Ticket work branch, all intended changes are committed, the Workdir is clean, the relevant validation has completed, and there is enough bounded repository and session evidence for an independent Reviewer to evaluate the current head commit.";
|
|
};
|
|
};
|
|
};
|
|
|
|
review = {
|
|
instructions = "Use the current Ticket Merge Request as review authority. Confirm its immutable source selector resolves to the exact committed implementation HEAD, then spawn one actual direct-child SubWorker with profile builtin:reviewer, read-only scope, and a structured review handoff bound to the current immutable Merge Request revision. The trusted spawn layer records `ReviewRequested`; do not place commit/ref identity, capability material, or a prewritten verdict in model input. The child must commit MergeRequestReview; prose output and Worker observation are not approval authority. After the structured current-revision result exists, request a Flow transition.";
|
|
transitions = {
|
|
approved = {
|
|
target = "complete";
|
|
condition = "The authoritative Merge Request current revision has a structured approve result from its registered direct-child builtin:reviewer attempt, with no later unresolved request_changes finding. The Flow transition itself does not complete the Ticket.";
|
|
};
|
|
changes_requested = {
|
|
target = "fix";
|
|
condition = "The latest independent Reviewer attempt for the current implementation requested one or more concrete changes that remain unresolved.";
|
|
};
|
|
};
|
|
};
|
|
|
|
fix = {
|
|
instructions = "Resolve every open Reviewer finding on the same Ticket work branch, rerun the validation affected by the fixes, commit the corrected implementation as a new revision, publish the updated source ref without force, and verify its remote tip. Return to the existing open Merge Request and request review from a fresh read-only Reviewer child so the trusted spawn layer captures a new immutable subject. Do not rewrite the previously reviewed commit or claim approval from the prior request_changes review. When the corrected committed revision is ready for a new independent review, request a Flow transition.";
|
|
transitions = {
|
|
review = {
|
|
target = "review";
|
|
condition = "Every finding from the latest request_changes review has been addressed with relevant validation evidence, and the corrected implementation is ready for a fresh independent Reviewer attempt.";
|
|
};
|
|
};
|
|
};
|
|
|
|
complete = {
|
|
instructions = "Verify the authoritative approval still matches the exact current Merge Request subject, keep the reviewed source ref immutable, leave concise implementation and validation evidence on the Ticket, then hand off to the Orchestrator. Do not call MergeRequestComplete, do not update the target selector, or treat the Flow terminal state as Ticket completion authority. After durable handoff evidence exists, request a Flow transition.";
|
|
transitions = {
|
|
completed = {
|
|
target = "done";
|
|
condition = "The exact approved Merge Request revision and implementation evidence have been durably handed off to the Orchestrator. A Flow state or prose report alone is never Ticket completion authority.";
|
|
};
|
|
};
|
|
};
|
|
|
|
done = {
|
|
instructions = "The approved implementation has been handed off for Orchestrator-owned readiness and integration. Flow terminal state only reflects that handoff.";
|
|
terminal = true;
|
|
};
|
|
};
|
|
}
|