test: mode registry consistency checks; fail fast if registry missing

Also documents the registry-driven mode integration in CLAUDE.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
James Smith
2026-06-12 08:11:04 +01:00
parent 71f44c0f40
commit ec59ef0e42
3 changed files with 51 additions and 3 deletions
+5 -2
View File
@@ -3815,6 +3815,9 @@
}
// Mode from query string (e.g., /?mode=wifi)
if (!window.INTERCEPT_MODES) {
throw new Error('mode-registry.js failed to load — the SPA cannot start');
}
let pendingStartMode = null;
const modeCatalog = {};
for (const [mode, def] of Object.entries(window.INTERCEPT_MODES)) {
@@ -4918,7 +4921,7 @@
refreshDroneDevices();
}
// Module destroy is now handled by moduleDestroyMap above.
// Module destroy is now handled by the mode registry (static/js/mode-registry.js).
// Show/hide Device Intelligence for modes that use it (not for satellite/aircraft/tscm)
const reconBtn = document.getElementById('reconBtn');
@@ -4999,7 +5002,7 @@
}
if (requestId !== modeSwitchRequestId) return;
// Waterfall destroy is now handled by moduleDestroyMap above.
// Waterfall destroy is now handled by the mode registry (static/js/mode-registry.js).
const totalMs = Math.round(performance.now() - switchStartMs);
console.info(