# Architecture

```text
Remote browser / Cloudflare One Client
                 |
                 | Cloudflare edge TLS
                 v
          Cloudflare network
                 |
                 | outbound-only tunnel
                 v
        cloudflared system service
                 |
                 | verified local TLS
                 v
  127.0.0.1:18443 -> rootless SSL Server container
                           |
                           | read-only mounts only
                           v
            static UI + allowlisted INI, full and delta JSON

Host-side collector
  reads: /proc statistics, selected /sys sensors,
         ~/cf_tunnel/server_name.txt,
         ~/cf_tunnel/message.txt when present
  writes: ~/cf_tunnel/status-page/data/status.json and
          status-delta.json atomically (continuous mode)
```

## Trust boundaries

1. `cloudflared` is a root-managed system service because its configuration and
   tunnel credential are under `/etc/cloudflared`.
2. SSL Server is a rootless Podman container. Root in that container is mapped
   to the unprivileged host user, not host root.
3. The container receives no cloudflared credential and no direct hardware,
   process, home-directory, Podman-socket, `/proc`, or `/sys` mount.
4. The collector is the only component that reads host metrics. It exports an
   explicit JSON schema rather than arbitrary files or command output.
5. The Status Page origin is loopback-only. Cloudflare Tunnel is the public
   path; router ports remain closed.

## Availability states

- Green: no active measured alert; not a guarantee of health.
- Yellow: actionable caution, such as sustained pressure, capacity or thermal evidence, or recurring kernel errors.
- Red: serious measured evidence, including critical storage/thermal or CPU/memory pressure conditions (I/O PSI alone is caution-only) or a recent serious kernel event; required host secure-path failures may also escalate.
- Unknown: missing, stale or unverified evidence is not success. Browser transport status is shown separately from the host orb.

Raw CPU, memory and link utilization are observations, not automatic alarm thresholds. See the alert quality standard and component-specific policies. The INI controls presentation and the two explicit server-side gates; authentication remains separate.

## Host telemetry boundary

The collector runs as a systemd user service on the Debian-family host. It reads host `/proc` and `/sys` directly and writes a narrow, sanitized JSON document. The nginx container does not receive `/proc`, `/sys`, the Podman socket, the home directory, or host network identity. The JSON includes `metrics_scope: host-system`, and the browser rejects telemetry missing that marker.


## Anonymized active-container telemetry (4.3.16)
The host collector queries only the current user's rootless Podman runtime. It preserves the minimum user-runtime variables Podman needs, uses the installer-recorded Podman binary, and runs inside a systemd user unit that keeps the rest of the home directory read-only while allowing Podman's normal runtime and state locks. A failed query is represented as unavailable telemetry, never as an empty runtime.

The JSON boundary emits no names, images, commands, ports, mounts, addresses, or full IDs. Each running workload is represented by its final four hexadecimal ID characters plus coarse CPU, memory, cumulative network I/O, cumulative block I/O, and PID-count values. Sampling is cached for three seconds to avoid delaying the one-second host telemetry loop. Setting `containers=false` disables active-container publication and inventory/statistics queries; independent authorized measurement workers retain their own policy.

## Publication and verification (4.3.71)

A one-second publisher and independent fast sampler separate measured history from presentation animation. Full and delta snapshots carry stream identity, age and bounded history; the browser reconstructs compatible tails or requests a full snapshot. Stale samples and incomplete checks remain unknown, not fabricated zeros. The allowlisted INI is public to authorized viewers and is not authentication. Kernel and active-container gates additionally restrict server-side publication. Both API routes and the INI must remain inside the independently enforced access boundary. The UI version is always the actual renderer; a missing collector version remains unreported. See [field acceptance](TESTING.md#field-acceptance-checklist-4371).

## Browser work scheduling (4.3.72)

The renderer keeps the original collection, publication, reconstruction and sample-age rules. It avoids constructing plots that are disabled by the administrator; their visibility flags do not change aggregate health inputs or API disclosure. Visible instruments retain all recorded history, extrema, gaps, manual ranges, cursor identity and phosphor parameters. The active sweep reads visible geometry before writing SVG attributes, and discards references to replaced plots; peak-hold decay advances already ordered samples using a scalar time offset. Matrix palettes are cached by base color. The wallpaper and polling are inactive in hidden documents; pending responses are not rendered there. Returning to the foreground immediately invalidates publications older than six seconds before restarting the display or requesting a new publication. See BROWSER_EFFICIENCY.md for scope and test methodology.

## Browser reconciliation (4.3.74)

Core cards retain ordered identity; kernel fields are reconciled against displayed evidence. The browser cancels superseded requests when paused or hidden and rejects their results before updating its transport base. Equivalent timestamp spellings share the same monotonic publication age. See BROWSER_EFFICIENCY.md.

## 4.3.75 directional history
RX and TX are existing independently measured rates; each now includes its bounded 120-second sample array. Both arrays participate in exact incremental reconstruction. A legacy summary-only direction remains compatible and does not fabricate historical points. Local visibility settings never change collector sampling or health policy.

## 4.3.76 overlay and split presentation

Use the network and processor Layout selectors to choose one overlaid graph or separate scopes. Visibility settings are independent of layout and persist locally. Overlay shares a timebase and range; split network plots retain their individual settings and labels; split CPU plots share the group range, timebase and CRT controls. No extra collector reads or probes. Hidden plots release SVG animation references and cursor handlers.


## 4.3.81 current release notes
The 4.3.80 notification statements above describe the prior release. The current candidate implements optional local-admin Web Push enrollment and a separate unprivileged background dispatcher (menu 18). It is disabled until reviewed dependency provisioning and device authorization. Critical/warning selections are initially checked, recovery is optional, and browser choices persist. The local notification test is distinct from real server test and actual receipt. Reset defaults does not silently change server enrollments or OS permission. See WEB_PUSH_DESIGN.md for installation, private enrollment, off/remove, security constraints and field acceptance. The independent network provider must be authorized; option 4 now checks fresh dual-provider measurement evidence, not worker availability alone. Menu 14 → on offers missing Cloudflare as well as independent authorization; existing consent/budgets remain unchanged. No automatic increase in active measurements, no host network worker fallback, and no public writable API. All prior display, security, storage and low-noise principles remain in force.

## 4.3.98 candidate — cumulative device and instrument update

Menu 18: 1 live TEST; 2 background TEST; 3 connect (temporary QR/code, encrypted JSON transfer, or original private import); 4 review; 5 remove; 6 disable sender; 7 rename; 8 move to top. Device pairing is optional in option 1 and defaults to defer when no device is ready. Finish normal setup and back up API credentials using the existing credential menu; enroll/test later. Preserve existing VAPID keys, subscriptions, preferences, and route configuration. See WEB_PUSH_DESIGN.md for exact platform and transfer steps. Only an explicitly started local pairing session opens the bounded receiver; the exact POST route uses the existing origin and Unix socket, not a new port. Do not weaken Access to work around pairing problems. An HTTP response or provider acceptance is not proof of device receipt. Native Safari/Firefox/mobile and target-Pi field qualification remain outstanding. The supplied 4.3.96 source is the baseline; 4.3.97 activity changes were reconstructed from its release notes, not merged from an available archive.
