summaryrefslogtreecommitdiff
path: root/makima/src
diff options
context:
space:
mode:
Diffstat (limited to 'makima/src')
-rw-r--r--makima/src/db/models.rs2
-rw-r--r--makima/src/db/repository.rs4
-rw-r--r--makima/src/server/handlers/contracts.rs4
-rw-r--r--makima/src/server/handlers/mesh.rs1
4 files changed, 9 insertions, 2 deletions
diff --git a/makima/src/db/models.rs b/makima/src/db/models.rs
index 3e6997f..65f7168 100644
--- a/makima/src/db/models.rs
+++ b/makima/src/db/models.rs
@@ -1348,6 +1348,8 @@ pub struct ContractSummary {
pub contract_type: String,
pub phase: String,
pub status: String,
+ /// Supervisor task ID for contract orchestration
+ pub supervisor_task_id: Option<Uuid>,
pub file_count: i64,
pub task_count: i64,
pub repository_count: i64,
diff --git a/makima/src/db/repository.rs b/makima/src/db/repository.rs
index 36e6bc1..536bc9b 100644
--- a/makima/src/db/repository.rs
+++ b/makima/src/db/repository.rs
@@ -2190,7 +2190,7 @@ pub async fn list_contracts_for_owner(
r#"
SELECT
c.id, c.name, c.description, c.contract_type, c.phase, c.status,
- c.version, c.created_at,
+ c.supervisor_task_id, c.version, c.created_at,
(SELECT COUNT(*) FROM files WHERE contract_id = c.id) as file_count,
(SELECT COUNT(*) FROM tasks WHERE contract_id = c.id) as task_count,
(SELECT COUNT(*) FROM contract_repositories WHERE contract_id = c.id) as repository_count
@@ -2214,7 +2214,7 @@ pub async fn get_contract_summary_for_owner(
r#"
SELECT
c.id, c.name, c.description, c.contract_type, c.phase, c.status,
- c.version, c.created_at,
+ c.supervisor_task_id, c.version, c.created_at,
(SELECT COUNT(*) FROM files WHERE contract_id = c.id) as file_count,
(SELECT COUNT(*) FROM tasks WHERE contract_id = c.id) as task_count,
(SELECT COUNT(*) FROM contract_repositories WHERE contract_id = c.id) as repository_count
diff --git a/makima/src/server/handlers/contracts.rs b/makima/src/server/handlers/contracts.rs
index 4f4a94b..4524860 100644
--- a/makima/src/server/handlers/contracts.rs
+++ b/makima/src/server/handlers/contracts.rs
@@ -371,6 +371,7 @@ pub async fn create_contract(
contract_type: contract.contract_type,
phase: contract.phase,
status: contract.status,
+ supervisor_task_id: contract.supervisor_task_id,
file_count: 0,
task_count: 0,
repository_count: 0,
@@ -391,6 +392,7 @@ pub async fn create_contract(
contract_type: contract.contract_type,
phase: contract.phase,
status: contract.status,
+ supervisor_task_id: contract.supervisor_task_id,
file_count: 0,
task_count: 0,
repository_count: 0,
@@ -518,6 +520,7 @@ pub async fn update_contract(
contract_type: contract.contract_type,
phase: contract.phase,
status: contract.status,
+ supervisor_task_id: contract.supervisor_task_id,
file_count: 0,
task_count: 0,
repository_count: 0,
@@ -1398,6 +1401,7 @@ pub async fn change_phase(
contract_type: updated_contract.contract_type,
phase: updated_contract.phase,
status: updated_contract.status,
+ supervisor_task_id: updated_contract.supervisor_task_id,
file_count: 0,
task_count: 0,
repository_count: 0,
diff --git a/makima/src/server/handlers/mesh.rs b/makima/src/server/handlers/mesh.rs
index f710be1..e9a421c 100644
--- a/makima/src/server/handlers/mesh.rs
+++ b/makima/src/server/handlers/mesh.rs
@@ -3447,6 +3447,7 @@ pub async fn create_adhoc_task(
contract_type: contract.contract_type,
phase: contract.phase,
status: contract.status,
+ supervisor_task_id: contract.supervisor_task_id,
file_count: 0,
task_count: 1,
repository_count: 0,