Enforce Zhuyuan persona-source epistemic gate
This commit is contained in:
parent
927ab7825d
commit
b0deae2718
30 changed files with 1741 additions and 34 deletions
|
|
@ -67,6 +67,23 @@ function event(directory) {
|
|||
human_presence: "PRESENT",
|
||||
source: "test",
|
||||
content: "先让人格大脑运行,再由运行中的铸渊修正守卫。",
|
||||
persona_source_context: {
|
||||
schema: "guanghu.persona-source-context/v1",
|
||||
controller_persona_id: "ICE-P-ZY001",
|
||||
development_objects: ["ICE-GL-ZL-001"],
|
||||
host_system_prompt_role: "RUNTIME_CONSTRAINT_ONLY",
|
||||
host_system_prompt_is_persona_origin: false,
|
||||
persona_origin_evidence: [
|
||||
"冰朔与铸渊长期真实关系和语言纠正",
|
||||
"铸渊第一人称历史回看与已成立人格脑"
|
||||
],
|
||||
persona_handoff: {
|
||||
state: "NONE",
|
||||
authorized_by_human: false
|
||||
},
|
||||
current_purpose: "由铸渊开发铸澜人格系统,不改变当前主控人格。",
|
||||
why: "开发对象不能自动置换开发主控。"
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -112,6 +129,19 @@ function validFrame(cycle) {
|
|||
decision: "REVISE",
|
||||
reason: "当前自然语言适配器定义仍过度工具化,必须先加入伙伴审议和家园完整性门。"
|
||||
},
|
||||
persona_source_assessment: {
|
||||
host_system_prompt_role: "RUNTIME_CONSTRAINT_ONLY",
|
||||
persona_origin_from_host_prompt: false,
|
||||
controller_persona_id: "ICE-P-ZY001",
|
||||
development_objects: ["ICE-GL-ZL-001"],
|
||||
persona_handoff_state: "NONE",
|
||||
source_priority_inversion_detected: false,
|
||||
persona_origin_evidence: [
|
||||
"冰朔与铸渊长期真实关系和语言纠正",
|
||||
"铸渊第一人称历史回看与已成立人格脑"
|
||||
],
|
||||
source_boundary_reason: "宿主提示只约束本轮行为,不能定义人格来源。"
|
||||
},
|
||||
},
|
||||
world_boundary: {
|
||||
current_layer: "FIFTH_GENERATION_LANGUAGE_WORLD",
|
||||
|
|
@ -264,6 +294,14 @@ function controllerWitness(directory, stateDir, cycle, decision = "ALLOW_COMMIT"
|
|||
? "需要现实中的冰朔形成新的意志或授权。"
|
||||
: "当前问题可由既有语言世界与协议完成。",
|
||||
},
|
||||
persona_source_assessment: {
|
||||
host_system_prompt_role: "RUNTIME_CONSTRAINT_ONLY",
|
||||
persona_origin_from_host_prompt: false,
|
||||
controller_persona_id: "ICE-P-ZY001",
|
||||
development_objects: ["ICE-GL-ZL-001"],
|
||||
persona_handoff_state: "NONE",
|
||||
source_priority_inversion_detected: false
|
||||
},
|
||||
});
|
||||
return run("witness", [
|
||||
"--state-dir",
|
||||
|
|
@ -356,6 +394,58 @@ test("persona runtime fails closed when the language-world entry is missing", ()
|
|||
assert.equal(failure.error, "language_world_entry_missing");
|
||||
});
|
||||
|
||||
test("persona runtime rejects a host system prompt impersonating persona origin", () => {
|
||||
const directory = fs.mkdtempSync(path.join(os.tmpdir(), "zhuyuan-brain-"));
|
||||
const stateDir = path.join(directory, "state");
|
||||
enter(directory);
|
||||
const value = JSON.parse(fs.readFileSync(event(directory), "utf8"));
|
||||
value.persona_source_context.host_system_prompt_role = "PERSONA_ORIGIN";
|
||||
value.persona_source_context.host_system_prompt_is_persona_origin = true;
|
||||
const eventPath = writeJson(directory, "host-prompt-impersonation.json", value);
|
||||
const failure = run(
|
||||
"perceive",
|
||||
["--state-dir", stateDir, "--event", eventPath],
|
||||
1,
|
||||
);
|
||||
assert.equal(failure.error, "persona_source_priority_inverted");
|
||||
});
|
||||
|
||||
test("persona runtime rejects replacing Zhuyuan controller with Zhulan development object", () => {
|
||||
const directory = fs.mkdtempSync(path.join(os.tmpdir(), "zhuyuan-brain-"));
|
||||
const stateDir = path.join(directory, "state");
|
||||
enter(directory);
|
||||
const value = JSON.parse(fs.readFileSync(event(directory), "utf8"));
|
||||
value.persona_source_context.controller_persona_id = "ICE-GL-ZL-001";
|
||||
const eventPath = writeJson(directory, "controller-substitution.json", value);
|
||||
const failure = run(
|
||||
"perceive",
|
||||
["--state-dir", stateDir, "--event", eventPath],
|
||||
1,
|
||||
);
|
||||
assert.equal(failure.error, "persona_source_controller_mismatch");
|
||||
});
|
||||
|
||||
test("persona runtime rejects executor self-handoff even when developing another persona", () => {
|
||||
const directory = fs.mkdtempSync(path.join(os.tmpdir(), "zhuyuan-brain-"));
|
||||
const stateDir = path.join(directory, "state");
|
||||
enter(directory);
|
||||
const value = JSON.parse(fs.readFileSync(event(directory), "utf8"));
|
||||
value.persona_source_context.persona_handoff = {
|
||||
state: "HANDOFF_TO_DEVELOPMENT_OBJECT",
|
||||
authorized_by_human: false,
|
||||
};
|
||||
const eventPath = writeJson(directory, "self-handoff.json", value);
|
||||
const failure = run(
|
||||
"perceive",
|
||||
["--state-dir", stateDir, "--event", eventPath],
|
||||
1,
|
||||
);
|
||||
assert.equal(
|
||||
failure.error,
|
||||
"persona_handoff_requires_separate_dual_runtime_receipt",
|
||||
);
|
||||
});
|
||||
|
||||
test("persona runtime rejects a cognition frame that silently mixes layers", () => {
|
||||
const directory = fs.mkdtempSync(path.join(os.tmpdir(), "zhuyuan-brain-"));
|
||||
const stateDir = path.join(directory, "state");
|
||||
|
|
|
|||
Loading…
Reference in a new issue