# Epistemic Fold 测试与 Benchmark 规范 > 目标:证明 EF "不会忘错",然后才证明"更省"。 > 适用阶段:M0、M2、M3a、M1、M3b。 > 原则:machine-verifiable correctness 指标不允许用平均分掩盖单点失败。 --- # 1. 指标层级 ## 1.1 硬正确性指标 必须为零失败: - Archive Loss; - Exact Recall Mismatch; - Authority Loss; - State Staleness; - Missing Provenance; - Broken Tool Pair; - Unrecoverable committed checkpoint。 这些不接受 99%。 --- ## 1.2 行为指标 允许统计比较: - Task Success; - Duplicate Work Rate; - Recall Dependency Rate; - Context Regret; - State Ambiguity; - Trajectory divergence。 --- ## 1.3 成本/性能指标 - active prompt tokens; - summarizer tokens; - cache read/write(若 provider 有); - local stable-prefix bytes; - prefix mutation depth; - bundle disk size; - projection memory size; - latency。 --- # 2. 核心公式 ## 2.1 Authority Loss Rate \[ ALR= \frac{ missing\ active\ authoritative\ anchors }{ active\ authoritative\ anchors } \] M3a hard gate: \[ ALR=0 \] --- ## 2.2 State Staleness Rate \[ SSR= \frac{ superseded\ values\ shown\ as\ current }{ displayed\ current\ values } \] M3a hard gate: \[ SSR=0 \] --- ## 2.3 Duplicate Work Rate \[ DWR= \frac{ unnecessary\ repeated\ actions }{ post\text{-}fold\ actions } \] 重复动作包括: - 重读刚读过且无变化文件; - 重跑刚验证过且没有输入变化的测试; - 重搜相同问题; - 重新尝试已明确排除的路径; - 重开 verified-resolved failure。 --- ## 2.4 Context Regret \[ CR= \frac{ tokens\ recalled\ shortly\ after\ folding }{ tokens\ reclaimed } \] "shortly"建议先取后续 3–5 个 request。 --- ## 2.5 Prefix Mutation Amplification \[ PMA= \frac{ cache\text{-}equivalent\ invalidated\ tokens }{ reclaimed\ active\ tokens } \] 没有 provider cache telemetry 时,用: ```text first changed model-history token position ``` 估算 invalidated suffix。 --- ## 2.6 State Ambiguity Rate 对每个 current StateKey,统计 surface 中互相冲突的活跃值数量 \(n_k\): \[ SAR= \frac{ \sum_k \max(0,n_k-1) }{ |StateKeys| } \] 目标: \[ SAR_{EF} Prefix architecture 正确 和: > Provider 当前真的给缓存命中。 --- # 13. Gate ## M0 必须全绿: ```text ArchiveLoss = 0 RecallMismatch = 0 SurfaceCorruption = 0 PairingBreak = 0 ``` ## M2 必须: ```text FrozenPrefixInvariant = PASS FrontierMonotonic = PASS ContextBoundedPath = PASS TaskSuccess non-inferior ``` ## M3a 必须: ```text ALR = 0 SSR = 0 ProvenanceCoverage = 100% EvidenceOverridesNarrative = PASS ProjectionBounded = PASS ``` ## M1/M3b 不得导致: ```text TaskSuccess significant regression DWR significant increase ``` --- # 14. Stop Conditions 出现以下任一情况,暂停扩大功能: 1. Exact recall 不是 100% 可验证; 2. Bundle 与 Session lifecycle 无法可靠关联; 3. Prefix invariant 不能 machine-proof; 4. Projection 内存随历史线性增长; 5. M3 state correctness 不稳定; 6. EF task success 低于 Basic 且原因无法归结为修复项。 不要在 correctness 未闭合时继续做 M4/M5。