API And Solver Policy
This page holds the longer reference material that must stay aligned with
src/api/routes.rs, src/api/dto.rs, src/solver/service.rs, solver.toml,
and the visible API guide in static/app/shell/api-guide.mjs.
REST API
GET /healthGET /infoGET /demo-dataGET /demo-data/{id}POST /jobsGET /jobs/{id}GET /jobs/{id}/statusGET /jobs/{id}/snapshotGET /jobs/{id}/analysisPOST /jobs/{id}/pausePOST /jobs/{id}/resumePOST /jobs/{id}/cancelDELETE /jobs/{id}GET /jobs/{id}/events
Lifecycle Semantics
pauserequests an exact runtime-managed pause and checkpointresumecontinues from the retained checkpoint- the user-facing Stop control calls
cancelto stop a live or paused job deleteremoves a terminal retained job before the next fresh solveGET /jobs/{id}andGET /jobs/{id}/statusreturn the same summary payloadsnapshot_revision={n}is optional on both snapshot and analysis requests- reconnects bootstrap from current runtime status plus retained snapshot revision, not from cached SSE text
Payload Shape
The transport payload mirrors the domain model directly. The important field is
employeeIdx, which is the scalar planning assignment chosen for each shift.
{
"employees": [
{
"id": "employee-0",
"name": "Alex Smith",
"homeHub": "critical_care",
"skills": ["Critical care doctor"],
"unavailableDates": [],
"undesiredDates": [],
"desiredDates": []
}
],
"shifts": [
{
"id": "shift-1",
"start": "2024-01-01T08:00:00",
"end": "2024-01-01T16:00:00",
"location": "Critical care",
"careHub": "critical_care",
"requiredSkill": "Critical care doctor",
"employeeIdx": 0
}
],
"score": "0hard/0soft"
}
Telemetry is intentionally a UI-facing projection, not the raw runtime type.
Fields like elapsedMs, movesPerSecond, and acceptanceRate are derived for
display.
Solver Policy
The runtime source of truth is ../solver.toml.
The currently shipped policy is deliberately narrow:
construction_heuristic = cheapest_insertion- one local-search phase
- nearby scalar change/swap selectors
late_acceptanceaccepted_count
That is not an accident. A candidate sweep against broader scalar phase-2/3 variants showed that the current nearby baseline remained the best balanced policy for this dataset and 30-second budget.
The canonical description of current behavior is solver.toml, the code,
README.md, this file, and WIREFRAME.md.