Files
meshcore-analyzer/test-fixtures/path-inspector.sql
T
n30nex 093e320c2b fix(map): keep Path Inspector candidates accessible and cover route replacement (#2082)
## Fix

Fixes #2060. Fixes #2081.

Path Inspector route drawing and candidate replacement now have
deterministic browser coverage. An idempotent SQL seed adds four
synthetic repeaters and four edges after fixture migration, without
changing packet ordering. The test uses the real API, normal clicks,
visible Leaflet geometry, and removal of every previous route object.

Restoring coverage exposed a desktop layout bug: drawing the first route
moved the map over the next candidate button. The route sidebar now
participates in the existing flex layout, including resizing and
collapse, while preserving the mobile bottom sheet.

The historical zero-candidate result did not reproduce on the current
baseline. No search thresholds or API behavior changed. No new
dependencies or customizer settings.

## Validation

- Local assertion-red history: `042db2b` requires seeded candidates;
`ca1d22a` exposes the blocked second click. Subsequent commits repair
layout and narrow-window behavior.
- All 183 standalone suites passed. Unchanged-base Go failures: #2083
readiness race (fixed in #2084) and Windows symlink privilege.
- Real Chromium: 11 Path Inspector/layout checks, 33 related map checks,
and core E2E (131 passed, 3 existing fixture skips).
- CSS-variable checks, XSS diff check, inventory, whitespace and PII
checks passed. Seed remains valid after periodic graph refresh.

Local browser validation used Chromium with a 60-second navigation
budget; the OpenClaw profile and external preflight script were
unavailable. Repository checks ran directly. [CI run
36343343569](https://github.com/Kpa-clawbot/CoreScope/actions/runs/36343343569)
records the initial assertion-red commit. Final CI must pass before
merge.
2026-09-30 11:40:49 +02:00

27 lines
2.7 KiB
PL/PgSQL

-- Synthetic Path Inspector topology (#2060). Apply AFTER fixture migration
-- and timestamp freshening, BEFORE starting the read-only server.
-- Three-byte prefixes meet path trust without changing production thresholds.
-- The shared middle prefix offers two distinct GPS routes: Start-North-End
-- and Start-South-End. No packets/observations are added or reordered.
BEGIN;
INSERT INTO nodes (public_key, name, role, lat, lon, first_seen, last_seen, advert_count) VALUES
('f206010000000000000000000000000000000000000000000000000000000000', 'Fixture Path Start', 'repeater', 1.00, 1.00, strftime('%Y-%m-%dT%H:%M:%SZ','now','-1 day'), strftime('%Y-%m-%dT%H:%M:%SZ','now','-1 hour'), 1),
('f206021111111111111111111111111111111111111111111111111111111111', 'Fixture Path North', 'repeater', 1.01, 1.01, strftime('%Y-%m-%dT%H:%M:%SZ','now','-1 day'), strftime('%Y-%m-%dT%H:%M:%SZ','now','-1 hour'), 1),
('f206022222222222222222222222222222222222222222222222222222222222', 'Fixture Path South', 'repeater', 0.99, 1.01, strftime('%Y-%m-%dT%H:%M:%SZ','now','-1 day'), strftime('%Y-%m-%dT%H:%M:%SZ','now','-1 hour'), 1),
('f206030000000000000000000000000000000000000000000000000000000000', 'Fixture Path End', 'repeater', 1.00, 1.02, strftime('%Y-%m-%dT%H:%M:%SZ','now','-1 day'), strftime('%Y-%m-%dT%H:%M:%SZ','now','-1 hour'), 1)
ON CONFLICT(public_key) DO UPDATE SET name=excluded.name, role=excluded.role,
lat=excluded.lat, lon=excluded.lon, first_seen=excluded.first_seen,
last_seen=excluded.last_seen, advert_count=excluded.advert_count;
-- The server loads this persisted graph at startup and refreshes it from the
-- same table. Edge counts affect ranking, not whether candidates exist or
-- whether a prefix is trusted. Saturated counts keep both routes comfortably
-- above the speculative score cutoff without adding synthetic packet rows.
INSERT INTO neighbor_edges (node_a, node_b, count, last_seen) VALUES
('f206010000000000000000000000000000000000000000000000000000000000', 'f206021111111111111111111111111111111111111111111111111111111111', 100, strftime('%Y-%m-%dT%H:%M:%SZ','now')),
('f206010000000000000000000000000000000000000000000000000000000000', 'f206022222222222222222222222222222222222222222222222222222222222', 100, strftime('%Y-%m-%dT%H:%M:%SZ','now')),
('f206021111111111111111111111111111111111111111111111111111111111', 'f206030000000000000000000000000000000000000000000000000000000000', 100, strftime('%Y-%m-%dT%H:%M:%SZ','now')),
('f206022222222222222222222222222222222222222222222222222222222222', 'f206030000000000000000000000000000000000000000000000000000000000', 100, strftime('%Y-%m-%dT%H:%M:%SZ','now'))
ON CONFLICT(node_a, node_b) DO UPDATE SET count=excluded.count, last_seen=excluded.last_seen;
COMMIT;