summaryrefslogtreecommitdiff
path: root/makima/src/db/models.rs
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-31 22:17:09 +0000
committerGitHub <noreply@github.com>2026-01-31 22:17:09 +0000
commit3ea2c72e2c50c0d73614d9ac82f41508b6ab1ce4 (patch)
treefbbd53c9e39d9af9dc0e92af5866dd9e3589bf2d /makima/src/db/models.rs
parentc526f93aa4255cb581eeb3f7a495c1689683b0a2 (diff)
downloadsoryu-3ea2c72e2c50c0d73614d9ac82f41508b6ab1ce4.tar.gz
soryu-3ea2c72e2c50c0d73614d9ac82f41508b6ab1ce4.zip
Add auto_merge_local option for local-only contracts (#50)
When local_only=true on a contract, all completion actions are skipped. This adds a new option auto_merge_local that, when enabled along with local_only, will automatically merge completed task changes to the master/main branch locally (without pushing or creating PRs). Changes: - Add auto_merge_local column to contracts table (migration) - Add auto_merge_local field to Contract model and summary - Update CreateContractRequest and UpdateContractRequest structs - Update contract repository create/update functions - Add auto_merge_local to WebSocket protocol StartTask command - Pass auto_merge_local through spawn_task and run_task functions - Modify task manager completion logic: if local_only=true AND auto_merge_local=true, execute 'merge' completion action locally - Update all server handlers to retrieve and pass auto_merge_local - Add TypeScript types to frontend components 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.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/makima/src/db/models.rs b/makima/src/db/models.rs
index 4411747..a6b5b05 100644
--- a/makima/src/db/models.rs
+++ b/makima/src/db/models.rs
@@ -1448,6 +1448,11 @@ pub struct Contract {
/// allowing users to manually handle code changes via patch files or other means.
#[serde(default)]
pub local_only: bool,
+ /// Whether to auto-merge to target branch locally when local_only mode is enabled.
+ /// When both local_only and auto_merge_local are true, completed task changes will be
+ /// automatically merged to the master/main branch locally (without pushing or creating PRs).
+ #[serde(default)]
+ pub auto_merge_local: bool,
/// Whether to spawn a red team task to monitor work tasks.
/// When enabled, a parallel task monitors outputs and can alert
/// the supervisor about potential issues.
@@ -1641,6 +1646,9 @@ pub struct ContractSummary {
/// When true, tasks do not auto-execute completion actions and work stays in worktrees.
#[serde(default)]
pub local_only: bool,
+ /// When true with local_only, automatically merge completed tasks to target branch locally.
+ #[serde(default)]
+ pub auto_merge_local: bool,
/// Whether red team monitoring is enabled for this contract.
#[serde(default)]
pub red_team_enabled: bool,
@@ -1710,6 +1718,11 @@ pub struct CreateContractRequest {
/// allowing users to manually handle code changes via patch files or other means.
#[serde(default)]
pub local_only: Option<bool>,
+ /// Enable auto-merge to target branch locally when local_only mode is enabled.
+ /// When both local_only and auto_merge_local are true, completed task changes will be
+ /// automatically merged to the master/main branch locally (without pushing or creating PRs).
+ #[serde(default)]
+ pub auto_merge_local: Option<bool>,
/// Enable red team monitoring for this contract.
/// When enabled, a parallel task monitors work task outputs
/// and can alert the supervisor about potential issues.
@@ -1745,6 +1758,11 @@ pub struct UpdateContractRequest {
/// allowing users to manually handle code changes via patch files or other means.
#[serde(default)]
pub local_only: Option<bool>,
+ /// Enable or disable auto-merge to target branch locally when local_only mode is enabled.
+ /// When both local_only and auto_merge_local are true, completed task changes will be
+ /// automatically merged to the master/main branch locally (without pushing or creating PRs).
+ #[serde(default)]
+ pub auto_merge_local: Option<bool>,
/// Version for optimistic locking
pub version: Option<i32>,
}