summaryrefslogtreecommitdiff
path: root/makima/src/llm/contract_tools.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/llm/contract_tools.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/llm/contract_tools.rs')
-rw-r--r--makima/src/llm/contract_tools.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/makima/src/llm/contract_tools.rs b/makima/src/llm/contract_tools.rs
index 855a2fe..44c1e20 100644
--- a/makima/src/llm/contract_tools.rs
+++ b/makima/src/llm/contract_tools.rs
@@ -287,6 +287,14 @@ pub static CONTRACT_TOOLS: once_cell::sync::Lazy<Vec<Tool>> = once_cell::sync::L
"properties": {}
}),
},
+ Tool {
+ name: "check_deliverables_met".to_string(),
+ description: "Check if all required deliverables are met for the current phase and whether the contract is ready to advance to the next phase. Returns detailed status including: deliverables_met (bool), ready_to_advance (bool), required_deliverables (list with status), missing items, and auto_progress_recommended (bool). Use this before calling advance_phase to ensure all requirements are satisfied. For simple contracts: Plan phase needs Plan document + Repository, Execute phase needs completed tasks + PR. For specification contracts: Each phase has specific required documents.".to_string(),
+ parameters: json!({
+ "type": "object",
+ "properties": {}
+ }),
+ },
// =============================================================================
// Task Derivation Tools
// =============================================================================
@@ -528,6 +536,7 @@ pub enum ContractToolRequest {
// Phase guidance
GetPhaseChecklist,
+ CheckDeliverablesMet,
// Task derivation
DeriveTasksFromFile { file_id: Uuid },
@@ -604,6 +613,7 @@ pub fn parse_contract_tool_call(call: &super::tools::ToolCall) -> ContractToolEx
// Phase guidance
"get_phase_checklist" => parse_get_phase_checklist(),
+ "check_deliverables_met" => parse_check_deliverables_met(),
// Task derivation
"derive_tasks_from_file" => parse_derive_tasks_from_file(call),
@@ -1057,6 +1067,16 @@ fn parse_get_phase_checklist() -> ContractToolExecutionResult {
}
}
+fn parse_check_deliverables_met() -> ContractToolExecutionResult {
+ ContractToolExecutionResult {
+ success: true,
+ message: "Checking if deliverables are met...".to_string(),
+ data: None,
+ request: Some(ContractToolRequest::CheckDeliverablesMet),
+ pending_questions: None,
+ }
+}
+
// =============================================================================
// Task Derivation Tool Parsing
// =============================================================================