seam: wire x-polaris-codes into polaris openapi #54
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#54
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?
Why
PH1.4 (#12) builds
polaris.contracts.codes.build_x_polaris_codes(), which returns the{findings, errors, notifications}structure that is meant to be attached to the OpenAPI spec under thex-polaris-codesextension key, so the frontend's Transloco key-parity CI check (docs/12-implementation-plan.md"Frontend decoupling rules") can diff against it.PH1.4 owns only
backend/src/polaris/contracts/**,backend/tests/fixtures/snapshots/**andbackend/src/polaris/cli/replay_run.py(per its row indocs/12-implementation-plan.mdandCLAUDE.md's "don't edit files you haven't edited before" rule). Wiring the extension into the emitted spec means editingbackend/src/polaris/cli/openapi.py(currently justspec = create_app().openapi(); out_path.write_text(...)), which belongs to the sealed PH0.2 output, not to PH1.4 -- so per the ticket's own instructions ("if it turns out you'd need to edit a file outside your ownership ... stop and post it as a seam request") that file is left untouched and this ticket is filed instead.What to change
In
backend/src/polaris/cli/openapi.py::run, after buildingspec, merge in the extension before writing:That's the whole change --
build_x_polaris_codes()already exists, is fully unit tested (backend/tests/unit/contracts/test_codes.py), and needs no arguments. Regeneratebackend/openapi.json(polaris openapi) in the same PR so the committed spec includes the extension.Acceptance
backend/openapi.json's top-level object has anx-polaris-codeskey withfindings/errors/notificationsarrays matchingpolaris.contracts.codes.build_x_polaris_codes().Blocks
Fix drafted on
feature/openapi-code-catalogue(local, not pushed yet): exactly the two-line change above. Holding off on pushing/opening the PR and regeneratingopenapi.json—polaris.contractsdoes not exist onmainyet (PR #55 is still open, not merged), sobuild_x_polaris_codescannot be imported or verified. Will rebase, regenerate the spec, and open the PR once #55 merges.