summaryrefslogtreecommitdiff
path: root/makima/src/db/models.rs
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-17 06:05:21 +0000
committersoryu <soryu@soryu.co>2026-01-17 16:38:44 +0000
commit06fb883b2b7a49c7123722463d24b0b4e57c3277 (patch)
tree9c0d07daeff90fa31cea320171a8678133fab801 /makima/src/db/models.rs
parent2f62df1cc89a23a5bd30e1a3f68a39bcfce9665c (diff)
downloadsoryu-06fb883b2b7a49c7123722463d24b0b4e57c3277.tar.gz
soryu-06fb883b2b7a49c7123722463d24b0b4e57c3277.zip
Add phase_guard field to Contract model and database
This adds a new boolean field to control whether the supervisor should wait for user confirmation before progressing to the next phase. When enabled, users can review and potentially amend phase outputs (like plans, requirements docs) before the contract continues. Changes: - Add migration for phase_guard column (defaults to false) - Add phase_guard to Contract, CreateContractRequest, and UpdateContractRequest structs - Update create_contract_for_owner and update_contract_for_owner repository functions to handle phase_guard - Update all CreateContractRequest instantiations with phase_guard field Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'makima/src/db/models.rs')
-rw-r--r--makima/src/db/models.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/makima/src/db/models.rs b/makima/src/db/models.rs
index 72ba6f2..33ef52e 100644
--- a/makima/src/db/models.rs
+++ b/makima/src/db/models.rs
@@ -1264,6 +1264,11 @@ pub struct Contract {
/// without a COMPLETION_GATE indicating ready: true.
#[serde(default)]
pub autonomous_loop: bool,
+ /// Whether to wait for user confirmation before progressing to the next phase.
+ /// When enabled, the supervisor will pause and ask the user to review and approve
+ /// phase outputs (like plans, requirements, etc.) before continuing.
+ #[serde(default)]
+ pub phase_guard: bool,
pub version: i32,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
@@ -1389,6 +1394,11 @@ pub struct CreateContractRequest {
/// without a COMPLETION_GATE indicating ready: true.
#[serde(default)]
pub autonomous_loop: Option<bool>,
+ /// Enable phase guard mode for this contract.
+ /// When enabled, the supervisor will pause and ask the user to review and approve
+ /// phase outputs before progressing to the next phase.
+ #[serde(default)]
+ pub phase_guard: Option<bool>,
}
/// Request payload for updating a contract
@@ -1405,6 +1415,11 @@ pub struct UpdateContractRequest {
/// Enable or disable autonomous loop mode for tasks in this contract.
#[serde(default)]
pub autonomous_loop: Option<bool>,
+ /// Enable or disable phase guard mode for this contract.
+ /// When enabled, the supervisor will pause and ask the user to review and approve
+ /// phase outputs before progressing to the next phase.
+ #[serde(default)]
+ pub phase_guard: Option<bool>,
/// Version for optimistic locking
pub version: Option<i32>,
}