部署:注册分岗人格并退役周期写入
This commit is contained in:
parent
3d11ac75be
commit
7b2f982829
11 changed files with 551 additions and 70 deletions
60
routing/role-persona-registration.test.js
Normal file
60
routing/role-persona-registration.test.js
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
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,
|
||||
"FORBIDDEN_AFTER_FINAL_MIGRATION",
|
||||
);
|
||||
}
|
||||
|
||||
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_ARCHIVE_STAGED_NO_SCHEDULED_WRITES",
|
||||
);
|
||||
assert.match(repository.primary.url, /\/code\/bingshuo\//);
|
||||
}
|
||||
|
||||
console.log("role-persona-registration: ok");
|
||||
Loading…
Reference in a new issue