feat(coder): boulder state — cross-session plan persistence + auto-resumption
New plans table (id, project_id, title, description, status, flow_run_id, progress_pct, items_total, items_completed, metadata, timestamps) with CHECK constraints and indexes. Plan store (plan-store.ts): createPlan, getPlan, listPlans, listActivePlans, updatePlan, updatePlanFromRun, findPlanWithRunningRun, planStatusFromRun. Flow-runner integration: onRunTerminal callback fires on every terminal transition (complete/fail/cancel) and updates linked plans automatically. 5 API endpoints: GET /api/plans, GET /api/plans/active, GET /api/plans/:id, POST /api/plans, PATCH /api/plans/:id. 484 tests pass, build clean.
This commit is contained in:
16
apps/coder/src/services/__tests__/plan-store.test.ts
Normal file
16
apps/coder/src/services/__tests__/plan-store.test.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { planStatusFromRun } from '../plan-store.js';
|
||||
|
||||
describe('planStatusFromRun', () => {
|
||||
it('maps completed to completed', () => {
|
||||
expect(planStatusFromRun('completed')).toBe('completed');
|
||||
});
|
||||
|
||||
it('maps failed to failed', () => {
|
||||
expect(planStatusFromRun('failed')).toBe('failed');
|
||||
});
|
||||
|
||||
it('maps cancelled to cancelled', () => {
|
||||
expect(planStatusFromRun('cancelled')).toBe('cancelled');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user