diff options
| author | soryu <soryu@soryu.co> | 2026-01-26 22:12:57 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-26 22:12:57 +0000 |
| commit | d1f5dadb549d499c5aeee9cacf6c9aa0a233c198 (patch) | |
| tree | a47e3d68a6b25bc39044a52b63099a199dce677d /makima/migrations | |
| parent | bc1ce8013bc36a1585be05b928f2386ab56529c2 (diff) | |
| download | soryu-d1f5dadb549d499c5aeee9cacf6c9aa0a233c198.tar.gz soryu-d1f5dadb549d499c5aeee9cacf6c9aa0a233c198.zip | |
Add local-only mode for contracts with patch export support (#34)
* Add local_only flag to contracts database and models
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Task completion checkpoint
* Skip automatic completion actions in local_only mode
Add `local_only` flag to contracts that prevents automatic completion
actions (branch, merge, pr) from executing when tasks complete. This
allows users to manually handle code changes via patch files or other
means when operating in local-only mode.
Changes:
- Add `local_only` field to Contract model and request types
- Add database migration for the new column
- Add `local_only` parameter to SpawnTask command in both state.rs and
daemon protocol.rs
- Modify task manager to skip completion action execution when
`local_only` is true, with appropriate logging
- Pass `local_only` flag through all task spawning paths:
- mesh_supervisor.rs (task spawn, retry, resume)
- mesh.rs (task start, reassign, continue)
- mesh_chat.rs (run task)
- contract_chat.rs (run task)
- Update repository create/update functions to handle `local_only`
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Task completion checkpoint
* Implement core patch export system
Add functionality to create uncompressed, human-readable git patches
for export. This enables users to generate patches that can be manually
applied or shared, without the compression used for internal checkpoints.
Changes:
- Add ExportPatchResult struct with patch content, file count, and line stats
- Add create_export_patch() function that generates diffs against a base SHA
- Add get_head_sha() utility function
- Add parse_diff_stat() helper to extract line counts from git output
- Add CreateExportPatch command to daemon protocol
- Add ExportPatchCreated response message to protocol
- Add handler in task manager to process export patch requests
- Add server-side handling to broadcast patch results to UI
The export patch system automatically finds the merge-base when no base
SHA is provided, trying upstream tracking branch first, then common
default branches (origin/main, origin/master, main, master).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* Task completion checkpoint
* Add GitActionsPanel frontend component
* Add WorktreeFilesPanel and PatchesListPanel components
* Add local-only mode toggle to contract creation
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'makima/migrations')
| -rw-r--r-- | makima/migrations/20250127000000_add_local_only.sql | 8 | ||||
| -rw-r--r-- | makima/migrations/20260126000000_add_local_only_mode.sql | 7 |
2 files changed, 15 insertions, 0 deletions
diff --git a/makima/migrations/20250127000000_add_local_only.sql b/makima/migrations/20250127000000_add_local_only.sql new file mode 100644 index 0000000..2cd594e --- /dev/null +++ b/makima/migrations/20250127000000_add_local_only.sql @@ -0,0 +1,8 @@ +-- Add local_only column to contracts table +-- When enabled, automatic completion actions (branch, merge, pr) are skipped, +-- allowing users to manually handle code changes via patch files or other means. + +ALTER TABLE contracts +ADD COLUMN IF NOT EXISTS local_only BOOLEAN NOT NULL DEFAULT FALSE; + +COMMENT ON COLUMN contracts.local_only IS 'Whether to skip automatic completion actions (branch, merge, pr) for this contract'; diff --git a/makima/migrations/20260126000000_add_local_only_mode.sql b/makima/migrations/20260126000000_add_local_only_mode.sql new file mode 100644 index 0000000..27af087 --- /dev/null +++ b/makima/migrations/20260126000000_add_local_only_mode.sql @@ -0,0 +1,7 @@ +-- Add local_only column to contracts +ALTER TABLE contracts ADD COLUMN local_only BOOLEAN NOT NULL DEFAULT false; + +-- Index for filtering by local_only mode +CREATE INDEX idx_contracts_local_only ON contracts(local_only) WHERE local_only = true; + +COMMENT ON COLUMN contracts.local_only IS 'When true, tasks do not auto-execute completion actions and work stays in worktrees'; |
