feat: audit-of-audit sampling rules (golden set and critical paths)
- cloud/audit_sampling.py (pure, stdlib): mandatory sampling (1.0) for rebuild cases and for third-failure near-complete cases whose continuation round still failed; random sampling for the rest (normal 0.10, critical-path 0.50, ceil so small groups are never rounded to zero, seed required and recorded for reproducibility). - Wrong-verdict handling: correct the original conclusion and retrigger the corresponding flow (wrong pushback -> cancel_pushback_and_rerun_audit; wrong rebuild -> halt_rebuild_and_restore; wrong pass -> reopen_audit_and_pushback; unknown original -> escalate_to_human); every result, correct or corrected, is appended to the audit-of-audit record. - Golden-set approval checklist: list reviewed, criteria defined, sample exclusion, approver+timestamp -- all human-confirmed before approval; sample entries (sample=True or sample- ids) are dropped and counted, never counted as golden. - metrics.build_report gains an optional sampling_plan section; without a plan it states sampling is pending, never implying the audit was re-examined.
This commit is contained in:
1 parent
dba6536ac2
commit
f1f8c8bf62
4 files changed
+455
-1
No files matched your search
@@ -64,3 +64,32 @@ workflow——第 2 轨拥有 lint/类型/安扫,本轨不碰。
|
||||
推翻率 0.30)只是测试用初值,报告标注
|
||||
`thresholds_source: "default_unapproved"`;生产阈值须人工拍板后
|
||||
以 `thresholds_source: "human_approved"` 传入,见待审定清单。
|
||||
|
||||
## 审计的审计:抽查口径(`cloud/audit_sampling.py`,纯函数)
|
||||
|
||||
审计结论本身要被人工抽查,抽查规则可测试、可核查,不留
|
||||
“定期复核”口号:
|
||||
|
||||
- **必抽(比例 1.0)**:推倒重做案例必抽;第三次失败根因判为
|
||||
接近完成、续轮仍 fail 的案例必抽。接近完成但续轮成功的、
|
||||
第 1/2 次失败接近完成的,均不属必抽(阈值就是第三次)。
|
||||
- **随机抽查**:其余案例按组抽取,普通案例默认 0.10,关键路径
|
||||
案例默认 0.50;小数组 ceil 取整,绝不因四舍五入抽到 0。
|
||||
抽取须带 seed(`select_sample` 无 seed 即报错),seed 记入
|
||||
抽查计划,抽取结果可复现、可事后核查。
|
||||
- **抽查结果处理**:抽查判审计正确 → 只记一条审计的审计记录,
|
||||
原结论不动;判错 → 纠正原结论并重新触发相应流程:错发推回
|
||||
→ `cancel_pushback_and_rerun_audit`;错发推倒 →
|
||||
`halt_rebuild_and_restore`(旧实现按推倒规则保存在 git 历史,
|
||||
可恢复);错放行 → `reopen_audit_and_pushback`;原结论未知
|
||||
→ `escalate_to_human`,绝不编造触发动作。每条结果(无论对错)
|
||||
都须记入审计的审计记录,未记入即视为未发生。
|
||||
- **金任务审定清单**(`golden_approval_checklist`):任务清单人工
|
||||
复核、每任务验收标准人工定义、样本排除、审定人+时间记录,
|
||||
四项全 done 且至少留一个非样本任务才算批准;样本任务
|
||||
(`sample=True` 或 id 以 `sample-` 开头)一律从金任务集中剔除
|
||||
并计数,示例文件永远不算金任务。报告的 `sampling` 段在无抽查
|
||||
计划时明写 pending,不暗示审计已被复核。
|
||||
|
||||
待人工项(单独列):金任务集审定清单的四项人工确认;抽查 seed
|
||||
的记录与保管;生产抽查比例拍板(默认值 0.10/0.50 只是测试初值)。
|
||||
Reference in new issue
Block a user