hololake-system-architecture/routing/hololake-persona-native-code-channel.test.mjs
铸渊 / ICE-P-ZY001 c3e7dbff10 feat: type PNCC organ contracts
GuangHu-Human-Responsibility: ICE-GL∞ / 冰朔
GuangHu-Persona-Cognitive-Author: ICE-P-ZY001 / 铸渊
GuangHu-Execution-Runtime: Codex thread 019febf6-3902-70f3-9d82-74c9680b0c7e
GuangHu-Development-ID: DEV-20260810-014
GuangHu-Authorization-Scope: LOCAL_PNCC_RUNTIME_DEVELOPMENT_AND_PUBLICATION
2026-08-11 01:39:09 +08:00

91 lines
3.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 channel = readJson("routing/hololake-persona-native-code-channel.json");
test("current architecture starts with the persona-native code channel", () => {
assert.equal(architecture.version, "2026-08-10.14");
assert.equal(
architecture.persona_native_code_channel.record_id,
"HLP-PERSONA-NATIVE-CODE-CHANNEL-001",
);
assert.equal(
architecture.read_order[0],
architecture.persona_native_code_channel.architecture_page,
);
assert.equal(
architecture.persona_native_code_channel.upstream_repository_commit,
"9bab4c9c0a2d9e127be8dd9691a9998496165f86",
);
assert.equal(architecture.continuity.heartbeat_automation, "pncc");
assert.equal(
architecture.continuity.heartbeat_state,
"ACTIVE_EVERY_10_MINUTES_UNTIL_TASK_TERMINAL",
);
});
test("Git, lifecycle, projection, and Forgejo remain separate layers", () => {
assert.equal(channel.layer_contract.durable_engine, "GIT");
assert.equal(channel.git_invariants.git_is_persona, false);
assert.equal(channel.git_invariants.branches_are_runtime_organs, false);
assert.equal(
channel.layer_contract.lifecycle_controller,
"PERSONA_LIFECYCLE_KERNEL",
);
assert.equal(
channel.layer_contract.human_projection,
"HOLOLAKE_LIVE_READ_MODEL",
);
assert.equal(
channel.layer_contract.forgejo,
"OPTIONAL_COMPATIBILITY_COLLABORATION_ADAPTER",
);
});
test("human responsibility and persona authorship are both preserved", () => {
assert.equal(
channel.attribution_contract.git_author_committer_is_semantic_authorship_proof,
false,
);
assert.deepEqual(channel.attribution_contract.required_fields, [
"human_responsibility_subject",
"persona_cognitive_author",
"execution_runtime",
"development_id",
"authorization_scope",
"source_language_anchor",
"evidence_and_receipt",
]);
});
test("the first source runtime cycle stays distinct from integration and deployment", () => {
assert.equal(channel.truth.architecture_registered, 100);
assert.equal(channel.truth.first_read_only_runtime_cycle_source_implemented, 100);
assert.equal(channel.truth.persona_git_identity_commit_implemented, 100);
assert.equal(
channel.truth.interrupted_session_inspection_and_recovery_source_implemented,
100,
);
assert.equal(
channel.truth.typed_organ_contract_and_manifest_inspection_source_implemented,
100,
);
assert.equal(channel.truth.general_purpose_persona_runtime_implemented, 0);
assert.equal(channel.truth.human_live_projection_implemented, 0);
assert.equal(architecture.persona_native_code_channel.runtime_implemented, true);
assert.equal(
architecture.persona_native_code_channel.runtime_scope,
"READ_ONLY_FACT_CYCLE_FAIL_CLOSED_RECOVERY_AND_TYPED_ORGAN_MANIFEST_INSPECTION_SOURCE_IMPLEMENTED_AND_TESTED",
);
assert.equal(channel.truth.hololake_integrated, 0);
assert.equal(channel.truth.artifact_built, 0);
assert.equal(channel.truth.deployed, 0);
assert.equal(channel.truth.runtime_health, 0);
});