feat(validation): 添加可执行的数据集完整性校验器 - #86
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.
背景
SCHEMA.md已定义 VulnGym 数据发布时需要满足的结构和跨文件不变量,但仓库目前缺少统一、可直接运行的校验入口。数据贡献者需要分别检查 JSONL、节点位置和 reports/entries 关联,容易遗漏数据漂移或编码损坏。本 PR 不修改现有数据,新增一个纯标准库数据集完整性校验器。
实现
examples/validate_dataset.py。"start-end"两种行号形式。entries.jsonl与reports.jsonl的双向关联:entry_ids是否完整、有序且无重复;num_entries是否准确;vuln_ids是否等于 entries 的规范化并集。U+FFFD、典型乱码标记,以及中文旁异常 ASCII?。--entries、--reports和--json-out,失败时返回非零退出码,可直接接入 CI。验证
验证截图
单元测试与分支状态
数据集完整性与远端校验