Files
ukmesh/scripts/check-compose-adoption.sh
T
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

38 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Read-only preflight. Never attempt automatic adoption or network recreation.
if [ "$#" -ne 1 ] || ! [[ "$1" =~ ^[a-zA-Z0-9][a-zA-Z0-9_.-]*$ ]]; then
echo 'usage: check-compose-adoption.sh SERVICE' >&2
exit 64
fi
service="$1"
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
project_dir="$(cd -- "${script_dir}/.." && pwd -P)"
project_name="${COMPOSE_PROJECT_NAME:-meshcore-analytics}"
reject() {
echo "service ${service} is not Compose-adoptable: $1; operator reconciliation is required before replacement" >&2
exit 65
}
cd "$project_dir"
container_id="$(docker compose --project-name "$project_name" ps -q "$service")"
if [ -z "$container_id" ] || [[ "$container_id" == *$'\n'* ]]; then
reject 'Compose must identify exactly one current container'
fi
labels="$(docker inspect "$container_id" --format '{{json .Config.Labels}}')"
if ! jq -e \
--arg project "$project_name" \
--arg service "$service" \
--arg directory "$project_dir" \
--arg base "${project_dir}/docker-compose.yml" '
.["com.docker.compose.project"] == $project
and .["com.docker.compose.service"] == $service
and .["com.docker.compose.project.working_dir"] == $directory
and ((.["com.docker.compose.project.config_files"] // "") | split(",") | index($base) != null)
' <<<"$labels" >/dev/null; then
reject 'project, service, working directory or config-file labels are missing or differ from this checkout'
fi
printf 'Compose adoption metadata verified for %s\n' "$service"