Commit Graph
36 Commits
Author SHA1 Message Date
gadgethd eab389c387 Merge current main into ukmesh-dev
Adapt main fixes to DEV ownership of split MQTT intake, private projections, lean Compose, and on-demand charts. Preserve deployed migration identities and standalone owner sessions.
2026-11-27 20:21:28 +00:00
gadgethd fde49a5850 Split durable MQTT ingest from the HTTP and WebSocket API 2026-11-27 17:53:22 +00:00
hermes-gadgetandgadgethd 4592dfd22f fix(stats): drop the observer-regions dimension and alert on stale snapshots
* fix(stats): drop the observer-regions dimension and alert on stale snapshots (#282)

The 7-day observer-regions aggregation was the slowest chart query (55.5 s isolated, 60-120 s under load); its budget overrun aborted all 17 snapshot queries and froze charts from 2026-11-24 until the budget was raised. Removes the dimension end to end, moves the feed region filter onto the live observer endpoint, and adds meshcore_stats_chart_snapshot_age_seconds plus a StatsChartSnapshotStale alert.

* test(e2e): assert live observer line survives an old chart snapshot (#282)

The removed observer-region cards were the old fixture anchor; the surviving invariant is that /stats/observers/live keeps the activity line current while the chart snapshot is stale.

---------

Co-authored-by: gadgethd <ben@ukmesh.com>
2026-11-27 17:02:55 +00:00
Codex 22aa187bee Prioritize durable MQTT acknowledgements and expose broker backlog 2026-11-18 10:39:45 +00:00
hermes-gadgetandhermes-gadget 22e2049e59 feat(observers): export registration delivery metrics and alert on failures (#230)
Refs #229

Co-authored-by: hermes-gadget <hermes-gadget@users.noreply.github.com>
2026-11-17 23:57:30 +00:00
Codex 0c4013183f refactor(ci): share owned fixtures and validate operational contracts 2026-11-12 19:12:43 +00:00
Codex 959fe142ad fix(regions): supervise bounded privacy-certified snapshot repair 2026-11-12 11:55:49 +00:00
Codex 7b3c191ceb Report bounded document Web Vitals and monitor public route latency and cache hits 2026-11-12 08:04:20 +00:00
ben d9f07bc38e chore(infra): fix monitor probe, trust split and stale config
- remove duplicate YAML key left by the deleted Mosquitto alerts
- probe mesh-health-check's real /api/bootstrap endpoint
- app/website nginx trust only their own Anubis edge
- use the default POSTGRES_USER for the tagger DB
- drop the unused Mosquitto 1883 listener and CORS/doc drift
2026-11-12 01:53:29 +00:00
ben 972d2ad75e chore(infra): remove dead compose/health-check/script assets and stale config
- delete compose.phase4.yml and docker-compose.infra-client.yml (no live path)
- delete unmounted health-check app.js/styles.css and three unreferenced scripts
- drop the retired ML env block and duplicate receipt key
- document OWNER_COOKIE_SECRET and GRAFANA_ADMIN_PASSWORD, fix example CORS
- remove the non-existent mosquitto-exporter scrape job and alerts
- delete the duplicate nginx .mjs location and stale proxy addresses
2026-11-12 01:51:11 +00:00
gadgethd ee377a1552 Fix observer telemetry freshness and recover stalled MQTT delivery 2026-11-01 20:42:26 +00:00
gadgethd 36f3741b74 Reconcile audited performance and correctness fixes with current main 2026-11-01 14:33:49 +00:00
hermes-gadget e762b43982 fix(rules): retune PacketPathsGrowthHigh to 60k rows/day
Durable packet path growth averages 35,944 rows/day over the last seven days
(range 28,397-39,486 over the last fortnight), so the 30,000/day ceiling was a
standing warning rather than a signal.

packet_paths is a compression-only target with no retention by design
(dataLifecycle.ts); capacity is guarded by the host disk rules. Raising the
ceiling to 60,000/day keeps a 1.7x regression signal for dedupe failures and
replay storms without breaking the data-lifecycle invariant.

Adds promtool coverage for both sides of the threshold.
2026-10-31 16:36:07 +00:00
hermes-gadget 58df0cb59a fix(rules): scope privacy generation alert to the health worker
The gauge is exported by every process (backend plus all workers) and reports 0
where no collector is registered, so the previous selector on job=meshcore-backend
matched nothing and absent() held PrivacyGenerationUnhealthy firing permanently.
That masked genuine privacy drift and paged roughly six times a day.

Select the health worker instead, matching the role convention already used by
PacketPathsGrowthHigh, and set the four promtool cases to the same identity.
absent() inherits only the selector's equality matchers, so the fail-closed case
expects job and role but no instance.
2026-10-31 16:36:03 +00:00
gadgethd 437e8bd9d5 fix(health): scope boundary retention deletes to the decompressed chunk 2026-10-25 21:55:13 +00:00
gadgethd 7dec1c6d33 fix(monitoring): align BackupStale with the documented 7-day restore-receipt precondition 2026-10-25 20:44:53 +00:00
gadgethd 078b417c49 Merge release/security-20261025; reconcile 61 conflicts and 19 findings
Port security remediation onto the newer main/VPS behavior. Preserve applied
migration names using exact checksum proof; retain durable ingest, egress,
worker recovery, telemetry normalization and newer main operational fixes.

Ledger: docs/reviews/20261025-merge-ledger.md
Validation: backend tsc/build; 708 tests, 0 fail, 3 DB skips; frontend
tsc/build; 166 tests, 0 fail, 10 opt-in browser skips; contract check;
confirmed-grant onboarding and isolated authenticated receiver fixtures.

Resolved paths:
- .env.example
- .github/workflows/ci.yml
- .gitignore
- .gitleaks.toml
- backend/package-lock.json
- backend/src/api/contracts.ts
- backend/src/api/routes.ts
- backend/src/api/routes/auditwave.integration.test.ts
- backend/src/api/routes/auditwave.performance.test.ts
- backend/src/api/routes/exports.test.ts
- backend/src/api/routes/misc.test.ts
- backend/src/api/routes/owner.ts
- backend/src/api/routes/ownerPacketSharing.test.ts
- backend/src/api/routes/regions.test.ts
- backend/src/api/routes/regions.ts
- backend/src/db/ownerAuth.ts
- backend/src/db/packetBatch.integration.test.ts
- backend/src/index.ts
- backend/src/metrics.ts
- backend/src/mqtt/client.ts
- backend/src/mqtt/envelopeSafety.test.ts
- backend/src/mqtt/envelopeSafety.ts
- backend/src/owner/ownerAccess.ts
- backend/src/owner/ownerLastHopPrewarm.test.ts
- backend/src/owner/ownerLastHopPrewarm.ts
- backend/src/owner/ownerRepository.ts
- backend/src/owner/packetShareForwarder.test.ts
- backend/src/owner/packetShareForwarder.ts
- backend/src/owner/packetShareRepository.integration.test.ts
- backend/src/owner/packetShareRepository.ts
- backend/src/owner/publicFeedForwarder.test.ts
- backend/src/owner/publicFeedForwarder.ts
- backend/src/owner/publicFeedRepository.ts
- backend/src/path-learning/rebuild.ts
- backend/src/ram/liveRead.ts
- backend/src/repositories/nodes.ts
- backend/src/spam/cluster.test.ts
- backend/src/spam/cluster.ts
- backend/src/spam/config.ts
- backend/src/spam/repository.ts
- backend/src/tools/rebuildRegionParticipation.ts
- backend/src/workers/alert-receiver.ts
- backend/src/workers/synthetic-monitor.ts
- backend/src/ws/server.ts
- backup-receipts/latest.json
- backup-receipts/latest.json.sig
- docker-compose.yml
- docs/openapi.yaml
- docs/operations.md
- docs/spam-detection.md
- frontend/playwright.config.ts
- frontend/src/components/Map/RegionsMap.tsx
- frontend/src/components/Map/regionOverlay.test.ts
- frontend/src/components/Map/regionOverlay.ts
- frontend/src/pages/RegionsPage.tsx
- frontend/src/pages/TopologyPage.browser.test.ts
- frontend/src/pages/regions-page.css
- frontend/src/pages/regionsModel.ts
- frontend/test/e2e/dashboard.spec.ts
- tagger-worker/Dockerfile
- vacuum-compressed-chunks.sh
2026-10-25 04:42:05 +00:00
gadgethd 882777eae7 Merge origin/main into deployed tree; reconcile all 52 conflicts
Preserve deployed behavior and adopt main fixes. Full per-file decisions and
checksum proof: docs/reviews/20261025-merge-ledger.md.

Resolved 52 paths:
- .env.example
- .gitignore
- backend/package.json
- backend/src/api/contracts.ts
- backend/src/api/routes/misc.ts
- backend/src/api/routes/owner.ts
- backend/src/api/routes/ownerPacketSharing.test.ts
- backend/src/api/routes/regions.test.ts
- backend/src/api/routes/regions.ts
- backend/src/db/index.ts
- backend/src/db/packetBatch.integration.test.ts
- backend/src/db/packetBatch.test.ts
- backend/src/db/packetBatch.ts
- backend/src/db/packetInput.ts
- backend/src/health/status.ts
- backend/src/health/statusIntegrity.test.ts
- backend/src/index.ts
- backend/src/metrics.test.ts
- backend/src/mqtt/client.ts
- backend/src/mqtt/statusTelemetry.test.ts
- backend/src/mqtt/statusTelemetry.ts
- backend/src/owner/ownerLastHopPrewarm.ts
- backend/src/owner/packetShareForwarder.ts
- backend/src/owner/publicFeedForwarder.test.ts
- backend/src/owner/publicFeedForwarder.ts
- backend/src/owner/publicFeedRepository.ts
- backend/src/ram/liveRead.ts
- backend/src/ram/liveStore.test.ts
- backend/src/ram/runtime.integration.test.ts
- backend/src/ram/writerRuntime.ts
- backend/src/repositories/nodes.ts
- backend/src/spam/cluster.test.ts
- backend/src/spam/cluster.ts
- backend/src/spam/config.ts
- backend/src/tools/rebuildRegionParticipation.ts
- backend/src/workers/alert-receiver.test.ts
- backend/src/workers/alertDeliveryQueue.ts
- backend/src/workers/privacy-rematerialization.ts
- backend/src/ws/server.ts
- backup-receipts/latest.json
- backup-receipts/latest.json.sig
- docker-compose.yml
- docs/openapi.yaml
- docs/spam-detection.md
- frontend/src/components/Map/RegionsMap.tsx
- frontend/src/components/Map/regionOverlay.test.ts
- frontend/src/components/Map/regionOverlay.ts
- frontend/src/pages/RegionsPage.tsx
- frontend/src/pages/regions-page.css
- frontend/src/pages/regionsModel.ts
- rf-coverage/config.ukmesh.yaml
- tagger-worker/Dockerfile

Validation: backend tsc; 673 tests, 670 pass, 0 fail, 3 DB skips; frontend
tsc/build; default frontend 166 tests, 0 fail (10 opt-in browser skips);
contract:check; fixture-only Compose config and adoption tests.
2026-10-25 04:30:19 +00:00
hermes-gadget 1c6d95d05c test(path-beta): give the worker-pool replacement budget room for a cold start 2026-10-25 04:19:50 +00:00
hermes-gadget b919432f45 Merge pull request #162 from gadgethd/burn/ukmesh-alerts-20261023
feat(alerts): bound alert delivery and report prewarm progress
2026-10-25 01:49:50 +00:00
hermes-gadget 46ac49636b fix(alerts): bind link heartbeat staleness to its Redis TTL 2026-10-25 01:23:14 +00:00
hermes-gadget 69cc48a767 Monitor public privacy generation convergence without repair 2026-10-25 01:18:00 +00:00
gadgethd d780729c5b fix(surface): project readyz, bound WS scope errors, authenticate alerts
- /readyz returns only database and MQTT state; owner-ACL generations,
  reconciliation errors and workload identity stay on the local-only surface
- an invalid network scope on a public WS upgrade returns 400 instead of
  throwing out of verifyClient
- POST /alerts requires a bearer token (fail-closed) and both in-repo senders
  send it; Alertmanager reads its token from a provisioned file

Audit: backend/src/index.ts:GET-readyz.publishes-owner-authorization-and-analysis-internals
       ws.verifyclient.invalid-network-scope-uncaught-exception
       backend/src/workers/alert-receiver.ts:POST-alerts:unauthenticated-alert-ingest-to-operator-webhook
2026-10-23 16:10:02 +00:00
hermes-gadget 0ada4674b3 fix(ingest): surface monitor failures and bound SQL execution 2026-10-23 08:58:06 +01:00
hermes-gadgetandgadgethd fa801dc004 fix: close ukmesh health and advert identity backlog gaps (#117)
* fix(backlog): close ukmesh health and advert identity gaps

* docs(review): record backlog round 2 pull request

---------

Co-authored-by: gadgethd <111318106+gadgethd@users.noreply.github.com>
2026-10-03 19:43:45 +01:00
b40793f36e Fix analysis state, worker observability, feed layout and maintenance (re-land onto main) (#114)
* Fix analysis state, worker observability, feed layout and maintenance (#113)

* fix(analysis): restore tested retired workload policy

* fix(owner): prewarm last-hop cache with bounded progress reporting

* fix(metrics): use real link worker heartbeat for queue alerts

* fix(feed): measure virtual rows and preserve scroll anchors

* fix(ops): reject Compose metadata drift before replacement

* fix(maintenance): archive inactive nodes across roles and bridge states

* docs(review): record validation and heartbeat audit findings

* fix(maintenance): retain private identities during stale cleanup

* fix(ops): consume Compose service output before adoption checks

* test(owner): cover prewarm scheduling recovery and shutdown

* test(e2e): isolate server ports and Vite dependency caches

* test(feed): cover empty filters and arrivals at the top

* test(map): budget two cold bootstraps in mode persistence check

* docs(review): record continuation regressions and final verification

* fix(alerts): match queue heartbeats to their scrape reporter

* test(feed): preserve packet anchors across scroll-mode changes

* test(owner): verify incremental prewarm cache refreshes

* fix(maintenance): preserve packet privacy fence during public cleanup

* fix(maintenance): recheck inactive sightings before archive and delete

* fix(owner): serve fresh cache hits during background prewarm

* test(map): give each viewport its own startup budget

* test(map): load valid terrain and coverage tiles in local fixtures

* fix(metrics): export unknown heartbeat when Redis initialization fails

* test(path): control worker-pool deadlines independently of thread startup

* test(e2e): await owner and map readiness before state assertions

* test(feed): check fractional viewport and spacer invariants

* docs(review): record green expanded verification checkpoint

* fix(maintenance): acquire visibility before node locks and skip busy rows

* test(maintenance): retain concurrent RF-only activity in native fixtures

* fix(owner): replace regrouped last-hop buckets during refresh

* test(owner): verify warm regrouping with actual last-hop SQL

* test(maintenance): retain concurrently committed node consent

* test(maintenance): avoid a waiting consent-trigger deadlock

* test(feed): verify responsive anchoring in Firefox and WebKit

* docs(review): reconcile completed checks and remote CI evidence

* docs(review): correct checkpoint wording

* test(maintenance): verify privacy fences on native PostgreSQL

* test(health): verify link heartbeat publisher lifecycle

* docs(review): record stop-signal handoff and remaining verification

---------

Co-authored-by: gadgethd <111318106+gadgethd@users.noreply.github.com>

* fix(feed): preserve scroll anchors across scroll-mode flips

React 19.3 fires the window scroll listener before React commits its new
row range, so updateViewport could overwrite the last known content offset
with the new-mode artifact (0) before the anchor-preserving layout effect
ran — dropping the feed to the top on a responsive resize.

Detect the scroll-mode flip (internal container <-> document scrolling) in
updateViewport and transfer the last known content offset into the new mode
before the anchor effect evaluates.

Verified: feed-virtualizer e2e (both viewports) and the full public-desktop
suite under react 19.2.8 and 19.3.0.

* fix(#553): sync replace-container test harness

* test(ops): sync replace-container harness with adoption + infra flows (#553)

Union of both branch evolutions: Compose adoption drills (check-compose-adoption
staging, MOCK_ADOPTION_* modes, adoption/long-service/overlay cases) plus the
infra-compose staging and timescaledb resolver drill assertions. Fixes the
Workers-and-Compose gate failing on this PR.

Verified locally: 16/16 drills pass.

---------

Co-authored-by: gadgethd <111318106+gadgethd@users.noreply.github.com>
Co-authored-by: hermes-gadget <284726080+hermes-gadget@users.noreply.github.com>
2026-10-03 17:14:34 +01:00
hermes-gadgetandgadgethd 5574d70139 fix: close High findings #43 + #45 — durable MQTT ingestion, bounded telemetry lifecycle (#100)
* fix(mqtt): ack QoS1 after durable persistence

* fix(retention): bound core telemetry lifecycle

* docs: add C5b durability handoff

* test(rules): 1m cadence for telemetry lifecycle alert windows so for: timers accumulate

---------

Co-authored-by: gadgethd <111318106+gadgethd@users.noreply.github.com>
2026-09-30 23:35:04 +01:00
gadgethd 26781dc7d9 fix(db): make reset schema and lifecycle reproducible 2026-08-27 23:48:01 +00:00
gadgethd efd2952684 feat: mosquitto $SYS exporter (read-only sysmon user) wired into prometheus 2026-08-12 01:42:16 +00:00
gadgethd 4d9872768a perf: reduce monitoring load and retire path history 2026-08-09 19:37:59 +00:00
gadgethd c3f64d5be3 ops: alert on mqtt ingest saturation 2026-08-09 13:16:54 +00:00
gadgethd 4553647f54 feat: integrate HopReach RF coverage 2026-08-02 14:11:11 +01:00
gadgethd 5db382e181 feat: complete codebase reliability upgrade 2026-08-02 03:40:11 +01:00
gadgethd 24d49198c6 Add Prometheus-backed Grafana dashboards 2026-07-28 23:17:33 +01:00
BenandClaude Sonnet 4.6 edc8206a22 Add ML path learner, Anubis bot protection, planned coverage, companion page, and misc improvements
- ml-path-learner: new Python worker that trains a prefix→node ML model from gold paths and writes scores to ml_path_prefix_scores
- lazyResolver: integrate ML scores and edge priors into tiered candidate ranking; bidirectional pass-2 propagation; global cross-group direct anchors
- Anubis: add sidecar bot-protection containers for all public HTTP services; botPolicy.yaml
- Planned coverage: new API route + frontend map layers for placing hypothetical repeaters and computing coverage
- Map: light/dark theme toggle; map-tools button group (LOS, Repeater, theme); plan-repeater mode with click-to-place/remove and polling
- Frontend: remove inferred nodes from map display (backend inference kept for internal use)
- Stats page: observer region summary, channel traffic, companion activity endpoints and UI
- UKCompanionPage: new companion activity page
- Teesside site: extracted into standalone build context (teesside-site/)
- healthcheck overrides: share.html, sw.js, region filter support, SVG score ring updates
- DB: dedicated analytics pool; DATABASE_SKIP_SCHEMA_INIT flag; path hash prefix indexes; lateral join fixes for node_link_radio_reports
- docker-compose: ml-path-learner service; anubis sidecars; DATABASE_SKIP_SCHEMA_INIT on all workers; OBSERVER_RETENTION_SECONDS; REGIONS_FILE
- backend-site: internal operator dashboard routes
- docker/mesh-health-check-entrypoint.sh: extract channel secret from MESHCORE_CHANNEL_SECRETS at startup
- scripts: observer key generation, observer registration, healthcheck tunnel check
- vacuum-compressed-chunks.sh: maintenance script

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-03 01:33:48 +00:00
BenandClaude Sonnet 4.6 f8e8717454 Add lazy path resolver, ACL watcher, feed map, and observability stack
- Lazy path resolver: geographic hop reconstruction from path_hashes without
  pre-training data; fixes observer self-hash trimming bug
- ACL watcher worker: auto-provisions Mosquitto ACL entries when PUBLISH is
  denied for a known user; eliminates the recurring gnomemoe ACL removal issue
- connectionMonitor: increase historical scan to 50 MB; fix OOM by streaming
  lines instead of buffering; fixes missed backfill on restart
- Feed page: replace path-beta with lazy paths; add clickable node markers
  showing name and public key; observer column nowrap; summary text unclipped
- PacketFeed: GRP-only message store protected from ADV eviction; scroll to
  bottom on new message; 24-hour message backfill on initial load
- getRecentMessages: separate DB query for last 50 GRP messages last 24h
- getPacketDetail: new endpoint for full packet detail including observations
- Grafana/Loki/Promtail observability stack with Docker log collection

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-22 23:28:57 +00:00