seam: FleetPulseDocument shape fix, ingest stub-test update, eslint generated-client ignore (from #17) #84
Labels
No labels
in-progress
in-review
ready-for-agent
seam-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
patrick/Polaris#84
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?
Found while working #17 (T-B — ingest & projector)
Three small fixes outside
backend/src/polaris/ingest/**,backend/src/polaris/projector/**,backend/src/polaris/worker/handlers/project_windows.py,backend/src/polaris/api/routers/ingest/**,backend/tests/**/{ingest,projector}/**,frontend/src/app/features/ingest/**,frontend/src/app/features/vehicles/components/heatmap*(#17's owned paths), made directly in #17's PR rather than leaving the ticket blocked or broken, per the precedent in issues #52/#57/#66. Flagged here for traceability.1.
backend/src/polaris/api/dto/ingest.py—FleetPulseDocumentshape correctedThis file's own docstring already flagged the problem:
FleetPulseDocument/FleetPulseSite/FleetPulseTimeBlockwere declared with an inferred shape (PH1.7, issue #15 — no real sample existed yet) — flattime_blocksper site, a top-levelvehicle_id, WKTpolygontext. The real feed (confirmed againstdocs/design_document.md"The raw feed we receive" and the sample feed #14 built atbackend/src/polaris/seed/data/fleetpulse_sample.json) has no top-levelvehicle_id(it repeats per-site — a document is "per vehicle"),observations_per_daykeyed by weekday name with a list of observation groups per weekday (Q4), and a nested GeoJSONpolygon.geometry.Fix (already in #17's PR): the canonical schema now lives in
polaris.ingest.schema(T-B's owned package — the ingest pipeline and its tests must not depend onpolaris.api), andpolaris.api.dto.ingestre-exports those same classes for the API boundary/OpenAPI, same pattern every other DTO in that module already follows.backend/openapi.jsonregenerated in the same PR (docs/12-implementation-plan.md's PH1.7 row: "openapi.json regenerated only in PRs that change a DTO").Owns:
backend/src/polaris/api/dto/ingest.py(theFleetPulseDocument/FleetPulseSite/FleetPulseTimeBlock/FleetPulseObservationGroup/FleetPulsePolygon/FleetPulseGeometryre-exports only —IngestResponse/IngestRecordReadare unaffected),backend/openapi.json.2.
backend/tests/unit/api/routers/plans_locks_assignments_stub_test.py— two ingest endpoints are no longer501This PH1.7 shared stub-test module asserted
501forGET /ingest/records[/{id}]andPOST /ingest/fleetpulseunder the right role. Both are real, DB-touching implementations now. Since this module is a plainTestClientunit test with no database, the "wrong role → 403" coverage for these paths stays (a 403 never reaches the DB-touching handler body); the "right role → real behaviour" coverage moved tobackend/tests/integration/ingest/test_pipeline.py(T-B's owned path,testcontainers-backed).Owns:
backend/tests/unit/api/routers/plans_locks_assignments_stub_test.py(the ingest-specific list entries/test functions only — every other router's stub coverage in that file is untouched).3.
frontend/eslint.config.js— ignorecore/api/generated/**openapi-typescript's generated client (npm run api:gen, git-ignored, never hand-written) emits index-signature types ({ [key: string]: T }) for everyadditionalProperties/Dict-shaped schema.tseslint.configs.stylistic's@typescript-eslint/consistent-indexed-object-styleflags every one of them — over 200 errors the momentbackend/openapi.jsonactually exists to generate from, which is exactly what #17 is the first ticket to hit (ng lintwas green before because no session had generated the client and then linted). Added anignores: ['src/app/core/api/generated/**']block — the generated file's style was never "ours" to fix per.gitignore's own comment ("never hand-written, never committed").Owns:
frontend/eslint.config.js(the addedignoresblock only).No action needed
Already resolved in #17's PR — this issue is for traceability, same as #57/#66, not a blocker.