From dce7f50e503dc374aaf879df33e725af16c4cc78 Mon Sep 17 00:00:00 2001 From: soryu Date: Fri, 8 May 2026 16:34:11 +0100 Subject: feat(directives): drop directives.goal — orchestration reads contract body (#132) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hard cut. The unified contracts surface owns spec text now; the directive itself is just a folder. The orchestrator daemon reads the active contract's body when it spawns, replans, or runs completion. Schema (migration 20260510000000): - DROP TABLE directive_goal_history - ALTER TABLE directives DROP COLUMN goal - ALTER TABLE directives DROP COLUMN goal_updated_at New repo helper: - get_active_contract_body(directive_id) — picks the active|queued|draft contract (in that order), most-recent first. Backend cuts: - Directive / DirectiveSummary / CreateDirectiveRequest / UpdateDirectiveRequest lose goal & goalUpdatedAt. - CreateDirectiveRequest gains optional `contractBody` — when provided, create_directive_for_owner auto-creates a first contract with that body in the same transaction. - Removed: update_directive_goal, update_directive_goal_keep_orchestrator, save_directive_goal_history, get_directive_goal_history, DirectiveGoalHistory model, UpdateGoalRequest. - Removed handlers::directives::update_goal + the /directives/{id}/goal route. - orchestration::directive::build_planning_prompt / build_completion_prompt / build_order_pickup_prompt now take a `contract_body: &str` instead of `goal_history`. classify_goal_change + try_interrupt_planner_with_goal_edit + GoalChangeKind + GoalEditInterruptResult removed (they were only useful for the small-vs-large goal-edit interrupt cycle). CLI: - `makima directive update-goal` removed (UpdateGoalArgs deleted, Commands enum trimmed, ApiClient::directive_update_goal + UpdateGoalRequest deleted). Frontend: - Directive / DirectiveSummary / CreateDirectiveRequest types lose goal & goalUpdatedAt; CreateDirectiveRequest gains `contractBody`. - useDirective drops updateGoal helper. - api.ts updateDirectiveGoal removed. - Legacy DirectiveList + DirectiveDetail components deleted; the /directives route now always renders the document-mode page. The user-settings documentModeEnabled flag is no longer consulted at the route level. - NewContractModal passes body via contractBody. Co-authored-by: Claude Opus 4.7 (1M context) --- makima/src/daemon/cli/directive.rs | 10 +--------- makima/src/daemon/cli/mod.rs | 3 --- 2 files changed, 1 insertion(+), 12 deletions(-) (limited to 'makima/src/daemon/cli') diff --git a/makima/src/daemon/cli/directive.rs b/makima/src/daemon/cli/directive.rs index 0f04720..a27b94e 100644 --- a/makima/src/daemon/cli/directive.rs +++ b/makima/src/daemon/cli/directive.rs @@ -90,15 +90,7 @@ pub struct StepActionArgs { pub step_id: Uuid, } -/// Arguments for update-goal command. -#[derive(Args, Debug)] -pub struct UpdateGoalArgs { - #[command(flatten)] - pub common: DirectiveArgs, - - /// New goal text - pub goal: String, -} +// (UpdateGoalArgs removed — spec edits flow through the contracts API now.) /// Arguments for batch-add-steps command. #[derive(Args, Debug)] diff --git a/makima/src/daemon/cli/mod.rs b/makima/src/daemon/cli/mod.rs index b01c161..acad9ad 100644 --- a/makima/src/daemon/cli/mod.rs +++ b/makima/src/daemon/cli/mod.rs @@ -107,9 +107,6 @@ pub enum DirectiveCommand { /// Mark a step as skipped SkipStep(directive::StepActionArgs), - /// Update the directive's goal (triggers re-planning) - UpdateGoal(directive::UpdateGoalArgs), - /// Batch add multiple steps from JSON BatchAddSteps(directive::BatchAddStepsArgs), -- cgit v1.2.3