Commit Graph
16 Commits
Author SHA1 Message Date
gadgethd 99bf7994b2 Enroll verified observer devices through the portal and isolated broker worker 2026-12-03 17:11:35 +00:00
UKMesh Readiness 65037280a4 Use the signed HTTPS Ubuntu mirror for hosted HopReach image builds 2026-12-01 14:33:49 +00:00
UKMesh Readiness eccfc2e110 Reduce broker reloader probe overhead under mixed load 2026-12-01 10:50:57 +00:00
UKMesh-CI e17de8ec9a Select the same signed mirror for the subsequent CI Compose worker build 2026-11-30 13:53:11 +00:00
gadgethd fde49a5850 Split durable MQTT ingest from the HTTP and WebSocket API 2026-11-27 17:53:22 +00:00
hermes-gadget e4da855d37 Merge main into revamp/backend-2026-11
One conflict, in the visibility-convergence fixture: main's row-level prefix
fence (074) landed after this branch forked, alongside the branch's statement
fence (066) and post-move reassertion (134). The fixture now re-applies the
full chain in migration order (066 -> 074 -> 134) and asserts the post-move
row triggers on core.private_node_prefixes. 074 sorts between the branch's
073 and 078 slots, so the two bands compose without renumbering.
2026-11-11 22:21:01 +00:00
hermes-gadget ec7fdfd452 ci: unblock the empty-volume smoke stack and its post-move browser fixtures (#220)
* ci: create the owner-auth database in the smoke stack

The backend derives its owner connection from DATABASE_URL with the database
name swapped for meshcore_owner_auth, and dies at startup when that database is
absent. Production creates it out of band (newuser.sh, restore-drill.sh); a
fresh CI volume never did, so 'Build every application image and smoke an
empty-volume stack' failed with 'database meshcore_owner_auth does not exist'.

Mirror production: an init-hook script creates the database and applies the
shipped owner-auth.sql to it. The SQL is mounted outside initdb so it is not
applied to the main database as well.

* test(tagger): build the fixture in the post-move ops namespace

The suite creates its own database and then runs the worker's real poll SQL,
which reads ops.public_visibility_state, ops.packet_visibility_materialization_state,
ops.privacy_rematerialization_queue and ops.tagger_retry since the P1 moves.
The fixture still created those tables in public, so all eight tests failed with
'relation "ops.packet_visibility_materialization_state" does not exist'.

This was masked until now: the smoke stack never got past backend startup, so
this step never ran. packets and message_tags stay unqualified - the worker
resolves those through the connection search_path, as the deployed P1
search_path does.

Verified against a disposable TimescaleDB with the same invocation CI uses:
8 tests, OK.

* ci: read the smoke-stack assertions from the post-move schemas

The empty-volume smoke readback still queried nodes, packets, packet_paths and
packet_hourly_stats by their pre-move public names. 116/123/124/125 moved them to
core and mesh, so the psql step failed with 'relation "packet_hourly_stats" does
not exist' once the stack got far enough to run it.

Use the canonical names; the public spellings are compatibility views at best and
for two of these relations no longer exist.

* test(e2e): warm the MapLibre module graph during setup

maplibre-gl is excluded from optimizeDeps because Vite's pre-bundling
rewrites the worker URL and kills it, so the first cold request pays for
transforming the whole module graph. On the CI runner that is 41-47s for
maplibre-gl-worker.mjs (measured from the retained traces on run
41887037964), which is most of the 60s map-health budget in the map specs:
the map starts ~57s after the document load and the assertion expires just
before the basemap turns healthy.

Playwright starts webServer before globalSetup, so warm the two heaviest
dev-server modules there. The cost moves into setup; assertions stay tight.
Failures are logged and ignored - this is never a gate.

Fixes #190

* test(e2e): log module warm-up response shape

The CI warm-up reported 200/116ms, but the browser still waited 47.8s for the
worker module and the map stayed loading. Log Content-Length and Content-Type
for each warm-up response so we can distinguish the transformed worker from a
fast SPA fallback before changing the fix.
2026-11-05 21:57:57 +00:00
hermes-gadget 619c1f5108 ci: seed the migration ledger when bootstrapping a fresh volume (#202)
A fresh volume is seeded from `backend/src/db/schema/base.sql` by the
TimescaleDB init hook, so the first `db-migrate` pass legitimately sees a
non-empty database with no ledger:

  [db-migrate] failed: public.schema_migrations is missing on a non-empty
  database; refusing to create a new ledger or replay historical migrations

Replaying history cannot produce that schema on its own: none of the 129
migrations create `nodes` or `packets`, and a genuinely empty database fails
at `relation "packets" does not exist`. The base schema is the ledger origin,
so the runner now recognises a deliberate, documented bootstrap:

* `MIGRATION_BASE_SCHEMA_BOOTSTRAP_APPROVAL` must carry the exact approval
  string; `true`, casing variants and an absent value are all refused.
* Even then the database must match the shipped `base.sql` exactly — same
  relations, same schemas, no extras. Any drift (an extra table from a
  production-like database, a missing baseline table, an extra schema) is
  refused with the differences named.
* An accepted bootstrap is recorded in `schema_migration_compatibility` as
  `schema/base.sql` / `bootstrap-base-schema` with the file's SHA-256.
* A database without the approval still throws the original assertion error.

`docker-compose.ci.yml` sets the approval for the empty-volume smoke only and
mounts the shipped operator role-bootstrap scripts into the same init hook, so
`072_backend_grants.sql` runs its real grant path instead of being skipped.

The runner's 011/015/016 supersession probe no longer assumes `core.nodes` and
`mesh.packets` exist: it probes whichever of the pre-move `public` relations and
the current `core`/`mesh` relations are present, so a fresh base schema is
correctly treated as empty instead of erroring out.

Tests: unit coverage for the decision table (refusal, wrong token, drift in
either direction, extra schema, missing baseline) plus a PostgreSQL integration
test that seeds `base.sql` and proves all three outcomes: refused without the
approval and no ledger created, bootstrapped with it (ledger rows carry the
real file checksums, the audit row is written, a second pass is a no-op), and
refused again once one extra relation appears. It also covers the 011 probe.
2026-11-05 16:56:20 +00:00
hermes-gadgetandHermes f00e533b49 fix(owner): converge feed ACL writes and recover readiness evidence (#186)
* fix(owner): use authenticated diagnostics for rebaseline decisions

* fix(owner): await reconciliation after committed feed changes

* fix(owner): preserve baseline ACL evidence and expose history repair plans

* docs(privacy): park unattended global convergence design

* fix(ci): wait for final PostgreSQL TCP server before migrations

* docs(review): record Lane L CI proof and credential escalation

---------

Co-authored-by: Hermes <hermes@local>
2026-11-04 17:27:04 +00:00
gadgethd a8b964cbba Reconcile deployed broker ownership and publish the audit deployment record 2026-11-01 14:41:53 +00:00
gadgethd 3139e92c48 Keep a single CI receiver service with an owned forwarding sink 2026-11-01 14:38:43 +00:00
gadgethd 36f3741b74 Reconcile audited performance and correctness fixes with current main 2026-11-01 14:33:49 +00:00
hermes-gadget 54dbc68bb2 Audit PostgreSQL shared memory and enforce explicit 1 GiB sizing 2026-10-25 01:24:00 +00:00
Hermes Agent 9094d900fb test(ci): opt the empty-volume smoke stack into shadow owner mode
The CI stack has no owner-auth database or ACL file; with enforce/apply now
the default, the backend health gate cannot pass there. Shadow is opt-in by
design, so the CI overlay says so explicitly. Production keeps enforce/apply.
2026-10-21 00:24:33 +01:00
Hermes Agent d2f24b7caf ci: use liveness for alert-receiver in the smoke stack
CI has no ALERT_FORWARD_URL, so the receiver reports archive-only mode as
not-ready on /readyz by design (503) and the stack never settles. Probe
/healthz in CI only; production keeps the strict delivery readiness gate.
2026-10-20 12:45:42 +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