fix: 验收阶梯与治理覆盖面修复 (#5 #6 #7 #8) - #12
Draft
odinwang wants to merge 1 commit into
Draft
Conversation
四个问题同属一类:机制本身正确,但验证的绑定方式或覆盖面有缺口。 #5 L5 门禁写死了数据修复前的 GMV 常量,导致 test_all.sh 必然失败。 改为 SQL 不变量判定(四条路径两两相等 + 非空),不再与具体数据版本绑定; GMV 数值仍打印供人阅读,但不参与 pass/fail。 #6 web/catalog.json 快照早于 2026-08-06 重灌,线上 demo 与文档呈现两套数字。 快照刷新到 91,294,056 行;deploy_web.sh 默认 --fresh,并新增 check_catalog_freshness.py 作为部署前闸门 —— 快照早于数据即拒绝部署, 让"忘了重生成"不再依赖记忆。 #7 三个验证资产未接入阶梯: - audit/run.py 在 test-plan 中显式列为人读层(无 PASS/FAIL,不进自动门禁) - run_eval.py 新增 --cases,cases_traps.json 的三个陷阱用例接入 L7 - manifest/render.py --check 接入 L0 - genlib/selftest.py 加 LEGACY 标注(随 v1 一同保留不维护) #8 新增 database/redshift/data_classification.yaml:48 张表、476 列全部审阅, 敏感列记录 level / treatment / 理由。reconcile.py 增加第七类检查 (治理覆盖面):声明为 pii 却无脱敏策略、声明为 restricted 却可 SELECT、 库中存在但未登记的列,均报错 —— 新增列默认不受保护的缺口由此闭合。 snapshot.py 的 MASKED_COLUMNS 改为从清单派生而非硬编码。 04_governance.sql 的措辞改为指向分类清单,不再暗示明细表 PII 已全覆盖。 离线验证:5 个 L0 自检 + 线上渲染契约全部通过。 云端验证(Glue 重建、真实 DDM/GRANT、L5 四路径、陷阱评测)待补。
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.
四个 issue 同属一类:机制本身正确,但验证的绑定方式或覆盖面有缺口。分别修复如下。
Closes #5, closes #6, closes #7, closes #8.
#5 L5 门禁与数据版本解绑
scripts/test_all.sh原先硬编码数据修复前的 GMV149685621.44,重灌后实际值为151238025.32,任何人跑全量测试都会在 L5 红 —— 而四条路径其实完全一致。按 issue 中的建议,没有把常量换成新数字(那样下次重灌又坏,这个坑已是第二次),改为让 SQL 返回不变量判定:四条路径两两相等且非空才通过。GMV 数值仍然打印供人阅读,但不再参与 pass/fail。
#6 元数据快照新鲜度闸门
web/catalog.json刷新到91,294,056行,与knowledge/connection.md、docs/data-walkthrough.md对齐。除刷新外落实了 issue 建议的对等检查:新增
scripts/deploy/check_catalog_freshness.py,deploy_web.sh默认--fresh并在部署前比对快照生成时间与数据构建时间,快照早于数据即拒绝部署。"忘了重生成"从此不依赖谁记得。#7 三个验证资产接入阶梯
scripts/audit/run.py:在docs/test-plan-v2.md中显式列为人读层,注明无 PASS/FAIL、不进自动门禁,并说明原因(L5 需要拿分布形状对照真实业务经验,不可机器判定)eval/cases_traps.json:run_eval.py新增--cases,三个陷阱用例接入 L7 —— 此前从未执行过scripts/manifest/render.py --check:接入 L0(秒级、无云依赖)scripts/genlib/selftest.py:加 LEGACY 标注,与 v1 一同保留不维护同时修正 issue 末尾列出的文档漂移(断言条数、命令个数、L6 实际覆盖
render_test_prod.mjs)。#8 数据分类清单 + 第七类对账检查
新增
database/redshift/data_classification.yaml:48 张表、476 列全部审阅,敏感列记录level/treatment/ 理由。采用与schema_manifest.yaml相同的 declare → validate → generate 模式。scripts/glue/reconcile.py增加第七类检查(治理覆盖面),三种情况报错:pii但svv_attached_masking_policy中无对应策略restricted但角色仍可 SELECTscripts/consistency/snapshot.py的MASKED_COLUMNS改为从清单派生而非硬编码。04_governance.sql:49的措辞改为指向分类清单,不再暗示明细表 PII 已全覆盖。关于 issue 中那条观察(只读角色查
svv_*返回 0 行而非报错):已在 test-plan 的 L4 注明该层需管理员凭证,并记录反向测试(三个 permission denied + 三个脱敏值)才是审计角色下验证治理的正确方式。验证状态
离线全绿:
保持 draft,因为云端验证尚未执行:Glue 重注册 + 七类对账、真实 DDM/GRANT negative test、L5 四路径不变量、L7 陷阱用例。补完后转为 ready for review。