Skip to content

test: measure report integrity cost and preserve mutation guards - #247

Merged
codeasier merged 2 commits into
mainfrom
test/238-report-integrity-cost
Oct 11, 2026
Merged

codeasier merged 2 commits into
mainfrom
test/238-report-integrity-cost

Conversation

@codeasier

Copy link
Copy Markdown
Owner

范围和结论

Refs #238;本 PR 不是减少扫描的性能修复,不关闭 #238。只新增报告级计量/故障回归和中英文成本说明,零产品 src 修改。保留 strong 的所有现有检查点,不把默认校验降为 inode/size/mtime,也不把顺序逐片复制当成目录原子快照。

实测正常 report:cold 4(B+M)、warm 3(B+M);无峰值分支 cold 3(B+M)、warm 2(B+M)。B 为全部成员字节、M 为manifest字节;是完整 hash 的逻辑读取量,不等于物理磁盘I/O或耗时。

原生稀疏空范围真实可达;compat无峰值使用明确标注的结果分支注入,仍运行真实inspect/validator/guard/hash,不冒充合法兼容产物的空峰值。

验证

基线 main ffa71df0ddf0fb5f17a904f4092898a27287d21e;审核 tree 8eb7a841fd35fd0f0e836b8e3bc49283ce2c49c4。

  • 47 new tests;最终focused/regression 212 passed(包含47新增,不重复相加)。
  • 全部non-slow 2348 passed / 14 skipped / 11 slow deselected。fixture gate7passed。
  • 独立审查67tests通过,无阻塞发现;确认0src变化。
  • 两个guard均拒绝隐藏generation token下的内容/manifest/另一设备变更;guard1阻止进入attribution后才恢复源的绕过。
  • 实际统计原hash读取返回的字节,17-byte故障确认中断未虚计全文件,文件关闭与现有缓存行为保持。
  • 运行时移除guard1/2敏感性探针分别令2/6项测试因未抛错失败,仅测试侧注入,无产品修改。
  • Ruff/Black/diff通过,basedpyright0errors(既存warnings)。远端完整CI待终态。

进一步减少整遍校验需要证明仍保留当前拒绝源目录中途变更的合同,或另行明确批准不同的快照/不可变语义。本轮不作未经验证的提速承诺。保留草稿。

Copy link
Copy Markdown
Owner Author

检视结论:approve(范围限定)

对照 #238:本 PR 零 src/ 改动,仅计量测试 + 文档;未削弱默认强验证;也未减少重复内容哈希遍数。作为「可测的完整性成本基线」可以合。

若目标是关闭 #238(减少默认模式下 report / 解析复用的重复哈希),还需要单独的产品修复 PR,且须先明确完整性合同(见 issue 评论:不可把默认 guard 改成仅比 mtime)。

复测:60 passed。本评论不 approve/merge。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant