Skip to content

Language sheets: answer-key column and a legacy/mainframe group - #9204

Merged
squid-shepherd[bot] merged 5 commits into
mainfrom
legacy-answer-keys
Nov 24, 2026
Merged

squid-shepherd[bot] merged 5 commits into
mainfrom
legacy-answer-keys

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

What this does

Step 1 of validating the legacy languages: show the evidence that already exists. The engine's strongest legacy evidence is the hand-built answer keys in tests/cobol_mainframe/ground_truth_ledger.json, and the language sheets showed almost none of it. This adds an Answer key stat and a Legacy and mainframe group. It measures nothing new.

Answer key. Each ledger field is assigned to the language it is evidence for: JCL (job flow, resolved datasets, runner programs, DD names), BMS (screen fields, symbolic maps), CSD (resources), PL/I (call sites, data moves, layouts, record fields), Db2 (table access, columns), and everything else to COBOL (including the CICS, IMS and MQ calls inside it). Each cell shows the engine's agreement with the key and a bar of how many facts sit at each verification tier, because the tier says how far the number can be trusted.

language facts engine agreement cross-verified weakest tier
cobol 40,694 99.9% precision, 99.5% recall 17% draft
pli 16,513 100% / 100% 0% draft
bms 9,945 100% / 100% 56% draft
jcl 2,792 100% / 100% 68% draft
csd 501 100% / 100% 91% draft
db2_sql 127 100% / 100% 89% draft
clist, easytrieve, hlasm, rexx none not measured

High agreement with a key that is mostly sample-verified or draft is a weaker claim than the same number against a cross-verified key. PL/I is the clearest case: every one of its facts is sample-verified or draft. The reviewers are LLMs, not people, and no field has a human sign-off; the README and the sheets say so.

Legacy group. A hand-set context in docs/language_sheets/notes keeps cobol, pli, hlasm, jcl, rexx, clist, bms, csd, easytrieve and db2_sql together in matrix_legacy.svg, whatever their coverage count. The README block gets the legacy matrix.

Added after reading the keys: how much of each key was re-read

