Skip to content

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

Closed

Description

@squid-protocol

Problem

The mainframe answer keys (tests/cobol_mainframe/answer_key/*.json) record each unit as name, kind and start line only. They have no end line and no intra-program edges: which paragraph PERFORMs or GO TOs which, and from which line. Program-level calls, copybooks, records, dead and so on are scored, but a unit's extent and the edges between units are not.

So a whole class of engine bug scores as correct. #4301 / #4283 hid for months in two keyed corpora:

  • In CBSA, 553 code lines and 39 PERFORM edges sat outside every unit.
  • In CardDemo, 11 RETURN-TO-* paragraphs were cut to their header line.

Every unit name and start line was right, so the key passed. #4302 (main-line code before the first paragraph belongs to no unit) is the same class and is also invisible to the key today.

Proposal

  1. Key format: each unit gains end (last line, inclusive). Each unit also gains performs / go_to (or a single edges list of {verb, target, line}), plus the main-line entry code before the first header (COBOL engine: statements between PROCEDURE DIVISION and the first paragraph belong to no unit, so the program's main-line PERFORM/CALL edges are never recorded #4302).
  2. Drafting: derive the new fields with the key's existing drafting path, then verify them the way the current fields were verified (verification, cross-checked against the forge). Don't copy them from the engine.
  3. Scoring: cobol_answer_key.py score adds unit extents (exact-match rate on start and end, plus a lines-outside-any-unit count) and intra-program edges (precision and recall). Report them in the ground-truth ledger like the existing fields.
  4. Corpora: the 7 keyed corpora (zopeneditor, CBSA, CardDemo, GenApp, zECS, DSF, DBB mortgage).

Acceptance criteria

Related

Found while fixing #4301 (2026-10-04).

Activity

  1. added
    enhancement
    testing
    legacy-modernization
    priority: high
    on Oct 4, 2026
  2. added
    scope:infra
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementlegacy-modernizationpriority: highscope:infratesting

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions