Skip to content

Answer keys: score unit extents and intra-program PERFORM / GO TO edges (#4318) - #4335

Merged
squid-protocol merged 4 commits into
mainfrom
feat/4318-answer-key-extents-edges
Oct 4, 2026
Merged

squid-protocol merged 4 commits into
mainfrom
feat/4318-answer-key-extents-edges

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Fixes #4318

What changes

The mainframe answer keys now record a unit's extent and the intra-program control edges, not only unit names and start lines. score and the ground-truth ledger grade both. That makes the #4301 class of bug visible: a unit cut short, with its code and edges outside every unit.

Key schema 2 (tests/cobol_mainframe/answer_key/*.json, documented in the answer_key README):

{"name": "A010", "kind": "paragraph", "line": 138, "end": 205, "edges": [
  {"verb": "PERFORM", "target": "UPDATE-CUSTOMER-VSAM", "line": 200},
  {"verb": "PERFORM", "target": "GET-ME-OUT-OF-HERE", "line": 205}]}

Scoring: two new rows, unit extents and intra-program edges.

Verification (the new fields are never copied from the engine)

  • Draft. The key's own reader drafted the new fields. Re-drafting reproduces every committed unit list exactly.
  • Forge. cobol_graveyard_finder's units give an independent reading of the edges. It agrees on all 1,880 / 1,880 distinct COBOL edges.
  • Engine. Every disagreement with the engine was settled against the source. All of them fall into the four causes below, and none is a key error.
  • Blind sample. Four fresh-context reviewers got a seeded sample of 100 claims: every main line, 10 COBOL units per corpus, and 6 PL/I procedures per PL/I corpus. They had a staged source copy and the definitions, with no answers. They agreed on 100 / 100 extents and edge lists.

All 7 keys are signed llm_verified for these fields.

Proof the gap is closed

The same keys, scored on the engine just before #4315 (c136f46b) and on main (0d64632e + this branch; no engine change):

corpus unit extents c136f46b unit extents main edges c136f46b edges main
zopeneditor-sample 62/66 · 43 lines outside 66/66 · 0 P 93/96 · R 93/93 P 93/96 · R 93/93
CBSA 668/680 · 593 outside 679/680 · 0 R 349/373 P 373/374 · R 373/373
CardDemo 649/881 · 490 outside 780/881 · 237 R 953/1024 P 1023/1023 · R 1023/1024
cics-genapp 162/162 · 0 162/162 · 0 131/131 131/131
zECS 216/221 · 34 216/221 · 34 R 161/184 184/184
DSF 86/166 · 44 155/166 · 14 R 106/123 P 116/116 · R 116/123
DBB mortgage 15/21 · 16 21/21 · 0 17/17 17/17

The old engine shows the #4301 shapes as extent and edge mismatches:

  • CBSA UPDCUST A010: L138-194 against the key's L138-205. UPDATE-CUSTOMER-VSAM and GET-ME-OUT-OF-HERE are lost (COBOL engine: UPDCUST records no PERFORM edges #4283).
  • CBSA BANKDATA A010: L370-406 against L370-673, with 4 PERFORMs lost.
  • CBSA BNK1CAC/CCA/CCS/CRA/DAC/DCS/TFN/UAC and BNKMENU A010: each loses POPULATE-TIME-DATE and ABEND-THIS-TASK.
  • CardDemo: all 14 RETURN-TO-* paragraphs at one line, e.g. COBIL00C RETURN-TO-PREV-SCREEN L273-273 against L273-284.
  • DSF: all 8 copies of KONTROLL_AV_INPUT are cut at ELSE RETURN;, and their CALL SEND_MAP is lost.
  • DBB and zopeneditor PL/I: units cut at a GOBACK / RETURN.

On main, none of these remains. CRECUST does not appear: at CBSA's pinned ref, P010 has no conditional GOBACK. The #4301 evidence came from the crucible's copy.

Ledger (regenerated with update after merging main, including #4323)

The new rows add 230 mismatches. Each cause names its owner:

cause kind issue entries
engine_unit_end_counts_noncode_lines defect #4300 200
engine_main_line_in_no_unit defect #4302 18
engine_drops_self_transfer deliberate #3362 8
engine_inline_perform_phantom_callee defect #4305 4

field_testing.json registers both new fields (introduced #4318, 7 development rounds), and the report and fact_channel_confidence.json are regenerated.

Checks

🤖 Generated with Claude Code

https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo

squid-protocol and others added 4 commits October 4, 2026 11:53
…4318)

Key schema 2: every unit carries its inclusive `end` and its intra-program
`edges` ({verb: PERFORM|PERFORM_THRU|GO_TO, target, line}); every program and
sibling carries `main_line` (#4302); PL/I sources gain `pli_units` (own extent,
block end, nested_in, CALL edges). `cobol_answer_key.py add-extents` drafts
them with the key's own reader, and `score` adds the `unit extents` (with code
lines outside any unit) and `intra-program edges` rows, read from function_data
and synthetic_unit_data.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo
#4318)

Every engine disagreement settled against the source (four causes:
non-code trailing lines #4300, main line #4302, self GO TO #3362,
PERFORM TEST #4305); forge agrees on every COBOL edge; a blind seeded
sample of 100 claims agreed 100/100. README documents schema 2, the
scores and the before/after-#4315 proof.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01FNWHcUSn5p7eMxFTsB5rFo
@github-actions

github-actions Bot commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-protocol
squid-protocol marked this pull request as ready for review October 4, 2026 16:17
@squid-protocol
squid-protocol merged commit ea3a9f0 into main Oct 4, 2026
40 checks passed
@squid-protocol
squid-protocol deleted the feat/4318-answer-key-extents-edges branch October 4, 2026 16:17
squid-protocol added a commit that referenced this pull request Oct 4, 2026
…4341)

#4335 (answer-key extents, #4318) and #4334 (#4300, sequence-area
blanking) merged three minutes apart. #4335's ledger recorded 200
`engine_unit_end_counts_noncode_lines` entries against the engine
before #4334; with #4334 on main, 182 of them no longer reproduce
(units no longer end on sequence-number-only lines), so the ledger
gate on main failed with "0 new, 182 no longer reproducing".
Regenerated with `ground_truth_ledger.py update`: +0 -182, 0 untriaged.

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

Answer keys: score unit extents and intra-program PERFORM / GO TO edges, not just unit names and start lines

1 participant