Backend refactor reconciliation + ASPA verification fix + silent-failure audit #2
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "merge-prod-snapshot"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reconciles production drift with the 2026-07-14 backend refactor, fixes a reversed hop-check direction in the ASPA path verification algorithm (empirically verified against the IETF draft), fixes a duplicate
fetchRipeStatCacheddeclaration that silently broke ~9 RIPE Stat checks, and fixes ~9 other silent-failure/fake-success patterns across server.js and local-db-client.js.Already deployed to production (server.js, local-db-client.js, public/index.html, package.json/package-lock.json) and confirmed live-working (abuse_contact now returns real data, /api/health honestly reports degraded state).
Not yet deployed: the new internal API server wiring for 13 previously-orphaned Fastify routes (dist/api/, ecosystem.config.js peercortex-api entry) -- code-complete and locally tested, but blocked on Postgres credentials not yet configured on Erik.
See commit messages for full detail on each fix.
Merges the production-only changes (Izzy PDF export via puppeteer, Adoption Tracker overlay, audit scripts, deploy/utility scripts) that had been living as uncommitted edits directly on Erik since before the 2026-07-14 backend refactor, on top of current main. 4 real conflicts, resolved by keeping whichever side is actually functional rather than picking a side mechanically: - package.json / package-lock.json: trivial union, kept both the refactor's pg/playwright deps and the snapshot's puppeteer dep; lockfile regenerated via `npm install --package-lock-only` rather than hand-edited - server.js top-of-file: additive, kept both the localDb require (backend refactor) and the puppeteer lazy-loader (PDF export) - server.js /api/health aspa_adoption block: main referenced `aspaAdoptionHistory`, a variable that is never declared anywhere in this file (confirmed by grep) -- a pre-existing dead reference that would throw if this code path ever ran. Kept the snapshot's working `aspaAdoptionDailyHistory`/`roaStore.count` version, which matches the live /api/health output from production. Also fixed the identical bug in the neighboring .catch() fallback block a few lines down (same undefined variable, not part of the conflict itself -- pre-existing on main, same fix applied for consistency). - server.js hijack-subscribe/webhooks section (186 lines): main's side was just a 2-line comment ("Migrated to src/features/hijack-subscribe/"). Kept the snapshot's actual working implementation instead, because server.js does not require() or import anything from src/features/ or dist/ anywhere -- confirmed by grep. The "migration" only ever happened on the src/features/ side; server.js's own HTTP routing was never wired up to call into it. IMPORTANT CAVEAT, found while investigating the above and NOT fixed here: server.js still has 13 other "// Migrated to src/features/..." comments (bgp-communities, irr-audit, asset-expand, rpki-history, aspath, looking-glass, ix-matrix, submarine-cables, global-infra, hijack-alerts (Fastify), changelog, rib, prefix-changes) where the same thing is true -- the route implementation was deleted from server.js and never replaced with a working call into src/features/. These weren't touched by this merge (git didn't flag them as conflicts, because production's snapshot never touched those sections either -- only main changed them, by deleting them). If this server.js is ever deployed as the new production file as-is, those 13 endpoints will silently 404 or fall through, exactly like the hijack-subscribe one would have if I'd taken main's side. This is a pre-existing gap in the 2026-07-14 refactor (PR #1), unrelated to the Izzy/Adoption Tracker work, and needs a deliberate decision (wire server.js to src/features/, or confirm those routes are meant to live on a different process/port entirely) before this branch should be treated as deployable. `node --check server.js` passes. Not deployed to Erik as part of this commit -- Erik's currently-live server.js/public/index.html are untouched.Follow-up from live testing the 2026-07-16 deploy: bogonDataUnavailable only checked '!prefixData'/'!neighbourData' (falsy/null), but local-db-client.js's DB-error signal is a truthy {status:'error', ...} object, not null (server.js's own fabricated-success fix from earlier today). So when the Postgres-backed prefix/neighbour source is what's actually degraded, this check showed status:'pass' at 0 checked prefixes instead of the more honest 'info' -- data wasn't fabricated (0 was visible), just the status label didn't reflect it. Fixed with an explicit isSourceUnavailable() check for both falsy and status:'error'.