Skip to content

prism: JCL //* comments are never stripped — comment surface structurally dead for jcl (comment_lines ~0, debt/doc rules can never fire) #2610

Description

@squid-protocol

Found while working rosetta[jcl] #2581 (epic #2560).

What happens

prism.py never extracts JCL comments. jcl's line_exclusive entry in gitgalaxy_config.py is deliberately empty ("jcl": [] — the inline comment explains why: //* is a whole-line positional prefix, and every JCL statement also starts with //, so the stateless per-line delimiter stripper can't express it without commenting out the entire language). The documented limitation was correct for that stripper — but no positional path was ever added either, so for every .jcl/.prc file:

  • Every //* comment line lands in the code stream. The comment stream is always empty; doc_loc is 0 for all JCL.
  • Comment-surface analysis is structurally dead for JCL: detector.comment_analysis() (doc / ownership / planned_debt / fragile_debt / dead_code) runs on an empty string. A real mainframe job deck full of //* TODO ... / //* FIXME ... banners reports zero technical debt, and comment mass (documentation/cognitive-load risk inputs) is wrong for the whole language.
  • ownership (^//\* Author: …) only works today by accident, because coding_analysis() also runs every rule against the code stream — i.e. it is currently counted on the wrong surface.
  • The keyword-rosetta control corpus measures the consequence directly: jcl comment_lines ≈ 0 real (reported 5 is a per-file total_loc−coding_loc artifact) vs a 46-language median of 30, and the comment-decoy architecture (planted decoys that must contribute nothing) can't be exercised because jcl "comments" are code.

Scope: all ~191 licensed .jcl files in the language-crucible corpus, plus every legacy-modernization scan.

Fix

  1. prism._strip_segment_comments(): route lang_id == "jcl" through a dedicated whole-line //* stripper (same structural slot as the cobol/fortran positional path), preserving line count, with a case-sensitive negative guard for the ten JES3 control verbs (//*MAIN, //*FORMAT, //*NET, //*DATASET, //*ENDDATASET, //*PROCESS, //*ENDPROCESS, //*OPERATOR, //*PAUSE, //*ROUTE) which are statements, not comments.
  2. languages/jcl.py: with a live comment surface, wire the comment-anchored signal rules JCL genuinely has morphology for:
    • fragile_debt / planned_debt = the shared GLOBAL_FRAGILE_DEBT/GLOBAL_PLANNED_DEBT patterns (as cobol already does)
    • safety = COND= return-code tests (JCL's step error-handling)
    • safety_bypasses = COND=EVEN/COND=ONLY (run the step even after a prior abend)
    • telemetry = MSGLEVEL=/MSGCLASS= (job log verbosity)
  3. Golden masters re-blessed (real expected diff: JCL coding_loc/doc_loc split changes corpus-wide; debt/safety signals appear on real JCL).

cleanup (DISP=(...,DELETE)) was considered and deliberately not added: DISP= already feeds the io rule, and the overlap would double-count every disposition; ledgered as morphology in the rosetta corpus instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugUnintended behavior or logic failure in the enginecore-engineModifications to the central physics and parsing enginelegacy-modernizationCOBOL refractor, dead-code extraction, and JCL forgingmetricsHeuristics, risk exposures, and topological math updatespriority: highCore feature broken, but workarounds exist

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions