Commit Graph
232 Commits
Author SHA1 Message Date
gadgethd 049b063a8c seo: static JSON-LD, sitemap lastmod, og-image for public website (crawler-only, no UI change) 2026-08-08 00:16:20 +00:00
gadgethd 99d444e200 fix(tools): backfillStatsRollups hourly phase counts every received packet
The hourly rollup rebuild was filtering source rows with
PUBLIC_PACKET_PRIVACY_SQL, so a backfill reproduced the public-only
rollup (~26k/24h) even after the incremental writer (packetBatch.ts)
was changed to count all rows (~101k/24h). The tool's hourly apply
slice + dry-run + catchUpCurrentHour now have NO privacy filter,
matching the runtime writer. The daily max-hop and observer-region
phases KEEP the privacy filter - their runtime writers still filter.
2026-08-07 16:36:20 +00:00
gadgethd 5732520e5c fix(stats): chart rollup counts every received packet - charts now match the totals
The hourly/daily chart series come from packet_hourly_stats, whose
incremental writer (packetBatch.ts) filtered WHERE path_is_valid AND
NOT is_private - so the charts only ever showed public-valid rows
(~26k/24h) while the totals now count all observations (~101k/24h).
Per Ben's spec (every packet received by every observer counts), the
rollup must include private rows too.

Changes:
- packetBatch.ts: rollup INSERT drops the path_is_valid/is_private
  filter (keeps the meshcore-test topic exclusion) - all rows counted
- statsRepository.ts: aggregate raw-slice CTEs (fresh hour + rollup
  gap) use totalFilters; legacy/observer chart series (perHour,
  perDay, types, hops, routes, transports) use totalFilters; region
  summary counts all rows
- rollup history will be rebuilt via stats:backfill-rollups (the
  backfill tool already counts all rows)

Verified: totals ~101k/24h; charts will sum to the same after backfill.
2026-08-07 16:20:09 +00:00
gadgethd 4a2d69bc58 fix(stats): packet counts = total observations (all rows, duplicates included)
Per Ben's spec the "Observed packets" totals must count EVERY packet
received by EVERY observer - duplicate receptions of the same packet by
multiple stations each count. Reverts the COUNT(DISTINCT packet_hash)
semantics from 8dff7d7 and additionally drops the privacy visibility
filter from the totals so they match the chart rollup path (which has
never been privacy-filtered - aggregateScope filters by network only).

Changes:
- packetsDay, totalPackets24h, totalPackets7d: COUNT(*) over all rows
  (network/test-topic scoped, rx_node_id present), no visibility filter
- channelTraffic: COUNT(*) all rows (percentages stay consistent with
  the all-rows total denominator)
- networkFilters(): new includePrivacy option (default true) so total
  queries can opt out of visibility conditions
- legacy/observer-scoped chart series back to COUNT(*) (row semantics
  everywhere; transportCodes alias fix from 40be809 retained)
- tests: includePrivacy coverage added

Verified live: 24h total ~99k rows (vs 25k privacy-filtered, vs 5.8k
distinct) - consistent with the hourly chart series which already
counted all rows.
2026-08-07 15:47:11 +00:00
gadgethd 40be809330 fix(stats): transportCodes legacy query missing packets alias; channelTraffic count scoped to carried column 2026-08-07 14:17:00 +00:00
gadgethd 8dff7d79d0 fix(stats): count distinct packets (not observation rows) in all packet-count stats
The packets table stores one row per observer per packet, so COUNT(*)
overcounted by the average observation multiplicity (~4.3x public, ~9.5x
overall). A packet heard by 5 stations counted 5 times.

Converted to COUNT(DISTINCT packet_hash) on every surface that presents a
"packets" number:
- /api/stats summary packetsDay (app + home dashboard card)
- charts summary totalPackets24h / totalPackets7d (StatsPage cards)
- legacy/observer-scoped chart series: packetsPerHour, packetsPerDay,
  packetTypes, hopDistribution, routeTypes, transportCodes
- channelTraffic channel counts (keeps allPct consistent with the
  distinct denominator)

The canonical rollup path (packet_hourly_stats, incrementally maintained)
remains row-based - it cannot maintain distinct counts incrementally and
stays as the trend-shape source for the public charts.

Verified: public distinct 24h = 5,835 vs 25,236 public rows vs 99,079
total rows (74% of traffic is from privacy-marked nodes).
2026-08-07 14:06:28 +00:00
gadgethd 8bc4b0dce6 fix(mqtt): accept official firmware neighbours payload shape (UK envelope + snr_db/heard_secs_ago) 2026-08-07 11:42:11 +00:00
gadgethd c122762df9 fix(nodes): restore node links query - alias identity source table for network filters
df7cfbe migrated listNodeLinks to node_identity_nodes but kept the
un-aliased filters.nodes fragment, whose EXISTS subquery references
nodes.node_id with no nodes table in scope, so every GET /nodes/:id/links
500'd (missing FROM-clause entry for table nodes) and the repeater page
showed no simulated neighbours for any node. Use filters.nodesAlias like
the sibling identity queries do.
2026-08-07 11:32:32 +00:00
gadgethd 9f6065a93c fix(deploy): align live overlay static IPs with the VPS 172.30.0.0/24 external network
The overlay still carried pre-migration 172.18.30.x addresses; the VPS
meshcore-analytics_default bridge is 172.30.0.0/24 (containers already run
on 172.30.0.x). Stale IPs made compose unable to (re)create app-ukmesh
(no subnet contains 172.18.30.10).
2026-08-07 11:16:13 +00:00
gadgethd 5b4da86e05 fix(mqtt,stats): accept UK neighbours topic spelling; render chart times in viewer local tz
- topic.ts/brokerLog.ts/client.ts: accept the neighbours suffix (official
  MeshCore firmware publishes the UK spelling; our MQTT fork uses neighbors)
- aclManager.ts: render + verify BOTH spellings in owner ACL grants (ukmesh
  and test scopes); inventoryOwnerAuthorization regex updated to match
- statsService.ts: chart bucket labels are now machine-readable ISO instead
  of server-timezone HH:MM/en-GB strings (backend container runs UTC;
  viewers saw UTC hours)
- StatsPage.tsx: axis ticks + tooltips + summaries formatted via
  statsTimeFormat.ts (Intl local timezone, raw fallback for legacy cached
  snapshots) + unit tests
2026-08-07 11:13:12 +00:00
gadgethd a1b2ae8c9a fix(acl): render test-scope topic grants for owner devices (meshcore-test/+/<id>/...) so test-network observers can publish 2026-08-07 02:30:20 +00:00
gadgethd f9d531784b Grant hermes-test owner ACL access 2026-08-07 00:55:58 +00:00
gadgethd 33bfdc1c6d Expose owner node telemetry and heard neighbors 2026-08-07 00:55:51 +00:00
gadgethd 55d1d319dd Add network-scoped neighbor telemetry ingest 2026-08-07 00:55:40 +00:00
gadgethd 2a24a14478 fix(ingest): store test-marker IATA traffic under the isolated test network scope 2026-08-07 00:06:37 +00:00
gadgethd 8306cd770c fix(paths): split multibyte-paths into two simple queries joined in JS (timeout → 0.3s) 2026-08-06 22:40:37 +00:00
gadgethd 991b99fef7 fix(frontend): keep mobile map controls in flow 2026-08-06 21:47:20 +00:00
gadgethd eb4201b9dd fix(frontend): resolve mobile map and owner layout defects 2026-08-06 21:34:07 +00:00
gadgethd 7fc2fb03ef revert(owner): drop card-click hint line 2026-08-06 21:11:56 +00:00
gadgethd 14cdb96189 feat(owner): clickable identity cards replace node dropdown selector 2026-08-06 21:08:49 +00:00
gadgethd b33696442b fix(owner): index-driven canonical member filters for owner live data (timeout → <500ms battery) 2026-08-06 20:20:13 +00:00
gadgethd 9d8a07a368 docs(spring-clean): record all 18 items complete + verification 2026-08-06 16:02:08 +00:00
gadgethd 2c5316a22f docs(topology): record final healthy check 2026-08-06 14:04:17 +00:00
gadgethd 4e75b1f8a9 docs(topology): record spring-clean item 11 2026-08-06 14:01:44 +00:00
gadgethd 7b6e860b57 fix(topology): keep map instance stable after load 2026-08-06 13:57:38 +00:00
gadgethd be0a68995a feat(topology): render live repeater links on UK map 2026-08-06 13:37:09 +00:00
gadgethd b2824b8833 docs: expand + fact-check spring-clean systems (decryption, node identity, pathing, operations) 2026-08-06 13:22:40 +00:00
gadgethd f5b1e2acbd docs(spring-clean): clarify health route audit 2026-08-06 13:06:09 +00:00
gadgethd ed70b55dfc docs(spring-clean): record local commit 2026-08-06 13:04:53 +00:00
gadgethd 1c3841cc52 chore(website): spring-clean public pages 2026-08-06 13:04:39 +00:00
gadgethd 2d0ee0fa36 docs(map): record spring-clean deployment verification 2026-08-06 12:45:51 +00:00
gadgethd 52820d004b fix(map): keep live feed viewport visible 2026-08-06 12:44:54 +00:00
gadgethd 45698318e5 feat(map): spring-clean live feed and repeater rendering 2026-08-06 11:47:46 +00:00
gadgethd 22dac9a839 chore(owner): remove proof-only dashboard artifact 2026-08-06 11:28:49 +00:00
gadgethd 1e5bc3b299 feat(owner): clean up spring dashboard 2026-08-06 11:25:07 +00:00
gadgethd cddc5efdff docs(feed): record history rollout 2026-08-06 05:24:27 +00:00
gadgethd f5a2a2b93a feat(feed): load historical channel messages 2026-08-06 05:13:22 +00:00
gadgethd 977ce17223 perf: materialized CTE wrapper for canonical identity views
The planner inlined the view CTEs into consumers and re-ran the links
aggregation once per candidate row (loops=13070, 24s+ for getViableLinks).
Wrapping each view body in WITH v AS MATERIALIZED forces one evaluation
per query: viable-links query 24.3s -> 3.1s, WS initial state <1s.
Also drops the dead terrain_profile_json column from node_identity_links
(no readers; frontend terrain comes from DEM tiles).
2026-08-06 04:24:45 +00:00
gadgethd df7cfbe0ed Fix canonical repeater identity projection 2026-08-06 03:53:29 +00:00
gadgethd 90d0dce603 fix: make MQTT packet ingest resilient 2026-08-06 02:13:38 +00:00
gadgethd c6a8813fc3 feat: packet_decryptions side table + feed join for historical decryption
- migration 035: append-only decryptions table (avoids TimescaleDB hypertable
  UPDATE scans which seq-scan every chunk)
- backfillDecrypt: two-phase (materialised candidates + keyset batches),
  DISTINCT ON packet_hash with upper(raw_hex) to handle case-variant copies,
  resumable/idempotent
- feed queries COALESCE(payload _summary, decryptions summary)
- 90-day type-5 coverage: 3.23M/7.0M packets decrypted (46%)
2026-08-06 01:29:32 +00:00
gadgethd 61fdcd9d11 feat: first-class MeshCore channel decryption
- channelRegistry: 39 validated channel secrets committed as the service
  default (Public + 38 community/hashtag channels recovered via the
  derivation audit); MESHCORE_CHANNEL_SECRETS env appends on top
- shared buildSummary/identifyChannel (single implementation for ingest
  and offline tools)
- tools/backfillDecrypt: keyset-paginated retroactive decryption of the
  stored raw_hex corpus (idempotent, resumable)
- feed: channel scope sidebar now lists every decrypted channel
2026-08-06 01:00:05 +00:00
gadgethd f6f8290c70 Color live paths by packet identity and extend TTL 2026-08-04 11:38:49 +01:00
gadgethd c853dd6bde fix(api): declare slow-mode path contracts 2026-08-04 11:21:45 +01:00
gadgethd ae93d2ace4 merge: deploy pathing slow mode and held refinement 2026-08-04 11:12:32 +01:00
gadgethd 5dd15d94c1 feat(pathing): add physics gates and held-path refinement 2026-08-04 11:04:04 +01:00
gadgethd 469c84ed13 feat(pathing): slow-mode packet resolution — wait out propagation window
Backend: schedule ONE final multi-observer resolution per path-bearing
packet after the propagation window closes (default 60s, calibrated on
real first->last observer spread p50 11s / p95 34s / p99 50s; median 17
observers per packet). The final runs with the COMPLETE observer set and
pushes into the resolve cache after invalidation, so the next API read
serves the full-propagation answer. mode=slow on /path-beta/resolve-multi
returns 202 {status:pending, remainingMs} while inside the window; new
/path-beta/slow-mode status endpoint; observability table
path_slow_resolutions (migration 034). Env knobs:
PATH_SLOW_MODE_ENABLED / PATH_SLOW_MODE_WINDOW_MS / PATH_SLOW_MODE_MIN_HOPS
/ PATH_SLOW_MODE_PENDING_MAX. Best-effort: restart loss is harmless.

Frontend: pinned packets resolve in slow mode (bounded 202 retry), local
path renders meanwhile, upgraded when the final lands. Live feed unchanged.

Tests: 4 new slowMode unit tests (dedupe, disable, bound, window timing).
Backend build clean, 257/258 (1 pre-existing workerPool timing flake on
base too); frontend build clean, 74/74.
2026-08-04 10:41:09 +01:00
gadgethd 7bcabcc426 fix(map): keep live path arcs above terrain 2026-08-04 03:07:37 +01:00
gadgethd 262a8a2515 fix(map): bind live paths to resolved packets 2026-08-04 02:12:16 +01:00
gadgethd d7e5b0ff92 fix(map): stream hop animation along stable arcs 2026-08-04 01:50:14 +01:00