feat(tools): 添加增量 trace 结构回归门禁 - #87
Open
Qiyuanqiii wants to merge 1 commit into
Open
Conversation
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.
背景与定位
Related to #5
Issue #5 的现有实现主要集中在全量扫描、数据清理、修复产物和人工复核流程。当前 v0.1.4 数据仍包含 383 个需要处理或复核的结构 finding,直接将全量 finding 数量设为 CI 条件,会让后续所有数据 PR 持续失败。
本 PR 不再增加另一套全量清理器,而是提供一个独立的增量回归门禁:比较 baseline 与 candidate,只阻止本次修改新引入的 trace 结构问题。
增量判定语义
1。2。entries.jsonl。检测范围
{file, line, code}完全相同的重复节点。entry_point同文件且完全位于入口之前的节点。critical_operation同文件且完全位于关键操作之后的节点。"start-end"区间行号。稳定指纹
finding 指纹由
entry_id、类型、file、line、code和出现序号组成,不包含trace数组索引与desc。因此以下修改不会制造假回归:
同一节点新增第三次或第四次重复仍会被分别检测。
交付内容
scripts/check_trace_regressions.py:增量比较器及 JSON/Markdown 报告生成。scripts/README_trace_regression_gate.md:CI 用法、退出码、策略和限制。tests/test_trace_regression_gate.py:11 项边界及 CLI 回归测试。真实数据结果
门禁结果:
PASS383 个历史 finding 的组成与 Issue #5 全量检测口径一致:
验证命令
验证结果:
Ran 11 tests,OK。new=0、resolved=0、unchanged=383。git diff --check:通过。验证截图
本 PR 不关闭 Issue #5,也不替代现有历史清理和人工复核方案;它提供的是可立即用于后续数据变更的增量质量门禁。