summaryrefslogtreecommitdiff
path: root/frontend/src/services
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-04-28 21:26:11 +0100
committerGitHub <noreply@github.com>2026-04-28 21:26:11 +0100
commit5bde7c2d7e099fd9c8b2615602ab1d096bd9b6be (patch)
treed605f7c02472f67a88f1c71c9258c1bf0823b44a /frontend/src/services
parentd1fdfb140cc440664f77a24886172f9976a05a31 (diff)
downloadsoryu-5bde7c2d7e099fd9c8b2615602ab1d096bd9b6be.tar.gz
soryu-5bde7c2d7e099fd9c8b2615602ab1d096bd9b6be.zip
revert PRs #93-#98; enforce strict-linear-DAG + mandatory directive verify (#100)
* revert: roll back PRs #93-#98 to pre-Lexical baseline Reverts the entire chain of directive document UI work and the homepage redesign, restoring the working tree to the state at 3679ceb (before c8b169d / PR #93). PRs reverted: - #93 c8b169d feat: Document UI for directive orchestration with Lexical editor - #94 d6f01a6 fix: compilation error and warnings already merged via PR #93 - #95 5aa3faf fix: resolve compilation error and warnings in Rust backend - #97 d513f93 feat: document UI with contract blocks, expandable logs, and interaction controls - #96 6366941 feat: Redesign homepage with professional PC-98 styling - #98 d1fdfb1 feat: revert broken directive PRs, re-implement Lexical document orchestrator The directive Document UI experiments produced fragile output and merge artifacts; follow-up commits in this PR change orchestration to favor strictly linear DAGs and add goal/conflict verification so future runs do not require this kind of cleanup. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * feat(directive): strict-linear-DAG planning + mandatory `directive verify` Tightens directive orchestration so the final PR almost never needs a hand-merge: 1. Planning prompts now strongly bias toward strictly linear DAGs. Parallel steps are reserved for genuinely independent work (e.g. disjoint modules); the default for "in doubt" is sequential. Linear chains inherit each previous step's worktree, so the final merge is typically just a rebase against the base branch. 2. New CLI command `makima directive verify` does a local in-memory `git merge-tree` of HEAD against `<remote>/<base>` and exits non-zero with a list of conflicting files if the PR would not merge cleanly. Pure-local — no API call, no working-tree mutation. 3. Completion / PR-creation prompts now mandate three pre-push checks: a. build (`cargo check` and/or `tsc --noEmit`), b. `makima directive verify --base <base_branch>` must exit 0, and c. an explicit goal-alignment self-check against the diff. The orchestrator is told NOT to push, create the PR, or call `makima directive update` until all three pass. Skipping any of them is documented as a directive failure. The combination means that with a linear DAG the final PR-creation task should almost never see a real conflict — when it does, that is treated as a planning bug to escalate rather than something to paper over with `-X theirs`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * fix(frontend): TS errors pre-existing on master - TaskSlideOutPanel: declare missing `selectedFileDiff` / `selectedFilePath` state hooks that were referenced everywhere but never created, and re-balance the JSX so the `<>...</>` fragment in the non-diff branch is closed (the previous indentation/braces would not parse). - api.ts: add a `getWorktreeDiff` thin wrapper around `getTaskDiff` so TaskDetail's per-file click handler type-checks (the per-file slice is a future improvement; today both return the full task diff). - WorktreeFilesPanel: remove unused `isClickable` local; the gating already reads `onFileClick` directly inline. Run after revert: `npx tsc --noEmit` exits 0. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Diffstat (limited to 'frontend/src/services')
-rw-r--r--frontend/src/services/directiveApi.ts185
1 files changed, 0 insertions, 185 deletions
diff --git a/frontend/src/services/directiveApi.ts b/frontend/src/services/directiveApi.ts
deleted file mode 100644
index fcb6636..0000000
--- a/frontend/src/services/directiveApi.ts
+++ /dev/null
@@ -1,185 +0,0 @@
-// API service for directive operations
-
-export interface DirectiveStepCounts {
- pending: number
- ready: number
- running: number
- completed: number
- failed: number
- skipped: number
-}
-
-export interface DirectiveSummary {
- id: string
- title: string
- goal: string
- status: string
- repositoryUrl: string
- prUrl: string
- prBranch: string
- createdAt: string
- updatedAt: string
- goalUpdatedAt: string
- stepCounts: DirectiveStepCounts
- version?: number
- pr_branch?: string | null
-}
-
-export interface DirectiveStep {
- id: string
- directiveId: string
- directive_id?: string
- name: string
- title?: string
- description: string | null
- taskPlan: string
- dependsOn: string[]
- status: string
- contractId: string
- /** @deprecated Use contractId instead */
- taskId: string
- orderIndex: number
- sort_order?: number
- completedAt: string
-}
-
-export interface DirectiveWithSteps extends DirectiveSummary {
- steps: DirectiveStep[]
- reconcileMode: string
-}
-
-// Alias for compatibility with context-menu branch types
-export type Directive = DirectiveSummary
-
-async function apiFetch(path: string, options?: RequestInit): Promise<Response> {
- const response = await fetch(path, {
- ...options,
- headers: {
- 'Content-Type': 'application/json',
- ...options?.headers,
- },
- })
- if (!response.ok) {
- const body = await response.json().catch(() => ({ message: response.statusText }))
- throw new Error(body.message ?? body.error ?? `API error ${response.status}: ${response.statusText}`)
- }
- return response
-}
-
-export async function listDirectives(): Promise<DirectiveSummary[]> {
- const response = await apiFetch('/api/v1/directives')
- const data = await response.json()
- return data.directives || []
-}
-
-export async function getDirective(id: string): Promise<DirectiveWithSteps> {
- const response = await apiFetch(`/api/v1/directives/${id}`)
- return response.json()
-}
-
-export async function getDirectiveSteps(id: string): Promise<DirectiveStep[]> {
- const response = await apiFetch(`/api/v1/directives/${id}/steps`)
- return response.json()
-}
-
-export async function updateGoal(id: string, goal: string): Promise<DirectiveWithSteps> {
- const response = await apiFetch(`/api/v1/directives/${id}/goal`, {
- method: 'PUT',
- body: JSON.stringify({ goal }),
- })
- return response.json()
-}
-
-export async function updateDirective(
- id: string,
- updates: { title?: string; goal?: string; version?: number },
-): Promise<DirectiveWithSteps> {
- const response = await apiFetch(`/api/v1/directives/${id}`, {
- method: 'PUT',
- body: JSON.stringify(updates),
- })
- return response.json()
-}
-
-export async function cleanupDirective(id: string): Promise<void> {
- await apiFetch(`/api/v1/directives/${id}/cleanup`, { method: 'POST' })
-}
-
-export async function createPr(id: string): Promise<{ prUrl: string }> {
- const response = await apiFetch(`/api/v1/directives/${id}/create-pr`, { method: 'POST' })
- return response.json()
-}
-
-export async function pickUpOrders(id: string): Promise<void> {
- await apiFetch(`/api/v1/directives/${id}/pick-up-orders`, { method: 'POST' })
-}
-
-export async function startDirective(id: string): Promise<DirectiveWithSteps> {
- const response = await apiFetch(`/api/v1/directives/${id}/start`, { method: 'POST' })
- return response.json()
-}
-
-export async function pauseDirective(id: string): Promise<DirectiveWithSteps> {
- const response = await apiFetch(`/api/v1/directives/${id}/pause`, { method: 'POST' })
- return response.json()
-}
-
-export async function getUserSetting(key: string): Promise<any> {
- const response = await apiFetch(`/api/v1/user-settings/${key}`)
- return response.json()
-}
-
-export async function upsertUserSetting(key: string, value: any): Promise<void> {
- await apiFetch('/api/v1/user-settings', {
- method: 'PUT',
- body: JSON.stringify({ key, value }),
- })
-}
-
-// ---- Task control APIs ----
-
-export async function sendTaskMessage(taskId: string, message: string): Promise<void> {
- await apiFetch(`/api/v1/mesh/tasks/${taskId}/message`, {
- method: 'POST',
- body: JSON.stringify({ message }),
- })
-}
-
-export async function stopTask(taskId: string): Promise<void> {
- await apiFetch(`/api/v1/mesh/tasks/${taskId}/stop`, {
- method: 'POST',
- })
-}
-
-export async function continueTask(taskId: string): Promise<void> {
- await apiFetch(`/api/v1/mesh/tasks/${taskId}/continue`, {
- method: 'POST',
- })
-}
-
-export async function startTask(taskId: string): Promise<void> {
- await apiFetch(`/api/v1/mesh/tasks/${taskId}/start`, {
- method: 'POST',
- })
-}
-
-// ---- Contract interaction APIs ----
-
-export async function sendContractMessage(taskId: string, message: string): Promise<void> {
- await apiFetch(`/api/v1/mesh/tasks/${taskId}/message`, {
- method: 'POST',
- body: JSON.stringify({ message }),
- })
-}
-
-export async function interruptContract(taskId: string): Promise<void> {
- await apiFetch(`/api/v1/mesh/tasks/${taskId}/message`, {
- method: 'POST',
- body: JSON.stringify({ message: '/interrupt' }),
- })
-}
-
-export async function getContractOutput(taskId: string): Promise<{ output: string }> {
- const response = await apiFetch(`/api/v1/mesh/tasks/${taskId}/output`)
- return response.json()
-}