Skip to content

fix(audit): parseClaimCounts 区分 passed/failed 与 passed/total(M13 切片 1,#178) - #179

Merged
surlymochan merged 1 commit into
mainfrom
m13s1-parse-claim-counts-178
Nov 12, 2026
Merged

surlymochan merged 1 commit into
mainfrom
m13s1-parse-claim-counts-178

Conversation

@surlymochan

Copy link
Copy Markdown
Owner

Fixes #178

改动

  • src/core/audit.js parseClaimCounts:首条 X/Y 正则不再一律当 passed/total。判定规则(已写进代码注释):第二数小于第一数时不可能是 total,判 passed/failed 口径(failed = 第二数,不设 total);第二数大于等于第一数时判 passed/total(failed = total - passed)。不改判定阈值,不回填历史账本。
  • test/xflow-audit.test.js:新增回归测试,覆盖 472/12 → {passed:472, failed:12}、240/0 → {passed:240, failed:0}、61/64 → {passed:61, total:64, failed:3} 及边界 240/240(total=passed,failed 0)、472 passed(无第二数)、0/5(failed 5)。

测试结果

  • 新回归测试通过;test/xflow-audit.test.js:62/65 通过,3 项失败为既有环境缺口(I6d 三项 pytest 回放测试因本机无 pytest 二进制报 spawnSync pytest ENOENT),已在干净 main(stash 后)复跑同一描述块确认同为 3 项失败,与本次改动无关。
  • 邻近套件 test/xflow-audit-batch.test.js、test/xflow-audit-go-rust.test.js、test/xflow-sarif.test.js:58/58 通过。

未做

…eClaimCounts (M13 slice 1, #178)

A total can never be smaller than the passed count, so when the
second number is smaller than the first it is the failed count
(472/12 -> failed 12, not -460); otherwise it is the total and
failed = total - passed (61/64 -> failed 3). Regression tests cover
both forms plus total==passed and no-second-number boundaries.
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.

M13 slice 1: parseClaimCounts 区分 passed/failed 与 passed/total+回归测试

1 participant