Repository navigation
COBOL: the unit a PROCEDURE DIVISION falls into is never an orphan or a duplicate (#7206) - #7241
Conversation
… a duplicate (#7206) The first paragraph after the header (no main line), or the first section and its first paragraph, is reached with no PERFORM naming it. Per program: nested and sibling programs each have their own entry. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
… unit (#7206) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No description provided. |
…o longer an orphan (#7206) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No description provided. |
|
PR #7241 @ 3e0ace2: 1 failed check(s) == Analyze (python) (failure) -- real |
…ne CodeQL alerts Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No description provided. |
|
No description provided. |
1 similar comment
|
No description provided. |
|
CI shepherd: the head of this PR (84a6de1) is not the one a maintainer labelled |
|
No description provided. |
|
PR #7241 @ da9f607: 30 failed check(s) == Analyze (python) (cancelled) -- infra == Pre-gate (Vault Sentinel, X-Ray, Supply Chain) (cancelled) -- infra == callgraph (cancelled) -- infra == committed ports compile (cancelled) -- infra == crucible (failure) -- infra == crucible-audit (full-precision) (cancelled) -- infra == crucible-audit (zero-dependency) (cancelled) -- infra == db2 (cancelled) -- infra == db2 ${{ matrix.shard }} (cancelled) -- infra == det (failure) -- infra == detmut (cancelled) -- infra == equivalence-e2e (failure) -- infra == evidence report level deltas (advisory) (cancelled) -- infra == full-suite (failure) -- real == full-suite part ${{ matrix.group }}/${{ needs.shard-plan.outputs.splits }} (cancelled) -- infra == ground-truth (failure) -- infra == ground-truth part ${{ matrix.shard }} (cancelled) -- infra == ground-truth-warm (cancelled) -- infra == measure (shard 1/2) (cancelled) -- infra == measure (shard 2/2) (cancelled) -- infra == muninn (cancelled) -- infra == plan the suite parts (cancelled) -- infra == publish-history (cancelled) -- infra == rosetta-audit (cancelled) -- infra == runner-tests (cancelled) -- infra == shard ${{ matrix.group }}/${{ needs.plan.outputs.splits }} (cancelled) -- infra == shard ${{ matrix.shard }} (cancelled) -- infra == shard ${{ matrix.shard }} (${{ matrix.loc }} LOC) (cancelled) -- infra == store the suite's durations (cancelled) -- infra == suite time budget (#5166) (cancelled) -- infra |
…y guards The duplicate/orphan guard now skips both the entry unit a PROCEDURE DIVISION falls into (#7206) and the program's main line (#7170). The main-line test now expects the main line as its own never-orphan unit; the first paragraph is still flagged. Goldens take main's side here and are re-blessed in the next commit. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rollups only) Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
CI shepherd: the head of this PR (3f8b3ab) is not the one a maintainer labelled |
|
No description provided. |
|
PR #7241 @ 3f8b3ab: 16 failed check(s) == crucible (failure) -- real == db2 ${{ matrix.shard }} (cancelled) -- infra == det (failure) -- real == equivalence-e2e (failure) -- real == full-suite (failure) -- real == full-suite part ${{ matrix.group }}/${{ needs.shard-plan.outputs.splits }} (cancelled) -- infra == ground-truth (failure) -- infra == ground-truth part ${{ matrix.shard }} (cancelled) -- infra == ground-truth-warm (cancelled) -- infra == measure (shard ${{ matrix.shard }}/${{ matrix.total }}) (cancelled) -- infra == publish-history (cancelled) -- infra == shard ${{ matrix.group }}/${{ needs.plan.outputs.splits }} (cancelled) -- infra == shard ${{ matrix.shard }} (cancelled) -- infra == shard ${{ matrix.shard }} (${{ matrix.loc }} LOC) (cancelled) -- infra == store the suite's durations (cancelled) -- infra == suite time budget (#5166) (cancelled) -- infra |
What was broken
A COBOL program falls into the first paragraph (or section) after
PROCEDURE DIVISION.; nothing PERFORMs it, so_is_orphangave itusage_status = 1and two scores read that as a defect (tech debt, dead-code family). Repro (MAIN-PARAperformsWORK-PARA):unreferenced_by_name= 2 (MAIN-PARA, UNUSED-PARA); aPREMIERE SECTION. / A010.entry: 4.Fix
StructuralExtractor._cobol_entry_unit_starts(detector.py) finds, per PROCEDURE DIVISION header, the unit reached with no statement between the header's separator period and it (a main line is the entry otherwise, #4302), plus the first paragraph of a first SECTION when that section header is followed straight by it. Those units skip BOTH the duplicate and orphan checks (same guard spot as the synthetic names). Nested/sibling programs are bounded by_COBOL_UNIT_END_RE, so each has its own entry. Fall-through from a predecessor is untouched.Note: the issue cites #7170's
def_shape != COBOL_MAIN_LINE_SHAPEguard; #7172 (#7170) is still open and not on main, so this PR does not depend on it. The main-line case here keeps the first paragraph flagged (reached only by fall-through, out of scope); once #7172 lands the main line itself is exempt there.Before -> after
tests/core_engine/test_cobol_entry_unit_not_orphan_7206.py(6 tests): first paragraph; first section + first paragraph (later section and paragraph still 1); section with code before its first paragraph; main-line case (first paragraph still 1); nested + sibling programs; same entry name and body in two programs is not a duplicate. Existing #2806 contract tests pass.Golden masters
Both legs regenerated via
golden-lock.sh crucible_check.py --update --yes;scope_check --expect cobol: all per-file moves are COBOL files (unreferenced_by_name,tech_debt_exposure,usage_status, and the derived fingerprint/coordinates/magnitude-neighbour fields); the only non-COBOL rows are repo-wide rollups (LLM brief, GPU column digests) that fold those files. Example: zopeneditorSAM2.cbltech debt 15.98% -> 0.0%.Ground-truth ledger
ground_truth_ledger.py update: +0 / -244 entries, 0 untriaged; the 23 shown cases were "no longer reproduces" (enginedeadcells for entry paragraphs, e.g.MAINLINEin cics-async-api-credit-card-application-example) and the dbb-mortgage and cics-async scoreboards moved. No new mismatch.engine_dead_is_unreferenced_by_namestays for the rest.Refraction pipeline / audits
test_refraction_differential.py+test_cobol_answer_key.py: 188 passed (no new unexplained deltas).audit_check.py: ruff, mypy, dead-key, ast-accuracy clean.pr_gates --ratchets: 8 pass, ground-truth failed until the update above (rerun not repeated after;ledger check: clean).Class / Sibling gaps
Class: the units a COBOL PROCEDURE DIVISION is entered at (no-main-line first paragraph; first section; first section's first paragraph), per program, in orphan and duplicate verdicts. Handled: all of those, including nested and sibling programs, each with a test. Sibling gaps: (1) a program whose entry follows
DECLARATIVES ... END DECLARATIVES.(the real entry is the first section after it; currently treated as having a main line, so still flagged) - no burned-estate program known to need it, CBSA/GenApp not checked; (2) the main-line unit exemption itself is #7172; (3) fall-through paragraphs, out of scope per the issue (CBSA programs withA010-style chains would need it).Closes #7206
🤖 Generated with Claude Code