Commit Graph
84 Commits
Author SHA1 Message Date
Codex 0903fe1563 Classify the earlier security closure report as historical evidence 2026-11-12 07:29:53 +00:00
Codex 13111ee992 Flush durable singleton packets without a timer wait and retain turn coalescing 2026-11-12 07:26:09 +00:00
Codex aa973a2d67 Record comparable ingest CPU WAL SQL and memory evidence in one command 2026-11-12 07:14:54 +00:00
Codex 70352812f3 Keep local ingest replay bounded and qualify RAM gates with TAP 2026-11-12 07:07:57 +00:00
Codex 264865ac6d fix(ci): qualify current migration head and colored preview startup 2026-11-12 06:45:24 +00:00
Codex a5c540cf59 perf(map): avoid presence-only rebuilds and coalesce status renders 2026-11-12 06:45:24 +00:00
Codex fd241e6ad7 test(perf): benchmark production dashboard presence updates 2026-11-12 06:07:39 +00:00
Codex 2bb41dddf4 fix(dev): preserve meaningful recent windows in snapshot benchmarks 2026-11-12 03:52:35 +00:00
Codex de2f2ab961 fix(dev): detach local app services from launcher sessions 2026-11-12 03:42:55 +00:00
Codex b8572800e4 build(dev): qualify local fixtures and add baseline tooling 2026-11-12 03:41:52 +00:00
ben 26d0d3789f docs(local-sample): document the local backend ACL and owner DB 2026-11-12 01:53:29 +00:00
ben eb23b0401c test(tools): add local sample database loader and MQTT replay harness
- load the local sample CSVs through COPY staging tables into a migrated DB
- replay packet receptions as observer JSON envelopes, or status telemetry
- local-only Mosquitto config and runbook; dataset stays out of Git
- 157k-row load completes in seconds with --fast
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
hermes-gadget 60667df5ac ci: stop seeding a marker table the freshness guard rejects
The readiness fixture created public.ci_init_completed to hold the entrypoint
open past the first health probe. The merged migration bootstrap refuses any
database whose relations do not match the shipped base schema, so the marker
now fails the smoke stack before migrations run. pg_sleep alone already holds
the entrypoint open; the table was never read.
2026-11-11 23:42:44 +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
dependabot[bot] 051fda337e chore(deps-dev): bump @types/node (#209)
Bumps the scripts-dependencies group in /scripts with 1 update: [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `@types/node` from 26.6.5 to 26.6.6
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 26.6.6
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: scripts-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-11-11 22:11:43 +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 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 d42c36a8b5 fix(ci): assert the migration head, not the file count (#189)
The readiness script compared the number of schema_migrations rows with the
number of .sql files. The runner supersedes some files (011 -> 044), so the
ledger is legitimately smaller: 67 rows against 71 files on main. The step
therefore failed on the merge commit and took main CI red.

Assert that the highest-sorted migration is recorded instead, and log the
ledger counts so a future failure is visible rather than silent under set -e.
The replay check still proves nothing is pending.
2026-11-04 18:25:35 +00:00
hermes-gadget 48d37867c1 p2: exclude non-wire legacy rows from coverage gate 2026-11-04 17:59:26 +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
hermes-gadget 384226c16b p2: harden identity backfill and reader statistics 2026-11-03 16:01:26 +00:00
hermes-gadget a469bcbffa p2: add background identity coverage check 2026-11-03 15:21:39 +00:00
hermes-gadget 8099a48aa0 p2: complete packet identity backfill and alias census 2026-11-03 13:50:57 +00:00
hermes-gadget 813289a19c test: add external consumer schema regression checks 2026-11-03 13:15:21 +00:00
hermes-gadget f3d94fb59b p1: qualify analytics relation in network unification script 2026-11-03 13:03:33 +00:00
hermes-gadget 82e73b48db p1: qualify operational scripts after core and mesh moves 2026-11-03 13:03:15 +00:00
hermes-gadget 477c2546c1 p1: qualify remaining worker nodes references 2026-11-03 12:44:28 +00:00
hermes-gadget 7ab05a0ae7 p1: qualify network unification runs for ops 2026-11-03 00:21:02 +00:00
hermes-gadget b7897f7cdc p1: move unreferenced ops simulation tables 2026-11-02 23:41:31 +00:00
hermes-gadget cd27866d39 p1: rehearse 071/072 and add reader role stubs 2026-11-02 11:31:24 +00:00
hermes-gadget 3c421c8217 p1: adopt approved 30G G1a floor 2026-11-02 02:17:13 +00:00
hermes-gadget 2f6cdee2b7 p1: add idempotent backend role bootstrap proposal 2026-11-02 00:22:58 +00:00
hermes-gadget 2e168550b6 p0: relax G1a floor to 40G after verified reclaim 2026-11-02 00:08:40 +00:00
hermes-gadget f5b9122a25 p0: honor P0-1 waiver and fail closed on phase-gate evidence 2026-11-02 00:04:06 +00:00
hermes-gadget 826cf09cdc p0: add consolidation gate harness scaffold 2026-11-01 23:31:58 +00:00
gadgethd 449bd47879 Complete signed releases for all UKMesh application workers 2026-11-01 21:53:25 +00:00
gadgethd 99c258c1d5 Preserve runtime permissions in release compatibility checks 2026-11-01 20:56:08 +00:00
gadgethd a8b964cbba Reconcile deployed broker ownership and publish the audit deployment record 2026-11-01 14:41:53 +00:00
dependabot[bot] f737a212f9 chore(deps): bump the scripts-dependencies group across 1 directory with 2 updates (#118)
Bumps the scripts-dependencies group with 2 updates in the /scripts directory: [pg](https://github.com/brianc/node-postgres/tree/HEAD/packages/pg) and [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node).


Updates `pg` from 8.23.0 to 8.23.1
- [Changelog](https://github.com/brianc/node-postgres/blob/master/CHANGELOG.md)
- [Commits](https://github.com/brianc/node-postgres/commits/pg@8.23.1/packages/pg)

Updates `@types/node` from 26.6.3 to 26.6.5
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-version: 26.6.4
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: scripts-dependencies
- dependency-name: pg
  dependency-version: 8.23.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: scripts-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:22:41 +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
hermes-gadget 9a572524a8 Merge pull request #165 from gadgethd/burn/ukmesh-onboard-20261023
fix(onboarding): surface default-topic broker denials and document linking
2026-10-25 02:16:07 +00:00
hermes-gadget 7ef12767d1 fix(onboarding): surface default MQTT topic denials and document linking 2026-10-25 01:52:43 +00:00
hermes-gadget 418ba258e8 feat: report owner prewarm progress and guide Compose adoption repair 2026-10-25 01:50:28 +00:00
hermes-gadget 54dbc68bb2 Audit PostgreSQL shared memory and enforce explicit 1 GiB sizing 2026-10-25 01:24:00 +00:00
gadgethd 0b6a352087 fix(release): separate trust anchors and key the export cache to visibility
Three unrelated trust-anchor defects:

- exports: /api/v1/exports/nodes.* set a 15-minute public cache with no
  visibility key. Add a generation-derived weak ETag, Vary, X-Visibility-
  Generation, optional v= with 412 + no-store on mismatch, 60s max-age, and a
  post-query generation re-read that downgrades mid-flight redactions. A
  generation read failure is 503 + no-store instead of a cached 200.
- release: keyless signing moved out of the image matrix into a sign job
  restricted to refs/tags/v*, behind the release-signing environment, with an
  in-script ref check as defence in depth. Branch dispatches still build.
- restore: the drill no longer copies the verify key into the receipt
  directory. Both sides require an out-of-band sha256 pin, reject a key inside
  the receipts tree (including symlinks), and fail closed on mismatch. Compose
  mounts the key from its own directory and passes the pin.

Docs updated for the new key layout and pin.

Audit: backend/src/api/routes/exports.ts:nodes-export:public-cache-not-keyed-to-visibility-generation
       supply-chain/release-workflow:keyless-signing-identity-not-bound-to-release-ref
       ukmesh/restore-receipt-verify-key-published-with-receipt
2026-10-23 16:41:26 +00:00
gadgethd 69d36a513b fix(owner): make verified grants the only owner authority
Remove the shadow-mode fallback that rebuilt owner authority from
OWNER_MQTT_USERNAME_MAP and broker ACL write stanzas whenever the verified
grant list was empty. Broker write scope is not ownership, and the fallback
survived revocation.

- empty verified list now returns [] in every mode
- sessions carry the credential generation and are rejected when it changes
- credential-generation read failures throw instead of returning 0, which
  compared equal to every pre-rotation session
- newuser.sh no longer writes an operator-config grant from a broker-log key;
  it requires --confirm-owner-grant NODE_ID

Audit: backend/src/owner/ownerAccess.ts:owner-credential-generation-revocation
       ukmesh-owner-access:shadow-fallback-regrants-revoked-acl-scope
       ukmesh/newuser-broker-log-node-key-promoted-to-operator-config-grant
2026-10-23 16:41:12 +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 5312b342e9 ci: retry transient image and apt failures without replaying test gates 2026-10-23 08:54:10 +01:00
hermes-gadget 0a8cb97e4d Merge pull request #143 from gadgethd/burn/privacy-fence-20261022
Fix empty prefix cascade fences and add verified privacy convergence
2026-10-22 22:12:35 +01:00