Skip to content

COBOL: engine-vs-translator fact cross-check as a CI gate, with fact ownership (#4273) - #4456

Merged
squid-protocol merged 5 commits into
mainfrom
feat/4273-fact-crosscheck-v2
Oct 5, 2026
Merged

squid-protocol merged 5 commits into
mainfrom
feat/4273-fact-crosscheck-v2

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

For #4273 (its acceptance criteria are all covered; close it on merge if the reviewer agrees).

What

The engine (scanner) and the det translator each derive the same COBOL facts. This PR compares them program by program and channel by channel, records which side owns each fact, and gates CI on any disagreement nobody has explained.

  • tests/tools/referees/translator_adapter.py: the translator's own parse as a referee-facts/1 document. Every value comes from the structures det builds when it translates (expanded Lines, layout.Items, stmt.Paragraphs). It re-parses nothing and does not touch det/. USAGE "as written" is read by wrapping layout._inherit_usage inside the tool.
  • tests/tools/fact_crosscheck.py: run / check / update / assign. It covers 7 keyed corpora (128 sources), 54 det-port case programs (using each case's copy_dirs), 112 keyed copybooks and estate-crucible at its pin (40 programs). 17 channels: units, unit_extents, edges, calls, copybooks, copy_resolution, data_items, pic, usage, occurs, redefines, value, layouts, offsets, moves, cics_commands, cics_files. Each side is also scored against the answer keys.
  • tests/cobol_mainframe/fact_crosscheck_ledger.json: 824 known disagreements under 14 causes. Each cause names the side that is wrong (engine / translator / definitional) and an issue.
  • docs/language_status/fact_ownership.md: the ownership table, with the numbers.
  • .github/workflows/fact-crosscheck.yml: the gate. It follows estate-crucible.yml's pattern (engine and translator paths, !**/*.md, cancel-in-progress for PRs, timeout-minutes: 12) and installs .[translator]. Without tree-sitter-language-pack the tool exits non-zero; it never skips.
  • field_testing.json: D045 / D046 for the two engine defects (mainframe-ground-truth protocol); report regenerated.

Agreement (engine vs translator; each vs keys, P / R)

channel agree engine vs key translator vs key
units / extents / edges 99.7 / 98.7 / 99.5% 100/100, 100/99.0, 100/99.5 100/99.7, 99.9/99.6, 100/99.9
calls, cics_commands, cics_files 100% 100/100 100/100
data items, PIC, USAGE, OCCURS, REDEFINES 99.8–100% 100/100 99.8–100
copy_resolution 96.2% 100/100 98.3/97.8
offsets (16,153 values) 96.2% 99.4/98.9 (crucible key) 90.5/90.8
moves 99.4% 100/100 99.7/99.7

Adjudication (each pattern checked against the source and the keys, ≥3 samples)

Ownership (summary)

Evidence

  • fact_crosscheck.py check after merging origin/main (0440595ee, which includes det: model EXEC CICS READ ... INTO LENGTH (#4436) #4453 READ LENGTH): 0 new, 0 ledger problems. 82 s cold (8 scans) on this box, ~6 s once scanned. tree-sitter-language-pack 1.20.0 and 1.21.0 (what CI installs) give identical results.
  • pr_gates.py --fast: 5/5 pass. test_fact_crosscheck.py: 22 pass (the toy-program test runs, not skipped).

Prior work reused

The 2026-10-03 experiment scripts (agent-scratch-2026-10-03/xcheck/xcheck.py): the (file, line, level) join of translator records to engine entries plus _copy_extension for offsets, the operand canonicalisation for moves, and the CVDA / POINTER findings. The old worktree xcheck-4273 (branch feat/4273-fact-crosscheck-gate) had no commits beyond main and no uncommitted files, so nothing came from it; it was left untouched.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VrujbRefDqQ8ptAwTBQTaz

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol squid-protocol changed the title WIP: COBOL engine-vs-translator fact cross-check as a CI gate (#4273) COBOL: engine-vs-translator fact cross-check as a CI gate, with fact ownership (#4273) Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant