refactor(ui): External CDN Deprecation, Standalone Tailwind CLI Integration (Candidate 4) & Air-Gapped Lockdown (Phase 5) #19
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#19
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
Partially addresses Issue #14: refactor(architecture): telemetry streaming, command deck, and standalone CSS tooling deepening (Candidate 4: Standalone Zero-Build Tailwind CLI Tooling Seam).
What to build
Complete the contract phase of the frontend overhaul by severing all runtime CDN dependencies, compiling an offline Tailwind utility bundle with zero npm/Node.js dependencies to protect legacy tabs (
content-console,content-probes,content-logs) from unstyled collapse, removing dead legacy code, and enforcing automated air-gapped quality gates.Acceptance criteria
scripts/(single standalone binary, zero npm, zeronode_modules) compiling an offlinetactical-bundle.min.csscovering legacy secondary tabs.cdn.tailwindcss.com,cdnjs.cloudflare.com,cdn.jsdelivr.net) permanently removed fromindex.html.content-console,content-probes,content-logs) retain intact layout and styling when loaded completely offline.app.jsandstyles.css.pytestasserting zero external HTTP/HTTPS network requests are made during page initialization.border-radius: 0pxandfont-variant-numeric: tabular-numson all dynamic metrics.pytesttest suite executes 100% green offline.Blocked by
📋 Tech Debt Carried Forward from Issue #18 Code Review
The following items identified during the #18 code review must be resolved during Phase 5 alongside the standalone Tailwind CLI integration and CDN lockdown:
1. Fix Broken Runtime Calls
door_service.py:1253: Changeawait ws_manager.broadcast_json(...)toawait ws_manager.broadcast(...)(RealtimeConnectionManagerdoes not havebroadcast_json).app.js:1109: Changewindow.telemetryEngine.getRawSnapshot()towindow.telemetryEngine.getSnapshot()so the CCTV HUD timecode syncs properly.2. Design System & CSS Corrections
app/static/css/tactical-telemetry.css:705, 979, replacevar(--color-text-main)withvar(--color-text-primary).TACTICAL_CHART_FONT(app.js:2477) to'JetBrains Mono'.<i class="fa-solid ...">tags in the newly added Phase 4 templates (#content-occupancy-adminand#content-video), replacing them with tactical ASCII indicators ([ CAM ],[ CALC ], etc.).3. DOM Collisions & Architecture
#content-analytics(calib-window-countdown,calib-target-guards,calib-multiplier-variance) to prefix withanalytics-to avoid collisions with#content-occupancy-admin.-240(facility_utc_offset_minutes) toapp.config.settings.facility_utc_offset_minutes.Phase 5 Implementation Report: External CDN Deprecation, Standalone Tailwind CLI & Air-Gapped Lockdown (#19)
1. Executive Summary of Deliverables
scripts/tailwindcsswith zero npm, zero Node.js, and zeronode_modulesoverhead (strict adherence to ADR 0002).scripts/build-css.shcompilingapp/static/css/input.cssinto minified offlineapp/static/css/tactical-bundle.min.css.tailwind.config.jsscanningapp/static/**/*.{html,js}and enforcingborderRadius: { DEFAULT: '0px', ... }.<script>and<link>tags (cdn.tailwindcss.com,cdnjs.cloudflare.com,cdn.jsdelivr.net) fromapp/static/index.html.[HUD],[OCC],[ANL],[CCTV],[CLI],[LOG],[CAM],[CALC],[CFG],[✓],[✕],[!]).<style>blocks inindex.htmlin favor of compiled CSS bundle.#content-console), API capability probes (#content-probes), and system event logs (#content-logs) styled and completely intact without runtime network access.initOperatorCarousel,moveCarouselToSlide,updateAutoScrollUI,toggleAutoScroll), auto-scroll interval timers, and dead state variables fromapp.js.renderRankedDoors,renderDoorsDashboardelement queries).app/static/css/styles.css.test_static_assets.pyfrom xfail into strict regression tests:test_index_html_strictly_air_gapped_no_external_cdns: verifies 0 external HTTP/HTTPS resource links.test_tactical_bundle_css_standalone_compilation: verifies compiled bundle presence (>10KB) and universal zero-radius rules.test_standalone_tailwind_cli_binary_executable: verifies local CLI tool existence and executable flags.test_dom_invariants_zero_radius_and_tabular_nums: verifiestabular-numson 16 dynamic metrics across HUDs and calibration desks and audits 0px border-radius invariants.2. Carried Technical Debt Resolution (Issue #18 Review - Comment #498)
door_service.pybroadcasts toawait ws_manager.broadcast(...)and extracted centralized async helper_broadcast_door_overview().app.js:1009to usewindow.telemetryEngine.getSnapshot().var(--color-text-main)withvar(--color-text-primary)inapp/static/css/tactical-telemetry.css.'JetBrains Mono'.<i class="fa-solid ...">tags in favor of tactical monospaced ASCII indicators.#content-analytics(analytics-calib-active-multiplier,analytics-calib-target-guards,analytics-calib-multiplier-variance,analytics-calib-window-countdown,analytics-calib-empirical-ratio) and updatedrenderCalibrationEquationCardto hydrate both views cleanly without ID collision.-240toapp.config.settings.facility_utc_offset_minutesacross backend services/schemas, and boundDEFAULT_FACILITY_UTC_OFFSET_MINUTESconstant on frontend.3. Verification & Test Evidence
pytestin 24.61s).node --test tests/frontend/*.test.jsin 720ms).ruff check .(0 errors) andruff format --check .(0 errors).4. Pull Request
docs/industrial-brutalist-ui-redesignunder PR #13 (commitd4660b6).🔍 Code Review: Issue #19 — External CDN Deprecation, Standalone Tailwind CLI & Air-Gapped Lockdown (Phase 5)
Fixed point:
074ed3d→ HEAD (d4660b6)Diff: 16 files changed, +499 / −509
Commit reviewed:
d4660b6feat(ui): External CDN Deprecation, Standalone Tailwind CLI & Air-Gapped Lockdown (Phase 5) (#19)Standards
Hard Violations
app/static/css/input.css:17, 32, 120&index.html:21, 24, 50backdrop-filter: blur(12px);,bg-gradient-to-tr,bg-gradient-to-r, and soft glowingbox-shadowrules, violating the brutalist zero-gradient / zero-soft-shadow mandate.app/services/door_service.py:1187, 1198set_exclusionandset_category_exclusionlack explicit return type hints (-> None).Judgement Calls (Fowler Smell Baseline)
door_service.py:1191-1196vs1203-1208try: asyncio.create_task(self._broadcast_door_overview()) except Exception: passblock is copy-pasted across exclusion methods with empty exception suppression.app/static/css/styles.cssstyles.csswas reduced to 35 lines but is no longer linked anywhere inindex.htmlordocs.html, remaining as an unreferenced orphan file.Spec
(a) Missing or Partial Requirements
docs.htmlStill Loads External CDNs: Whileindex.htmlis completely air-gapped,app/static/docs.htmlstill links to FontAwesome on Cloudflare CDN (cdnjs.cloudflare.com) and uses 20fa-*icons.calib-window-badgestill exists on both line 549 (#content-occupancy-admin) and line 995 (#content-analytics), causingdocument.getElementByIdcollisions.(b) Scope Creep (Unrequested Behaviour)
app/static/css/input.css:12-40.glass-panel,.info-tooltip) were re-added toinput.cssalongside Tailwind directives, recreating styles that belong in the tactical design system.(c) Implemented-but-Wrong Requirements
test_index_html_strictly_air_gapped_no_external_cdnsstrictly scansindex.html, but omitsdocs.htmlfrom the air-gap audit, creating an incomplete air-gap verification boundary.test_dom_invariants_zero_radius_and_tabular_numsasserts"border-radius:0"in the compiled CSS text rather than asserting the absence of un-resetroundedclasses in the DOM tree.Tech Debt Status from Issue #18
ws_manager.broadcast_jsonindoor_service.pyawait ws_manager.broadcast()in_broadcast_door_overview.window.telemetryEngine.getRawSnapshot()inapp.jsgetSnapshot().var(--color-text-main)in CSSvar(--color-text-primary).'JetBrains Mono'TACTICAL_CHART_FONT.index.html, but residual FontAwesome CDN link remains indocs.html.#content-analyticscalib-target-guards,calib-multiplier-variance, etc. fixed, butcalib-window-badgeremains duplicated.facility_utc_offset_minutesinsettingsSettings.facility_utc_offset_minutes = -240and wired across all services.Summary
input.cssandindex.htmllogin modal.docs.htmlstill loads Cloudflare CDN.📋 Final PR #13 Punch List (Pre-Merge Clean-Up)
Since all sub-tickets (#15 through #19) are now closed, the following cleanup items should be addressed directly on the PR branch
docs/industrial-brutalist-ui-redesignbefore merging PR #13 intomaster:docs.html: Remove the external FontAwesome CDN link fromapp/static/docs.htmland replace icon tags with tactical text/ASCII.d4660b6and close the loop on Candidate 4.bg-gradient-*andbackdrop-blur-*inindex.html(login modal) andinput.csswith solid tactical tokens (--color-bg-surface,--color-border-grid).calib-window-badge: Rename the second instance in#content-analyticstoanalytics-calib-window-badge.-> Nonetoset_exclusionandset_category_exclusionindoor_service.py.styles.css: Removeapp/static/css/styles.cssto prevent codebase clutter.