Files
meshcore-analyzer/scripts/non-unit-tests.json
T
TeTeHackoandClaude Opus 5.5 77a5f14925 feat(observers): radio setting per observation from the observer's radio history (#1869) (#2292)
Part of #1869.

## Problem

`observers.radio` keeps only the **last** `MHz,kHz,SF,CR` an observer
reported. Once an observer is retuned (say from SF7 to the EU narrow SF8
setting to listen to a neighbouring mesh), every packet it ever heard
reads as heard on the new setting, and there is no way to tell an SF7
packet from an SF8 one.

## What this does

As #1869 proposes, the packet data model is untouched: the setting of an
observation is resolved from its observer and time.

**Ingestor** (all schema in `dbschema.Apply`)

- `observer_radios`: one row per stretch of time an observer, and each
radio of a multi-radio node, stayed on one setting. Every live status
extends the current row and a change starts a new one; retained replays
never extend a row. On the first run it is seeded with every observer's
current radio, which is what the UI already showed for the past.
- Settings are stored canonical through `dbschema.CanonicalRadio`, so
`869.4320068,62.5,7,5` and `869.432,62.50,7,5` are one setting.
- `observation_radios` (`observation_id → rx_radio_id`): multi-radio
openHop nodes tag each packet with `rx_radio_id` and list `radios: [{id,
radio}]` in their status, so their observations resolve per radio.
- The table is sparse: single-radio nodes never send the field, so
`observations` and every query that scans it stay untouched.
  - The row id comes from the observation upsert via `RETURNING id`.
- Rows are pruned with their transmissions, and a purged observer takes
its history along.

**Server** (read-only)

- No `AssertReady` change: an absent table reads as empty and is probed
again later, the same rule as `advert_route_evidence`.
- The history is held in memory. The live poller checks it on every tick
(two primary-key lookups), so a retune or a new `rx_radio_id` is known
before the observation is broadcast. A full reload runs every 10 min.
- `radio` is added to observations, packets, grouped rows (taken from
the header observation) and the live feed.
- `GET /api/packets?radio=MHz,kHz,SF,CR` filters by setting.
- Combined with `observer=`, it means *that* observer heard it on that
setting.
- A radio query is served from memory instead of falling back to SQL,
which would return the window unfiltered.
- `GET /api/radios` (named struct) and `radio_history` on `GET
/api/observers/{id}`.

**Frontend**

- Packet filter fields `radio`, `freq`, `bw`, `sf`, `cr`, e.g. `sf == 8`
or `freq > 869.5 && bw == 62.5`.
- A Radio row in the packet detail and a Radio column in its
observations table (only when the server reports one).
- A radio history table on the observer page once there is more than one
stretch.
- `RfParams.radioText` formats the setting. It escapes all five
characters and returns non-numeric input as it came, escaped.

## Performance

`txMatchesRadio` runs once per observation inside `filterPackets`.

- Each observation costs one map lookup by observer id.
- Observers with a single stretch (nearly all) answer from that lookup
directly.
- Retuned observers add a binary search over their few stretches.
- Multi-radio observers add one lookup by observation id.
- The snapshot is loaded once per filter call.

`BenchmarkTxMatchesRadio`, 30K packets / 150K observations (20
observers, 2 of them retuned):

```
BenchmarkTxMatchesRadio-24    602    2056924 ns/op    0 B/op    0 allocs/op
```

Memory is one entry per stretch plus one per multi-radio observation;
nothing is added per observation otherwise.

## Tests

- **dbschema:** seed runs once, canonical spellings, the tables exist
without `observers.radio`.
- **ingestor:**
  - stretches extend and split; canonical spellings do not split
- two radios of one node hearing one transmission over two paths each
keep their own radio
  - a retained status does not write history
  - prune and purge
  - `rx_radio_id` reaches `PacketData`
- **server:**
- resolution before, between and after stretches, and with an unknown
radio id
  - `observer` + `radio`, and grouped rows carry `radio`
  - incremental refresh, `/api/radios`, `radio_history`, missing tables
  - the benchmark above
- **frontend:** the new filter fields in
`tests/unit/test-packet-filter.js`, and XSS cases through the real
`RfParams.radioText` and the history renderer.
- **E2E:** `tests/e2e/test-radio-setting-1869-e2e.js` checks the grouped
rows' radio, `sf ==` on the packets page, the detail Radio row and the
observer history. It is added to `scripts/non-unit-tests.json` and to
shard 2.

`go test -race` in `cmd/server`, `cmd/ingestor` and `internal/dbschema`
passes, along with `sh test-all.sh`, `eslint@8` (0 errors) and the XSS
diff gate. The new E2E test and `test-e2e-playwright.js` pass against
the fixture.

## Browser validation

This runs on a live instance with six observers, one of them retuned to
869.618/62.5/SF8/CR8:

- The packet detail shows `Radio: 869.432 MHz · SF7 · BW 62.5 kHz · CR
4/5`.
- `sf == 7` shows 106 of 106 grouped rows and `sf == 8` shows 0 of 107;
the SF8 observer has not heard anything yet.
- `/api/radios` lists both settings.
- No page errors.

