From 9aadbc7958d39d181c0dd0600e2b7c30bb6c391a Mon Sep 17 00:00:00 2001 From: soryu Date: Sat, 14 Feb 2026 21:29:26 +0000 Subject: Makima system improvements: Orders, directive questions, PR creation fix, bug fixes (#62) * feat: soryu-co/soryu - makima: Fix directive goal update bug - stale closure issue * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Create Orders database schema and backend API * feat: soryu-co/soryu - makima: Fix task Claude instance not receiving user inputs from input box * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Build Orders frontend page replacing the Board page * WIP: heartbeat checkpoint * WIP: heartbeat checkpoint * feat: soryu-co/soryu - makima: Fix directive PR creation system --- makima/src/server/state.rs | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'makima/src/server/state.rs') diff --git a/makima/src/server/state.rs b/makima/src/server/state.rs index 58e8545..41c336e 100644 --- a/makima/src/server/state.rs +++ b/makima/src/server/state.rs @@ -142,8 +142,11 @@ pub struct SupervisorQuestionNotification { pub question_id: Uuid, /// Supervisor task that asked the question pub task_id: Uuid, - /// Contract this question relates to + /// Contract this question relates to (Uuid::nil() for directive context) pub contract_id: Uuid, + /// Directive this question relates to (if from a directive task) + #[serde(skip_serializing_if = "Option::is_none")] + pub directive_id: Option, /// Owner ID for data isolation #[serde(skip)] pub owner_id: Option, @@ -170,6 +173,8 @@ pub struct PendingSupervisorQuestion { pub question_id: Uuid, pub task_id: Uuid, pub contract_id: Uuid, + /// Directive this question relates to (if from a directive task) + pub directive_id: Option, pub owner_id: Uuid, pub question: String, pub choices: Vec, @@ -818,6 +823,25 @@ impl AppState { context: Option, multi_select: bool, question_type: String, + ) -> Uuid { + self.add_supervisor_question_with_directive( + task_id, contract_id, None, owner_id, + question, choices, context, multi_select, question_type, + ) + } + + /// Add a pending supervisor question with optional directive context and broadcast it. + pub fn add_supervisor_question_with_directive( + &self, + task_id: Uuid, + contract_id: Uuid, + directive_id: Option, + owner_id: Uuid, + question: String, + choices: Vec, + context: Option, + multi_select: bool, + question_type: String, ) -> Uuid { let question_id = Uuid::new_v4(); let now = chrono::Utc::now(); @@ -829,6 +853,7 @@ impl AppState { question_id, task_id, contract_id, + directive_id, owner_id, question: question.clone(), choices: choices.clone(), @@ -844,6 +869,7 @@ impl AppState { question_id, task_id, contract_id, + directive_id, owner_id: Some(owner_id), question, choices, @@ -857,6 +883,7 @@ impl AppState { question_id = %question_id, task_id = %task_id, contract_id = %contract_id, + directive_id = ?directive_id, question_type = %question_type, "Supervisor question added" ); @@ -904,6 +931,7 @@ impl AppState { question_id, task_id: question.1.task_id, contract_id: question.1.contract_id, + directive_id: question.1.directive_id, owner_id: Some(question.1.owner_id), question: question.1.question, choices: question.1.choices, -- cgit v1.2.3