fix(data): repair inaccurate code locations#60
Open
Sam-Hui-dot wants to merge 1 commit into
Open
Conversation
Signed-off-by: Sam-Hui-dot <19303092837@163.com>
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.
Closes #4
Summary
This PR adds a conservative, reproducible workflow for auditing and repairing inaccurate code locations in VulnGym.
It:
entry_point,critical_operation, andtrace[*]node against the exact repository commit recorded by the entry;The original
data/entries.jsonlis not modified. The repaired dataset is written todata/entries.fixed.jsonl.Repair policy
Matching tolerates:
Location semantics are intentionally conservative:
lineremains a start anchor, including for multiline code;"start-end"value must match both range boundaries;Exact matching always runs first. A secondary annotation projection removes only clearly annotator-authored CJK
//or#suffixes from the snippet side. Source text and ordinary source comments are never broadly stripped.When a location changes, only explicit file or line anchors in
descare synchronized. Unrelated numbers such as第 1 步and descriptions without location references remain unchanged.Full-dataset results
The complete dataset was scanned:
Repair strategies:
nearby_unique;same_file_unique;The 29 manual-review rows consist of:
Each manual row includes a stable
review_id, anexpected_node_sha256, the review reason, candidate evidence, and a pinned source URL.Priority samples
entry-00103 trace[1]:605-614→606-614entry-00103 trace[2]:146-155→146-154entry-00185 trace[1]:75-82→76-82entry-00320: all six nodes already matchedentry-00511: all seven nodes already matchedExplicit line references in the affected
entry-00103descriptions were synchronized without changing step-number semantics.Audit artifacts
This PR includes:
data/entries.fixed.jsonl— complete repaired dataset;reports/fix_diff.csv— full before/after values, strategy, source URL, and source SHA-256 for every repair;reports/needs_human.csv— stable manual-review queue;reports/code_location_sources.csv— per-commit source coverage;reports/code_location_report.json— machine-readable counts and integrity hashes;reports/code_location_report.md— human-readable run summary;reports/code_location_acceptance_matrix.md— requirement-by-requirement evidence.All generated artifacts use deterministic ordering, UTF-8, LF line endings, and final newlines.
Independent verification
scripts/verify_code_location_outputs.pyverifies the generated artifacts independently from the repair resolver.It confirms that:
codefield was changed;Validation
Commands executed:
Additional checks completed: