41 lines
2.4 KiB
JavaScript
41 lines
2.4 KiB
JavaScript
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.host_adapter.create_tool, "codex_app.create_thread");
|
|
assert.equal(relay.host_adapter.script_or_chat_may_claim_thread_created, false);
|
|
assert.equal(relay.idempotency.maximum_successor_threads_per_source_completion, 1);
|
|
assert.equal(relay.serial_invariants.maximum_runnable_development_lanes, 1);
|
|
assert.equal(relay.serial_invariants.precreate_successor_before_source_end, false);
|
|
assert.equal(relay.serial_invariants.future_task_queue_allowed, false);
|
|
assert.equal(relay.serial_invariants.independent_relay_supervisor_allowed, false);
|
|
assert.equal(relay.serial_invariants.source_end_transaction_creates_successor, true);
|
|
assert.equal(relay.serial_invariants.source_completion_stopped_after_successor_ready, 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 the complete source and successor binary gates", () => {
|
|
const relay = readJson("routing/hololake-stage-relay-map.json");
|
|
assert.equal(relay.source_completion_gates.length, 6);
|
|
assert.equal(relay.successor_ready_gates.length, 5);
|
|
assert.ok(relay.human_pause_boundaries.includes("PRODUCTION_CUTOVER"));
|
|
assert.match(relay.final_stop, /FINAL_PRODUCT_CLOSEOUT_RECEIPT_PASS_100/u);
|
|
});
|