PH1.4 -- Engine contracts: PlanningSnapshot, PlanResult, Finding, projector/scorer I/O, task payloads, code lists, fixtures #55
No reviewers
Labels
No labels
ready-for-agent
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
patrick/Polaris!55
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/engine-contracts"
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?
Summary
polaris.contracts: frozen Pydantic models crossing module boundaries per the import-rules table indocs/12-implementation-plan.md--PlanningSnapshot(engine/validator input),PlanResult(engine output),Finding(validator output:code+ structuredparams,messageexplicitly dev-only), projector I/O (ProjectionInput/ProjectionOutput) and scorer I/O (ScoreInput/ScoreOutput) including theAdjustedConfidenceFnhook signature agreed here for T-B/T-G, and theTaskPayloaddiscriminated union (project_windows,solve,solve_event,validate,score).polaris.contracts.codes):FindingCode+ severity table,NotificationKind, anderror_codes()/build_x_polaris_codes()for thex-polaris-codesOpenAPI extension.backend/tests/fixtures/snapshots/:tiny.json(hand-computable optimum),medium.json(realistic mix),every_lock_type.json(all elevenplan_locktypes).polaris replay-run --file <snapshot>(cli/replay_run.py): loads and summarises a snapshot, runs it through clearly-marked stubsolve()/validate()(T-C/T-D don't exist yet). Discovered automatically by the existing CLI package walk.backend/tests/unit/test_import_rules.py: a data-driven AST walker enforcing the full backend import-rules table, at the path the docs already reserve for it. Only checks a package once it exists on disk, so later tracks get coverage for free.Acceptance criteria (issue #12)
PlanningSnapshotserialises to JSON and back with equalityx-polaris-codesin the generated spec -- the builder function exists and is tested; wiring it intobackend/openapi.jsonneeds a 2-line change topolaris/cli/openapi.py, which this ticket doesn't own. Filed as seam request #54.polaris replay-run --file <snapshot>runs end to end with a no-op enginecoreNotes for downstream tracks
FindingCodeseverity is a table (FINDING_SEVERITY), not derived from theE_/W_/I_prefix --W_IDLE_CREW/W_WAITINGare documentedinfoseverity indocs/04-lifecycles.mddespite theW_prefix. BuildFindings viaFinding.for_code(...).NotificationKindis an initial v1 list inferred from the scenarios (no doc enumerates one) -- flagged on #12, extending it later is a!commit sincecontracts/is sealed after PH1.TaskPayloadsplits event-triggered replans into their ownsolve_eventkind (matching PH5.2'sworker/handlers/solve_event.py) rather than folding everything intosolve'smodefield -- flagging in case T-E/PH5.2 want a different split before it's load-bearing.Test plan
ruff check/ruff format --checkcleanmypy --strict srcclean (39 source files)pytestgreen: 70 passed (62 unit + 8 integration, including all pre-existing PH0.2 tests)Closes
Closes #12
🤖 Generated with Claude Code
https://claude.ai/code/session_013YioTVKBPoE6thZqbnTtnM
polaris openapi#54