Technical Walkthrough

Multi-Layer State Integrity
for Evidence-Grounded AI Agents

从证据身份到可验证终态
让长流程 Agent 的每次状态转移都可检查

Evidence-grounded Agents Typed State Fail-closed Execution
一句话:下游只有在上游状态身份仍成立时,才获得继续执行与最终输出的权限。
01 · Roadmap

先把整条因果链讲通

问题 → 机制 → 实现 → 证据
最后回到可检验的工程边界
01

技术问题

为什么最终答案正确,仍不能证明 Agent 的执行状态有效?

02

核心组合

五层绑定如何在同一个 typed state 上形成失败闭锁链?

03

实施方式

证据、压缩、决策、验证、恢复和完成门如何具体落地?

04

技术效果

已有工程审计支持哪些性质,哪些结论明确不主张?

05

实现地图

运行时、状态服务与恢复路径如何围绕同一协议协作?

06

验证问题

哪些性质已经有工程证据,哪些仍需要故障注入与跨域实验?

02 · Technical problem

一个“看起来正确”的答案,可能来自无效状态

问题不只在模型会不会答
而在每一步是否仍绑定同一份证据
Interprettask & claims
Retrievedocuments
Extractevidence
Compressmemory
Calculategrounded values
Judgeclaim verdict
Verifyindependent check
Resumecheckpoint

Answer: B

证据、单位、计算与当前 verifier
全部闭合并可重放

≠

Answer: B

摘要改了限定词、verifier 已陈旧
checkpoint 混入旧产物

相同终局输出,不代表相同执行有效性。

03 · Result-only blind spot

终局评测看不到跨阶段完整性

结构化证据地图提供问题背景
本方案聚焦一类跨阶段机制缺口
362

active, author-verified studies in the structured evidence map

223

process-empirical

61

structural

48

formal

Three bounded lessons

Observation ≠ assurance.
看到错误,不等于下一步被约束。

Local guarantees do not automatically compose.
局部性质不能自动跨阶段继承。

Restoration ≠ safe reuse.
恢复了字节,不等于恢复状态仍可采纳。

这些统计只建立问题背景;本方案需要单独验证的是:跨阶段状态绑定能否被机械检查,并在绑定断裂时失败闭锁。
04 · Failure modes

四类高频失效,都不是“再问模型一次”能解决

共同根因:身份、内容与授权
在阶段边界上没有被绑定
E1

Evidence drift

后续阶段使用了摘要、旧段落或错误 offset,却仍看起来引用同一文档。

M2

Memory drift

压缩悄悄丢掉数字、单位、否定、限定词、冲突或开放依赖。

V3

Stale verification

决策或证据已经变化,Verifier 仍批准先前生成的判断包。

R4

Unsafe resume

checkpoint 混合不同阶段产物,或恢复被修改的 artifact 后继续执行。

核心问题:下游阶段如何证明,它消费的正是上游已经接受的那一份状态?
05 · Core design principle

把 Agent 的每次状态转移
变成可验证的许可条件

方案不依赖某一个 retrieval、compression、verifier、checkpoint 或 hash log。

它把这些组件的输出放进同一个结构化 AgentState,通过连续的内容绑定,使下游只有在上游状态身份仍成立时才能继续。

Identity

这是同一份证据、记忆和决策吗?

Authority

这个组件有权验证、修改或完成吗?

Admissibility

当前状态满足进入下一阶段的条件吗?

06 · Nested integrity chain

五层绑定,共同回答“这还是同一条执行链吗?”

每层输出成为下一层的输入条件
任一断裂都 fail closed
Hₑ

Source Span Hash

exact span + canonical location + content digest

reproduce & verify
σₘ

Memory Signature

protected facts, units, qualifiers, dependencies

equal before / after
δᵈ

Decision Fingerprint

claim + verdict + evidence IDs + calculations

current fingerprint only
ρₛ

Receipt Hash Chain

stage order + artifacts + state transition + usage

validate & replay
⊣

Completion Gate

evidence, calculation, verification, format, accounting

emit or typed stop
07 · Typed agent state

先把“什么能改、什么不能丢”写进状态结构

四层状态分离来源、工作记忆、冲突和决策
replaceable history 另行管理

EvidenceStore

不可变原文 span、doc / section / span hash、字符偏移、检索来源

append-only

WorkingMemory

