Repository navigation
data_validation: shared dataset-validator core; findings annotated on PR diffs - #97
Merged
Merged
Conversation
… PR diffs - datasets/_shared/validate_lib.py holds what the exploit, vulnerability, risk-assessment, rag and incident validators had copied five times: schema with format checks, DSGAI IDs at any depth, ID matches file name, duplicate IDs, output and exit codes. Each validate.py now states only its schema, ID field and dataset-specific rules (exploit: ATLAS ID in its mapping; vulnerability: CVE ID matches cve_id). The ID/file-name and duplicate checks are new for three datasets; all current data passes. agentdataflow and the Turkish pairs validators keep their own code. - run_all_checks.py --github prints GitHub Actions annotations for every shared-check finding and dataset-validator failure, on the exact line (validators/json_lines.py maps a JSON pointer to its line). CI uses it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.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.
Summary
Items 16–17 of the data-validation review.
One shared core for the dataset validators (17)
datasets/_shared/validate_lib.pyreplaces five near-identical copies. The copies had already drifted: format checking was missing from three of them until #93. The shared core does:format(dates, URIs) enforced;dsgai_mapping,dsgai_id,addresses_dsgai), which covers the risk-assessment nesting;Each
validate.py(exploit, vulnerability, riskassessment, rag, incident) now only states its schema, ID field and dataset-specific rules. Those rules are unchanged: exploit's "an ATLAS exploit_id must be in mitre_atlas_mapping" and vulnerability's "a CVE vulnerability_id must equal cve_id". Tests run the real validators on broken copies to prove both still fire.The ID-matches-file-name and duplicate-ID checks are new for exploit, vulnerability and riskassessment; all current entries pass. The agentdataflow validator (different structure, contributor-designed) and the Turkish pairs validator (contributor-owned) keep their own code. Validators still need only
jsonschema.Findings on the PR diff (16)
run_all_checks.py --github(used in CI) prints a GitHub Actions annotation for every shared-check finding and every dataset-validator failure, on the exact line:validators/json_lines.pymaps each finding's JSON pointer to its line. Unlike SARIF upload, workflow annotations also work on PRs from forks, which is how most contributions arrive.Smoke test on a copy with two planted errors (an unknown DSGAI ID and an invalid rating): five annotations, on lines 8 (
dsgai_mapping) and 11 (qualitative), from both the dataset validator and the shared checks.Verification
actionlintis clean.🤖 Generated with Claude Code