feat(ui): Admin Calibration Command Desk & CCTV Surveillance Wall (Phase 4) #18
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#18
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
PR #13: docs(ui): industrial brutalist frontend redesign and tactical telemetry guidelines
What to build
Re-engineer the secondary management and surveillance views into tactical workstations.
This transforms the Occupancy Admin tab into the scientific Calibration Command Desk (proportional multiplier $ controls, nocturnal quiet-window countdown, anomaly quarantine audit table, high-contrast tactical Chart.js theme) and refactors the Video tab into a high-density 0px border-radius CCTV surveillance grid with on-screen tactical telemetry overlays powered by local
hls.min.js.Acceptance criteria
03:30 - 04:30) and auto-reconciliation status banner.[ VERIFIED ],[ AUTO_EXCLUDED ],[ MANUAL_OVERRIDE ]).hls.min.js.Blocked by
📋 Tech Debt Carried Forward from Issue #17 Code Review
The following items identified in the #17 code review should be resolved as prefactoring during Phase 4:
1. Visual & Brutalist Token Alignment
app/static/css/tactical-telemetry.css:531, removebox-shadow: inset 0 0 10px rgba(255, 42, 42, 0.2);and replace with a crisp solid border per ADR 0002.tabular-nums: Addtabular-numsto±${errorMargin}elements incommand_deck_adapter.js:162, 343andindex.html:241.2. Domain Notation Alignment
command_deck_adapter.jsandindex.html, renameN(t)andρto the canonical domain symbols $O(t)$ (Estimated Occupancy) and $k$ (Proportional Exit Multiplier) defined inCONTEXT.mdanddocs/adr/0001-two-phase-dwell-bounded-occupancy.md.3. Timezone & Millisecond Precision
toLocaleTimeString()incommand_deck_adapter.js:410with a millisecond formatter (HH:MM:SS.mmm) referencing facility time to prevent client OS timezone drift and support CCTV correlation.4. Backend Cleanliness & API Standards
DoorControlResponseinapp/schemas/models.py, bind it asresponse_modelonPOST /api/doors/{door_index_code}/control, and usestatus.HTTP_404_NOT_FOUND.app/static/js/app.js:372, replace directwindow.telemetryEngine._transportproperty access withwindow.telemetryEngine.ingestMessage(...).Phase 4 Implementation Report: Calibration Command Desk & CCTV Surveillance Wall (#18)
1. Executive Summary of Deliverables
#content-occupancy-admin):k \in [0.80, 1.30]with granular\pm 0.01and coarse\pm 0.05stepping buttons, input direct entry, and commit mutation viaPOST /api/occupancy/multiplier.\mathcal{O}_{\text{preview}}(t) = \max(N_{\text{patrol}}, \mathrm{round}(I - k \cdot E + N_{\text{patrol}}))with delta indicator\Delta\mathcal{O} = \mathcal{O}_{\text{preview}} - \mathcal{O}_{\text{active}}.03:30 - 04:30) with status banner displays ([ AUTO-RECONCILIATION: ENGAGED ]/[ AUTO-RECONCILIATION: ACTIVE IN WINDOW ]). Polling cadence throttled to 60s when inside the active window.[ VERIFIED ],[ AUTO_EXCLUDED ],[ MANUAL_OVERRIDE ]) and operator actions ([ QUARANTINE ],[ OVERRIDE // VERIFY ]).#content-video):HH:MM:SS.mmm).app/static/js/vendor/hls.min.js.flowChartInstance,occupancyChartInstance,multidayChartInstance,driftChartInstance) to zero-radius, zero-tension (tension: 0,borderRadius: 0), dark grid, and high-contrast tactical palette (cyan#00E5FF, amber#FFB000, hazard#FF2A2A).2. Carried Technical Debt Resolution (Issue #17 Review - Comment #483)
box-shadowinset glow on.portal-card.is-alarmintactical-telemetry.css. Enforcedtabular-numson\pm${errorMargin}elements across the DOM.N(t) \to \mathcal{O}(t)and\rho \to kacross DOM labels, schemas, and test suites.toLocaleTimeString()with facility timeHH:MM:SS.mmmreferencingfacility_utc_offset_minutes(-240m).DoorControlResponseschema andLiteral[...]commands inmodels.py. Standardized error responses toHTTPException(status_code=404, detail=..., headers=...) from err. Boundresponse_model=DoorControlResponseindoor_controller.py. Addedset_active_exit_multiplier_asyncinOccupancyManagerto prevent controller seam breaches. Decoupled transport inspection withtelemetryEngine.isConnected().3. Verification & Test Evidence
node --test tests/frontend/*.test.jsin ~387ms):CalibrationDeskbounds, stepping math, instantaneous recalculation preview formula, quiet window countdown, trust badges, and anomaly table rendering.CommandDeckAdapterHUD formatting, left wing portal matrix, right wing tachometer, and directional flux feed.TelemetryEnginesnapshot immutability, clock skew smoothing, alarm hoisting, Little's Law dwell envelope, and nocturnal quiet window across midnight rollover.python3 -m pytestin 9.49s).ruff check .andruff format --check .100% clean (0 errors).4. Pull Request
docs/industrial-brutalist-ui-redesignunder PR #13 (commit781759a).🔍 Code Review: Issue #18 — Calibration Command Desk & CCTV Surveillance Wall (Phase 4)
Fixed point:
cdb7b90→ HEAD (074ed3d)Diff: 20 files changed, +1908 / −431
Commits reviewed:
781759afeat(ui): Calibration Command Desk & CCTV Surveillance Wall (Phase 4) (#18)074ed3dfix(telemetry): emit facility_utc_offset_minutes on initial WS handshakeStandards
Hard Violations
app/static/css/tactical-telemetry.css:705, 979color: var(--color-text-main);references a non-existent CSS variable. The approved design token defined in:rootis--color-text-primary.app/static/index.html:326, 373, 621, 636<i class="fa-solid fa-bolt">,fa-calculator,fa-video) contrary to the zero-CDN transition mandate.app/static/js/app.js:3097-3130startCalibCountdownTimerinstantiates an independentsetInterval(1000)counter rather than deriving countdowns synchronously fromsnapshot.serverTimeviaTelemetryEngine.app/services/door_service.py:1253await ws_manager.broadcast_json(...)calls a non-existent method onRealtimeConnectionManager(the defined method isbroadcast()), causing a silent failure swallowed byexcept Exception.Judgement Calls (Fowler Smell Baseline)
app/static/js/app.js:2889-2906vscalibration_desk.js:32-74app.jsduplicate the clamping and preview calculation logic already isolated insidecalibration_desk.js.monitor_service.py:37, 47, 113,occupancy_service.py:549, 1039-240(facility_utc_offset_minutes) is duplicated across 10+ broadcast and payload sites rather than referencing a centralized facility configuration constant.calibration_desk.js:216<tr class="... transition ...">introduces default 150ms smooth transition, diverging from the brutalist instant-switch /<50msrule.Spec
(a) Missing or Partial Requirements
X_{\text{raw}}), scaled exits (X_{\text{adj}} = k \cdot X_{\text{raw}}), and baseline offset (\beta) was not integrated into#content-occupancy-admin.#analytics-error-margin-badge(index.html:1001) still lackstabular-numsand retains consumer classes (badge badge-primary).(b) Scope Creep (Unrequested Behaviour)
074ed3d&monitor_service.pyfacility_utc_offset_minutesprotocol field to initial WS handshake and monitor broadcasts. While helpful, backend protocol extensions were unrequested in Phase 4 frontend scope.index.html:841(Simulation Controls)[ SIMULATE ]) in the calibration header outside of the Phase 4 specification.(c) Implemented-but-Wrong Requirements
app.js:1109app.js:1109attempts to callwindow.telemetryEngine.getRawSnapshot(), butTelemetryEngineonly definesgetSnapshot(). The check always evaluates to false, leaving CCTV HUD timecodes permanently falling back to-240.app.js:3086clobbers#calib-window-badgewith legacy classesbadge badge-success/badge-warning, overwriting the tactical CSS design tokens.calib-window-countdown,calib-target-guards,calib-multiplier-variance) exist in both#content-occupancy-adminand#content-analytics, causing selector collisions.TACTICAL_CHART_FONTinapp.js:2477specifies system fallbacks (Consolas, Monaco...) rather than declaringJetBrains Monoas the primary font family.Tech Debt Status from Issue #17
tactical-telemetry.css)N(t)/\rho \to O(t)/k)O(t)andkincommand_deck_adapter.js.${hh}:${mm}:${ss}.${mmm}withtabular-nums.tabular-numson Margin Elementscontrol_doorEndpointDoorControlResponseandstatus.HTTP_404_NOT_FOUND._transport)_transportaccess removed, but replaced with buggy call to non-existentgetRawSnapshot()inapp.js:1109.Summary
ws_manager.broadcast_jsoncall indoor_service.py; S1: Undefined CSS token--color-text-main.getRawSnapshot(); W3: Duplicate DOM IDs across tabs.📋 Tech Debt Hand-off for Issue #19 (Phase 5: Air-Gapped Lockdown)
The following items should be addressed in Issue #19 alongside the standalone Tailwind CLI integration and CDN deprecation:
app/services/door_service.py:1253, changeawait ws_manager.broadcast_json(...)toawait ws_manager.broadcast(...).app/static/js/app.js:1109, changewindow.telemetryEngine.getRawSnapshot()towindow.telemetryEngine.getSnapshot().app/static/css/tactical-telemetry.css:705, 979, replacevar(--color-text-main)withvar(--color-text-primary).#content-analytics(calib-window-countdown,calib-target-guards, etc.) to prefix withanalytics-so they do not collide with#content-occupancy-admin.<i class="fa-solid ...">tags in#content-occupancy-adminand#content-videowith tactical ASCII brackets (e.g.[ HLS ],[ CALC ]) as part of Phase 5 CDN removal.TACTICAL_CHART_FONTto'JetBrains Mono'.FACILITY_UTC_OFFSET_MINUTES = -240inapp/config.pyrather than repeating magic number-240.