Skip to content

dead_code (commented-out code) rules match English comments: COBOL's matched 21 of 21 prose lines; 43 of 57 language rules match plain-prose probes #7207

Closed

Description

@squid-protocol

What happens. The dead_code signal is meant to count commented-out code. In most languages it is a comment marker followed by a bare keyword, so ordinary prose comments match. COBOL's rule (gitgalaxy/standards/language_standards/languages/cobol.py, rule 12):

r"^(?:.{6}\*|[ \t]*\*>)[ \t]*(?:MOVE|COMPUTE|IF|PERFORM|CALL|EXEC)\b", re.I | re.M

It matches any comment that begins with one of those words, in any case. The signal feeds the dead-code exposure score (_calc_graveyard, metrics/signal_processor.py), with each hit counting as 3 deprecated lines, and the dead-code signal family.

Evidence (COBOL). The ten agentic-COBOL systems (acherm/agentic-*-cobol-*, MIT): the rule matched 21 comment lines, and all 21 are prose, headings or pseudocode; none is a commented-out statement. Comment text only:

  • English sentences:
    • * Move the piece
    • * if last iteration used > 40% of remaining time
    • *> If king moved, clear both rights for that side.
    • *> Compute truth state of WS-OTHER-LIT under current
    • * If per-field CODEC unspecified, apply --codec:
  • Headings: * MOVE REPRESENTATION, *> MOVE LIST
  • Pseudocode: *> if conflict:, * if c & 1: c = (c>>1) XOR 0xEDB88320 else c >>= 1

Resulting risk_dead_code on files with no commented-out code:

file dead-code exposure matched lines
agentic-chessengine-cobol-codex copybooks/types.cpy 64.6 2 headings
agentic-cobol-sat-cc src/copy/search.cpy 33.6 3 pseudocode lines
agentic-cobol-compress-cc src/crc32.cob 14.2 1 pseudocode line

Reproduce: agentic-cobol-pairs/scoring_checks.py in squid-protocol/gitgalaxy-population-analyses (PR #23) prints every matched line.

Class sweep. All 57 languages with a dead_code rule were probed with 9 English comment lines ("if the user cancels, we retry", "for each item in the list", "move the piece", "call this once at startup", "return value is ignored", ...) under 14 comment markers. 43 match at least one probe (probes matched in brackets):

abap (2), acs (4), ada (6), apex (3), assembly (3), c (8), cobol (8), cpp (8), crystal (2), csharp (8), dart (6), db2_sql (3), easytrieve (2), embedded_python (4), fortran (9), fsharp (1), go (4), groovy (8), haskell (2), java (10), javascript (5), kotlin (4), livecode (3), lua (8), matlab (3), objective-c (2), perl (2), php (3), postgresql (3), powershell (3), python (5), rexx (3), ruby (2), rust (8), scala (2), shell (3), solidity (1), swift (2), tcl (3), typescript (10), yacc (8), zig (3), zscript (4)

Caveat: the probe tries every marker on every language, so a few hits may use a marker the language doesn't have. Each language's slice should confirm with its own comment syntax. The rules that already require some statement shape (PL/I: CALL name(/;, IF … THEN; REXX: IF … THEN, DO WHILE) still match call this once at startup as CALL <name>.

Expected. A comment counts as commented-out code only when what follows the marker has the statement's shape, not just its first word. For COBOL:

  • MOVE <operand> TO <operand>
  • COMPUTE <name> =
  • IF <operand> <relation>
  • PERFORM <paragraph-name> with nothing else on the line, or PERFORM … UNTIL/VARYING/TIMES
  • CALL '<literal>' / CALL <name> USING
  • EXEC SQL|CICS
  • with a terminating period or a following code line in Area B.

For other languages: their own syntax markers (;, a balanced (...), =, a trailing :/{). Prose with a capitalised first word and no code punctuation should not match.

Suggested slicing: COBOL first (this evidence), then the class as one checklist per language family. Each slice needs a rosetta or strict-test pin with a prose negative and a real commented-out-statement positive, and a golden re-bless.

Probe used for the class sweep
MARKERS = ["#", "//", "/*", "--", "!", ";", "*>", "*", "      *", "%", "'", "REM", "C", "<!--"]
PROSE = ["if the user cancels, we retry", "for each item in the list", "move the piece", "call this once at startup",
         "return value is ignored", "do not edit", "while waiting for input", "import order matters", "compute the total"]
# for each language's compiled rules["dead_code"]: a hit is pat.search(f"{marker} {prose}") or pat.search(f"{marker}{prose}")

Found by the agentic-COBOL structural comparison (DOOM study follow-up).

Activity

  1. added
    bug
    core-engine
    lane:nyx
    on Oct 30, 2026
  2. squid-protocol commented on Oct 31, 2026

    @squid-protocol
    OwnerAuthor

    Claimed by promoter-bot host nyx, lease renewed 2026-11-01T09:00Z. It lapses after 6 h without a renewal. To take it back, assign someone or remove the claim:nyx label.

  3. squid-protocol commented on Oct 31, 2026

    @squid-protocol
    OwnerAuthor

    Churn run 7207-20261031T0330Z (host nyx) ended without a PR. crashed at start, no session: headless claude ignored settings because workspace /home/joe/gitgalaxy/repo is not trusted (hasTrustDialogAccepted unset in ~/.claude.json). Owner must accept trust; #7207 slice 1 not requeued yet.

  4. 9 remaining items

  5. squid-protocol commented on Nov 1, 2026

    @squid-protocol
    OwnerAuthor

    Closing: re-ran the issue's class-sweep probe on origin/main 15efa35. 0 of 57 languages with a dead_code rule match the prose probes (was 43). Slices landed in #7296, #7307, #7319, #7322, #7335, #7341, #7355, #7359, #7360, #7381, #7393, #7402, #7407. Slice 3 found nothing left, so no PR.

  6. squid-protocol commented on Nov 1, 2026

    @squid-protocol
    OwnerAuthor

    Churn run 7207-20261101T0900Z (host nyx) ended without a PR. slice 3 stale: all languages already landed; probe 0/57; issue closed

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

    bugclaim:nyxcore-enginelane:nyx

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions