Skip to content

feat: add trace cleanup tool#67

Open
baoyingshenjing wants to merge 1 commit into
Tencent:mainfrom
baoyingshenjing:feat/issue-5-trace-cleanup
Open

feat: add trace cleanup tool#67
baoyingshenjing wants to merge 1 commit into
Tencent:mainfrom
baoyingshenjing:feat/issue-5-trace-cleanup

Conversation

@baoyingshenjing

@baoyingshenjing baoyingshenjing commented Jul 23, 2026

Copy link
Copy Markdown

Summary

Closes #5.

本 PR 为 VulnGym 新增保守、可审计的 trace 结构检测与清理工具,主要支持:

  • 检测 trace 内部 {file, line, code} 完全相同的重复节点
  • 检测同文件内 entry point 之前和 critical operation 之后的结构异常
  • 支持整数和 "start-end" 区间行号
  • 跨文件节点不按行号比较、不排序、不删除
  • 默认保护 verify=1 的人工审核数据
  • 输出检测报告、人工复核清单和修复日志
  • 提供单元测试与完整数据集回归测试

Safety Policy

  • 默认只报告顺序异常,不直接删除
  • 只自动删除 verify=0desc 一致的精确重复节点
  • desc 冲突的重复节点进入人工复核
  • 不将源码行号顺序等同于实际执行顺序
  • 不直接修改原始 data/entries.jsonl

Validation

  • 完整扫描 408 条 entries
  • 扫描 2073 个 trace 节点
  • 检测到 7 组精确重复节点
  • 检测到 139 个 before-entry findings
  • 检测到 237 个 after-critical findings
  • 默认保守修复产生 0 个数据修改
  • 修复输出与原始输入 SHA-256 一致
  • 单元测试全部通过

Files

  • tools/trace_cleanup/
  • tests/trace_cleanup/
  • reports/trace_cleanup/
  • data/entries.trace_fixed.jsonl

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.

【2026犀牛鸟】清理 VulnGym 调用链顺序异常和重复节点

1 participant