Skip to content

feat: compare verified delivery bundles - #7

Merged
fly1d merged 2 commits into
mainfrom
codex/compare-delivery-bundles
Aug 12, 2026
Merged

feat: compare verified delivery bundles#7
fly1d merged 2 commits into
mainfrom
codex/compare-delivery-bundles

Conversation

@fly1d

@fly1d fly1d commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Closes #6

变更目的

14 天付费试点已经能生成并校验基线与复测交付包,但顾问端仍需手工导入工作台生成整改结论。本 PR 新增 compare-deliveries,把“两个已验证客户包 -> 可审计整改复测结果”收敛成一条命令,降低每个客户的交付成本。

风险等级

  • 低:文档、文案、非行为性测试数据
  • 中:诊断规则、API、界面或持久化行为
  • 高:凭据、网络访问、生产数据、自动化操作或部署

验证

  • make verify:41 项通过
  • make smoke
  • 新行为有自动测试或说明无法自动化的原因
  • 界面未改动
  • Python 3.9.6 与 3.12.13 完整测试通过
  • Python 3.9/3.12 生成 Markdown 与 JSON 逐字节一致
  • 敏感信息模式扫描仅命中文档占位符和测试/实验凭据
  • git diff --check

Review 重点

  1. 两个 ZIP 均从一次内存读取中完成规范容器、schema、哈希、诊断和报告重建校验,比较阶段不会二次读取输入。
  2. 相同包、不同伪名集群/脱敏映射、时间倒置和无意覆盖均失败,且不会留下部分输出或临时文件。
  3. 报告只使用固定标签,不包含客户控制的输入文件名;但仍包含伪名、时间、规模、速率和风险证据,文档要求按客户伪名化数据处理。

威胁模型与失败路径

  • 不读取脱敏密钥、不访问网络、不写 SQLite。
  • 两个交付包都必须由当前同一 RabbitMQ Guard 版本重建验证。
  • 输出使用同目录临时文件和 os.link 不覆盖发布;目标已存在时在输入解析前失败。
  • ZIP 无效、内容篡改、不同脱敏映射、采集时间倒置或发布竞争时不发布报告。
  • 集群伪名一致不是客户身份或来源证明,采集时间不是可信时间戳,ZIP SHA-256 也不是签名。

回滚

Squash revert 本 PR 即可恢复 0.4.0 行为。现有 deliververify-delivery、工作台、SQLite 和交付包格式均未迁移或修改。

数据与安全

  • 不记录 RabbitMQ 密码或其他密钥
  • 不扩大默认网络访问范围
  • 合成数据仍明确标注为 synthetic
  • 复测输出纳入客户数据保留、访问控制和试点结束删除约定

@fly1d fly1d left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Completed a focused high-risk review for the customer delivery comparison path. No blocking findings remain.

Review found and fixed one identity gap before merge: matching only the pseudonymized cluster name could compare the same-named cluster at a different Management API address. Commit f055043 now requires both the cluster and capture-source pseudonyms to match, with a regression test and explicit documentation that this still is not physical cluster identity proof.

Final review covered:

  • both ZIP files are fully verified from their single in-memory reads before comparison
  • canonical ZIP, schema, hash, diagnostic reconstruction, and report reconstruction checks remain unchanged
  • same-bundle, different redaction mapping, different capture source, and reversed-time inputs fail closed
  • output refuses overwrite, publishes with a same-directory hard link, and cleans temporary files on failure
  • customer-controlled filenames and raw identifiers do not enter Markdown or JSON output
  • comparison artifacts are explicitly treated as pseudonymized customer data
  • Markdown and JSON bytes are deterministic across Python 3.9 and 3.12
  • existing deliver, verify-delivery, workbench, SQLite, and bundle-format contracts remain compatible

Required CI is green: Unit tests (3.9), Unit tests (3.12), and Smoke test.

@fly1d
fly1d merged commit 9ab32ed into main Aug 12, 2026
3 checks passed
@fly1d
fly1d deleted the codex/compare-delivery-bundles branch August 12, 2026 02:30
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.

Add verified baseline-to-followup delivery comparison

1 participant