Repository navigation
Fix #4243: the forge reads a multi-program source per program - #4291
Merged
Merged
Conversation
cobol_graveyard_finder read a source holding several programs as one: DBB epscsmrd.cbl (eleven batch-compiled siblings, two nested, each opening with MAINLINE SECTION) gave the later programs' AUTHOR / INSTALLATION / LINKAGE headers as units of the first, one MAINLINE for thirteen, and reachability across programs -- 973 forge unit / dead mismatches against the key's draft. - split_programs: a program per IDENTIFICATION DIVISION in Area A, ending at its END PROGRAM; a header met while one is open nests in it. Each program's own lines (a nested program's cut out), copybooks inlined per program. A one-program or free-format source takes the old path unchanged. - x_ray_dead_code / old_paragraphs: units and reachability per program, a later program's named PROG:NAME as the key does (#4206). - The same reader gaps the key's draft fixed on this file (#4206): GO TO targets read one name at a time after the verb (a consuming run swallowed the later GO TO ... DEPENDING ON), a plain GO TO after a DEPENDING ON ends the unit, XML PARSE PROCESSING PROCEDURE A THRU B is reached like a PERFORM, END-XML / END-JSON / END-INVOKE close ON EXCEPTION. - refraction_differential places engine units per program (PROG:NAME), its classifier context is per program, and key verdicts use keyed names; the key's bare_units / bare_dead (one-program grading) are gone. - epscsmrd.cbl against its draft: forge units 269/269, dead 6/6 (from 18 matched units and 0 dead). DBB full refraction snapshot re-blessed: the file's IR dump now names the six EPSCSMRI headers. Field-testing D043. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
squid-protocol
force-pushed
the
fix/4243-multi-program-forge
branch
from
October 3, 2026 22:27
af70009 to
cd4104c
Compare
Contributor
squid-protocol
marked this pull request as draft
October 4, 2026 12:04
squid-protocol
marked this pull request as ready for review
October 4, 2026 12:29
squid-protocol
added a commit
that referenced
this pull request
Oct 4, 2026
field_testing.json merged by entry (main's #4243 defect kept; this branch's defect renumbered where its ID collided), then cics_field_testing.md and fact_channel_confidence.json regenerated with `tests/tools/field_testing.py report --write` rather than hand-merged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
squid-protocol
added a commit
that referenced
this pull request
Oct 4, 2026
field_testing.json merged by entry (main's #4243 defect kept; this branch's defect renumbered where its ID collided), then cics_field_testing.md and fact_channel_confidence.json regenerated with `tests/tools/field_testing.py report --write` rather than hand-merged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Resolves #4243.
What was broken
cobol_graveyard_finder(the refraction forge's unit and dead-code reader) took everything after the firstPROCEDURE DIVISIONas one program. DBBepscsmrd.cblhas eleven batch-compiled siblings and two nested programs, and each one opens withMAINLINE SECTION. Read that way:AUTHOR/INSTALLATION/LINKAGE/WORKING-STORAGEheaders became units of the first program;Against the key's draft entry (#4206 models the file as
siblingswithPROG:NAMEunits), the forge scored 973 mismatches: units 236 fp / 251 fn, dead 237 / 6, non-trivial dead 237 / 6. This is the "about 1,000" in the answer-key README.Changes
split_programs(graveyard finder). A program starts at eachIDENTIFICATION DIVISION.in Area A and ends at itsEND PROGRAM; a header met while a program is open starts a nested one. Each program keeps only its own lines, so a nested program's lines are cut out of its parent, and copybooks are inlined per program. A one-program source, or a free-format one, takes the old code path unchanged.x_ray_dead_code/old_paragraphscompute units and reachability per program. A later program's units are namedPROG:NAME(keyed_unit), the same as the key, so forge and key score pair for pair.The reader gaps the key's draft already fixed on this file (answer key: model multi-program sources (sibling programs / END PROGRAM) #4206), ported to the forge (they are what made its dead verdicts wrong here):
_GO_TO_TARGET). The old match consumed a run of names that also spans the following statements, so it swallowed the laterGO TO X000000CC … X00000174 DEPENDING ON, and 169 EPSCSMRI targets read as dead. Reading token by token also keeps the pattern out of the ReDoS gate; a lookahead version, even bounded, was flagged.GO TOafter aGO TO … DEPENDING ONin the same sentence ends the unit.XML PARSE … PROCESSING PROCEDURE A THRU Breaches A..B like a PERFORM.END-XML/END-JSON/END-INVOKEclose an ON EXCEPTION phrase.refraction_differential:usage_statusunits are placed in their program by start line (_program_placer, innermost program wins, read with the key'sprogram_spans);own_units,unit_kind,reached) is per program;keyed_units/keyed_dead.The key's
bare_units/bare_dead(grading the forge on bare names) are removed: nothing reads a file as one program any more.Docs: the answer-key README and
epscsmrd.cbl'sexcluded_programsnote no longer describe the one-program reading. The file stays excluded until it is censused.Field testing: D043 (forge, units / dead, DBB round, found by the fix(answer-key): model multi-program sources (sibling / nested programs) (#4206) #4226 census); report regenerated.
Numbers
epscsmrd.cblagainst a locally drafted key entry (not committed; scratch harness callingdraft_program+score), forge side: units 269/269, 0 fp / 0 fn; dead 6/6, 0 / 0. Onorigin/mainit was 973 mismatches.epscsmrd.cblmoved: its IR dump now lists the six EPSCSMRI headers the key and the engine call dead, instead of 238 cross-program "dead" names, and the audit summary goes from 238 to 7 unreachable blocks. No other corpus snapshot moved.PROGRAM-ID. 'EPSCSMRD'.) #4285 cherry-picked locally on top of this branch,epscsmrd.cbl's 7paragraph/oldand 231usage_status_not_reachabilitydeltas are gone. What remains is 26schema_column/db. Those are not multi-program: they are the first program's own items, andcobol_schema_forge._LEVEL_ENTRYaccepts only two-digit level numbers (01,[1-4][0-9]), so this generated wrapper's1/2/3levels are skipped. They are the same names as the file'sforge_flat_schemarecord deltas. That's a separate follow-up, not done here.Merge order (with #4285)
mainwithout Fix #4242: record a quoted PROGRAM-ID (PROGRAM-ID. 'EPSCSMRD'.) #4285, so on its ownepscsmrd.cblstill has no program in the engine and the DBB differential baseline doesn't move here.PROGRAM-ID. 'EPSCSMRD'.) #4285's, D043 this one's; D042 is Fix #4246: an unnamed data description entry is an implicit FILLER #4284's);python tests/tools/field_testing.py report --write;refraction_differential.py --update-baseline --corpus dbb-mortgage-application. Expected 33 → 26 unexplained, with Fix #4242: record a quoted PROGRAM-ID (PROGRAM-ID. 'EPSCSMRD'.) #4285's note updated to name the schema-level reader instead of COBOL forge/differential reads a multi-program source as one program, blocking EPSCSMRD onboarding #4243.Verification
tests/cobol_mainframe+tests/cics_cruciblewith every pinned corpus fetched: 1389 passed, 427 skipped.test_cobol_graveyard_finder.py: the multi-program split and per-program dead set; one-program and free-format reading unchanged; the GO TO run; DEPENDING then GO TO; XML PARSE / END-XML. The five reader and split tests fail onmain's code.test_cobol_answer_key.py: forgeold_paragraphsand dead verdicts equal the key's keyed units and dead set on the multi-program fixture.test_refraction_differential.py: engine unit placement.refraction_differential.py --ci: no new unexplained. ReDoS tool-regex gate: passes.Not done
record_dataand key_data_items).🤖 Generated with Claude Code