## Notes

- **The customizer (rule 8)** gets nothing: the only constants are
server-side refresh intervals.
- **Attribution timing:** packets heard between a retune and the
observer's next status message (minutes) are attributed to the previous
setting, because a stretch starts when the status is handled. This is
documented at `RecordObserverRadios`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 21:08:40 +01:00

151 lines
7.7 KiB
JSON

{
"browser": {
"reason": "Requires Playwright and Chromium; most suites also require a running local fixture server via BASE_URL. Existing E2E workflow steps retain their separate setup and selection. Never point these tests at production.",
"files": [
"tests/e2e/test-1110-live-filter.js",
"tests/e2e/test-a11y-axe-1668.js",
"tests/e2e/test-analytics-fluid-charts.js",
"tests/e2e/test-audio-lab-1297-e2e.js",
"tests/e2e/test-audio-live-1297-e2e.js",
"tests/e2e/test-bottom-nav-1061-e2e.js",
"tests/e2e/test-channel-color-picker-e2e.js",
"tests/e2e/test-channel-decrypt-e2e.js",
"tests/e2e/test-channel-fluid-e2e.js",
"tests/e2e/test-channel-issue-1087-e2e.js",
"tests/e2e/test-channel-issue-1111-e2e.js",
"tests/e2e/test-channel-modal-e2e.js",
"tests/e2e/test-channel-qr-e2e.js",
"tests/e2e/test-channels-add-modal-e2e.js",
"tests/e2e/test-channels-list-render-e2e.js",
"tests/e2e/test-channels-selection-flow-e2e.js",
"tests/e2e/test-channels-share-color-e2e.js",
"tests/e2e/test-channels-ws-batch-e2e.js",
"tests/e2e/test-channels-ws-race-1498-e2e.js",
"tests/e2e/test-charts-fluid-1058-e2e.js",
"tests/e2e/test-customize-branding-e2e.js",
"tests/e2e/test-customize-display-e2e.js",
"tests/e2e/test-customize-export-e2e.js",
"tests/e2e/test-customize-theme-e2e.js",
"tests/e2e/test-drag-manager-e2e.js",
"tests/e2e/test-e2e-1267-mobile-vcr.js",
"tests/e2e/test-e2e-playwright.js",
"tests/e2e/test-filter-ux-e2e.js",
"tests/e2e/test-gesture-hints-1065-e2e.js",
"tests/e2e/test-gestures-1062-e2e.js",
"tests/e2e/test-gestures-1185-scroll-discriminator-e2e.js",
"tests/e2e/test-health-status-e2e.js",
"tests/e2e/test-home-coverage-e2e.js",
"tests/e2e/test-hop-path-inference-e2e.js",
"tests/e2e/test-issue-1109-hamburger-dropdown-visible-e2e.js",
"tests/e2e/test-issue-1122-packets-filter-ux-e2e.js",
"tests/e2e/test-issue-1128-multi-viewport-e2e.js",
"tests/e2e/test-issue-1128-packets-layout-e2e.js",
"tests/e2e/test-issue-1136-live-region-e2e.js",
"tests/e2e/test-issue-1146-path-link-contrast-e2e.js",
"tests/e2e/test-issue-1147-section-order-e2e.js",
"tests/e2e/test-issue-1150-404-state-e2e.js",
"tests/e2e/test-issue-1151-orphan-separators-e2e.js",
"tests/e2e/test-issue-1204-live-panel-structure-e2e.js",
"tests/e2e/test-issue-1205-live-controls-anchor-e2e.js",
"tests/e2e/test-issue-1206-resize-observer-leak-e2e.js",
"tests/e2e/test-issue-1206-vcr-overlap-e2e.js",
"tests/e2e/test-issue-1224-channels-mobile-ux-e2e.js",
"tests/e2e/test-issue-1234-live-chrome-pass2-e2e.js",
"tests/e2e/test-issue-1236-map-mobile-e2e.js",
"tests/e2e/test-issue-1244-live-vcr-row-hints-e2e.js",
"tests/e2e/test-issue-1273-qr-overlay-height-e2e.js",
"tests/e2e/test-issue-1274-legend-coverage-e2e.js",
"tests/e2e/test-issue-1279-legend-p2-e2e.js",
"tests/e2e/test-issue-1281-location-row-e2e.js",
"tests/e2e/test-issue-1306-collisions-terminology-e2e.js",
"tests/e2e/test-issue-1329-map-controls-accordion-e2e.js",
"tests/e2e/test-issue-1367-channels-chat-app-e2e.js",
"tests/e2e/test-issue-1374-route-map-a11y-e2e.js",
"tests/e2e/test-issue-1400-nav-vertical-clip.js",
"tests/e2e/test-issue-1413-nav-overlap-e2e.js",
"tests/e2e/test-issue-1486-collapse-reopens-detail-e2e.js",
"tests/e2e/test-issue-1487-byop-modal-layout-e2e.js",
"tests/e2e/test-issue-1510-live-nav-pin-e2e.js",
"tests/e2e/test-issue-1567-corner-clears-drag-e2e.js",
"tests/e2e/test-issue-1599-replay-freeze-e2e.js",
"tests/e2e/test-issue-1630-reach-mobile-e2e.js",
"tests/e2e/test-issue-1268-rf-params-e2e.js",
"tests/e2e/test-issue-1639-observers-sort-e2e.js",
"tests/e2e/test-issue-748-node-analytics-coverage-e2e.js",
"tests/e2e/test-issue-2218-node-analytics-stale-e2e.js",
"tests/e2e/test-issue-661-airtime-e2e.js",
"tests/e2e/test-issue-1640-compare-discovery-e2e.js",
"tests/e2e/test-issue-1648-m1-icons-e2e.js",
"tests/e2e/test-issue-1648-m2-icons-e2e.js",
"tests/e2e/test-issue-1648-m3-icons-e2e.js",
"tests/e2e/test-issue-1648-m4-icons-e2e.js",
"tests/e2e/test-issue-1648-m5-icons-e2e.js",
"tests/e2e/test-issue-1657-analytics-channels-group-sprites-e2e.js",
"tests/e2e/test-issue-1692-packets-init-parallel-e2e.js",
"tests/e2e/test-issue-1705-subpath-contrast-e2e.js",
"tests/e2e/test-issue-1758-ng-filter-rerenders-e2e.js",
"tests/e2e/test-issue-1799-label-vocab-e2e.js",
"tests/e2e/test-issue-1833-legend-toggle-clickable-e2e.js",
"tests/e2e/test-issue-1997-distance-building-e2e.js",
"tests/e2e/test-live-dedup.js",
"tests/e2e/test-live-fullscreen-1572-e2e.js",
"tests/e2e/test-live-layout-1178-1179-e2e.js",
"tests/e2e/test-live-mql-leak-1180-e2e.js",
"tests/e2e/test-live-multibyte-only-e2e.js",
"tests/e2e/test-logo-default-sage-teal-e2e.js",
"tests/e2e/test-logo-pulse-1173-e2e.js",
"tests/e2e/test-logo-rebrand-e2e.js",
"tests/e2e/test-logo-theme-e2e.js",
"tests/e2e/test-map-estimated-e2e.js",
"tests/e2e/test-reported-nodes-e2e.js",
"tests/e2e/test-map-modal-fluid-e2e.js",
"tests/e2e/test-map-nodes-pagination-e2e.js",
"tests/e2e/test-nav-drawer-1064-e2e.js",
"tests/e2e/test-nav-fluid-1055-e2e.js",
"tests/e2e/test-nav-more-floor-1139-e2e.js",
"tests/e2e/test-nav-priority-1102-e2e.js",
"tests/e2e/test-nav-priority-1311-e2e.js",
"tests/e2e/test-nav-priority-1391-e2e.js",
"tests/e2e/test-neighbor-map-btn-clip-e2e.js",
"tests/e2e/test-node-reach-coverage-e2e.js",
"tests/e2e/test-node-reach-e2e.js",
"tests/e2e/test-nodes-export-e2e.js",
"tests/e2e/test-observer-iata-1188-e2e.js",
"tests/e2e/test-observer-detail-ownership-e2e.js",
"tests/e2e/test-packets-compact-columns-e2e.js",
"tests/e2e/test-packets-node-filter-e2e.js",
"tests/e2e/test-packets-scope-column.js",
"tests/e2e/test-path-inspector-coverage-e2e.js",
"tests/e2e/test-rx-coverage-mobile-nav-e2e.js",
"tests/e2e/test-rx-coverage-gaps-e2e.js",
"tests/e2e/test-rx-coverage-noise-e2e.js",
"tests/e2e/test-rx-coverage-viewport-e2e.js",
"tests/e2e/test-show-neighbors.js",
"tests/e2e/test-slideover-1056-e2e.js",
"tests/e2e/test-slideover-1168-munger-e2e.js",
"tests/e2e/test-table-fluid-e2e.js",
"tests/e2e/test-theme-url-param-2236-e2e.js",
"tests/e2e/test-touch-gestures-coverage-e2e.js",
"tests/e2e/test-touch-targets.js",
"tests/e2e/test-user-management-e2e.js"
]
},
"domIntegration": {
"reason": "Requires jsdom. The JS unit gate runs with no node_modules at all (its job has no npm install), so a suite needing a third-party module cannot live in test-all.sh. It runs in the E2E job, which does npm ci, and is invoked by its own deploy.yml line.",
"files": [
"tests/e2e/test-region-quick-picks.js",
"tests/e2e/test-radio-setting-1869-e2e.js",
"tests/e2e/test-table-sort.js"
]
},
"playwrightRunner": {
"reason": "Requires the @playwright/test runner (not plain node), its configuration, Chromium, and a local server. @playwright/test is not currently declared in package.json; these suites are inventoried but not part of the standalone unit gate.",
"files": [
"tests/e2e/test-issue-1522-trace-url-sync-e2e.js",
"tests/e2e/test-marker-outline-weight.js",
"tests/e2e/test-path-inspector-e2e.js",
"tests/e2e/test-pr-1490-live-map-gpu-animations-e2e.js"
]
}
}