Skip to content

I-02H/I-02I1-I3: 整改闭环与版本化 CSV 报告执行及下载 - #11

Merged
SayQuan1 merged 1 commit into
mainfrom
wsq/i-02-remediation-reports
Oct 7, 2026
Merged

SayQuan1 merged 1 commit into
mainfrom
wsq/i-02-remediation-reports

Conversation

@SayQuan1

@SayQuan1 SayQuan1 commented Oct 7, 2026

Copy link
Copy Markdown
Owner

本次交付第27–30批:确认后的风险可进入整改与独立复查流程;CSV报告从冻结快照异步生成,围栏提交登记准确对象版本,创建人或完整范围admin在重新授权后取得60秒固定版本下载签名。

关联任务:I-02H、I-02I1/I2/I3、I-03A2;关联需求API-01/02、SEC-01/02、JOB-04、EXPORT-01的本批子范围,未关闭完整部署/导出验收。

变更文件

  • apps/api/app/{remediation,reports}.py、packages/{application,persistence}/{remediation,reports}.py:租户/实验室授权、版本与幂等、整改证据和独立复查。
  • apps/worker/report_export.py、packages/{application,domain,persistence}/report_execution.py:CSV防公式注入、有界生成/上传、租约/心跳/重试/围栏提交,独立q.reports门禁。
  • packages/domain/report_download.py、packages/storage/s3.py:完整快照范围重检、精确key/SHA/VersionId、固定60秒GET签名。
  • packages/persistence/migrations/versions/0002_report_object_version.py、tools/design/data_model.py及生成DDL:追加nullable对象版本/大小,初始迁移保持冻结。
  • 测试与docs/08-delivery/27–30、架构/接口/开发指南同步;模型/CPU适配不包含在这个PR中。

验证

  • python -m pytest tests/business tests/domain tests/security tests/protocol -q:1550项通过;业务单独暂存树也执行同一套件。
  • 隔离MySQL runner,PYTEST_ADDOPTS=-k "report or remediation or structure":73项通过、374项未选中;MySQL8.0.33、head=0002_report_object_version、43表/115外键。仅创建随机端口/临时datadir/schema,不连接既有数据库。
  • 业务独立暂存树:15个fixture测试、Ruff check/format、生成契约--check及设计验收通过。
  • 历史完整持久化446项证据在第29批;本次不把定向73项冒充完整447项执行。远程CI由本PR运行。

风险、审批与回滚

涉及数据库、权限、审计与整改状态机,按根目录CONTRIBUTING.md须两名协作者共同确认,作者不得批准自己的PR。使用Squash merge,先完成自动检查和独立审查。

报告开关默认关闭,仅dev/test;PDF、完成通知、过期状态处理/对象清理、真实MinIO/IAM/TLS与UI未交付。SDK Stubber与本地签名不能代替真实存储验收。

回滚先停publisher、排空报告消费者并关闭WORKER_REPORT_EXPORT_ENABLED,回退应用版本;保留已追加列、对象版本、任务/快照和审计历史。有数据时不以downgrade或删除对象回退。

Deliver batches 27-30: tenant-scoped remediation commands, frozen report
requests, fenced CSV export execution, and exact-version download grants.
Add the nullable report object_version and size_bytes migration while
preserving the initial migration and existing report snapshots.

Validation: business/domain/security/protocol 1550 passed; disposable
MySQL 8.0.33 report/remediation/structure subset 73 passed (374 deselected).
Business-only staged tree: generated contracts, design checks, Ruff and
15 fixture tests passed. Existing model changes are a separate stacked PR.

Rollback: stop report publishing, drain consumers and disable the report
worker; revert application code while preserving schema, objects, tasks
and audit history. Do not downgrade populated databases or delete objects.

@SayQuan987 SayQuan987 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Pass

@SayQuan1
SayQuan1 merged commit 27c847c into main Oct 7, 2026
10 checks passed
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.

2 participants