Repository navigation
Description
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.MIt 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, orPERFORM … UNTIL/VARYING/TIMESCALL '<literal>'/CALL <name> USINGEXEC 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
squid-protocol commentedon Oct 31, 2026
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 theclaim:nyxlabel.cobol dead_code: literal operands and continued MOVE; re-bless golden…
cobol dead_code: use \w for the hyphenated name (national-letter clas…
squid-protocol commentedon Oct 31, 2026
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.re-bless goldens after merging origin/main (Part of #7207)
cobol dead_code: count a comment only when it has a statement's shape…
c/cpp/java dead_code: count a keyword-led comment only when it has a …
csharp/typescript/javascript/rust dead_code: re-bless goldens (Part of …
csharp dead_code: ruff format (Part of #7207)
go/kotlin/swift dead_code: re-bless goldens (Part of #7207)
csharp/typescript/javascript/rust dead_code: count a keyword-led comm…
9 remaining items
dead_code keyword-statement shape for acs, crystal, db2_sql, easytrie…
goldens: re-bless gpu_json after merging main (Part of #7207)
embedded_python/fsharp/groovy/scala dead_code: count a keyword-led co…
rexx dead_code: a CALL with a numeric argument is a statement (keywor…
powershell/tcl/rexx/matlab dead_code: count a keyword-led comment onl…
assembly/fortran/haskell/livecode dead_code: count a keyword-led comm…
objective-c/solidity/zig/zscript dead_code: count a keyword-led comme…
squid-protocol commentedon Nov 1, 2026
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.
squid-protocol commentedon Nov 1, 2026
Churn run
7207-20261101T0900Z(host nyx) ended without a PR. slice 3 stale: all languages already landed; probe 0/57; issue closedyacc dead_code: count a keyword-led comment only when it has a statem…
fix(dead_code): control keywords need '(' and return needs a statemen…
fix(dead_code): control keywords need '(' and return needs a statemen…
fix(detector): has_header_comment steps over the unit's own prototype…