diff options
| author | soryu <soryu@soryu.co> | 2026-05-08 16:34:11 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-08 16:34:11 +0100 |
| commit | dce7f50e503dc374aaf879df33e725af16c4cc78 (patch) | |
| tree | 50b6aad1aa47e56b61f0700e224028bb7578cb91 /makima/frontend/src/lib/api.ts | |
| parent | e4f1622a0f0ac74707cc1c9810e0b99e948d1319 (diff) | |
| download | soryu-dce7f50e503dc374aaf879df33e725af16c4cc78.tar.gz soryu-dce7f50e503dc374aaf879df33e725af16c4cc78.zip | |
feat(directives): drop directives.goal — orchestration reads contract body (#132)
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) <noreply@anthropic.com>
Diffstat (limited to 'makima/frontend/src/lib/api.ts')
| -rw-r--r-- | makima/frontend/src/lib/api.ts | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/makima/frontend/src/lib/api.ts b/makima/frontend/src/lib/api.ts index f777ba0..a4ec4db 100644 --- a/makima/frontend/src/lib/api.ts +++ b/makima/frontend/src/lib/api.ts @@ -3207,7 +3207,6 @@ export interface Directive { id: string; ownerId: string; title: string; - goal: string; status: DirectiveStatus; repositoryUrl: string | null; localPath: string | null; @@ -3220,7 +3219,6 @@ export interface Directive { memoryEnabled: boolean; /** Reconcile mode: auto (timeout), semi-auto (pause), or manual (ask questions) */ reconcileMode: string; - goalUpdatedAt: string; startedAt: string | null; version: number; createdAt: string; @@ -3255,7 +3253,6 @@ export interface DirectiveSummary { id: string; ownerId: string; title: string; - goal: string; status: DirectiveStatus; repositoryUrl: string | null; orchestratorTaskId: string | null; @@ -3281,7 +3278,9 @@ export interface DirectiveListResponse { export interface CreateDirectiveRequest { title: string; - goal: string; + /** Optional. When provided, a first contract is auto-created with + * this body so the directive is immediately ready to start. */ + contractBody?: string; repositoryUrl?: string; localPath?: string; baseBranch?: string; @@ -3293,7 +3292,6 @@ export interface CreateDirectiveRequest { export interface UpdateDirectiveRequest { title?: string; - goal?: string; status?: string; repositoryUrl?: string; localPath?: string; @@ -3433,15 +3431,8 @@ export async function skipDirectiveStep(directiveId: string, stepId: string): Pr return res.json(); } -export async function updateDirectiveGoal(id: string, goal: string): Promise<Directive> { - const res = await authFetch(`${API_BASE}/api/v1/directives/${id}/goal`, { - method: "PUT", - headers: { "Content-Type": "application/json" }, - body: JSON.stringify({ goal }), - }); - if (!res.ok) throw new Error(`Failed to update goal: ${res.statusText}`); - return res.json(); -} +// (updateDirectiveGoal removed — spec edits go through the contracts API. +// Use updateDirectiveContract(activeContractId, { body }) instead.) export async function cleanupDirective(id: string): Promise<{ message: string; taskId: string | null }> { const res = await authFetch(`${API_BASE}/api/v1/directives/${id}/cleanup`, { |
