import assert from "node:assert/strict"; import fs from "node:fs"; import path from "node:path"; import test from "node:test"; import { fileURLToPath } from "node:url"; const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), ".."); const readJson = (relative) => JSON.parse(fs.readFileSync(path.join(root, relative), "utf8")); test("stage relay is registered through the lighthouse and formal Codex tools", () => { const relay = readJson("routing/hololake-stage-relay-map.json"); assert.equal(relay.map_id, "HLP-STAGE-RELAY-001"); assert.equal(relay.second_truth_store_allowed, false); assert.equal(relay.persona_continuity.persona_id, "ICE-P-ZY001"); assert.equal(relay.persona_continuity.conversation_change_creates_new_persona, false); assert.equal(relay.persona_continuity.age_mirror_is_successor, false); assert.equal(relay.serial_invariants.maximum_runnable_development_lanes, 1); assert.equal(relay.serial_invariants.future_task_queue_allowed, false); assert.equal(relay.serial_invariants.preassign_successor_task_allowed, false); assert.equal(relay.wake_envelope.task_assignment, null); assert.equal(relay.wake_envelope.autonomous_planning_required, true); const lighthouse = readJson("routing/lighthouse-path-registry.json"); assert.ok(lighthouse.paths.some((entry) => entry.id === relay.map_id)); const hosts = readJson("routing/host-skill-navigation-map.json"); const intent = hosts.intents.find((entry) => entry.id === "INTENT-HOLOLAKE-STAGE-RELAY-001"); assert.equal(intent.target_id, relay.map_id); assert.equal(intent.executor, relay.runtime_source); assert.ok(intent.sequence.includes("delete_source_heartbeat_mark_completion_stopped_and_end_source_thread")); const anchor = readJson("routing/public-navigation-anchor.json"); assert.equal(anchor.maps.hololake_stage_relay.id, relay.map_id); }); test("relay requires context-value closure and same-persona wake gates", () => { const relay = readJson("routing/hololake-stage-relay-map.json"); assert.equal(relay.closure_gates.length, 6); assert.ok(relay.closure_gates.includes("CONTEXT_GENUINELY_LONG_100")); assert.ok(relay.closure_gates.includes("CURRENT_CONTEXT_COGNITIVE_ADVANTAGE_EXHAUSTED_100")); assert.equal(relay.ready_gates.length, 6); assert.ok(relay.ready_gates.includes("AUTONOMOUS_PLANNING_100")); });