feat(occupancy): reviewed monthly historical passenger-flow backfill #160
Labels
No labels
blocked
bug
enhancement
high-priority
low-priority
needs-info
needs-triage
ready-for-agent
ready-for-human
referenced
research
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gabogg/hikcentral#160
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?
Research question: can we import historical passenger-flow data from HikCentral to retroactively fill our database, so the statistics deck (and calibration) have history from before this system started recording?
Why
The prod DB only has counted events from 2026-09-03. Consequences:
HikCentral has been counting for much longer.
What we know
…/aiapplication/v1/people/advance/resourceGroupList(group totals;occupancy_service.py:2077);…/people/resourceGroupRealTimeCount.app/docs/artemis_catalog.json,app/docs/artemis_openapi.json) lists…/people/statisticsHeatMapByTime. Its description is per-camera heat map by time. Nothing is obviously a historical passenger-flow report.IN/OUTevents with timestamps (ADR 0005: one camera per group), plus cycle-quality, calibration and audit records. Startup already runsreconcile_and_quarantine_historical_anomalies_asyncover history (see docs/design-history/occupancy-calibration-model-redesign.md, "Startup Backfill Requirement").Questions to answer
hikctl) or a background job.Output
A research note under
docs/answering 1–5 from primary sources, with a recommendation. Then, if feasible, an RFC/ADR proposal and implementation issues. Needs a maintainer decision on questions 2 and 3 before implementation.Maintainer triage — 2026-09-27
Maintainer accepts research-first scope and will revisit this when in the office; deferred for now. Do not begin importer implementation. Establish available historical source, granularity, identity, retention and overlap from primary V2.6.3 sources before deciding representation, quality/calibration/baseline eligibility or operational import behavior. Implementation remains gated on a later design interview.
Verified read-only research facts — 2026-09-27
The maintainer authorized SSH/OpenAPI inspection and publication of these facts. SSH authenticated as
Administradoron the supplied host;Administratorwas rejected. Installed registry versions:The bundled
docs/OpenAPI Developer Guide/Video API.docxsection labelled “Statics total number by time” contains the event-subscription description and/api/eventService/v1/eventSubscriptionByEventTypescontract. The generated catalog repeats this mismatch. Therefore the local catalog cannot establish absence of historical passenger-flow support.Hikvision's official OpenAPI reference lists
POST /artemis/api/aiapplication/v1/people/statisticsTotalNumByTime. This confirms a historical candidate in vendor documentation, not its deployed V2.6.3 contract or availability.Windows denied access during installed-document discovery. No historical endpoint request was sent, no secrets were published, and no server configuration/data was changed. Request/response fields, granularity, retention, timezone/boundaries, paging, licensing and overlap remain unverified.
Retain needs-triage, research-first scope and the maintainer's office deferral. Do not implement an importer; settle representation, quality and operational behavior only after matching primary documentation and read-only probes establish the facts.
Follow-up: deployed historical route confirmed — 2026-09-27
After the maintainer asked whether the route could be checked through SSH, a temporary tunnel to the deployed Artemis listener on port 9016 and the app's existing HMAC signing code were used for read-only queries. The tunnel was closed afterward.
POST /artemis/api/aiapplication/v1/people/statisticsTotalNumByTimereturnedcode: 0,msg: Successon deployed OpenAPI 2.6.3.20250826. A bounded request for one member camera of a people-counting group usedpageNo: 1,pageSize: 1,cameraIndexCodes: <one camera ID>,statisticsType: 0(hour), andstartTime/endTimecovering 2026-08-31 12:00–13:00 in facility time. The response hadcompleteness: 1and two aggregate rows withtime,cameraIndexCode,enterNum,exitNum. The returned timestamps were exactly 12:00 and 13:00. No camera identity or counts are published here.This confirms historical hourly people-counting aggregates exist before the app's 2026-09-03 recording start, for at least one camera on 2026-08-31. It does not establish event-level history, all-camera coverage or retention depth. The two returned boundary rows despite requested
pageSize: 1make endpoint inclusivity and pagination behavior explicit research tasks; do not infer a safe importer loop yet. Group-to-camera mapping and deduplication against existing local data remain unresolved.Hikvision's official people-counting OpenAPI example documents the same request fields and aggregate shape. Continue research-first; retain
needs-triageand the maintainer's importer-design deferral.Confirmed implementation scope — 2026-09-27
The maintainer completed the design interview and explicitly authorized implementation planning, decomposition and publication. This resolution supersedes the earlier research-first deferral and
needs-triagewording above. The deployed Artemis 2.6.3 route was verified to return historical camera-hour IN/OUT aggregates on 2026-07-31 and 2026-08-31. Its boundary rows are inclusive at the tested hour; page 1 and 2 repeated rows despitepageSize: 1. Use bounded ranges and source-key deduplication, not page progression as a completion signal. Hikvision's people-counting guide requires the report to be generated first.End-to-end behavior
Child issues and order
Related existing work: #113 (historical schedule), #114 (schedule activation), #161 (holiday/event context), #109 (Closed Day calibration), #58 (shared flow-query semantics), #62 (future multi-camera groups), #157 (statistics performance), and #73 (i18n identifiers). #62 remains trigger-based; the others are coordination points or explicit prerequisites as stated on the children. The four child issues are independently scoped and
ready-for-agent; dependencies do not waive implementation gates. #160 is their ready-for-agent umbrella. The repository RFC and one draft PR carry the full operation specification.Draft implementation PR: #166 — reviewed historical passenger-flow backfill. The PR currently contains the agreed RFC and glossary; implementation will follow on the same branch.
research: import historical passenger flow from HikCentral to backfill the databaseto feat(occupancy): reviewed monthly historical passenger-flow backfillgabogg referenced this issue2026-09-27 23:39:54 +00:00
gabogg referenced this issue2026-09-28 00:03:59 +00:00
Delivery split (2026-09-28): #166 now closes only #162 (retrieval and staging). #163, #164 and #165 continue as stacked draft PRs #170, #171 and #172. This umbrella stays open until #165 lands. Details: #166 (split comment).