# Multichannel workload fabric

## Operator purpose
The full-width selectable instrument compares individual observed rootless workloads on one common measurement axis. It is not an arbitrary CPU/RAM/network "stress score". The earlier CPU, RAM and host PSI summaries and wide aggregate CPU/RAM/network instruments remain available. Select CPU, RAM, network, block I/O, or local CPU/memory/I/O PSI. Toggle any trace; Auto select resets selection. Up to 12 workload traces plus the optional complete total are drawn concurrently; all published noncolliding workload channels are selectable. The legend labels last observed values and the server-calculated five-minute time averages with accepted interval coverage. Shared renderer controls apply per selected resource; custom color and single-trace emerald settings can override the base palette. Colors are stable suffix-derived aids and may repeat; suffix labels disambiguate them. A recently removed workload can retain its recorded channel until the configured retention expires; no new points are created for it.

## Measurement contract
`containers.aggregate_scope.channels[]` contains `id_suffix`, `historical`, `samples`, `averages`. Each sample is `[age_seconds, cpu_host_percent, ram_host_percent, rx_plus_tx_bytes_per_second, read_plus_write_bytes_per_second, cpu_psi_some_percent, memory_psi_some_percent, io_psi_some_percent]`. Ages are relative to the existing monotonic workload clock (`scope_clock_ms`). Null is unavailable, not zero. Scope rows are chronological with a decreasing age, maximum 128 per identity and 300 s age. Internal full IDs never cross publication. Current set is capped at 64 and recent retained identities at 64. No additional Podman commands or kernel reads are performed. CPU is runtime-reported core-relative percent divided by host logical CPU count; RAM is runtime-reported bytes divided by host MemTotal. Shared pages can be counted more than once. CPU is not exact scheduler-time accounting. Both gauge time averages use trapezoidal interpolation between adjacent valid readings, excluding missing and >15 s intervals; coverage is not the full window unless actually observed. Rate/PSI averages weight each accepted complete interval by elapsed duration. Intervals crossing the window boundary are excluded, not partially attributed. Local PSI is the existing engine's cgroup `some` stall-time fraction; it is not additive and does not prove which workload caused contention.

Counter rates are derived separately for each identity before any aggregation. Negative deltas, unavailable counters, no baseline, and elapsed times >15 s are unknown. A reset in another container does not erase an established peer's rate. Network sums both directions and may count forwarded or shared traffic more than once; it is not WAN throughput. Podman documents that rootless network statistics may be unavailable; reported zeros may be runtime placeholders. Runtime formatted byte counters may be rounded, so derived rates are estimates of the reported counters, not packet capture. Block I/O is a counter rate, not allocated disk space. The existing aggregate total requires complete membership and valid measurements; it deliberately leaves network intervals blank after a membership change. A visible total does not depend on the viewer's trace selection. Stopped/returning identities insert a gap rather than interpolate across downtime. A delayed snapshot remains historical with the original sample clock; missing intervals are not filled with zeros or duplicate measurements.

## Privacy and control
`[features]`: `workload_channels=true` (default) enables collection and publication of this extra history. Set false to clear collection state and remove cached channel payloads at the next publication. `container_roles=true` (default) controls optional console and measurement-role hints, icons, and reserved ordering. Role mapping is a presentation hint from exact local reserved names, not ownership authentication. False suppresses role metadata on the server as well as the browser. `containers=false` removes all workload publication; `live_telemetry=false` removes scope history. The new channels respect CPU, memory, network, storage and intelligence source flags. `workload_recent_seconds=60` controls the departed record interval (0 disables; maximum 600); browser recent-history toggle is display only. No new permission is granted. The numerical history can reveal workload activity patterns; continue protecting both API endpoints.

## Research basis
- Prometheus query functions: rate before aggregation to preserve independent counter resets. https://prometheus.io/docs/prometheus/latest/querying/functions/
- Grafana time series and legend: preserve gaps and allow selection/isolation of time series. https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/visualizations/time-series/ and https://grafana.com/docs/grafana/latest/visualizations/panels-visualizations/configure-legend/
- Podman stats: rootless network accounting limitations. https://docs.podman.io/en/latest/markdown/podman-stats.1.html

These are design references, not claims of equivalence or benchmark superiority. The independent statistical-engine API and algorithms are unchanged. The added collector adapter is responsible for runtime-specific counter handling and host capacity normalization.

## Layout and measurement worker activity

The compact summary scopes now expand to fill each available row. Wide instruments remain full width; sample inspection text uses its own row and buttons wrap beneath it. The existing scope engine, history, range and sweep controls are unchanged. The worker card distinguishes runtime availability from controller activity: `SLEEPING` means a verified reusable session is waiting between authorized requests; `AWAKE / MEASURING` means an authorized request is in flight (including execution setup/finalization). `ACTIVITY UNCONFIRMED` means the controller and recent running inventory could not be matched. This is not a Linux scheduler sleep-state measurement, and brief requests can occur between publications. Full IDs are joined privately, never published. The indicator is removed with `container_roles=false` in `[features]`; no live activity is retained on departed cards. No extra Podman commands or network tests are needed.
