Usage and audit dashboard
The prototype in #57 adds Bandwidth and Activity to the authenticated dashboard in both display modes. Display mode grants no capability. These screens use persisted usage reports/settings and audit queries, including historical sites with no currently enrolled device. Host/browser evidence covers the isolated implementation.
Usage and policy
An explicit Read usage request loads link settings, the selected monthly billing cycle, rolling seven-day UTC trends and persisted alerts. The date selects a UTC calendar day at noon, clamped to the current time; the configured IANA timezone/day determines the actual billing boundaries. The UI shows allowance, used/remaining bytes, upload/download by layer, confidence/coverage, stale and missing counters, source counter epochs, gaps, largest categories, classifier residuals, forecast assumptions and session attribution. Exact byte values remain decimal strings/BigInt. WAN, application payload and provider reports remain separate. Unknown counters never become zero, categories are already included in their totals, and a shared stream is counted once regardless of viewer count. Session links prefill the corresponding audit filter.
Configuration permission enables an audited allowance, timezone/day, first WAN warning threshold and transfer-mode edit. The editor reads the current settings first, preserves other rules/destinations/forecast/rollover options, and creates a plan only through an explicit save. Server validation and current authority apply again to every save. The acknowledgement includes the committed audit ID. Cloud policy acceptance does not establish edge application: actual paused uploads, degraded media and pending updates stay explicitly unavailable without owning observed adapters. Alert identity remains once per rule/billing cycle, including after warning edits.
Audit and export
Activity filters receipt time, original trusted actor ID, action, resource, device, result, correlation and session. Each page contains at most 40 records from the backend's frozen, identity/filter-bound snapshot. Rows retain intent/cause/job/command/session links, source boot/session/sequence, original UTC uncertainty or unknown clocks, monotonic time and receipt/chain provenance. Site-scoped pseudonyms are displayed rather than raw actor IDs. Legacy unchained and retired payloads remain explicit.
Access grants, media connection/delivery observations and cloud lifecycle results are distinct. A cloud timeout is labelled Cloud policy end; media termination unobserved; it does not imply a media disconnect. Existing device connection-loss evidence remains an inferred result. The UI displays only the committed audit vocabulary; update, manipulation and configuration evidence depends on its owning adapter. Future recording stays unavailable.
Search requires audit.read. Audit and usage export require separate audit.export, current site/session authorization and durable self-audit. Audit export reuses the frozen start cursor and exact applied filters, contains at most 1,000 records/8 MiB and fails explicitly on capacity. Browser reads are byte bounded (1 MiB audit pages, 32 KiB settings, 8 MiB reports/exports), have cancellation/deadlines, and downloads use ephemeral Blob URLs. Exports retain the existing canonical digest/minimized schema and exclude credentials, private media and raw request bodies. The digest is not a signature.
Trusted composition and lifecycle
createDashboardHistoryTools installs usage/audit servers using the same authenticated opaque human identity and current directory resolver as the dashboard. Async request context supplies the principal to transactional authority rechecks; submitted claims cannot replace it. /api/sites/:siteId/dashboard-tools/:feature/:action maps the HttpOnly session cookie to the shared bearer boundary while preserving method, body and abort signal. Origin/CSRF checks apply to mutations and exports. Only settings/report/history/alerts/export and audit search/export are exposed; ingestion, corrections and lifecycle steward actions retain their separate boundaries.
The bridge permits one active request per instance, returning explicit 429/Retry-After rather than occupying every connection while transactional current-directory rechecks need another connection. Production composition must supply migrated storage and protected resource ownership, including the per-site audit-export resource. There are no implicit migrations or provider provisioning. Ordinary starts and branch previews fail closed; only explicit operator-created isolated test instances expose fixture history.
Neither screen polls or fetches on mount. Reads are sequential and demand driven. Hidden/offline/page teardown and session expiry cancel pending work and clear authorized results; returning visible/online does not replay a policy mutation or restart a read. The layout uses responsive forms and horizontal table scrolling at 390 pixels. No browser persistence, recording control or physical enablement is introduced.