From 4c09aa13a50064a4145ef53021490d303e46bc5e Mon Sep 17 00:00:00 2001
From: soryu <soryu@soryu.co>
Date: Fri, 30 Jan 2026 03:28:40 +0000
Subject: Add auto_merge_local option for local-only contracts

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>
---
 frontend/src/components/ContractList.tsx | 2 ++
 1 file changed, 2 insertions(+)

(limited to 'frontend/src/components/ContractList.tsx')

diff --git a/frontend/src/components/ContractList.tsx b/frontend/src/components/ContractList.tsx
index 77012db..d6b332c 100644
--- a/frontend/src/components/ContractList.tsx
+++ b/frontend/src/components/ContractList.tsx
@@ -8,6 +8,8 @@ interface ContractSummary {
   contract_type: string
   phase: string
   status: string
+  localOnly?: boolean
+  autoMergeLocal?: boolean
   file_count: number
   task_count: number
   repository_count: number
-- 
cgit v1.2.3

