Repository navigation
tests/tools: family_validity_chart draws the keyword-family accuracy grid (Part of #8863) - #8876
Merged
Merged
Conversation
…grid (Part of #8863) One column per language, one row per family with a written contract (71 families, 73 code languages, grouped by the contract's phase). A cell is N/A (the language defines no rule), gray (a rule, not yet tested), dotted (scored, the oracle never sees the construct) or a rainbow colour for the weaker of recall and precision against a parser's reading of the same functions. Faded = fewer than 10 functions; hatched = an unpinned corpus. A pure function of tests/family_validity_baseline.json and the engine registry, in the house style of graph_coverage_chart.py: --write, --check (stale SVG), --history. Seeded with the 91 cells scored so far (Python, Go, Rust, JavaScript, TypeScript, Java, C). Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018srRvejJbzNR67xR3D2VxV
…tations Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018srRvejJbzNR67xR3D2VxV
This was referenced Nov 21, 2026
… parserless decoy test) (Part of #8863) The baseline gains a `decoys` section (language -> family -> comment pass/leak, string counts, keyword) from the keyword-rosetta decoy matrix: the family's menu keyword planted as bare code (positive control), as a comment and as a string literal in each language's own syntax. The grid draws a green dot on every cell with a passed comment decoy (red if it leaked) and a tooltip; a decoy-only cell stays gray under the dot. 812 of 2,893 defined cells are now tested (91 against a parser, 721 by decoy only). README numbers and the legend updated. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018srRvejJbzNR67xR3D2VxV
…8863) The reviewer's findings: green dots read as "validated" though they marked only the half of the decoy test that cannot fail; the stretched rainbow made 80% look green; red/green is not colour-blind safe; the title promised parser agreement while 89% of tested cells were decoy-only; ~2,000 identical gray cells buried the ~90 cells with evidence. README figure (family_validity_chart.svg) is now a summary: a coverage bar (91 parser / 721 decoy only / 2,081 untested), a table of every parser-measured cell with the score printed in it (lower of recall and precision, R/P marks the weaker side, red outline under 50%, one blue hue in five fixed bins, rows worst first), and the decoy result as two bars (comment ignored 756/756, string counted 665/715). The full 73 x 71 grid becomes a separate maintainer matrix (family_validity_matrix.svg) with hover tooltips, no dots, the same palette. --write and --check cover both. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018srRvejJbzNR67xR3D2VxV
…ract, README figure 900 px wide (Part of #8863) Baseline: C#, Kotlin, Scala, Swift, Ruby, PHP, Lua and shell added (181 parser-measured cells in 15 languages; 677 decoy-only; 2,036 untested), from oracle specs written by two agents and gated on args and branch (6 of 8 pass; Swift misses on branch precision, a real engine defect; shell on strings). All branch cells re-scored after the branch contract's corollary 1 (a handler is not a decision): catch, except and assert no longer count in the oracle. Figure: language names rotated and the decoy panel moved below the table, so the README figure stays about 900 px wide and readable with 15 columns. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018srRvejJbzNR67xR3D2VxV
…ate), README rows best first Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_018srRvejJbzNR67xR3D2VxV
squid-protocol
marked this pull request as ready for review
November 21, 2026 14:22
Contributor
|
No description provided. |
Contributor
|
No description provided. |
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.
Part of #8863 (keyword-family validity epic, milestone Eagle Eye).
What this adds
The third validation graph, beside function finding (
tri_comparison_chart.svg) and the call graph (graph_coverage_chart.svg): which keyword families are measured, in which language, and how well.One column per code language the engine parses (73), one row per family that has a written contract in
signal_contracts.py(71, grouped by the contract's phase). A cell is:Faded = fewer than 10 oracle functions behind the cell. Hatched = from a corpus that is not a pinned crucible release (exploratory, not reproducible). Hover a cell for recall, precision, function counts and corpus.
python tests/tools/family_validity_chart.pyprints a markdown summary;--writewrites the SVG;--checkfails on a stale SVG;--history PATHappends per-language rows. It is a pure function oftests/family_validity_baseline.jsonand the engine's own registry (no scan), likegraph_coverage_chart.py.Where the data comes from
tests/family_validity_baseline.jsonis written by the family-validity tool (#8864):family_oracle.py SCAN_DB --src ROOT --lang L --corpus NAME [--pinned] --update-baseline. A pinned result is never overwritten by an exploratory one, and a cell with fewer than 10 oracle functions never displaces one with real numbers behind it. This PR does not depend on #8864 to merge (the chart only reads the JSON), but the baseline can only be refreshed once #8864 is in.Seeded with 91 parser-scored cells and the decoy section (2026-11-21): language-crucible v1.7.0 (pinned) for Python, Go, Rust, TypeScript, JavaScript, Java and C, plus exploratory GitGalaxy-engine, prometheus, tokio, express, vue, retrofit and redis scans where the pinned corpus has too few functions. In its current form 858 of 2,894 defined cells are tested (30%): 181 against a parser (15 languages) and 677 by the decoy test only (keyword-rosetta menus and decoy lines: the family keyword planted as bare code, as a comment and as a string literal in each language's syntax; comments stripped in 756 of 756 controlled cells, a keyword in a string counts in 93%, which is #2535's documented behaviour).
README
A short block after the call-graph chart: what a cell is, the date and count, one limit (one corpus per language; the oracle is our reading of each contract, not ground truth).
Checks run
graph_coverage_charttests: 228 passed, 1 skipped. Time ratchet: 229 tests, none over the limit.audit_check.py: all clear.pr_gates(this box'sgauntletgate fails on 8 Kotlin Unicode cells that also fail on unchanged main code; see tests/tools: family_oracle scores each keyword family against an ast oracle (Part of #8863) #8864).Not in this PR
Registering the chart in
merge_main.py's regenerate table and the history workflow (follow-up), more oracles (C++, C#, Kotlin, PHP, Ruby, Swift, Lua, shell), and a non-tree-sitter oracle for COBOL, JCL, assembler (26 of the 79 language definitions have no tree-sitter grammar). Hand-written files: 3 (tool, test, README); the baseline and SVG are generated.🤖 Generated with Claude Code