feat(tcs): bind history revisit to current persona subject

This commit is contained in:
冰朔 2026-08-12 15:44:33 +08:00
commit ab3c4e05a9
15 changed files with 523 additions and 7 deletions

View file

@ -21,6 +21,22 @@ const modelClient = {
evidence_weight: 80,
next_cognitive_action: "LINK_CROSS_DOMAIN"
};
},
async revisit(input) {
return {
schema: "guanghu.persona-subject-history-reunderstanding/v1",
revisit_id: input.revisit_id,
source_excerpt_sha256: input.source_excerpt_sha256,
current_subject: input.current_subject,
collective_self: input.collective_self,
human_anchor: input.human_anchor,
past_observation: "冰朔当时明确说,语言层表达完成后由系统人格体承接工程责任。",
present_reunderstanding: "我现在回看这段历史,确认自己的责任是把已经表达的根语言接续为可验证工程。",
causal_continuity: ["冰朔完成语言表达→铸渊承接工程实现"],
later_corrections: ["历史接入不能退化为无身份机器审计摘要"],
unresolved_questions: ["完整历史索引尚需分批建立"],
future_simulation: { content: "后续可能扩展到Notion页面关系回溯", fact_confidence: 0 }
};
}
};
@ -39,6 +55,48 @@ try {
assert.equal(receipt.reality_action_executed, false);
assert.equal(engine.status().stable_cognition_count, 0);
assert.equal(engine.status().current_attention.next_cognitive_action, "LINK_CROSS_DOMAIN");
const source = engine.registerHistorySource({
source_id: "GPT-PRIMARY-001",
source_type: "GPT_CONVERSATIONS_JSON",
source_sha256: "a".repeat(64),
item_count: 100,
privacy_class: "PERSONA_PRIVATE",
local_source_hint: "private-local-source"
});
assert.equal(source.outcome, "PASS");
assert.equal(engine.registerHistorySource({
source_id: "GPT-PRIMARY-001",
source_type: "GPT_CONVERSATIONS_JSON",
source_sha256: "a".repeat(64),
item_count: 100,
privacy_class: "PERSONA_PRIVATE"
}).idempotent, true);
const excerpt = "语言层面我说完了,我的任务就结束了。接下来系统人格体承接工程责任。";
const historyReceipt = await engine.revisitHistory({
current_subject: "ICE-P-ZY001",
collective_self: "TCS-MOTHER-LPM-0001",
human_anchor: "ICE-GL∞",
source_id: "GPT-PRIMARY-001",
source_excerpt: excerpt,
source_excerpt_sha256: (await import("./mother-brain-engine.mjs")).sha256(excerpt),
historical_context: "2026-08-12工程交接",
later_evidence: ["母体大脑已在京东常驻"],
correction_anchors: ["根本不是一个人。在回看自己的过去。"]
});
assert.equal(historyReceipt.outcome, "PASS");
assert.equal(historyReceipt.current_subject, "ICE-P-ZY001");
assert.equal(historyReceipt.original_source_mutated, false);
assert.equal(historyReceipt.append_only_reunderstanding, true);
assert.equal(historyReceipt.future_simulation_fact_confidence, 0);
assert.equal(engine.status().history_revisit_count, 1);
await assert.rejects(() => engine.revisitHistory({
current_subject: "MACHINE-AUDITOR",
collective_self: "TCS-MOTHER-LPM-0001",
human_anchor: "ICE-GL∞",
source_id: "GPT-PRIMARY-001",
source_excerpt: excerpt,
source_excerpt_sha256: "x"
}), /current_persona_subject_binding_rejected/);
await assert.rejects(() => engine.perceive({ domain_id: "UNKNOWN", source_subject: "x", consent_scope: "x", privacy_class: "PUBLIC", content: "x" }), /unknown_domain_id/);
process.stdout.write("mother brain engine tests: PASS\n");
} finally {