Commit Graph
63 Commits
Author SHA1 Message Date
gadgethd b492ffb867 Fall back to canonical signed Ubuntu archives when the Azure replica is incomplete 2026-12-03 23:23:35 +00:00
UKMesh Readiness 96aa400f0f Probe missing repeater endpoints before rescanning the link graph 2026-11-30 18:30:13 +00:00
UKMesh-CI 65f99029f3 Use the signed Ubuntu Azure mirror for hosted viewshed image tests 2026-11-30 13:23:45 +00:00
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
dependabot[bot] ebb17cf0c8 chore(deps): bump redis from 8.1.0 to 8.2.0 in /viewshed-worker in the rf-worker-dependencies group across 1 directory
Bumps the rf-worker-dependencies group with 1 update in the /viewshed-worker directory: [redis](https://github.com/redis/redis-py).


Updates `redis` from 8.1.0 to 8.2.0
- [Release notes](https://github.com/redis/redis-py/releases)
- [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES)
- [Commits](https://github.com/redis/redis-py/compare/v8.1.0...v8.2.0)

---
updated-dependencies:
- dependency-name: redis
  dependency-version: 8.2.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rf-worker-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-27 16:30:26 +00:00
hermes-gadget 4914eb4bcb fix(viewshed): scope side-effect markers to the coverage generation (#47) (#272)
A node-keyed marker left by an earlier successful run could vouch for a
newer coverage row after a model-version bump or elevation backfill, so a
failure between store_coverage() and link admission/publish was ACKed on
retry with the link jobs and notifications never produced.

Key the Redis marker by the coverage row's model_version + calculated_at
generation and compare on read; a stale marker now forces a replay. Also
fail closed when link replay has no node position instead of marking the
row complete.
2026-11-27 13:45:50 +00:00
dependabot[bot] 70220e384b chore(deps): bump numpy (#255)
Bumps the rf-worker-dependencies group in /viewshed-worker with 1 update: [numpy](https://github.com/numpy/numpy).


Updates `numpy` from 2.5.4 to 2.5.5
- [Release notes](https://github.com/numpy/numpy/releases)
- [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst)
- [Commits](https://github.com/numpy/numpy/compare/v2.5.4...v2.5.5)

---
updated-dependencies:
- dependency-name: numpy
  dependency-version: 2.5.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rf-worker-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-23 16:05:26 +00:00
Codex eb24691ebe Bound the Redis cache of completed link jobs 2026-11-19 03:55:56 +00:00
Codex 9d2aa474c8 Keep link workers independent of unused coverage support data 2026-11-17 03:54:21 +00:00
Codex 4f4be0ed63 fix(workers): publish graph notifications after the commit fence 2026-11-12 20:08:45 +00:00
Codex 0a4c79d91d refactor(workers): own runtime contexts and isolate graph generations 2026-11-12 19:18:42 +00:00
Codex fad74caffc refactor(contracts): generate shared queue and public metadata bindings 2026-11-12 18:40:56 +00:00
Codex b5c5b6d8ef chore(release): prepare 2.0 candidate identity and upgrade notes 2026-11-12 10:28:32 +00:00
Codex 35c0392e4b perf(worker): defer coverage imports and spatial trees in link mode 2026-11-12 09:14:12 +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
hermes-gadget 79190f8382 fix(ci): ship the external-consumer SQL checker with the worker image (#196)
The Workers and Compose job runs the worker suite inside the built image
(`python -m unittest discover -s /app/tests`). The relation-qualification
test resolved the checker as `<repo>/scripts/check_external_consumer_sql.py`
via `Path(__file__).parents[2]`, which inside the container is `/scripts`,
and the image only carries `viewshed-worker/`, so the job died with
`ModuleNotFoundError: check_external_consumer_sql` before any test ran.

The image builds with `context: viewshed-worker`, so a repo-level `scripts/`
file cannot be COPYed in without widening the build context (and the release
workflow). Move the implementation next to the worker (`viewshed-worker/
check_external_consumer_sql.py`), leave a thin shim at the old path so
`backend`'s `test:external-consumers:sql` keeps working from a checkout, and
add the module to the Dockerfile COPY.

The test now resolves the module from the worker root, and a new in-image
test asserts the checker imports from that root, so dropping it from the
image fails with a named test instead of a bare import error.
2026-11-05 16:44:29 +00:00
hermes-gadget 813289a19c test: add external consumer schema regression checks 2026-11-03 13:15:21 +00:00
hermes-gadget c807ccfabf p1: qualify link worker packet reads 2026-11-03 13:00:35 +00:00
hermes-gadget 477c2546c1 p1: qualify remaining worker nodes references 2026-11-03 12:44:28 +00:00
hermes-gadget 6880ae5162 p1: update RF worker tests for core qualification 2026-11-03 01:02:25 +00:00
hermes-gadget e37dc9abce p1: qualify coverage and link radio tables in RF worker 2026-11-03 00:58:31 +00:00
hermes-gadget 6a7bd84aa0 p1: qualify node links in RF worker 2026-11-03 00:56:50 +00:00
hermes-gadget 7ef35af116 p1: qualify link worker commits for ops schema 2026-11-02 23:55:17 +00:00
gadgethd 36f3741b74 Reconcile audited performance and correctness fixes with current main 2026-11-01 14:33:49 +00:00
dependabot[bot] 09a00c8ad0 chore(deps): bump numpy (#128)
Bumps the rf-worker-dependencies group with 1 update in the /viewshed-worker directory: [numpy](https://github.com/numpy/numpy).


Updates `numpy` from 2.5.3 to 2.5.4
- [Release notes](https://github.com/numpy/numpy/releases)
- [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst)
- [Commits](https://github.com/numpy/numpy/compare/v2.5.3...v2.5.4)

---
updated-dependencies:
- dependency-name: numpy
  dependency-version: 2.5.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rf-worker-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-10-30 01:52:13 +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 5312b342e9 ci: retry transient image and apt failures without replaying test gates 2026-10-23 08:54:10 +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 029cc6ac33 fix(ops): ukmesh deploy/alert/stats hardening (#47 #54 #55 #57) (#104)
* test(viewshed): inject post-commit side-effect failures

* fix(deploy): rollback on unhealthy or mismatched sites

* fix(alerts): persist forwarding queue across restarts

* perf(stats): add per-network aggregate cutover controls

* docs: add Mission C5d handoff

* test(viewshed): correct side-effect marker cursor row sets

* fix(alerts): keep archive-only receiver live

---------

Co-authored-by: gadgethd <111318106+gadgethd@users.noreply.github.com>
2026-10-01 00:24:31 +01:00
dependabot[bot] d3eb1e55ef chore(deps): bump the rf-worker-dependencies group across 1 directory with 2 updates (#94)
Bumps the rf-worker-dependencies group with 2 updates in the /viewshed-worker directory: [numpy](https://github.com/numpy/numpy) and [psycopg2-binary](https://github.com/psycopg/psycopg2).


Updates `numpy` from 2.5.2 to 2.5.3
- [Release notes](https://github.com/numpy/numpy/releases)
- [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst)
- [Commits](https://github.com/numpy/numpy/compare/v2.5.2...v2.5.3)

Updates `psycopg2-binary` from 2.9.12 to 2.9.13
- [Changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS)
- [Commits](https://github.com/psycopg/psycopg2/compare/2.9.12...2.9.13)

---
updated-dependencies:
- dependency-name: numpy
  dependency-version: 2.5.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rf-worker-dependencies
- dependency-name: psycopg2-binary
  dependency-version: 2.9.13
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rf-worker-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-09-30 22:58:06 +01:00
dependabot[bot] f555b46932 chore(deps): bump osgeo/gdal in /viewshed-worker (#73)
Bumps [osgeo/gdal](https://github.com/OSGeo/gdal) from ubuntu-full-3.13.2 to ubuntu-full-3.13.3.
- [Release notes](https://github.com/OSGeo/gdal/releases)
- [Changelog](https://github.com/OSGeo/gdal/blob/master/NEWS.md)
- [Commits](https://github.com/OSGeo/gdal/compare/v3.13.2...v3.13.3)

---
updated-dependencies:
- dependency-name: osgeo/gdal
  dependency-version: ubuntu-full-3.13.3
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-29 11:22:24 +01:00
dependabot[bot] 2be2b498a6 chore(deps): bump scipy (#77)
Bumps the rf-worker-dependencies group in /viewshed-worker with 1 update: [scipy](https://github.com/scipy/scipy).


Updates `scipy` from 1.18.0 to 1.18.1
- [Release notes](https://github.com/scipy/scipy/releases)
- [Commits](https://github.com/scipy/scipy/compare/v1.18.0...v1.18.1)

---
updated-dependencies:
- dependency-name: scipy
  dependency-version: 1.18.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rf-worker-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-29 11:22:11 +01:00
dependabot[bot] 68225c463b chore(deps): bump the rf-worker-dependencies group (#68)
Bumps the rf-worker-dependencies group in /viewshed-worker with 6 updates:

| Package | From | To |
| --- | --- | --- |
| [numpy](https://github.com/numpy/numpy) | `2.3.5` | `2.5.2` |
| [prometheus-client](https://github.com/prometheus/client_python) | `0.21.1` | `0.26.0` |
| [psycopg2-binary](https://github.com/psycopg/psycopg2) | `2.9.11` | `2.9.12` |
| [redis](https://github.com/redis/redis-py) | `5.0.8` | `8.1.0` |
| [requests](https://github.com/psf/requests) | `2.32.3` | `2.34.2` |
| [scipy](https://github.com/scipy/scipy) | `1.16.3` | `1.18.0` |


Updates `numpy` from 2.3.5 to 2.5.2
- [Release notes](https://github.com/numpy/numpy/releases)
- [Changelog](https://github.com/numpy/numpy/blob/main/doc/RELEASE_WALKTHROUGH.rst)
- [Commits](https://github.com/numpy/numpy/compare/v2.3.5...v2.5.2)

Updates `prometheus-client` from 0.21.1 to 0.26.0
- [Release notes](https://github.com/prometheus/client_python/releases)
- [Commits](https://github.com/prometheus/client_python/compare/v0.21.1...v0.26.0)

Updates `psycopg2-binary` from 2.9.11 to 2.9.12
- [Changelog](https://github.com/psycopg/psycopg2/blob/master/NEWS)
- [Commits](https://github.com/psycopg/psycopg2/compare/2.9.11...2.9.12)

Updates `redis` from 5.0.8 to 8.1.0
- [Release notes](https://github.com/redis/redis-py/releases)
- [Changelog](https://github.com/redis/redis-py/blob/master/CHANGES)
- [Commits](https://github.com/redis/redis-py/compare/v5.0.8...v8.1.0)

Updates `requests` from 2.32.3 to 2.34.2
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.32.3...v2.34.2)

Updates `scipy` from 1.16.3 to 1.18.0
- [Release notes](https://github.com/scipy/scipy/releases)
- [Commits](https://github.com/scipy/scipy/compare/v1.16.3...v1.18.0)

---
updated-dependencies:
- dependency-name: numpy
  dependency-version: 2.5.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rf-worker-dependencies
- dependency-name: prometheus-client
  dependency-version: 0.26.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rf-worker-dependencies
- dependency-name: psycopg2-binary
  dependency-version: 2.9.12
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: rf-worker-dependencies
- dependency-name: redis
  dependency-version: 8.1.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: rf-worker-dependencies
- dependency-name: requests
  dependency-version: 2.34.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rf-worker-dependencies
- dependency-name: scipy
  dependency-version: 1.18.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: rf-worker-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-08-27 09:41:41 +01:00
hermes-gadgetandhermes-gadget e069f6b102 fix: close Wave 3 medium findings (owner auth, deploy, newuser, alerts, gitleaks, viewshed) (#64)
* fix(owner): Wave 3 mediums — password handling, deploy rollback, newuser races, session revocation

- BUG-017: stop trimming MQTT passwords (frontend + backend). A valid
  broker password may begin/end with whitespace; trimming made it
  permanently unauthenticatable. Username trimming unchanged.
- BUG-013: deploy-website.sh now set -Eeuo pipefail with an EXIT rollback
  trap armed only after the pin mutates; container-down and bundle-mismatch
  paths fail loudly and restore the old pin + verify the restored service.
- BUG-012: newuser.sh installs an EXIT trap (ERR does not fire on explicit
  exit 1 from die()) so every post-mutation failure rolls back; rollback is
  idempotent and a no-op before any mutation flag. Disarm points clear EXIT.
- BUG-011: newuser.sh re-reads + re-validates OWNER_MQTT_USERNAME_MAP under
  the re-acquired lock after the long unlocked discovery window, then merges
  the new grant into the current map — concurrent provisioning runs can no
  longer be overwritten by a stale snapshot.
- BUG-010: owner sessions are now v3 cookies carrying a credential
  generation (Redis-backed). When the broker rejects a previously-valid
  password (revocation detected), the generation bumps and every older
  session is rejected on the next request. TTL shortened 30d -> 7d.

Verified: tsc clean, 310/310 backend tests pass, bash -n on both scripts.

* fix(alert-receiver): durable alert delivery with bounded retry + dead-letter (BUG-014)

Forwarding was fire-and-forget: failures logged asynchronously after HTTP 202,
/healthz stayed green, and alerts could be archived to the local JSONL while
operators never saw them. Now:
- Every receipt is enqueued for delivery with bounded exponential backoff
  (ALERT_FORWARD_MAX_ATTEMPTS=5, base 1s, cap 60s) and dead-lettered to
  receipts.jsonl.dead after exhausting attempts.
- /healthz keeps returning 200 (compose wget healthcheck must not restart
  the container) but the body reports degraded status + detail; new /readyz
  returns 503 when ALERT_FORWARD_URL is unset (archive-only), no successful
  forward since startup, or alerts stuck undelivered >5min.

Verified: tsc clean, 310/310 tests pass.

* fix(ci): classify reviewed public channel keys + fixtures in gitleaks (BUG-009)

The nightly full-history secret scan flagged 42 findings spanning the
documented community channel keys (VALIDATED_CHANNELS — intentionally
public, each verified to decrypt real UK Mesh group text), fake test
fixtures, and a deployed-commit SHA in the website live manifests. That
made a genuine credential easy to dismiss among expected hits.

- Rule-scoped allowlists with exact fingerprints (regexTarget: secret,
  anchored full-value matches) for the Public channel key, test fixtures
  (0123456789... / abcdef0123...), and the manifest commit SHA.
- Structure-exact line allowlist for channelRegistry.ts VALIDATED_CHANNELS.
- Verified locally with gitleaks 8.24.3 full-history scan: 42 -> 0 findings.

* fix(viewshed): side-effect completion markers prevent skipped link jobs (BUG-006)

store_coverage() commits on an autocommit connection, then the worker queues
physical-link jobs and publishes Redis notifications. A Redis failure after
the DB commit NACKed the job; on retry already_calculated() saw the coverage
row and returned early — link work and frontend notifications were skipped
forever.

- Record a Redis completion marker (viewshed:side-effects:<node>) only after
  EVERY side effect succeeds.
- On the already_calculated early return, a missing marker triggers an
  idempotent replay: link jobs are re-enqueued from the stored node position
  (admission is idempotent) and coverage_update/node_upsert notifications are
  re-published from the stored coverage row.
- Redis read failures are treated as incomplete (replay attempt re-raises and
  NACKs rather than silently skipping).
- Added tests/test_side_effect_markers.py (5 tests) with a conftest that stubs
  osgeo/psycopg2 so pure-logic worker tests run without GDAL (CI keeps real
  GDAL via setdefault). Verified: 5/5 new tests pass; full suite 34 passed,
  2 GDAL-required terrain tests fail only in stub env (pass in CI image).

---------

Co-authored-by: hermes-gadget <hermes-gadget@users.noreply.github.com>
2026-08-11 22:50:16 +01:00
hermes-gadgetandgadgethd ab6372b8a9 fix(ci): pin gitleaks-action to valid commit after upstream force-push (#63)
* fix(ci): pin gitleaks-action to valid commit after upstream force-push

Upstream deleted dcedce43 (force-push), so every ci.yml run fails at
workflow-parse with 0 jobs. The dependabot actions-group bump (#30)
contains this fix but cannot merge whole: its docker/* actions require
node24, which GitHub runners do not support yet. Pin gitleaks alone
(ff98106e is node20).

* fix(ci): downgrade v7 actions to node20-compatible versions

actions/checkout@v7, setup-node@v7, setup-python@v7 require node24,
which GitHub-hosted runners do not support yet — every ci.yml run has
failed at workflow-parse (0 jobs) since the Aug 3 v7 bump. Pin to the
latest node20 versions (checkout v4, setup-node v4, setup-python v5).
Also pins gitleaks-action to a valid commit (upstream force-pushed away
dcedce43).

* ci: noop retrigger

* fix(ci): escape literal ${{ in bash string so GitHub parser accepts workflow

The 'Validate tracked build and Compose inventory' step matched literal
${{ inside run-block strings, which GitHub's expression parser reads as
the start of an expression (${{'* is invalid) — the workflow fails at
parse time with 0 jobs. Split the literal as '$''{{' (bash concatenates
adjacent quoted strings at runtime; the source no longer contains a
contiguous ${{).

* fix(ci): resolve all three pre-existing ukmesh CI failures

Backend (packetBatchWriteCoalesce):
- 045: restore nodes_public_visibility_generation trigger — 015 is
  superseded by 044 on fresh DBs so the trigger was never created,
  leaving generation/visibility_generation out of sync and public
  packet reads returning empty.
- 046: restore packet privacy classification — the 042 fence design
  assumes sync_private_node_prefixes rewrites packets on privacy
  change, but 026's version only maintains prefixes. Node flips to
  private left old packets visible; direct SQL inserts were never
  classified. Restore the packet rewrite in the sync trigger and add
  a BEFORE INSERT trigger mirroring the batch path's is_private /
  visibility_ok computation.
- packetBatch.integration.test.ts: exclude the prefix-cache refresh
  query from statementCount (matches unit-test convention).

Frontend e2e:
- public.spec.ts: assert the TopologyMap component's actual labels
  ('Geographic repeater topology map', '2 mapped repeaters · 2
  observed relationships') instead of the pre-map SVG graph labels.

Workers (pip install):
- viewshed-worker: bump numpy 1.26.4→2.3.5, scipy 1.13.1→1.16.3,
  psycopg2-binary 2.9.10→2.9.11 (cp314 wheels); the base gdal image
  ships Python 3.14 so the old pins had no wheels. Inherit shapely
  from the image's python3-shapely apt package (no cp314 wheel
  exists; source builds are GEOS 3.14-incompatible).

* fix(ci): restore data-plane services for compose validation and smoke test

Commit 8c5e1c8 split the long-lived data-plane services (timescaledb,
mosquitto, redis, mosquitto-reloader) into the external meshcore-infra
project on the live host, but the Workers-and-Compose CI job still
asserted their presence in the app compose project (max_worker_processes
check, inventory check, smoke-test execs). CI had been broken since
Aug 3 so the mismatch was never caught.

Add docker-compose.ci.yml — a CI-only overlay restoring the four
data-plane services from their pre-split definitions — and point every
compose invocation in the Workers-and-Compose job at
'-f docker-compose.yml -f docker-compose.ci.yml'.

Validated locally: merged config parses, the jq assertions and the full
inventory (db-migrate backend app-ukmesh website-ukmesh website-dev
mesh-health-check mosquitto-reloader link-worker link-backfill-worker
hopreach timescaledb mosquitto) all pass.

* fix(ci): include dev profile in compose inventory check

website-dev is a dev-profile service; the inventory gate compared the
base-config service list, so the merged stack never matched. This gate
has been red since the workflow was first written (CI parse-broken from
Aug 3 until the gitleaks pin landed).

* fix(ci): db-migrate must wait for timescaledb health

The Aug 9 data-plane split removed db-migrate's depends_on along with
the timescaledb service definition, so the migration runner raced the
fresh database init in the empty-volume smoke test and failed on the
not-yet-created base schema. Restore the pre-split condition:
timescaledb service_healthy.

* fix(ci): restore internal TCP MQTT listener for smoke test + exporter

Commit 40e843f dropped the 1883 TCP listener, breaking the CI smoke
(mosquitto_pub targets 1883) and the Prometheus mosquitto exporter.
The listener is internal-only: compose never publishes 1883 on the
host, and the password/ACL policy still applies.

---------

Co-authored-by: gadgethd <111318106+gadgethd@users.noreply.github.com>
2026-08-11 19:55:29 +01:00
dependabot[bot]andhermes-gadget a0addabeae Bump osgeo/gdal in /viewshed-worker (#26)
Bumps [osgeo/gdal](https://github.com/OSGeo/gdal) from ubuntu-full-3.12.2 to ubuntu-full-3.13.2.
- [Release notes](https://github.com/OSGeo/gdal/releases)
- [Changelog](https://github.com/OSGeo/gdal/blob/master/NEWS.md)
- [Commits](https://github.com/OSGeo/gdal/compare/v3.12.2...v3.13.2)

---
updated-dependencies:
- dependency-name: osgeo/gdal
  dependency-version: ubuntu-full-3.13.2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: hermes-gadget <whatinthe3duk@gmail.com>
2026-08-11 04:10:51 +01:00
gadgethd 6e07077e60 perf: make link worker change driven 2026-08-09 16:16:43 +00:00
gadgethd 133a2eefca fix: reconnect worker DB on InterfaceError; rate-limit error logging 2026-08-03 15:12:05 +01:00
gadgethd 5db382e181 feat: complete codebase reliability upgrade 2026-08-02 03:40:11 +01:00
gadgethd b9b2ecdbfa Harden CI and background worker reliability 2026-07-28 23:17:49 +01:00
gadgethd 1ebc496965 Map UI redesign, live-path visibility, feed latency, and security hardening (#19)
* Fix map node freshness consistency

* Harden output, ingest, caches, and WebSocket limits

* Enforce public visibility across derived data

* Harden proxy and operator deployment boundary

* Make owner grants authoritative and reconcile ACLs safely

* Bound path, spam, and statistics analysis

* Make link and coverage jobs crash-safe

* Implement strategic security remediation

* Fix production cutover configuration

* Fix disabled viewshed worker health signal

* Serve stale stats during background refresh

* Retain stale stats through refresh windows

* Bound analytics work to protect ingestion

* Prioritize summary warmup over chart scans

* Throttle path history rebuilds

* Bound path history result memory

* Stream path history aggregation

* Give bounded path rebuild one CPU

* Serve stale charts during bounded refresh

* Prioritize startup stats before chart scans

* Bound path history segment cardinality

* Pin path rebuild context to privacy generation

* Self-host original frontend fonts

* Allow bounded path rebuild to complete

* Improve live map UI and low-latency group feed

- Dock node details on the right with selection highlight and collapsible layers
- Add node legend, 24h activity sparkline, copy-link, and layout/overlap fixes
- Keep all repeaters visible during Live Path focus
- Send GroupText feed packets immediately over WebSocket (no batch delay)
- Cache expensive stats/observer activity more aggressively to protect ingest
- Remove stale local planning/audit markdown from the tree

* fix(ci): supply OPERATOR_SITE_TOKEN for compose validation

Workers/Compose CI failed because docker-compose requires
OPERATOR_SITE_TOKEN. Add CI placeholders for that and MQTT_PASSWORD.
2026-07-27 02:39:12 +01:00
gadgethd 93cc3e1b38 Expand network intelligence and harden operations (#9)
Consolidates the stacked backend, privacy, network-intelligence, frontend, operations, mobile, and owner-cache changes after resolving main conflicts and passing the full CI suite.
2026-07-23 20:50:47 +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 Opus 4.6 7994e13175 Add SEO, improve path resolution, per-node antenna heights, and UI refinements
Backend: derive observer IATA from packet topic instead of node table,
send messages separately in WS initial state, add tiered prefix/edge
priors to lazy path resolver for more accurate hash disambiguation.

Frontend: add SeoHead, JsonLd, and vite-seo plugin for per-route meta
tags and structured data. Add earth-curvature correction to custom LOS
tool. Owner portal last-hop chart supports hiding/showing individual
series with cookie persistence. Feed page and path map refactored.
Cache-busting build filenames. Track firstSeenTs on aggregated packets.

Infra: serve robots.txt and sitemap.xml via nginx, add manifest.json,
reduce Mosquitto log verbosity. Viewshed worker supports per-node
antenna heights, configurable profile step, and SNR-median calibration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-27 17:22:31 +00:00
Ben 21224a0525 Refactor backend, map, and worker boundaries
- split backend API into route/service/repository boundaries across stats, owner, and pathing\n- extract shared API bootstrap and helper modules\n- reduce MapLibreMap into smaller frontend map modules with extracted builders, config, popup UI, and types\n- continue worker modularization by extracting RF terrain/tile helpers alongside RF config and loss helpers\n- add repo-local architecture, DB lifecycle, link model, pathing, frontend map, and contributing docs\n\nThis is the verified refactor checkpoint: backend and frontend builds passed, worker syntax checks passed, affected containers were rebuilt, and /healthz is OK.
2026-03-20 17:45:47 +00:00
Ben 812aa95837 Tune RF link model and fix map stale link nodes 2026-03-20 00:41:02 +00:00
Ben 8db9a71e43 Rewrite map stack and tighten path topology 2026-03-19 22:42:35 +00:00
BenandClaude Sonnet 4.6 0c5c97df39 Add Teesside Mesh dashboard and path-beta worker improvements
- New www.teessidemesh.com single-page dashboard (TeessieDashboard.tsx)
  with amber/charcoal theme, connectivity status, repeater cards with
  7-day battery sparklines, MQTT observer grid, and decoded packet feed
- Backend: cross-network connectivity endpoint (hop-count packet matching),
  radio-stats and radio-history proxy endpoints, observer-activity endpoint,
  nodesDay stat field
- docker-compose: website-teesside service on port 3002
- Path-beta: worker pool, resolve cache, and pool refactor for performance
- Connection monitor, WS server and MQTT client improvements
- Mosquitto config, viewshed worker, and frontend UI polish

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-16 02:01:54 +00:00
BenandClaude Opus 4.6 ad4ce0dbb1 Add repeater search page, UK bounds filter, and performance improvements
- New /repeater route with search and detailed repeater cards
- UK geographic bounds filter for viewshed calculations
- Advert packets API endpoint (GET /api/nodes/:id/adverts)
- Battery calculation fix (3.0V-4.2V range)
- NodeMarker optimizations (CircleMarker for repeaters)
- Map z-index adjustments for link lines
- Database performance indexes
- Nginx gzip compression
- Exclude mosquitto/acl and multipath.md from git

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-14 22:31:10 +00:00