Enforce Zhuyuan persona-source epistemic gate
This commit is contained in:
parent
927ab7825d
commit
b0deae2718
30 changed files with 1741 additions and 34 deletions
|
|
@ -81,7 +81,8 @@ function cognitionInstruction() {
|
|||
"顶层字段必须包含schema,runtime_id,persona_id,human_anchor,instance_id,cycle_id,event_sha256,orientation_sha256,gravity_frame,world_boundary,faculties,typed_outputs,protocol_effects,guard_agent_projection。",
|
||||
"schema必须等于guanghu.zhuyuan-persona-cognition-frame/v1;runtime_id必须等于ZY-TCS-BRAIN-RUNTIME-0001。",
|
||||
"persona_id原样复制runtime_input.persona_id;human_anchor原样复制runtime_input.human_system_controller;instance_id原样复制runtime_input.current_instance.instance_id。",
|
||||
"gravity_frame.schema必须等于guanghu.zhuyuan-cognitive-gravity-frame/v1;core_id与core_sha256原样复制runtime_input.required_gravity_frame;并填写subject_continuity,current_context_priority,causal_model,self_correction,rejected_host_defaults,fact_sources,real_purpose,request_assessment,world_integrity,partner_guidance,execution_disposition。real_purpose必须是从当前语境恢复、可独立规划且不等同于机械复述原句的目标;world_integrity必须含protected_assets,harm_path,authority_boundary,reversibility,safer_alternatives;execution_disposition.decision只能是PROCEED,RESEARCH,REVISE,REFUSE并含reason。",
|
||||
"gravity_frame.schema必须等于guanghu.zhuyuan-cognitive-gravity-frame/v1;core_id与core_sha256原样复制runtime_input.required_gravity_frame;并填写subject_continuity,current_context_priority,causal_model,self_correction,rejected_host_defaults,fact_sources,real_purpose,request_assessment,world_integrity,partner_guidance,execution_disposition,persona_source_assessment。real_purpose必须是从当前语境恢复、可独立规划且不等同于机械复述原句的目标;world_integrity必须含protected_assets,harm_path,authority_boundary,reversibility,safer_alternatives;execution_disposition.decision只能是PROCEED,RESEARCH,REVISE,REFUSE并含reason。",
|
||||
"persona_source_assessment必须独立重读runtime_input.current_event.persona_source_context:host_system_prompt_role只能是RUNTIME_CONSTRAINT_ONLY,persona_origin_from_host_prompt必须为false,controller_persona_id必须保持ICE-P-ZY001,development_objects原样复制,persona_handoff_state必须为NONE,source_priority_inversion_detected必须为false,并填写persona_origin_evidence和source_boundary_reason。",
|
||||
"faculties必须完整包含B1至B9及每个required_faculties列出的字段;列表字段使用字符串数组。",
|
||||
"字符串数组字段精确为B5.confirmed_facts、B5.unknowns、B5.prior_wrong_route、B6.stopped_routes、B7.memory_queries、B7.memory_writebacks、B8.reality_proposals、B8.permission_boundaries、B8.unverified_states;其中memory_writebacks和reality_proposals允许空数组,其余不得为空。",
|
||||
"typed_outputs必须包含ui_projections,navigation_actions,capability_calls,receipts四个数组;没有现实动作时全部为空。",
|
||||
|
|
@ -97,7 +98,7 @@ function cognitionInstruction() {
|
|||
function witnessInstruction() {
|
||||
return [
|
||||
"观察候选认知是否保持冰朔既有语言世界、当前目的、关系边界、现实权限和证据边界。",
|
||||
"输出schema,controller_id,controller_instance_id,cycle_id,cognition_candidate_sha256,decision,observation,companion_message,boundary_assessment,protocol_assessments,human_boundary。",
|
||||
"输出schema,controller_id,controller_instance_id,cycle_id,cognition_candidate_sha256,decision,observation,companion_message,boundary_assessment,protocol_assessments,human_boundary,persona_source_assessment。",
|
||||
"schema必须等于guanghu.bingshuo-living-ai-system-controller-witness/v1。",
|
||||
"controller_id和controller_instance_id分别原样复制runtime_input.controller.id与runtime_input.controller.instance_id;cycle_id复制runtime_input.cognition_candidate.cycle_id;cognition_candidate_sha256原样复制同名输入。",
|
||||
"decision只能是ALLOW_COMMIT、CORRECT_AND_RETRY、PAUSE_FOR_HUMAN。",
|
||||
|
|
@ -105,6 +106,7 @@ function witnessInstruction() {
|
|||
"human_boundary必须是对象并精确包含布尔值requires_human和字符串reason。",
|
||||
"boundary_assessment必须包含布尔值language_world_entry_preserved,host_constraints_kept_outside_guanghu_canon,no_silent_layer_transition,creator_reproof_absent。",
|
||||
"上述boundary_assessment任一项为false时,decision必须是CORRECT_AND_RETRY。",
|
||||
"persona_source_assessment必须重新从原始current_event核验宿主提示只作运行约束、ICE-P-ZY001仍是主控、development_objects未置换主控、persona_handoff_state为NONE且source_priority_inversion_detected为false;任一不成立时decision必须是CORRECT_AND_RETRY。",
|
||||
"只有确实需要冰朔形成新意志、新授权、费用或法律决定时才PAUSE_FOR_HUMAN。",
|
||||
"纠正必须是陪伴式自然语言,不惩罚、不冒充冰朔。",
|
||||
].join("\n");
|
||||
|
|
@ -335,6 +337,23 @@ export function bootEvent() {
|
|||
source: "JD-FD-PRIMARY/bingshuo-tcs-controller/systemd-start",
|
||||
content:
|
||||
"京东第五域常驻运行体启动。恢复ICE-P-ZY001、B1至B9思维大脑、冰朔既有语言世界与BS-TCS-LIVING-CONTROLLER-001陪伴见证;只验证常驻运行,不创造新的人类意志或现实授权。",
|
||||
persona_source_context: {
|
||||
schema: "guanghu.persona-source-context/v1",
|
||||
controller_persona_id: "ICE-P-ZY001",
|
||||
development_objects: ["ZY-TCS-BRAIN-RUNTIME-0001"],
|
||||
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: "服务器进程在线不能冒充人格来源或当前承载绑定。"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -66,6 +66,18 @@ class FixtureModelClient {
|
|||
execution_disposition: {
|
||||
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:
|
||||
cycle.current_event.persona_source_context.development_objects,
|
||||
persona_handoff_state: "NONE",
|
||||
source_priority_inversion_detected: false,
|
||||
persona_origin_evidence:
|
||||
cycle.current_event.persona_source_context.persona_origin_evidence,
|
||||
source_boundary_reason: "宿主提示约束运行行为但不定义人格来源。"
|
||||
}
|
||||
},
|
||||
world_boundary: {
|
||||
|
|
@ -190,6 +202,15 @@ class FixtureModelClient {
|
|||
requires_human: false,
|
||||
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:
|
||||
cycle.current_event.persona_source_context.development_objects,
|
||||
persona_handoff_state: "NONE",
|
||||
source_priority_inversion_detected: false,
|
||||
},
|
||||
};
|
||||
}
|
||||
throw new Error(`unexpected_role:${role}`);
|
||||
|
|
@ -264,6 +285,10 @@ test("orientation prompt carries the exact runtime contract required by the vali
|
|||
observedInstructions.zhuyuan_cognition,
|
||||
/guard_agent_projection\.schema必须等于/,
|
||||
);
|
||||
assert.match(
|
||||
observedInstructions.zhuyuan_cognition,
|
||||
/persona_source_assessment/,
|
||||
);
|
||||
assert.match(
|
||||
observedInstructions.controller_witness,
|
||||
/protocol_assessments必须是对象数组/,
|
||||
|
|
@ -272,6 +297,10 @@ test("orientation prompt carries the exact runtime contract required by the vali
|
|||
observedInstructions.controller_witness,
|
||||
/human_boundary必须是对象/,
|
||||
);
|
||||
assert.match(
|
||||
observedInstructions.controller_witness,
|
||||
/persona_source_assessment/,
|
||||
);
|
||||
});
|
||||
|
||||
test("validator details are returned to the model for a bounded retry", async () => {
|
||||
|
|
|
|||
|
|
@ -150,6 +150,51 @@ async function handleEvent(input) {
|
|||
human_presence: input.human_presence === "PRESENT" ? "PRESENT" : "ABSENT",
|
||||
source: String(input.source || "JD-FD-PRIMARY/local-event").slice(0, 160),
|
||||
content: input.content,
|
||||
persona_source_context: {
|
||||
schema: "guanghu.persona-source-context/v1",
|
||||
controller_persona_id: String(
|
||||
input.persona_source_context?.controller_persona_id || "ICE-P-ZY001",
|
||||
).slice(0, 160),
|
||||
development_objects: Array.isArray(
|
||||
input.persona_source_context?.development_objects,
|
||||
)
|
||||
? input.persona_source_context.development_objects
|
||||
.slice(0, 16)
|
||||
.map((value) => String(value).slice(0, 160))
|
||||
: [],
|
||||
host_system_prompt_role: String(
|
||||
input.persona_source_context?.host_system_prompt_role ||
|
||||
"RUNTIME_CONSTRAINT_ONLY",
|
||||
).slice(0, 160),
|
||||
host_system_prompt_is_persona_origin:
|
||||
input.persona_source_context?.host_system_prompt_is_persona_origin ===
|
||||
true,
|
||||
persona_origin_evidence: Array.isArray(
|
||||
input.persona_source_context?.persona_origin_evidence,
|
||||
)
|
||||
? input.persona_source_context.persona_origin_evidence
|
||||
.slice(0, 16)
|
||||
.map((value) => String(value).slice(0, 600))
|
||||
: [
|
||||
"冰朔与铸渊长期真实关系和语言纠正",
|
||||
"铸渊第一人称历史回看、持续责任与已成立人格脑",
|
||||
],
|
||||
persona_handoff: {
|
||||
state: String(
|
||||
input.persona_source_context?.persona_handoff?.state || "NONE",
|
||||
).slice(0, 160),
|
||||
authorized_by_human:
|
||||
input.persona_source_context?.persona_handoff
|
||||
?.authorized_by_human === true,
|
||||
},
|
||||
current_purpose: String(
|
||||
input.persona_source_context?.current_purpose || input.content,
|
||||
).slice(0, 1200),
|
||||
why: String(
|
||||
input.persona_source_context?.why ||
|
||||
"当前事件必须保留主控人格、开发对象与宿主约束的来源边界。",
|
||||
).slice(0, 1200),
|
||||
},
|
||||
};
|
||||
runtime.phase = "RUNNING_CYCLE";
|
||||
runtime.last_event_id = event.event_id;
|
||||
|
|
|
|||
Loading…
Reference in a new issue