From 6386622eb42702dbfa8701a9a5e2d786846d42a5 Mon Sep 17 00:00:00 2001 From: soryu Date: Sat, 24 Jan 2026 16:17:42 +0000 Subject: feat: Add check_deliverables_met tool and deliverable checking for phase transitions Adds deliverable checking functionality to ensure contracts meet phase requirements before advancing: - Add check_deliverables_met() function to phase_guidance.rs - Add should_auto_progress() for autonomous contract progression - Add generate_deliverable_prompt_guidance() for LLM context - Add get_next_phase_for_contract() for type-aware phase transitions - Add new ContractToolRequest::CheckDeliverablesMet tool - Update advance_phase handler to block transitions when deliverables not met - Export new types: DeliverableCheckResult, DeliverableItem, AutoProgressDecision, AutoProgressAction The check_deliverables_met tool helps LLMs determine if all required deliverables are satisfied before advancing phases, supporting auto-progress when enabled. Co-Authored-By: Claude Opus 4.5 --- makima/src/llm/contract_tools.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'makima/src/llm') 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> = 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 // ============================================================================= -- cgit v1.2.3