grounded facts、公式、变量、依赖、开放任务;只压缩 replaceable 部分

signature-gated

ConflictLedger

主体、时间、单位、方向、限定词、否定、例外和来源冲突

explicit conflict

DecisionLedger

逐 claim verdict、证据/计算引用、operational status、verification status、修订历史

non-overwriting

技术关键不是“有一个 JSON”,而是 protected / replaceable 分区与合法状态转移由确定性代码执行。

08 · Mechanism 1

证据不是一句引用,而是一条可回放的内容地址记录

generated summary 不能替代 source of truth
接受前必须 round-trip

Acceptance condition

从 canonical section 按 offsets 重新截取,必须得到完全相同的 span,并重新验证 digest。

reproduce(section, start, end)
== exact_source_span

hash(reproduced_span) == span_hash
EvidenceRecord · ev-0142ACCEPTED
document_idfin_report_q4
section_idnote_27.revenue
section_hash7f4c…91a2
char_offsets[1832, 1907)
exact_span“Revenue increased by 12.4% …”
span_hash0a9d…fe31
slot / provenancegrowth_rate / locator→search
09 · Mechanism 2

压缩是否可接受,不看“语义像不像”

只允许删除 replaceable history
protected signature 必须逐字节相等

Before compression

  • protected evidence & facts
  • numbers, units, qualifiers
  • open dependencies & conflicts
  • search attempts × 5
σ_before = H(canonical(P))
8f2a…6c10
= ?

Candidate state

  • protected evidence & facts
  • numbers, units, qualifiers
  • open dependencies & conflicts
  • search attempts × 2
σ_after = H(canonical(P′))
8f2a…6c10

Equal → commit

所有 protected references 可解析,记录 removed IDs 与前后数量。

Different → integrity failure

不让 LLM 解释“差不多”;候选压缩状态直接拒绝。

10 · Mechanism 3

Verifier 只能验证“当前决策”,不能悄悄改答案

identity binding + authority separation
同时阻断 stale approval 与 ledger overwrite

Decision Ledger

claim_idC-07
verdictSUPPORTED
evidence_ids[E12, E19]
calculation_ids[K03]
δ_current = H(C-07 | verdict | E12,E19 | K03)
→
frozen package
no judge CoT
no gold answer

Isolated Verifier

checkssubject · time · unit · direction
checksthreshold · negation · exception · calc
resultPASS / PROPOSE_REVISION / UNRESOLVED
δ_supplied ≠ δ_current → STALE_REJECTION
Revision → immutable proposal, never overwrite
11 · Mechanism 4

Checkpoint 不是“存下来再打开”,而是验证后重建

stage receipts 绑定顺序与 artifact identity
重跑上游时下游产物必须失效

Retrieve

before: s₀
after: s₁
artifact: a₁
prev: ρ₀

Evidence

before: s₁
after: s₂
artifact: a₂
prev: ρ₁

Decision

before: s₂
after: s₃
artifact: a₃
prev: ρ₂

Verify

before: s₃
after: s₄
artifact: a₄
prev: ρ₃

1
验证 task identity
与 prerequisite presence
→
2
重算 artifact hashes
核对 receipts
→
3
按合法转移 replay
并 invalidate downstream
不会盲信序列化 process object;tampered / missing / mismatched artifact 触发 recovery failure。
12 · Mechanism 5

最终输出是一种权限,不是默认动作

Completion gate 消费前面所有绑定
不闭合就保留 typed unresolved
✓证据记录可回放,source / section / span hash 有效
✓grounded calculation 的输入、表达式、输出和证据引用闭合
✓每个 decision 具有当前 fingerprint 与有效 verifier record
✓开放依赖、冲突、typed failures 达到允许的终态
✓输出格式合法,resource accounting 完整

EMIT

all completion predicates pass

or

TYPED STOP

missing · ambiguous · conflicting · stale · exhausted

13 · End-to-end example

一个 claim 如何穿过整条完整性链

示例强调 artifacts 与 acceptance gates
不是展示模型的隐藏推理
STEP 01

Evidence

定位财报段落,按 offset 重放并验证 span hash。

E19 · accepted
Hspan = 0a9d…fe31
STEP 02

Memory

记录 12.4%、期间、单位与 evidence pointer;清理无引用搜索历史。

σ_before = σ_after
8f2a…6c10
STEP 03

Decision

