audit: classify api round-trip failures by measured divergence and rank a worklist#225
Merged
Conversation
…upport opinion The classifier keyed categories (B/D/E/G) on the hand-authored `support` attribute in data/api.features.xml -- a prediction of round-trip behavior, not a measurement, and demonstrably wrong (part-group was marked full yet dropped data, #224). Ranking built on a fallible prediction is untrustworthy. Rework classification to be grounded only in what each expected/actual pair actually shows: - Drop the api.features.xml cross-reference entirely. Whether a drop is intended is a present-day human call (#214), not something the classifier asserts. - Reduce every difference to a signature (drop/add/value/attr/reorder); a file's distance to passing is its count of unique signatures (a tag dropped many times is one signature). - value/attr now come from the alignment walk (recurse SequenceMatcher equal blocks) so they survive sibling drops; drops/adds stay on the O(n) multiset. - Status is PASS/FAIL/CRASH. A FAIL with no reorder is a candidate; reorders are expected mx::api behavior, deferred to test normalization (#214). - Worklist ranks signatures by candidate files they are the sole blocker of, then by total files blocked; report adds a distance histogram and distance-1..3 near-miss buckets so small fix-sets are visible. Rewrite the classifier tests for the measured model and update the design doc, audit/README, the explain-api-roundtrip skill, and the CLI help to match.
The signature worklist ranks fixes independently, but most candidate files need several fixes before they pass strict comparison. Add build_batch_plan: a greedy set-cover that, at each step, picks the signature clearing the most candidate files outright, answering #212's "minimal changes -> most files" directly. The report gains a batch_plan section and the stdout summary prints it. On the current corpus the first two fixes -- stop emitting an empty <encoding/> and preserve part-name/@print-object -- land 26 files; 15 fixes land 71.
gen-quality
|
This was referenced Jun 20, 2026
Closed
Coverage reportCore-dev coverage
|
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 77.9% | 28539 / 36624 |
| Functions | 74.4% | 6360 / 8550 |
| Branches | 50.7% | 22672 / 44725 |
API coverage src/private/mx/{api,impl,utility}/
| Metric | Coverage | Covered / Total |
|---|---|---|
| Lines | 72.7% | 5428 / 7468 |
| Functions | 60.3% | 1831 / 3034 |
| Branches | 43.7% | 4532 / 10375 |
Core HTML report | API HTML report
Commit 6d4db346b0eb9ec5b90b2551208453b9c343e0dd.
This was referenced Jun 20, 2026
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
Reworks the api round-trip failure classifier (
audit/classify.py) to rank fixes purely by measured behavior, and produces the ranked worklist #212 asked for.The classifier keyed its categories on the hand-authored
supportattribute indata/api.features.xml— a prediction of round-trip behavior, not a measurement, and demonstrably wrong (part-group was markedfullyet dropped data, #224). Ranking built on a fallible prediction is untrustworthy.What changed:
api.features.xml. Whether a drop is intended is a present-day decision (api: define divergence policy and guardrails for round-trip corpus coverage #214), not something the classifier asserts.drop:/add:/value:/attr:/reorder:. A file's distance to passing is its count of unique signatures (a tag dropped many times counts once).value/attrcome from an alignment walk that survives sibling drops;drop/addstay on the O(n) multiset.Ran natively over the corpus: 828 failing files, 0 crashes, 550 reorder-free candidates. The top signals are
add:— mx::api injecting elements the source lacked (encoding, identification, type) — which the old support-based classifier could never surface. The first two fixes (stop emitting an empty<encoding/>, preservepart-name/@print-object) land 26 files; 15 fixes land 71.The individual fixes are filed as separate issues under #208 / #213.
Testing
make test-audit(classifier unit tests): 19 cases, greenmxtest-api-roundtrip, ranmake dump-api-roundtrip(828 files) andmake classify-api-roundtrip— produces the worklist + batch planReferences
api.features.xmlcross-reference they describe is removed)