Repository navigation
I-02H/I-02I1-I3: 整改闭环与版本化 CSV 报告执行及下载 - #11
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
本次交付第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项通过;业务单独暂存树也执行同一套件。PYTEST_ADDOPTS=-k "report or remediation or structure":73项通过、374项未选中;MySQL8.0.33、head=0002_report_object_version、43表/115外键。仅创建随机端口/临时datadir/schema,不连接既有数据库。--check及设计验收通过。风险、审批与回滚
涉及数据库、权限、审计与整改状态机,按根目录
CONTRIBUTING.md须两名协作者共同确认,作者不得批准自己的PR。使用Squash merge,先完成自动检查和独立审查。报告开关默认关闭,仅dev/test;PDF、完成通知、过期状态处理/对象清理、真实MinIO/IAM/TLS与UI未交付。SDK Stubber与本地签名不能代替真实存储验收。
回滚先停publisher、排空报告消费者并关闭
WORKER_REPORT_EXPORT_ENABLED,回退应用版本;保留已追加列、对象版本、任务/快照和审计历史。有数据时不以downgrade或删除对象回退。