Repository navigation
fix(audit): parseClaimCounts 区分 passed/failed 与 passed/total(M13 切片 1,#178) - #179
Merged
Merged
Conversation
…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.
This was referenced Nov 12, 2026
Merged
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.
Fixes #178
改动
src/core/audit.jsparseClaimCounts:首条 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 通过。未做