claim verdict 绑定 E19 和 K03,不只保存一段自然语言理由。

δ(C-07,E19,K03)
4bc1…aa90
STEP 04

Verify

独立核对主体、期间、单位、方向和 calculation provenance。

PASS · δ matched
ledger unchanged
STEP 05

Finalize

receipt chain 与 completion predicates 全部通过后,才允许输出。

terminal: VERIFIED
output authorized
14 · Failure closure

系统不是“尽量不出错”,而是让错误落到可处理终态

代表性故障注入与确定性响应
避免 silent corruption 与 blind retry
Injected conditionDetected bySystem responseWhy it matters
source span / offset driftspan_hash + round-tripreject evidence record摘要不能冒充原文
unit or qualifier removed in compressionσ_before ≠ σ_afterreject candidate state语义相似不能掩盖 protected drift
decision changed after package creationδ_supplied ≠ δ_currentstale rejectionVerifier 只批准当前支持关系
checkpoint artifact modifiedartifact_hash + receiptrecovery failure恢复状态不盲信持久化对象
one claim has invalid intermediate artifactclaim-local contractisolate claim; retain independent claims局部失败不污染整个任务
source information truly absentcompletion predicatestyped unresolved / abstain不把“没找到”伪装成确定答案
15 · Representative evidence

已有工程证据支持“完整性与闭合”,不等于全对

frozen development-mode implementation
所有数字保留解释边界
40 / 40
tasks passed deterministic protected-state checks
136
claims represented in evidence and memory gates
16 / 16
claims independently verified across 8 dimensions
5 / 5
decision ledgers unchanged through verification
100 / 100
runtime closure after one artifact-aware resume
360 / 360
claims reached verified operational state
95 + 5
ordinary answers + explicit typed abstentions
−72%
verification tokens on one anchor using shared context
Strict reading: 100/100 means runtime closure, not answer accuracy. 360/360 verified means protocol completion, not grader correctness. The 72% token reduction is one representative anchor, not a universal efficiency claim.
16 · Design boundary

不是“用了 hash”,而是这些机制怎样互相授权

individual components are known
the proposed subject matter is their nested coupling

Known component families

  • ReAct reasoning-action loop
  • RAG and source citations
  • prompt / memory compression
  • self-verification and critic agents
  • graph persistence and checkpoints
  • append-only or hash-linked logs
NOT
+

Proposed coupled mechanism

  • exact source record authorizes protected state
  • signature equality authorizes compressed state
  • current fingerprint authorizes verifier result
  • receipt identity authorizes recovery replay
  • the same bindings authorize final output
  • any broken dependency fails closed
边界:单个组件并不构成完整方案。需要验证的是连续授权关系能否减少 silent corruption,并以可控成本维持失败闭锁。
17 · Implementation map

三个执行面,共享一条状态完整性协议

同一组 identity 与 admissibility 规则
贯穿在线执行、状态管理和故障恢复

Three execution surfaces

核心约束保持一致,但每个执行面承担不同职责。

Runtime · bounded state transitions
State service · identity & lineage
Recovery path · validation & replay

Evidence & compression

multi-level hashes, absence record, protected fields, replaceable history, compression audit

Decision & verification

grounded calculation, canonical fingerprint, eight checks, non-overwrite, no-op rejection

Recovery & completion

receipt fields, validated replay, downstream invalidation, typed unresolved reasons

Distributed execution

model namespace, parallel workers, shared audit record, cross-domain documents

Typed recovery

failure code, deterministic flag, bounded retry / rewind / stop policy

Local containment

monotonic entailment and claim-local failure containment

18 · Closing the loop

现在,可以回答开头的问题

相同答案不代表相同执行
有效性来自可验证的状态链
01

要防什么?
证据、记忆、决策与恢复在阶段边界上发生 silent corruption。

02

怎么防?
五层内容绑定让每个下游动作都消费当前、可重放的上游状态。

03

失败怎么办?
拒绝、回退、局部隔离或 typed stop;无效状态不能静默向后传播。

04

证据说明什么?
工程审计支持协议闭合与状态完整性,不把它写成答案全对。

Next: 组件消融 · 故障注入 · 跨域验证 · 完整性—成本 Pareto 分析
Takeaway

答案相同,不等于
执行有效

可回放证据 → 受保护状态 → 当前决策
→ 合法恢复 → 授权输出

状态身份无法证明,就不应继续执行。