code-to10 v6 A12: scorecard example renamed to 2026-10-31 snapshot with timeliness fields
(cherry picked from commit 633cdbc94e7a7b0c5d3b0b135189faf3de6673f4) Reconcile-port: handler_admin.py hunks redirected into cloud/server.py _audit_scorecard (target keeps 6-mixin split; scorecard module itself applied cleanly).
This commit is contained in:
1 parent
bbc7103dec
commit
c25854fff7
4 files changed
+39
-19
No files matched your search
+13
-7
@@ -9035,17 +9035,20 @@ pid 须为整数、address 须为字符串,否则 400(注册表里的
|
||||
|
||||
权限:与 /metrics 同款,任意项目成员即可读(不要求 owner),
|
||||
但本端点不统计任何项目数据、不写库、不写账本、不改链头、
|
||||
不触发推回或重审——它只是把评分卡模块的当前状态报出来。
|
||||
主基底(main)上没有存放结构化评分证据的表(metrics-report、
|
||||
台账、账本、门禁模块都在未合并的 PR 分支上),所以本端点
|
||||
在主基底上返回的只能是“全部未知/已知未强制”的诚实状态,
|
||||
总体必然是不达标;调用方要拿到真实分数,必须显式把结构化
|
||||
不触发推回或重审——它只返回评分卡模块的一张历史示例卡。
|
||||
该示例卡的证据是 2026-10-31 的快照(见
|
||||
``example_scorecard_as_of_2026_10_31``),此后未重新
|
||||
实测,响应里以 ``evidence_as_of`` /
|
||||
``not_current_system_score`` 明示;调用方绝不能把它读
|
||||
成当前系统得分。调用方要拿到真实分数,必须显式把结构化
|
||||
证据传给 cloud/audit_scorecard.py 的 build_scorecard(),
|
||||
端点本身绝不从测试文件、摘要文档、PR 描述里拼凑分数。
|
||||
阈值仍为测试默认值(``test_default_unapproved``),未拍板。
|
||||
"""
|
||||
try:
|
||||
from cloud.audit_scorecard import example_scorecard_current_state
|
||||
report = example_scorecard_current_state()
|
||||
from cloud.audit_scorecard import (
|
||||
example_scorecard_as_of_2026_10_31)
|
||||
report = example_scorecard_as_of_2026_10_31()
|
||||
except ImportError: # pragma: no cover - 导入失败时仍要诚实返回
|
||||
report = {
|
||||
"dimensions": [], "average_score": None,
|
||||
@@ -9054,6 +9057,9 @@ pid 须为整数、address 须为字符串,否则 400(注册表里的
|
||||
"missing_items": ["audit_scorecard_module_unavailable"],
|
||||
"untested_items": [],
|
||||
"thresholds_source": "test_default_unapproved",
|
||||
"evidence_as_of": "2026-10-31",
|
||||
"evidence_kind": "historical_example_snapshot",
|
||||
"not_current_system_score": True,
|
||||
}
|
||||
self._send_json(200, report)
|
||||
|
||||
|
||||
Reference in new issue
Block a user