summaryrefslogtreecommitdiff
path: root/makima/src/server/handlers/contract_daemon.rs
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-24 20:06:28 +0000
committersoryu <soryu@soryu.co>2026-01-24 20:06:28 +0000
commit6364363d1418728351f252b799d397b756e1f985 (patch)
tree9b5227f141bfc587b487265b3687a11f6f504be3 /makima/src/server/handlers/contract_daemon.rs
parent792d12df6b1b1bc4f327cbe8e71e7986c67e98f6 (diff)
downloadsoryu-6364363d1418728351f252b799d397b756e1f985.tar.gz
soryu-6364363d1418728351f252b799d397b756e1f985.zip
feat: Simplify contract deliverables and add Templates UI
## Backend Changes ### Phase Deliverables Simplified - **Simple contract type**: - Plan phase: Only 'Plan' deliverable (required) - Execute phase: Only 'PR' deliverable (required) - **Specification contract type**: - Research phase: Only 'Research Notes' deliverable (required) - Specify phase: Only 'Requirements Document' deliverable (required) - Plan phase: Only 'Plan' deliverable (required) - Execute phase: Only 'PR' deliverable (required) - Review phase: Only 'Release Notes' deliverable (required) ### New 'execute' Contract Type - Only has 'execute' phase (no plan or review phases) - NO deliverables at all - executes tasks directly - Added to ContractType enum with proper Display/FromStr implementations - Added helper methods: `initial_phase()`, `terminal_phase()` ### API Updates - Added `get_phase_deliverables_for_type()` for contract-type-aware deliverables - Added `get_phase_checklist_for_type()` for contract-type-aware checklists - Added `check_phase_completion_for_type()` for contract-type-aware completion checks - Added `check_deliverables_met()` function for deliverable validation - Added `should_auto_progress()` for autonomous contract progression - Added new ContractToolRequest::CheckDeliverablesMet tool ## Frontend Changes (makima/frontend) ### Templates Page - Add TemplateEditor component for editing phase deliverables - Create Templates page with template card grid layout - Add navigation link in NavStrip - Implement three built-in templates: Simple, Specification, Execute - Support for creating custom templates with configurable phases/deliverables - Templates are persisted to localStorage Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'makima/src/server/handlers/contract_daemon.rs')
-rw-r--r--makima/src/server/handlers/contract_daemon.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/makima/src/server/handlers/contract_daemon.rs b/makima/src/server/handlers/contract_daemon.rs
index 13c5640..5b23831 100644
--- a/makima/src/server/handlers/contract_daemon.rs
+++ b/makima/src/server/handlers/contract_daemon.rs
@@ -280,7 +280,7 @@ pub async fn get_contract_checklist(
Err(_) => false,
};
- let checklist = phase_guidance::get_phase_checklist(&contract.phase, &files, &tasks, has_repository);
+ let checklist = phase_guidance::get_phase_checklist_for_type(&contract.phase, &files, &tasks, has_repository, &contract.contract_type);
Json(checklist).into_response()
}
@@ -319,7 +319,7 @@ pub async fn get_contract_goals(
match repository::get_contract_for_owner(pool, id, auth.owner_id).await {
Ok(Some(contract)) => {
- let deliverables = phase_guidance::get_phase_deliverables(&contract.phase);
+ let deliverables = phase_guidance::get_phase_deliverables_for_type(&contract.phase, &contract.contract_type);
Json(ContractGoalsResponse {
description: contract.description,
phase: contract.phase,
@@ -491,7 +491,7 @@ pub async fn get_suggest_action(
.map(|r| !r.is_empty())
.unwrap_or(false);
- let checklist = phase_guidance::get_phase_checklist(&contract.phase, &files, &tasks, has_repository);
+ let checklist = phase_guidance::get_phase_checklist_for_type(&contract.phase, &files, &tasks, has_repository, &contract.contract_type);
// Determine suggested action based on checklist
let (action, description) = if !checklist.suggestions.is_empty() {