T-E — Plan orchestration: snapshot builder, result writer, solver_run/plan_version lifecycle, publish/supersede #20

Open
opened 2026-09-11 09:02:12 +00:00 by bart · 0 comments
Collaborator

Parent

Row T-E in docs/12-implementation-plan.md (branch, owned paths and doc section are defined there).

What to build

A planner triggers a run through the API; the worker builds a PlanningSnapshot from the database, calls the engine and validator, writes a plan_version with assignments, findings and unassigned jobs, and exposes it via the plans, runs, tasks and opportunities endpoints. Publishing supersedes per date and moves jobs open → planned → open. Until T-C/T-D merge, a stub engine/validator under tests/ returns fixture results.

Acceptance criteria

  • Exhaustive transition tables for solver_run and plan_version state machines, every transition through a domain service with an audit row
  • Publish/supersede integration test: publishing v2 for a date supersedes v1 for that date only; published assignments are never mutated
  • GET /tasks/{id} reports task progress; opportunities endpoint returns computed opportunities
  • Snapshot built from seeded data round-trips through the contracts
  • No stub crosses into src/; docs/04 plan-version rules updated

Blocked by

  • #15 — API surface: every DTO and endpoint from docs/09-api.md stubbed, openapi.json committed
  • #14 — Seed: sample FleetPulse feed, catalogue, three crews, week of shifts, dev persons
  • #6 — Worker skeleton: claim loop, task handler registry, jobs discovery, heartbeat
## Parent Row **T-E** in `docs/12-implementation-plan.md` (branch, owned paths and doc section are defined there). ## What to build A planner triggers a run through the API; the worker builds a `PlanningSnapshot` from the database, calls the engine and validator, writes a `plan_version` with assignments, findings and unassigned jobs, and exposes it via the plans, runs, tasks and opportunities endpoints. Publishing supersedes per date and moves jobs `open → planned → open`. Until T-C/T-D merge, a stub engine/validator under `tests/` returns fixture results. ## Acceptance criteria - [ ] Exhaustive transition tables for `solver_run` and `plan_version` state machines, every transition through a domain service with an audit row - [ ] Publish/supersede integration test: publishing v2 for a date supersedes v1 for that date only; published assignments are never mutated - [ ] `GET /tasks/{id}` reports task progress; opportunities endpoint returns computed opportunities - [ ] Snapshot built from seeded data round-trips through the contracts - [ ] No stub crosses into `src/`; docs/04 plan-version rules updated ## Blocked by - #15 — API surface: every DTO and endpoint from docs/09-api.md stubbed, openapi.json committed - #14 — Seed: sample FleetPulse feed, catalogue, three crews, week of shifts, dev persons - #6 — Worker skeleton: claim loop, task handler registry, jobs discovery, heartbeat
Sign in to join this conversation.
No labels
ready-for-agent
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
patrick/Polaris#20
No description provided.