Repository navigation
data_validation: implement the validators and QC tools, fix reference data - #89
Merged
Merged
Conversation
… data The validators/ and qc_tools/ scripts were stubs that printed "contributions welcome", the tests passed without testing anything, and the MITRE ATLAS reference table had the wrong name for 21 of its 28 IDs. - run_all_checks.py also finds validate.py in dataset sub-collections (the Turkish pairs validator now runs in CI), gives each a timeout, and then runs the shared checks on every data file. Errors fail the run; heuristic hits are warnings (--strict makes them fail). #87's output format and exit codes are kept. - validators/: schema (finds each file's schema; covers datasets with no validate.py, folding in completeness_check), DSGAI IDs, CVE/GHSA/CWE/ATLAS IDs, anonymization patterns, duplicates. Shared helpers in _common.py. - qc_tools/: coverage report, anomaly list, cross-dataset reference check. CI posts the report and anomalies to the job summary. - reference_data/: ATLAS (2026.09, with retired IDs marked) and CWE (4.20) tables regenerated from MITRE by update_reference_data.py; sources in SOURCES.md. Header-only framework control CSVs removed. - datasets/_shared/dsgai_taxonomy.json: DSGAI07 and DSGAI12 use the paper's full titles, matching the README and dsgai_entries.json. - Real tests for every check (82); CI runs the whole suite. - README and SETUP describe what exists; Python 3.10+; unused pandas and regex dependencies dropped; venv/ gitignored as SETUP already claimed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| if not m or m.end() != len(text): | ||
| # "CVE-2024-1234-style" or a sub-technique suffix is not malformed. | ||
| if m and kind in ("CVE", "GHSA", "CWE") and text[m.end()] == "-": | ||
| text = m.group(0) |
| if base is not None: | ||
| try: | ||
| shown = self.path.resolve().relative_to(base.resolve()) | ||
| except ValueError: |
…path) rag_dataset and incident_dataset get their own validate.py in #92, crossframework_mapping_dataset is superseded by the crosswalk repo, and RAG-0001.json moves to rag_dataset/entries/. Update the README dataset table, the example paths in README, SETUP and the validator docstrings, and the suggested first contribution. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Updated to match #92: rag and incident now have their own |
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
Builds on #87. Before this PR,
data_validation/mostly described checks that didn't exist:validators/scripts and all threeqc_tools/scripts were stubs that printed "contributions welcome".reference_data/mitre_atlas_techniques.csvhad the wrong name for 21 of its 28 IDs. For example,AML.T0046was listed as "Prompt Injection - Direct" but is officially "Spamming AI System with Chaff Data".Runner (
run_all_checks.py)validate.pyinside a dataset's sub-folders, sopromptinj_dataextraction_testcases/tr_turkish_conversation_prompt_injection_pairsnow runs in CI.--timeout).--verbose, and fail the run only with--strict.Shared checks (
validators/)schema_validator$schemakey, then the nearestschema.json, thendata_validation/schemas/dsgai_mapping_check_shared/dsgai_taxonomy.jsoncrossref_validatoranonymization_scannerdedup_checkercompleteness_check.pyis removed: required fields and allowed values are exactly what schema validation checks.QC tools (
qc_tools/)bias_report: DSGAI × dataset coverage matrix and distributions of severity and category fields.anomaly_detector: one DSGAI entry dominating a dataset, records with far more mappings than usual, skewed fields.consistency_check: fails on dangling internal references (DSGAI-VULN-…,DSGAI-EXP-…,DSGAI-RA-…).Reference data
update_reference_data.pyregenerates the ATLAS table (release 2026.09, 208 techniques, with 3 retired IDs marked) and the CWE table (4.20, 1,450 entries) from MITRE's published data. Versions are recorded inreference_data/SOURCES.md.framework_control_ids/*.csvfiles and the 11-row NIST CSF sample are removed. Nothing read them, and complete ISO and CIS control lists can't be redistributed.datasets/_shared/dsgai_taxonomy.json: DSGAI07 and DSGAI12 now use the paper's full titles, matching the main README anddsgai_entries.json. A test keeps the two DSGAI lists in sync.Tests, CI and docs
data_validation/testssuite. The fixtures are updated to the current schemas.pandasandregexdependencies are dropped.venv/is now gitignored (SETUP already claimed it was).Results on current data
AML.T0019,AML.T0058andAML.T0104were merged intoAML.T0115.000–.002("Publish Poisoned AI Artifacts"). Affected entries:AML.T0019.json,AML.T0058.json,AML.T0110.json,DSGAI-EXP-rome-targeted-fact-editing.json.tr_altayduel_testcases.jsonhas no schema. It's an aggregate file, and its 5 cases don't matchpromptinj_testcase.schema.json.Not in this PR
exploit_idrenames files, so it should be a separate dataset PR.Checklist
python data_validation/run_all_checks.py)python -m pytest data_validation/tests(82 passed)🤖 Generated with Claude Code