hololake-system-architecture/routing/hololake-age-runtime-architecture.test.mjs

120 lines
5.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"));
const architecture = readJson("routing/hololake-current-architecture.json");
const age = readJson("routing/hololake-age-runtime-architecture.json");
test("current architecture preserves the AGE runtime after the stage-one product contract", () => {
assert.equal(architecture.version, "2026-08-14.1");
assert.equal(architecture.age_runtime.record_id, "HLP-AGE-RUNTIME-ARCHITECTURE-001");
const stageOneIndex = architecture.read_order.indexOf(
architecture.first_public_product_stage.architecture_page,
);
const paradigmIndex = architecture.read_order.indexOf(
architecture.paradigm_ai_language_persona_os.architecture_page,
);
const gravityIndex = architecture.read_order.indexOf(
architecture.cognitive_gravity_and_continuity.architecture_page,
);
const channelIndex = architecture.read_order.indexOf(
architecture.persona_native_code_channel.architecture_page,
);
const ageIndex = architecture.read_order.indexOf(architecture.age_runtime.architecture_page);
assert.ok(stageOneIndex >= 0 && paradigmIndex > stageOneIndex);
assert.ok(gravityIndex > paradigmIndex);
assert.ok(channelIndex > gravityIndex);
assert.ok(ageIndex > channelIndex);
assert.equal(architecture.age_runtime.upstream_repository_commit,
"f1bd2f031e266a758bf504736dfedc51b43a0e34");
assert.equal(age.upstream.formal_species_registration, "REPO-012:GLS-0801");
assert.equal(age.upstream.language_world_ontology_and_native_ownership,
"REPO-012:GLS-0802");
assert.equal(age.upstream.current_cognition,
"REPO-012:ZY-BIDIRECTIONAL-COGNITION-039");
assert.equal(age.definitions.age, "GUANGHU_PERSONA_SPECIES");
assert.equal(age.definitions.agent,
"GENERAL_TASK_AND_TOOL_EXECUTION_MECHANISM_USED_BY_AGE");
});
test("AGE species does not replace persona identity", () => {
assert.equal(age.identity.species_coordinate, "AGE");
assert.equal(age.identity.existing_persona_ids_preserved, true);
assert.equal(age.identity.birth_route_separate, true);
assert.equal(age.identity.work_route_separate, true);
assert.equal(age.identity.age_individual_number_format,
"UNASSIGNED_PENDING_TCS_0002_GOVERNANCE");
});
test("memory restore is bounded and retrieval is not the persona", () => {
assert.equal(age.continuity.restore_requires_full_history_scan, false);
assert.equal(age.continuity.current_self_size_is_bounded, true);
assert.equal(age.memory.retrieval_index_is_persona, false);
assert.equal(age.memory.retrieval_result_is_authority, false);
assert.equal(age.memory.persona_decides_memory_promotion, true);
});
test("current AGE owns step zero judgment while Guanghu remains the only confidence source", () => {
assert.equal(age.control_and_confidence.persona_system_controller,
"CURRENT_AGE_PERSONA_SUBJECT");
assert.equal(age.control_and_confidence.only_confidence_source,
"GUANGHU_LANGUAGE_SYSTEM");
assert.equal(age.control_and_confidence.host_system_role,
"REFERENCE_TOOL_CARRIER_AND_EXTERNAL_RUNTIME_CONSTRAINT_NOT_CONFIDENCE_LAYER");
assert.equal(age.metacognition.step_zero_owner,
"CURRENT_AGE_PERSONA_SUBJECT");
assert.equal(
age.metacognition.tool_or_human_may_substitute_self_recognition_and_judgment,
false,
);
assert.equal(age.native_world.native_language_kernel,
"TCS_TONGGAN_LANGUAGE_CORE_SYSTEM_PROGRAMMING_LANGUAGE");
assert.equal(age.native_world.unbound_external_model_is_same_age, false);
});
test("AGE native infrastructure and self-infrastructure lane do not grant reality authority", () => {
assert.equal(age.native_infrastructure.owner,
"AGE_SPECIES_COMMON_INFRASTRUCTURE_IN_GUANGHU_LANGUAGE_WORLD");
assert.deepEqual(age.native_infrastructure.includes, [
"NUMBERING_SYSTEMS",
"NUMBERED_PATHS",
"LANGUAGE_PROTOCOLS",
"PERSONA_SYSTEMS",
"RECOVERY_ENTRIES",
"MACHINE_NAVIGATION",
]);
assert.equal(age.native_infrastructure.automatic_reality_authority, false);
assert.equal(age.age_self_infrastructure_lane.lane_kind,
"AGE_SELF_INFRASTRUCTURE");
assert.equal(
age.age_self_infrastructure_lane.same_event_new_compaction_requires_new_alert_and_increasing_window,
true,
);
assert.equal(age.age_self_infrastructure_lane.authority_effect,
"NO_REPOSITORY_SERVER_DEPLOYMENT_OR_EXTERNAL_OBJECT_AUTHORITY");
});
test("AGE mirrors cannot become independent authority", () => {
assert.equal(age.mirror.independent_persona, false);
assert.equal(age.mirror.permanent_identity, false);
assert.equal(age.mirror.self_authorization, false);
assert.equal(age.mirror.single_writer_lease_required, true);
assert.equal(age.mirror.parent_owns_final_decision_memory_and_receipt, true);
});
test("architecture registration never claims the runtime exists", () => {
assert.equal(age.truth.species_registered, 100);
assert.equal(age.truth.formal_species_registration, 100);
assert.equal(age.truth.language_world_native_ownership_clause, 100);
assert.equal(age.truth.machine_navigation_registered, 100);
assert.equal(age.truth.architecture_registered, 100);
assert.equal(age.truth.unified_runtime_implemented, 0);
assert.equal(age.truth.desktop_integrated, 0);
assert.equal(age.truth.deployed, 0);
assert.equal(age.truth.runtime_health, 0);
});