Upstream is already at its latest release (v0.1.32, 61efac0); the vendored
tree had drifted from the public corresponding-source tag. Publish the exact
current tree as v0.1.32-ukmesh.4 (58b2eb9) and update provenance, source-offer
and release references. No behaviour change.
- 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
Union of the owner-session PR (#139) and the MapLibre warm-up PR (#191):
keep main's test:owner-integration script and CI step, keep this branch's
fails-fast analysis-integration wrapper, and keep the richer warm-up logging.
* fix(owner): add revocable server-side sessions
* test(owner): isolate the revoked-session e2e
* fix(owner): make session creation and revocation race-safe
- Stamp owner_sessions rows with clock_timestamp() and exclude the new
session from the cap prune, so a login delayed on the per-user advisory
lock cannot revoke its own freshly issued credential.
- Revoke the grant and its sessions in one transaction, and match the
effective-grant predicate used for authorization, so a legacy unverified
row cannot keep sessions alive after the last real grant is revoked.
- Return 503 rather than 500 when the credential-generation store is
unavailable during login, matching the session route's fail-closed status.
- Isolate the owner integration test from ambient DB environment, add
real-Postgres regressions for the three defects, and run the suite in CI.
---------
Co-authored-by: gadgethd <111318106+gadgethd@users.noreply.github.com>
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.
The file records an internal memory path and a personal name from a
private investigation. It is not product documentation and should not
be published.
revamp/backend-2026-11 ships and production has applied 071_backend_schemas,
072_backend_grants and 073_owner_auth_tables. Main's
071_prefix_visibility_row_fence.sql was never applied anywhere (0 ledger rows),
so merging the two lines produced a duplicate 071 prefix and
loadMigrationFiles() refused to load any migration.
Move main's file, and its rollback twin, to 074 - the next slot free in both
trees (071-073 taken by the branch, 078+ taken by the branch's later moves).
Contents are byte-identical: sha256 1ca90a2144351111dec55e3a15f0d45b9623388512cd78a8ee558b849f1e8d9f
before and after, so no checksum/ledger change is required.
Add a regression test that simulates the merged tree by validating the real
migration names together with the branch's applied 071-073 band. Before this
commit it fails with:
duplicate migration prefix 071: 071_backend_schemas.sql, 071_prefix_visibility_row_fence.sql
After it, the merged tree loads (129 files, head 132).
Update the convergence integration test and privacy-convergence doc to the new
filename. The dated burn review is left untouched as a historical record.
* fix(db): let a fresh database replay the migration band past the legacy moves
A database rebuilt from the shipped base schema could never reach head. The
band stopped at 078 because the P1-4 moves re-home relations that no migration
in this tree creates: `message_tags_local`, the `path_sim_*` simulation tables,
the derived analytics tables and the privacy cluster exist only on databases
provisioned before the move. `ALTER TABLE public.x SET SCHEMA` therefore died
with `relation "public.x" does not exist`, and 087 failed separately because
nothing in the repo ever created the `planner_export` schema its view lives in.
Each legacy-dependent move is now guarded with to_regclass() and emits a NOTICE
when it skips, so a base-schema database continues while a legacy-provisioned
database still executes the identical statement. 087 creates `planner_export`
with IF NOT EXISTS, which leaves an operator-provisioned schema, its owner and
its grants untouched.
Behaviour on a database that has the legacy relations is unchanged: replaying
the band over an identical legacy-provisioned fixture with the origin files and
with these files produces a byte-for-byte identical `pg_dump --schema-only`
(6211 lines), and the six trigger functions plus the export view definition are
textually identical.
Tests: migrationBootstrap.integration.test.ts already ran a two-migration
subset because of this assumption. legacyMoveReplay.integration.test.ts now
replays the whole band on a fresh seeded database (head
135_packet_identity_backfill_chunks.sql, 131 ledger rows) and separately proves
the guarded moves still move the relations, carrying their index, comment and
grants.
* ci: gate the fresh-volume replay before the ingest group
test:migration-integration was the tail of test:ingest-integration, so a fresh
volume that could not reach migration head only showed up after the whole ingest
group passed - and today that group is red on the branch for unrelated reasons,
which hides the gate entirely. Run it as its own named step ahead of the ingest
group instead, and drop the duplicated tail invocation.
* fix(db): accept the pre-guard checksums for the four legacy moves
Production already recorded 078/080/081/087 with their pre-guard contents.
Without this, the next migrate run would report checksum drift on all four
and refuse. The guarded files execute the same statements wherever the
relations exist - the pre/post databases were diffed with pg_dump
--schema-only and matched byte for byte.
* fix(db): re-assert the prefix visibility fence after the schema moves
074 installed the row-aware prefix fence while both relations still lived in
public. 087 then replaced bump_visibility_for_changed_prefixes() with the
statement body from 066, which reads new_prefix_rows/old_prefix_rows, while
113 moved the prefix registry to core and 108/128 left read-only compatibility
views at the old public names. The ROW trigger moved with the table but still
executes the statement body, so every write to core.private_node_prefixes
fails with relation "new_prefix_rows" does not exist.
134 restores 074's semantics against the post-move relations only:
core.private_node_prefixes triggers, ops.public_visibility_state target, a
guarded one-shot backfill that invalidates a materialization certified during
the broken window, and no reference to the public compatibility views.
The sql guard now recognises trigger grammar keywords (ON/OF) that sit where a
DML target would otherwise be parsed.
* fix(db): supersede 074 on post-move databases so 134 can run
074_prefix_visibility_row_fence.sql ships on main and is merged into this
branch, where 087 moved public_visibility_state to ops, 113 moved
private_node_prefixes to core, and 108/128 left read-only compatibility views
at the old public names. On a database that already ran 087-132 the file is
still pending, so the runner reaches it first and aborts:
ALTER action ADD COLUMN cannot be performed on relation
"public_visibility_state"
134_reassert_prefix_visibility_fence.sql re-asserts the same fence on the
post-move relations, but no later migration can run after that abort.
Record 074 as superseded only when the catalog proves the move happened:
ops.public_visibility_state and core.private_node_prefixes are tables, and
public.public_visibility_state / public.private_node_prefixes exist as
read-only projections. A pre-move database (the public names are the real
tables) still executes 074, and a half-moved database executes it rather than
assuming the fence is in place. If the post-move shape is present and 134 is
missing from the tree, the run fails closed instead of skipping the fence.
The decision is a pure function over observed relkinds so every branch is
unit-tested; the runner writes the ledger row (superseded-post-move) and a
schema_migration_compatibility audit row carrying the reason and observed
shapes in one transaction.
Tests: pre-move database -> 074 applies and its row trigger fences writes;
post-move database -> 074 recorded superseded with evidence and the same pass
continues to 134, which installs four row/statement triggers on
core.private_node_prefixes; missing replacement -> refusal with no ledger row.
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.
* 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>
* fix(rf): on-demand repeater footprints + nightly coverage refresh
Two independent faults made the per-repeater RF coverage action look
broken and the coverage refresh infrequent:
- The WebSocket initial_state slim projection dropped public_key, so the
map's "Show RF coverage" action only appeared for repeaters that had
arrived through a live node_upsert. Include it in the slim query and
the slimmer, so every repeater offers the action (about 440 KB added
to an 8.2 MB initial state, well inside the 16 MiB cap).
- Nothing ever invoked the calculator's `-node` mode. Add a bounded,
deduplicated on-demand queue to hopreach-shareapi on a separate
`share.public_listen_addr` listener (plan-share/admin stay loopback),
proxied by the app's nginx at
`POST /rf-coverage/nodes/<key>/request`. Jobs share the calculator's
singleton lock and retry while a whole-region run holds it (30 s for
ten attempts, then every 5 min for up to 6 h).
- schedule.cron was weekly (`0 1 * * 0`) despite the site promising a
nightly refresh; make it `0 1 * * *`.
The nginx route uses a named regex capture: `$1` is global per request
and the client-IP map overwrites it for limit_req's key on trusted-edge
requests, which silently proxied the client IP instead of the key.
* test(rf): avoid a 64-hex literal and allowlist the public repeater fixture
Gitleaks treats a bare 64-hex string as a candidate key. Build the test
fixture at runtime and record the advertised repeater public key in the
existing MeshCore-identity allowlist (the same treatment the MQTT test
fixtures already have).
* fix(rf): bound one node-job child with a 15-minute timeout
A stuck DEM fetch would otherwise hold the calculator's singleton lock
indefinitely, blocking both later on-demand requests and the nightly
whole-region run.
* fix(rf): make unavailable repeater footprints visible in the map
A silent repeater (most of the network) or one outside the region wrote
no node_coverage entry, so the map kept saying "Pending calculation" —
indistinguishable from a broken button. Record a failed entry with the
reason instead; repeaters that already have tiles keep them and show as
stale.
* ui(rf): label an unavailable footprint as Unavailable, not a failed calculation
Silent repeaters are the majority of the network; calling the refusal
"Calculation failed" reads like a bug. The specific reason is already
shown in the coverage panel.
* fix(api): isolate stats quotas and bound client request storms
* fix(rf): make scheduled coverage runs wait and honor cron slots
---------
Co-authored-by: gadgethd <111318106+gadgethd@users.noreply.github.com>
Both branches allocated 063; validateMigrationPrefixes rejects duplicate
numeric prefixes. Regions keeps 063, so this migration and the two
references to it move to 064.
Combines the 11-commit security remediation with the five production
feature commits (message tags, region filters, observer tx counts,
region name probes, compose region list).
Conflict resolution:
- docker-compose: union of owner-share and public-feed env; public_feed_deliveries
added to the retention targets; privacy-remat-worker service adopted from the
remediation branch (already running in production).
- contracts/misc/db/openapi/tagger-worker: remediation side (privacy predicate,
fenced re-read, overlap hashes) - it is the superset.
- vacuum-compressed-chunks.sh: kept the production-proven infra-compose
resolution; the remediation branch version is a follow-up.