PH1.4 — Engine contracts: PlanningSnapshot, PlanResult, Finding, projector/scorer I/O, task payloads, code lists, fixtures #12
Labels
No labels
ready-for-agent
No milestone
No project
No assignees
1 participant
Notifications
Total time spent: 9 minutes 50 seconds
Due date
bart
9 minutes 50 seconds
No due date set.
Blocks
Depends on
#15 PH1.7 — API surface: every DTO and endpoint from docs/09-api.md stubbed, openapi.json committed
patrick/Polaris
#17 T-B — Ingest & projector: FleetPulse ingest, pure presence projector, P12, heatmap on P06
patrick/Polaris
Reference
patrick/Polaris#12
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
Row PH1.4 in
docs/12-implementation-plan.md(branch, owned paths and doc section are defined there).What to build
The frozen Pydantic contracts crossing module boundaries exist:
PlanningSnapshot,PlanResult,Finding(code + params), projector and scorer I/O, and theTaskPayloadunion. Closed code lists (finding codes, error codes, notification kinds) are exported bypolaris openapiasx-polaris-codes. Three fixture snapshots and apolaris replay-run --fileskeleton ship with them. Theadjusted_confidencehook signature is agreed here for T-B/T-G.Acceptance criteria
PlanningSnapshotserialises to JSON and back with equalityx-polaris-codesin the generated spec (resolved via seam request #54, PR #65).polaris replay-run --file <snapshot>runs end to end with a no-op enginecoreBlocked by
Starting PH1.4 on branch
feature/engine-contracts(fromdevelop, already includes PH0.2).Owned paths for this ticket:
backend/src/polaris/contracts/**backend/tests/fixtures/snapshots/**backend/src/polaris/cli/replay_run.pyWill not touch
polaris.{core,api,db}orpolaris.worker/domain/tasks.py(owned by the concurrent #6 worker-skeleton session). Wiring thex-polaris-codesOpenAPI extension intopolaris openapi-- if that needs a change tocli/openapi.pybeyond what's clearly additive/owned, I'll flag it here as a seam request instead of editing outsidecontracts/.polaris openapi#54Progress update -- contracts, fixtures and replay-run skeleton are built and green (ruff, ruff format, mypy --strict, pytest all pass). Four of five acceptance criteria are ticked. Flagging a few things:
Seam request filed: #54 -- wiring
x-polaris-codesintobackend/openapi.jsonneeds a 2-line change topolaris/cli/openapi.py, which this ticket doesn't own (see reasoning there).polaris.contracts.codes.build_x_polaris_codes()exists and is fully tested; only the actual wiring into the committed spec is blocked. Left that AC box unchecked with a note.Two modelling decisions future tracks should know about (not formal
Qns, since no doc left them open -- these are new ground this ticket had to cover):FindingCodeseverity is NOT always derivable from theE_/W_/I_prefix.docs/04-lifecycles.md's validator table marksW_IDLE_CREWandW_WAITINGasinfoseverity despite theW_prefix.polaris.contracts.codes.FINDING_SEVERITYis a per-code table (source of truth = the doc's severity column, not the prefix) -- T-D (validator, #19) should buildFindings viaFinding.for_code(...), which reads this table, rather than deriving severity from the code string.NotificationKindis an initial v1 list I inferred from the scenarios that mention a notification (plan_draft_ready,event_replan_ready,technician_day_changed,job_on_hold,solver_failed,ingest_rejected,vehicle_pattern_stale,job_unplannable) -- no doc enumerates a closed list. PH6.2 (api-notifications, #43) will likely need to add kinds; sincecontracts/is sealed after PH1, that's a!commit with a changelog entry perdocs/12-implementation-plan.md, not a normal PR.adjusted_confidencehook signature (for T-B #17 / T-G #22):polaris.contracts.scorer.AdjustedConfidenceFn-- aProtocoltakingAdjustedConfidenceInputs(feed_confidence,site_score,vehicle_site_weekday_score,floor,ceiling) and returningfloat. T-B calls it per window it builds; T-G implements it inprojector/adjust.py(PH4.3). Seebackend/tests/unit/contracts/test_projector_scorer.py::test_adjusted_confidence_hook_signature_is_usablefor a worked example.TaskPayloadkinds:project_windows,solve,solve_event,validate,score--solvecoversdaily/override/manual(mode carried in the payload);solve_eventis the separate freeze-window path PH5.2 (#34) names its own handler file for. If T-E (#20) or PH5.2 want a different split, that's a contracts change (!commit) -- flagging now so it's a deliberate decision, not a surprise later.Opening the PR next.