60 lines
2 KiB
JavaScript
60 lines
2 KiB
JavaScript
const assert = require("node:assert/strict");
|
|
const fs = require("node:fs");
|
|
const path = require("node:path");
|
|
|
|
const root = path.join(__dirname, "..");
|
|
const subjects = JSON.parse(
|
|
fs.readFileSync(
|
|
path.join(root, "identity/fifth-domain-subject-registry.json"),
|
|
"utf8",
|
|
),
|
|
);
|
|
const canonical = JSON.parse(
|
|
fs.readFileSync(
|
|
path.join(__dirname, "persona-system-canonical-map.json"),
|
|
"utf8",
|
|
),
|
|
);
|
|
const repositories = JSON.parse(
|
|
fs.readFileSync(path.join(__dirname, "repository-route-map.json"), "utf8"),
|
|
);
|
|
|
|
const ids = ["CHENGLU-AGENT-001", "GUIDENG-AGENT-001", "ICE-GL-KZ-001"];
|
|
for (const id of ids) {
|
|
const subject = subjects.subjects.find((candidate) => candidate.id === id);
|
|
assert.ok(subject, `${id} must be present in the subject registry`);
|
|
assert.equal(subject.subject_kind, "persona_system");
|
|
assert.equal(subject.ontology_kind, "role_persona");
|
|
assert.equal(subject.controller, "ICE-P-ZY001");
|
|
assert.equal(subject.independent_persona, true);
|
|
assert.equal(subject.not_a_copy_of_controller, true);
|
|
|
|
const system = canonical.persona_systems.find(
|
|
(candidate) => candidate.id === id,
|
|
);
|
|
assert.ok(system, `${id} must be present in the canonical persona map`);
|
|
assert.equal(system.controller.id, "ICE-P-ZY001");
|
|
assert.equal(
|
|
system.permanent_memory_and_protocol.scheduled_writes,
|
|
"CONTENT_DRIVEN_DAILY_FIFTH_DOMAIN_UPDATE_ONLY",
|
|
);
|
|
}
|
|
|
|
for (const code of ["REPO-009", "REPO-010", "REPO-011"]) {
|
|
const allRepositories = [
|
|
...(repositories.historical_repositories || []),
|
|
...(repositories.repositories || []),
|
|
];
|
|
const repository = allRepositories.find(
|
|
(candidate) => candidate.code === code,
|
|
);
|
|
assert.ok(repository, `${code} must remain addressable`);
|
|
assert.equal(repository.controller, "ICE-P-ZY001");
|
|
assert.equal(
|
|
repository.state,
|
|
"CURRENT_PRIVATE_PERSONA_HISTORY_AND_DAILY_ROLE_MEMORY_PENDING_DEPLOYMENT",
|
|
);
|
|
assert.match(repository.primary.url, /\/code\/bingshuo\//);
|
|
}
|
|
|
|
console.log("role-persona-registration: ok");
|