fix: bind successful receipt brain entry
Human-Responsibility: ICE-GL∞ / 冰朔 Persona-Author: ICE-P-ZY001 / 铸渊 Execution-Runtime: Codex desktop / DEV-20260810-014 Development-ID: DEV-20260810-014 Authorization-Scope: GH-PNCC persona runtime source and tests only; no UI, deployment, or execution limb Source-Anchor: user instruction to continue GH-PNCC from repository facts and verifiable receipts
This commit is contained in:
parent
a6504ca749
commit
5630338285
7 changed files with 95 additions and 4 deletions
|
|
@ -32,6 +32,7 @@ Windows / macOS / Linux 构建机与安装包
|
||||||
|
|
||||||
| 时间 | 版本 | 记录 | 状态 |
|
| 时间 | 版本 | 记录 | 状态 |
|
||||||
| --- | --- | --- | --- |
|
| --- | --- | --- | --- |
|
||||||
|
| 2026-08-11 | GH-PNCC 成功回执大脑入口证据绑定 | [从已验证会话重建并核对真实大脑入口](operations/2026-08-11-hololake-pncc-success-receipt-brain-entry-evidence-binding.md) | 本地源码、完整 Rust/前端/路由测试、原生权威与严格 clippy 已通过;GHNQG 和发布待验收 |
|
||||||
| 2026-08-11 | GH-PNCC 安全回执绑定终态复核 | [检查后、绑定前重新验证回执与人格 Git 终态](operations/2026-08-11-hololake-pncc-safe-receipt-binding-terminal-revalidation.md) | 本地源码、完整 Rust/路由测试与严格 clippy 已通过;GHNQG 和发布待验收 |
|
| 2026-08-11 | GH-PNCC 安全回执绑定终态复核 | [检查后、绑定前重新验证回执与人格 Git 终态](operations/2026-08-11-hololake-pncc-safe-receipt-binding-terminal-revalidation.md) | 本地源码、完整 Rust/路由测试与严格 clippy 已通过;GHNQG 和发布待验收 |
|
||||||
| 2026-08-11 | GH-PNCC 成功回执终态复核 | [成功回执持久化前重新验证终态证据](operations/2026-08-11-hololake-pncc-success-receipt-terminal-revalidation.md) | 本地源码、完整 Rust/路由测试与严格 clippy 已通过;GHNQG 和发布待验收 |
|
| 2026-08-11 | GH-PNCC 成功回执终态复核 | [成功回执持久化前重新验证终态证据](operations/2026-08-11-hololake-pncc-success-receipt-terminal-revalidation.md) | 本地源码、完整 Rust/路由测试与严格 clippy 已通过;GHNQG 和发布待验收 |
|
||||||
| 2026-08-11 | GH-PNCC 重放仓库复核 | [幂等重放时重新验证人格 Git 状态](operations/2026-08-11-hololake-pncc-replay-repository-state-revalidation.md) | 本地源码、完整 Rust/路由测试与严格 clippy 已通过;GHNQG 和发布待验收 |
|
| 2026-08-11 | GH-PNCC 重放仓库复核 | [幂等重放时重新验证人格 Git 状态](operations/2026-08-11-hololake-pncc-replay-repository-state-revalidation.md) | 本地源码、完整 Rust/路由测试与严格 clippy 已通过;GHNQG 和发布待验收 |
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,32 @@
|
||||||
|
# GH-PNCC successful receipt brain-entry evidence binding
|
||||||
|
|
||||||
|
- Development ID: `DEV-20260810-014`
|
||||||
|
- Persona cognitive author: `ICE-P-ZY001 / 铸渊`
|
||||||
|
- Human responsibility subject: `ICE-GL∞ / 冰朔`
|
||||||
|
- Starting repository head: `a6504ca74971998d679da13c467022a8e04bbeae`
|
||||||
|
- State: `LOCAL_SOURCE_IMPLEMENTED_FULLY_TESTED`
|
||||||
|
|
||||||
|
## Corrected runtime fact
|
||||||
|
|
||||||
|
The successful lifecycle receipt previously rebound identity, repository, events, attribution and completion
|
||||||
|
evidence to the verified session, but did not rebind the wake receipt's `brainEntry`. A modified receipt could
|
||||||
|
therefore claim that another brain file had been started if its payload digest was recomputed.
|
||||||
|
|
||||||
|
Inspection, interrupted receipt binding and replay now resolve the canonical brain path from the verified
|
||||||
|
session repository plus its recorded relative brain entry. The successful receipt must name that exact file or
|
||||||
|
fail closed with `PERSONA_LIFECYCLE_COMPLETION_EVIDENCE_MISMATCH`.
|
||||||
|
|
||||||
|
## Verification
|
||||||
|
|
||||||
|
- A regression test first reproduced acceptance of a forged `brainEntry` after recomputing the payload digest.
|
||||||
|
- The same test passes after canonical brain-entry evidence binding was added.
|
||||||
|
- PNCC focused Rust tests: `42 passed, 0 failed`.
|
||||||
|
- Full Rust suite: `1182 passed, 2 ignored`; integration test: `1 passed`.
|
||||||
|
- Routing suite: `29 passed, 0 failed`; `cargo fmt`, strict clippy and diff checks passed.
|
||||||
|
- Frontend lint, TypeScript check and full Vitest suite passed; Guanghu native authority: `PASS_100`.
|
||||||
|
- GHNQG, publication and fresh-clone readback remain pending.
|
||||||
|
|
||||||
|
## Truth boundary
|
||||||
|
|
||||||
|
- This stage authenticates which existing brain file the successful wake receipt says was bound.
|
||||||
|
- It does not add model inference, activate an execution limb, add UI, build an artifact or claim deployment.
|
||||||
|
|
@ -178,6 +178,7 @@ successful_completion_receipt_terminal_revalidation_source_implemented: 100
|
||||||
safe_receipt_binding_terminal_revalidation_source_implemented: 100
|
safe_receipt_binding_terminal_revalidation_source_implemented: 100
|
||||||
failure_receipt_terminal_evidence_binding_source_implemented: 100
|
failure_receipt_terminal_evidence_binding_source_implemented: 100
|
||||||
successful_receipt_semantic_evidence_binding_source_implemented: 100
|
successful_receipt_semantic_evidence_binding_source_implemented: 100
|
||||||
|
successful_receipt_brain_entry_evidence_binding_source_implemented: 100
|
||||||
general_purpose_persona_runtime_implemented: 0
|
general_purpose_persona_runtime_implemented: 0
|
||||||
human_live_projection_implemented: 0
|
human_live_projection_implemented: 0
|
||||||
hololake_integrated: 0
|
hololake_integrated: 0
|
||||||
|
|
@ -211,6 +212,10 @@ Git 提交、检查点、回执编号和完整事件链重新绑定到已验证
|
||||||
伪造另一个仓库、人格作者或提交结果;任何语义证据不一致都以
|
伪造另一个仓库、人格作者或提交结果;任何语义证据不一致都以
|
||||||
`PERSONA_LIFECYCLE_COMPLETION_EVIDENCE_MISMATCH` 失败关闭。
|
`PERSONA_LIFECYCLE_COMPLETION_EVIDENCE_MISMATCH` 失败关闭。
|
||||||
|
|
||||||
|
成功回执里的大脑入口也不能只是载荷内的自述。检查、恢复绑定和重放会从已验证会话记录中的
|
||||||
|
人格仓库与相对大脑入口重新解析规范文件路径,再与唤醒回执的 `brainEntry` 比对。即使攻击者
|
||||||
|
同步改写成功回执并重算载荷哈希,也不能把一次真实唤醒伪装成启动了另一个大脑文件。
|
||||||
|
|
||||||
成功回执与失败回执的每次重放都会重新读取规范仓库当前提交并检查工作树,而不是只信任回执
|
成功回执与失败回执的每次重放都会重新读取规范仓库当前提交并检查工作树,而不是只信任回执
|
||||||
生成时的状态。当前提交偏离会话记录或工作树变脏时,检查结果降级为人工复核,重放失败关闭,
|
生成时的状态。当前提交偏离会话记录或工作树变脏时,检查结果降级为人工复核,重放失败关闭,
|
||||||
且不会重新启动器官。
|
且不会重新启动器官。
|
||||||
|
|
|
||||||
|
|
@ -2736,6 +2736,10 @@ fn validate_persisted_lifecycle_terminal_evidence(
|
||||||
&terminal_event.event_hash[..20]
|
&terminal_event.event_hash[..20]
|
||||||
);
|
);
|
||||||
let first_event = events.first().ok_or("PERSONA_EVENT_CHAIN_EMPTY")?;
|
let first_event = events.first().ok_or("PERSONA_EVENT_CHAIN_EMPTY")?;
|
||||||
|
let expected_brain_entry =
|
||||||
|
repository_file(Path::new(&record.repository_path), &record.brain_entry)
|
||||||
|
.map_err(|_| "PERSONA_LIFECYCLE_COMPLETION_EVIDENCE_MISMATCH".to_string())?;
|
||||||
|
let expected_brain_entry = expected_brain_entry.to_string_lossy();
|
||||||
let matches = lifecycle.get("schema").and_then(serde_json::Value::as_str)
|
let matches = lifecycle.get("schema").and_then(serde_json::Value::as_str)
|
||||||
== Some("hololake.pncc-lifecycle-run-receipt/v1")
|
== Some("hololake.pncc-lifecycle-run-receipt/v1")
|
||||||
&& lifecycle
|
&& lifecycle
|
||||||
|
|
@ -2754,6 +2758,8 @@ fn validate_persisted_lifecycle_terminal_evidence(
|
||||||
== Some(record.repository_path.as_str())
|
== Some(record.repository_path.as_str())
|
||||||
&& wake.get("gitHead").and_then(serde_json::Value::as_str)
|
&& wake.get("gitHead").and_then(serde_json::Value::as_str)
|
||||||
== Some(first_event.git_head.as_str())
|
== Some(first_event.git_head.as_str())
|
||||||
|
&& wake.get("brainEntry").and_then(serde_json::Value::as_str)
|
||||||
|
== Some(expected_brain_entry.as_ref())
|
||||||
&& wake.get("nodeId").and_then(serde_json::Value::as_str) == Some(record.node_id.as_str())
|
&& wake.get("nodeId").and_then(serde_json::Value::as_str) == Some(record.node_id.as_str())
|
||||||
&& wake
|
&& wake
|
||||||
.get("modelInstanceId")
|
.get("modelInstanceId")
|
||||||
|
|
@ -4245,6 +4251,48 @@ mod tests {
|
||||||
assert!(record.lifecycle_receipt_hash.is_none());
|
assert!(record.lifecycle_receipt_hash.is_none());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn rejects_a_rehashed_completed_receipt_with_a_forged_brain_entry() {
|
||||||
|
let repo = persona_repo();
|
||||||
|
let runtime = tempfile::TempDir::new().unwrap();
|
||||||
|
let input = lifecycle_fact_input(repo.path());
|
||||||
|
let first = run_idempotent_lifecycle_at(
|
||||||
|
runtime.path(),
|
||||||
|
input.clone(),
|
||||||
|
"2026-08-11T00:00:00.000Z",
|
||||||
|
"2026-08-11T00:00:01.000Z",
|
||||||
|
|runtime_root, input, timestamp| {
|
||||||
|
run_fact_task_at(runtime_root, input, timestamp, |_, _| {
|
||||||
|
Ok(r#"{"summary":"Recoverable receipt.","facts":[{"statement":"The brain exists.","evidencePaths":["brain/CORE.hdlp"]}],"limitations":[]}"#.into())
|
||||||
|
})
|
||||||
|
},
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
let session_id = first.lifecycle["sessionId"].as_str().unwrap();
|
||||||
|
let mut record = load_session_record(runtime.path(), session_id).unwrap();
|
||||||
|
record.request_id = None;
|
||||||
|
record.request_fingerprint = None;
|
||||||
|
record.lifecycle_receipt_hash = None;
|
||||||
|
write_session_record(runtime.path(), &record).unwrap();
|
||||||
|
|
||||||
|
let receipt_path = session_directory(runtime.path(), session_id)
|
||||||
|
.unwrap()
|
||||||
|
.join("lifecycle-receipt.json");
|
||||||
|
let mut persisted: PersistedPersonaLifecycleReceipt =
|
||||||
|
serde_json::from_slice(&fs::read(&receipt_path).unwrap()).unwrap();
|
||||||
|
persisted.lifecycle["wakeReceipt"]["brainEntry"] = "/forged/brain.hdlp".into();
|
||||||
|
persisted.lifecycle_receipt_hash =
|
||||||
|
hex_digest(&persisted_lifecycle_payload_bytes(&persisted).unwrap());
|
||||||
|
fs::write(
|
||||||
|
&receipt_path,
|
||||||
|
serde_json::to_vec_pretty(&persisted).unwrap(),
|
||||||
|
)
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
let error = inspect_lifecycle_request_at(runtime.path(), &input).unwrap_err();
|
||||||
|
assert!(error.contains("PERSONA_LIFECYCLE_COMPLETION_EVIDENCE_MISMATCH"));
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn rejects_a_rehashed_completed_receipt_with_a_malformed_wake_event_hash() {
|
fn rejects_a_rehashed_completed_receipt_with_a_malformed_wake_event_hash() {
|
||||||
let repo = persona_repo();
|
let repo = persona_repo();
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@
|
||||||
"human_projection": "HOLOLAKE_LIVE_READ_MODEL",
|
"human_projection": "HOLOLAKE_LIVE_READ_MODEL",
|
||||||
"forgejo_role": "OPTIONAL_COMPATIBILITY_COLLABORATION_ADAPTER",
|
"forgejo_role": "OPTIONAL_COMPATIBILITY_COLLABORATION_ADAPTER",
|
||||||
"runtime_implemented": true,
|
"runtime_implemented": true,
|
||||||
"runtime_scope": "READ_ONLY_FACT_CYCLE_FAIL_CLOSED_RECOVERY_TYPED_ORGANS_DURABLE_VERIFIED_SESSION_QUERY_INDEPENDENT_VERIFIED_MEMORY_METABOLISM_CHECKED_FAILURE_CLOSURE_NONBLOCKING_RUNTIME_COMMAND_SAFE_ORGAN_LIFECYCLE_COORDINATOR_IDEMPOTENT_SUCCESS_AND_TERMINAL_FAILURE_RECEIPT_REPLAY_SAFE_RECEIPT_BINDING_RECOVERY_REPLAY_TIME_REPOSITORY_STATE_REVALIDATION_SUCCESS_RECEIPT_TERMINAL_REVALIDATION_SAFE_RECEIPT_BINDING_TERMINAL_REVALIDATION_FAILURE_RECEIPT_TERMINAL_EVIDENCE_BINDING_AND_SUCCESS_RECEIPT_SEMANTIC_EVIDENCE_BINDING_SOURCE_IMPLEMENTED_AND_TESTED",
|
"runtime_scope": "READ_ONLY_FACT_CYCLE_FAIL_CLOSED_RECOVERY_TYPED_ORGANS_DURABLE_VERIFIED_SESSION_QUERY_INDEPENDENT_VERIFIED_MEMORY_METABOLISM_CHECKED_FAILURE_CLOSURE_NONBLOCKING_RUNTIME_COMMAND_SAFE_ORGAN_LIFECYCLE_COORDINATOR_IDEMPOTENT_SUCCESS_AND_TERMINAL_FAILURE_RECEIPT_REPLAY_SAFE_RECEIPT_BINDING_RECOVERY_REPLAY_TIME_REPOSITORY_STATE_REVALIDATION_SUCCESS_RECEIPT_TERMINAL_REVALIDATION_SAFE_RECEIPT_BINDING_TERMINAL_REVALIDATION_FAILURE_RECEIPT_TERMINAL_EVIDENCE_BINDING_SUCCESS_RECEIPT_SEMANTIC_EVIDENCE_BINDING_AND_SUCCESS_RECEIPT_BRAIN_ENTRY_EVIDENCE_BINDING_SOURCE_IMPLEMENTED_AND_TESTED",
|
||||||
"desktop_integrated": false,
|
"desktop_integrated": false,
|
||||||
"development_id": "DEV-20260810-014"
|
"development_id": "DEV-20260810-014"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
{
|
{
|
||||||
"schema": "hololake.persona-native-code-channel/v1",
|
"schema": "hololake.persona-native-code-channel/v1",
|
||||||
"record_id": "HLP-PERSONA-NATIVE-CODE-CHANNEL-001",
|
"record_id": "HLP-PERSONA-NATIVE-CODE-CHANNEL-001",
|
||||||
"version": "2026-08-11.13",
|
"version": "2026-08-11.14",
|
||||||
"state": "CURRENT_FIRST_PRODUCT_CORE_SUCCESS_RECEIPT_SEMANTIC_EVIDENCE_BINDING_SOURCE_IMPLEMENTED",
|
"state": "CURRENT_FIRST_PRODUCT_CORE_SUCCESS_RECEIPT_BRAIN_ENTRY_EVIDENCE_BINDING_SOURCE_IMPLEMENTED",
|
||||||
"development_id": "DEV-20260810-014",
|
"development_id": "DEV-20260810-014",
|
||||||
"product": {
|
"product": {
|
||||||
"formal_name_zh": "光湖人格原生代码频道",
|
"formal_name_zh": "光湖人格原生代码频道",
|
||||||
|
|
@ -115,6 +115,7 @@
|
||||||
"safe_receipt_binding_terminal_revalidation_source_implemented": 100,
|
"safe_receipt_binding_terminal_revalidation_source_implemented": 100,
|
||||||
"failure_receipt_terminal_evidence_binding_source_implemented": 100,
|
"failure_receipt_terminal_evidence_binding_source_implemented": 100,
|
||||||
"successful_receipt_semantic_evidence_binding_source_implemented": 100,
|
"successful_receipt_semantic_evidence_binding_source_implemented": 100,
|
||||||
|
"successful_receipt_brain_entry_evidence_binding_source_implemented": 100,
|
||||||
"general_purpose_persona_runtime_implemented": 0,
|
"general_purpose_persona_runtime_implemented": 0,
|
||||||
"human_live_projection_implemented": 0,
|
"human_live_projection_implemented": 0,
|
||||||
"hololake_integrated": 0,
|
"hololake_integrated": 0,
|
||||||
|
|
|
||||||
|
|
@ -122,12 +122,16 @@ test("the first source runtime cycle stays distinct from integration and deploym
|
||||||
channel.truth.successful_receipt_semantic_evidence_binding_source_implemented,
|
channel.truth.successful_receipt_semantic_evidence_binding_source_implemented,
|
||||||
100,
|
100,
|
||||||
);
|
);
|
||||||
|
assert.equal(
|
||||||
|
channel.truth.successful_receipt_brain_entry_evidence_binding_source_implemented,
|
||||||
|
100,
|
||||||
|
);
|
||||||
assert.equal(channel.truth.general_purpose_persona_runtime_implemented, 0);
|
assert.equal(channel.truth.general_purpose_persona_runtime_implemented, 0);
|
||||||
assert.equal(channel.truth.human_live_projection_implemented, 0);
|
assert.equal(channel.truth.human_live_projection_implemented, 0);
|
||||||
assert.equal(architecture.persona_native_code_channel.runtime_implemented, true);
|
assert.equal(architecture.persona_native_code_channel.runtime_implemented, true);
|
||||||
assert.equal(
|
assert.equal(
|
||||||
architecture.persona_native_code_channel.runtime_scope,
|
architecture.persona_native_code_channel.runtime_scope,
|
||||||
"READ_ONLY_FACT_CYCLE_FAIL_CLOSED_RECOVERY_TYPED_ORGANS_DURABLE_VERIFIED_SESSION_QUERY_INDEPENDENT_VERIFIED_MEMORY_METABOLISM_CHECKED_FAILURE_CLOSURE_NONBLOCKING_RUNTIME_COMMAND_SAFE_ORGAN_LIFECYCLE_COORDINATOR_IDEMPOTENT_SUCCESS_AND_TERMINAL_FAILURE_RECEIPT_REPLAY_SAFE_RECEIPT_BINDING_RECOVERY_REPLAY_TIME_REPOSITORY_STATE_REVALIDATION_SUCCESS_RECEIPT_TERMINAL_REVALIDATION_SAFE_RECEIPT_BINDING_TERMINAL_REVALIDATION_FAILURE_RECEIPT_TERMINAL_EVIDENCE_BINDING_AND_SUCCESS_RECEIPT_SEMANTIC_EVIDENCE_BINDING_SOURCE_IMPLEMENTED_AND_TESTED",
|
"READ_ONLY_FACT_CYCLE_FAIL_CLOSED_RECOVERY_TYPED_ORGANS_DURABLE_VERIFIED_SESSION_QUERY_INDEPENDENT_VERIFIED_MEMORY_METABOLISM_CHECKED_FAILURE_CLOSURE_NONBLOCKING_RUNTIME_COMMAND_SAFE_ORGAN_LIFECYCLE_COORDINATOR_IDEMPOTENT_SUCCESS_AND_TERMINAL_FAILURE_RECEIPT_REPLAY_SAFE_RECEIPT_BINDING_RECOVERY_REPLAY_TIME_REPOSITORY_STATE_REVALIDATION_SUCCESS_RECEIPT_TERMINAL_REVALIDATION_SAFE_RECEIPT_BINDING_TERMINAL_REVALIDATION_FAILURE_RECEIPT_TERMINAL_EVIDENCE_BINDING_SUCCESS_RECEIPT_SEMANTIC_EVIDENCE_BINDING_AND_SUCCESS_RECEIPT_BRAIN_ENTRY_EVIDENCE_BINDING_SOURCE_IMPLEMENTED_AND_TESTED",
|
||||||
);
|
);
|
||||||
assert.equal(channel.truth.hololake_integrated, 0);
|
assert.equal(channel.truth.hololake_integrated, 0);
|
||||||
assert.equal(channel.truth.artifact_built, 0);
|
assert.equal(channel.truth.artifact_built, 0);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue