Skip to main content

Module decision

Module decision 

Source
Expand description

AI Decision Definition

A Decision is the terminal verdict of a Run. After the agent finishes generating and validating PatchSets, the orchestrator (or the agent itself) creates a Decision to record what should happen next.

§Position in Lifecycle

Task ──runs──▶ Run ──patchsets──▶ [PatchSet₀, PatchSet₁, ...]
                 │
                 └──(terminal)──▶ Decision
                                    ├── chosen_patchset ──▶ PatchSet
                                    └── evidence (via Evidence.decision)

A Decision is created once per Run, at the end of execution. It selects which PatchSet (if any) to apply and records the resulting commit hash. Evidence objects may reference the Decision to provide supporting data (test results, lint reports) that justified the verdict.

§Decision Types

  • Commit: Accept the chosen PatchSet and apply it to the repository. chosen_patchset and result_commit should be set.
  • Checkpoint: Save intermediate progress without finishing. The Run may continue or be resumed later. checkpoint_id identifies the saved state.
  • Abandon: Give up on the Task. The goal is deemed impossible or not worth pursuing. No PatchSet is applied.
  • Retry: The current attempt failed but the Task is still viable. The orchestrator should create a new Run to try again, potentially with different parameters or prompts.
  • Rollback: Revert previously applied changes. Used when a committed PatchSet is later found to be incorrect.

§Flow

  Run completes
       │
       ▼
  Orchestrator creates Decision
       │
       ├─ Commit ──▶ apply PatchSet, record result_commit
       ├─ Checkpoint ──▶ save state, record checkpoint_id
       ├─ Abandon ──▶ mark Task as Failed
       ├─ Retry ──▶ create new Run for same Task
       └─ Rollback ──▶ revert applied PatchSet

Structs§

Decision
Terminal verdict of a Run.

Enums§

DecisionType
Type of decision.