From 97e21c8296ec5f91912d56980ebf3b18a1ca3507 Mon Sep 17 00:00:00 2001 From: soryu Date: Sat, 7 Feb 2026 18:27:54 +0000 Subject: Add directive monitor contracts --- makima/src/daemon/api/directive.rs | 26 ++++++++++++++++++++++++++ makima/src/daemon/cli/directive.rs | 20 ++++++++++++++++++++ makima/src/daemon/cli/mod.rs | 6 ++++++ makima/src/daemon/skills/directive.md | 20 ++++++++++++++++++++ 4 files changed, 72 insertions(+) (limited to 'makima/src/daemon') diff --git a/makima/src/daemon/api/directive.rs b/makima/src/daemon/api/directive.rs index 42f6f45..3589e78 100644 --- a/makima/src/daemon/api/directive.rs +++ b/makima/src/daemon/api/directive.rs @@ -57,4 +57,30 @@ impl ApiClient { self.post_empty(&format!("/api/v1/directives/{}/start", directive_id)) .await } + + /// Trigger a manual evaluation for a step. + pub async fn directive_evaluate_step( + &self, + directive_id: Uuid, + step_id: Uuid, + ) -> Result { + self.post_empty(&format!( + "/api/v1/directives/{}/steps/{}/evaluate", + directive_id, step_id + )) + .await + } + + /// List evaluations for a step. + pub async fn directive_evaluations( + &self, + directive_id: Uuid, + step_id: Uuid, + ) -> Result { + self.get(&format!( + "/api/v1/directives/{}/steps/{}/evaluations", + directive_id, step_id + )) + .await + } } diff --git a/makima/src/daemon/cli/directive.rs b/makima/src/daemon/cli/directive.rs index 5ce88c5..4c29c14 100644 --- a/makima/src/daemon/cli/directive.rs +++ b/makima/src/daemon/cli/directive.rs @@ -38,3 +38,23 @@ pub struct UpdateStatusArgs { /// New status (draft, planning, active, paused, completed, archived, failed) pub status: String, } + +/// Arguments for evaluate command (trigger manual evaluation). +#[derive(Args, Debug)] +pub struct EvaluateArgs { + #[command(flatten)] + pub common: DirectiveArgs, + + /// Step ID to evaluate + pub step_id: Uuid, +} + +/// Arguments for evaluations command (list evaluation history). +#[derive(Args, Debug)] +pub struct EvaluationsArgs { + #[command(flatten)] + pub common: DirectiveArgs, + + /// Step ID to list evaluations for + pub step_id: Uuid, +} diff --git a/makima/src/daemon/cli/mod.rs b/makima/src/daemon/cli/mod.rs index b07ab5a..c9a8c6f 100644 --- a/makima/src/daemon/cli/mod.rs +++ b/makima/src/daemon/cli/mod.rs @@ -225,6 +225,12 @@ pub enum DirectiveCommand { /// Start a directive (create planning contract and begin orchestration) Start(DirectiveArgs), + + /// Trigger a manual evaluation for a step + Evaluate(directive::EvaluateArgs), + + /// List evaluation history for a step + Evaluations(directive::EvaluationsArgs), } impl Cli { diff --git a/makima/src/daemon/skills/directive.md b/makima/src/daemon/skills/directive.md index cdfdaa2..0d1e9d6 100644 --- a/makima/src/daemon/skills/directive.md +++ b/makima/src/daemon/skills/directive.md @@ -47,6 +47,20 @@ makima directive update-status ``` Updates the directive status. Valid statuses: `draft`, `planning`, `active`, `paused`, `completed`, `archived`, `failed`. +## Evaluation + +### Trigger manual evaluation for a step +```bash +makima directive evaluate +``` +Triggers a monitoring evaluation for the specified step. The step must have been executed (have a contract). Sets the step to "evaluating" and dispatches a monitoring contract. + +### List evaluations for a step +```bash +makima directive evaluations +``` +Returns the evaluation history for a step, ordered by evaluation number. + ## Output Format All commands output JSON to stdout. @@ -63,6 +77,12 @@ makima directive chains # Get details of a specific chain makima directive chain +# Trigger manual evaluation of a step +makima directive evaluate + +# Check evaluation history +makima directive evaluations + # Update status to active makima directive update-status active ``` -- cgit v1.2.3