For the large fields the keys are verified by a seeded sample, and each answer key already records what blind reviewers found (items asked, key errors, a 95% upper bound). That says more about trust than the tier alone, so the sheets and the matrix now show it, pooled per language with the same formula as cross_verify_sections.py (a test pins it to the key's own figure: 2 errors in 315 is 0.019):

language items re-read key errors upper bound (95%)
pli 1,350 3 0.6%
bms 932 0 0.3%
jcl 365 0 0.8%
cobol 2,787 103 4.3%

Read the COBOL row with care: 86 of its 103 errors are one reader defect (a record's line fell on the blank line before its level number) found by a review and fixed afterwards, so the counts are findings against the key as first drafted and the bound is conservative for the key as it is now. The sheets say this. A sample bounds the error rate; it does not prove the unsampled facts correct. A section whose result is nested (no direct asked) is skipped, so the figures use only numbers a key records directly.

Read before merging

  • Correction. I told you the COBOL ground-truth commit was part of README: per-language evidence matrix replaces the function and call-graph charts #9144. It was not: README: per-language evidence matrix replaces the function and call-graph charts #9144 was squash-merged at 22:07Z with only its first commit, and the second was pushed to the old branch afterwards. main's cobol sheet still says "not measured" for functions, call links and imports. That commit (cobol's three stats from the same ledger, method answer-key, its note and tests) is cherry-picked into this PR, with the conflicts resolved, since the answer-key stat builds on it.
  • dead and dead (non-trivial) are listed on each sheet but left out of the aggregate: the engine's flag means unreferenced by name and the key's means unreachable (ledger cause engine_dead_is_unreferenced_by_name, deliberate).
  • The "Answer key" row appears on every sheet (it says "not measured" for the languages with no key), so 89 generated files change. The generated pages are the bulk of the diff; the code change is tests/tools/language_sheets.py and its tests.
  • Tree-sitter accuracy audit: node maps for crystal, erlang, nim, julia, r and fsharp #9201 (node maps) also regenerates docs/language_sheets. Whichever merges second needs python tests/tools/language_sheets.py --write after resolving, not a hand merge.
  • The seven-stat denominator changes "N of 6" to "N of 7" in the sheets; the "four or more" grouping threshold is unchanged. The legacy languages mostly have 2 or 3 of 7, which is why they get their own group.
  • Not done: the other legacy languages have no answer key (hlasm, rexx, clist, easytrieve). A separate read-only survey of permissive sources and independent reference tools is running; its findings will decide what to attempt.

Checked

  • pytest tests/tools/test_language_sheets.py: 23 passed
  • language_sheets.py --check: current; ruff_audit.py --ci and doc_refs_audit.py --ci: no new findings
  • Rendered the legacy matrix in headless Chrome and read it. I did not preview the README on GitHub.
  • Not run: CI on the PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_018srRvhLsKhsTZmCyX36Qem

squid-protocol and others added 5 commits November 24, 2026 09:55
… the COBOL ground truth that missed #9144)

The engine's strongest evidence for the legacy languages is the hand-built answer keys in
tests/cobol_mainframe/ground_truth_ledger.json, and the sheets showed almost none of it. This adds an
"Answer key" stat and a legacy/mainframe group.

Answer key: each ledger field is assigned to the language it is evidence for (JCL job flow, resolved
datasets, runner programs and DD names to jcl; BMS screen fields and symbolic maps to bms; CSD resources
to csd; the four PL/I fields to pli; Db2 table access and columns to db2_sql; everything else, COBOL and the
CICS, IMS and MQ calls inside it, to cobol). The cell shows the engine's agreement with the key summed over
the keyed corpora, and a bar of how many facts sit at each verification tier (cross-verified, LLM-verified,
sample-verified, draft), because the tier is what says how far the number can be trusted. `dead` and
`dead (non-trivial)` are listed on the sheet but not in the aggregate: the engine's flag means
unreferenced by name, the key's means unreachable (ledger cause engine_dead_is_unreferenced_by_name).

What it shows: bms 9,945 facts, jcl 2,792, csd 501, db2_sql 127 and cobol 40,694 all agree at 99.5% to 100%,
but only 56%, 68%, 91%, 89% and 17% of those facts are cross-verified, and pli's 16,513 facts have none
(all sample-verified or draft). clist, easytrieve, hlasm and rexx have no answer key.

Legacy group: a hand-set context (legacy/mainframe) in docs/language_sheets/notes keeps cobol, pli, hlasm,
jcl, rexx, clist, bms, csd, easytrieve and db2_sql together in matrix_legacy.svg whatever their coverage
count. The README block gains the legacy matrix and states that the reviewers are LLMs and no field has a
human sign-off.

Also included: the COBOL commit from the #9144 branch (cobol's functions, call links and imports from the
same ledger, method `answer-key`, its note and tests). It was pushed after #9144 was squash-merged, so it
never reached main; main's cobol sheet still said "not measured" for those three stats. It is cherry-picked
here with the conflicts resolved, and the answer-key stat builds on it.

Tests: the field-to-language mapping, the by-design exclusion, the tier mix and cell text, the legacy
grouping, and each language landing in exactly one matrix.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhLsKhsTZmCyX36Qem
… with the error bound

The tier bar says how much of a language's evidence was read in full, but for the large fields the keys
are verified by a seeded sample, and the answer keys already record what that sample found: items
asked, key errors, and a 95% upper bound. This surfaces it, pooled per language with the same formula
as tests/tools/cross_verify_sections.py (a test pins it to the key's own figure: 2 errors in 315 is
0.019).

Pooled over the keyed corpora: pli 1,350 items re-read, 3 key errors, at most 0.6%; bms 932 and 0
errors, at most 0.3%; jcl 365 and 0, at most 0.8%; cobol 2,787 and 103, at most 4.3%. The COBOL figure
is mostly one reader defect found and fixed in a review of record fields (86 of the 103), so it bounds
the key as first drafted. The sheets say so: the counts are findings against the key as first drafted,
the bound is conservative for the key as it is now, and a sample bounds the error rate but does not
prove the unsampled facts correct. A section whose result is nested (no direct `asked`) is skipped.

The matrix cell gains a line ("sample: key error <= 0.6% (95%)"), each sheet a "How much of the key was
re-read" table, and the README block a sentence. Also fixes "1 fields".

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_018srRvhLsKhsTZmCyX36Qem
@squid-protocol
squid-protocol marked this pull request as ready for review November 24, 2026 19:30
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Nov 24, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) November 24, 2026 19:33
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot merged commit a49eaed into main Nov 24, 2026
32 checks passed
@squid-shepherd
squid-shepherd Bot deleted the legacy-answer-keys branch November 24, 2026 19:33
squid-protocol added a commit that referenced this pull request Nov 24, 2026
squid-shepherd Bot pushed a commit that referenced this pull request Nov 24, 2026
…#9235)

* Missing-keyword mining report per family and language (Part of #8863)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

* Regenerate docs_read_by_tests.txt (stale on main since #9204)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

---------

Co-authored-by: Claude Sonnet 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant