关于「拦截位置:写入前、写入后与出版前,门禁坏了放行还是拒绝」,《硬门禁与软提示衰减》给出的定量结论是什么?

结论:第四章比较写入前、写入后与出版前三种拦截位置,组合设计 E 在钩子故障率 0.010 时成本只有 0.60。

数据口径:软提醒按比例起作用,各层独立时残余违规率是漏过率之积,示意参数下四层之后仍是 0.0048,不是零;只有确定性的代码门禁能在它自己定义的模式类别之内做到零。 书中参数均为示意;全部计算由书中程序生成。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 与结论吻合的打印值: 0.010, 0.60

designeescapesblockscost
save hook fail-open0.0010.00960.001.15
save hook fail-closed0.0010.00002.006.00
E open save + closed0.0010.00000.020.06
save hook fail-open0.0100.09600.0011.52
save hook fail-closed0.0100.000020.0060.00
E open save + closed0.0100.00000.200.60
in E an escape needs the save hook down and the publish gate
down at once; a closed publish gate turns that into a block
查看完整验算程序
# Chapter 4. p42: when the gate itself breaks, open or closed?
# A save hook crashes with probability e per call. Fail-open lets the
# save through unchecked; fail-closed blocks it. Per week: N = 2000
# saves, a share r = 0.0048 of them carry an in-class violation after
# the soft layers (p11), M = 20 publish-gate runs. Costs (minutes,
# illustrative): a violation that reaches readers 120, a wrong block
# of a clean save 3. Design E pairs a fail-open save hook with a
# fail-closed publish gate: availability where work is done, safety
# where work leaves.
N, R, M = 2000, 0.0048, 20
C_ESC, C_BLK = 120.0, 3.0
print("%-22s %7s %10s %10s %9s" % ("design", "e", "escapes", "blocks",
                                   "cost"))
for e in (0.001, 0.01):
    designs = [
        ("save hook fail-open", N * R * e, 0.0),
        ("save hook fail-closed", 0.0, N * e),
        ("E open save + closed", 0.0, M * e),
    ]
    for name, esc, blk in designs:
        cost = esc * C_ESC + blk * C_BLK
        print("%-22s %7.3f %10.4f %10.2f %9.2f" % (name, e, esc, blk,
                                                   cost))
print("in E an escape needs the save hook down and the publish gate")
print("down at once; a closed publish gate turns that into a block")

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《客户端生命周期硬门禁工程、软提示遵从率轮次衰减与保存前物理拦截状态机母典》第 4 章「拦截位置:写入前、写入后与出版前,门禁坏了放行还是拒绝」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-256 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026256,
  author    = {Fan, Yafu},
  title     = {Hard Gates across the Client Lifecycle: the Decay of Soft-Prompt Compliance over Turns and State Machines for Interception before Publication},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论