Skip to content

rosetta[cobol]: cross-language consistency — 4 red / 8 amber metrics, 5 ledgered shapes #2567

Closed

Description

@squid-protocol

Part of #2560 — per-language tracking for the keyword-rosetta control corpus (built for #1096). Planted intent is identical in every language, so every deviation below is measured bias vs. the 46-language median, validated in the corpus's deviation ledger. 🔴 = beyond ±50% of the cross-language median, 🟡 = ±25–50%.

Triage order (per the epic): structure detection first, then signal/keyword rules, then risk-score consequences — §3's numbers are downstream of §1–§2 and re-baseline as those fix. Cross-cutting engine issues (e.g. #2535/#2546) fix many languages at once; this issue tracks this language's residual after each cross-cutting fix lands, and closes when the language sits inside the ±25% band on every comparable metric (or every remaining deviation is ledgered as intended morphology).

1. Structure detection (fix first)

  • 🔴 args: 1 vs median 13 (-92%)

2. Signal / keyword deviations

  • 🔴 fragile_debt: 3 vs median 1 (+200%)
  • 🔴 planned_debt: 2 vs median 1 (+100%)
  • 🔴 state_mutation: 2 vs median 6 (-67%)
  • 🟡 comment_lines: 15 vs median 30 (-50%)
  • 🟡 globals: 3 vs median 2 (+50%)
  • 🟡 high_risk_execution: 3 vs median 2 (+50%)
  • 🟡 io: 4 vs median 3 (+33%)
  • 🟡 keyword_hits: 178 vs median 247.5 (-28%)

3. Risk-exposure consequences (downstream)

  • 🟡 risk_api_exposure: 6.81696 vs median 5.31104 (+28%)
  • 🟡 risk_cognitive_load: 8.11636 vs median 15.1444 (-46%)
  • 🟡 risk_safety_score: 53.1215 vs median 37.297 (+42%)

Ledgered shapes touching cobol

defect type issue evidence summary
census-requires-git-tracked engine-semantic — — GalaxyScope's census enumerates git-tracked files only; an untracked folder scans as '0 files mapped' with no per-file warning
cobol-working-storage-globals keyword-overlap — (notes) cobol globals pattern includes WORKING-STORAGE\s+SECTION as an alternative — every fixed-format program with a working-storage section records globals >= 1
cobol-hyphen-identifier-debt-leak upstream-bug #2537 c.cpy Debt rules are whole-text, not comment-anchored, and '-' is a regex word boundary: HACK-LEVEL (data item, 2 code occurrences) counts fragile_debt, PROBE-TODO (paragraph …
cobol-area-b-bare-token-paragraph upstream-question #2538 (notes) A bare token + period in Area B (CEE3DMP
string-literal-selective-shielding upstream-question #2535 a.cpy Keywords inside one string literal ('if eval fails, try open') count toward branch (+2), safety (+1), io (+1) but eval does NOT count toward high_risk_execution (routes …
Decoy outcomes (file-level evidence)
  • main.cbl · never ALTER this flow and no PERFORM loop (comment): stripped: contributed 0
  • a.cpy · DISPLAY 'IF ALTER FAILS TRY OPEN AGAIN' (string): ALL counted: IF (branch +1), ALTER (high_risk +1), OPEN (io +1) — cobol does NOT shield the high-risk family in literals, unlike python/javascript. Ledger: string-literal-selective-shielding; gitgalaxy#2535 comment
  • c.cpy · 77 HACK-LEVEL PIC 9. / DISPLAY HACK-LEVEL. (code): COUNTED (+2): hyphen is a word boundary so \bHACK\b matches inside the identifier, both occurrences; the PROBE-TODO paragraph name likewise adds planned_debt +1. Ledger: cobol-hyphen-identifier-debt-leak; gitgalaxy#2537

Reproduce / evidence

Activity

  1. added
    metricsHeuristics, risk exposures, and topological math updates
    core-engineModifications to the central physics and parsing engine
    legacy-modernizationCOBOL refractor, dead-code extraction, and JCL forging
    priority: highCore feature broken, but workarounds exist
    on Aug 31, 2026
  2. squid-protocol commented on Aug 31, 2026

    @squid-protocol
    OwnerAuthor

    Sweep complete (rosetta-language-sweep): 6🔴 / 4🟡 → 3🔴 / 4🟡

    Worked per the corpus's rosetta-language-sweep skill. Note the live language_deviations.py
    table had already superseded this issue's title (4🔴/8🟡): the post-#2618 api re-baseline moved
    keyword_hits and risk_api_exposure in-band and re-banded comment_lines/risk_cognitive_load
    to red before this sweep started — the sweep's true starting point was 6🔴/4🟡.

    The five-bucket classification

    1. Real engine bug — fixed. fragile_debt +200% / planned_debt +100% = #2537: the shared
    debt patterns' bare \b(...)\b + --as-word-boundary matched debt keywords inside hyphenated
    identifiers (HACK-LEVEL ×2, the PROBE-TODO paragraph name; scheme's probe-todo symbol
    reproduced it). Fixed by PR #2622 (hyphen-adjacency guards on GLOBAL_FRAGILE_DEBT /
    GLOBAL_PLANNED_DEBT; golden masters re-blessed — the same FP class died corpus-wide, e.g. an
    SSN mask xxx-xx-xxxx counted as XXX and a roles-path-bug directory name counted ×4).
    cobol → 1/1 exact, scheme planned_debt → 1. Re-baselined in keyword-rosetta PR #10.

    2. Missing rule w/ morphology. None — cobol's rule surface was already the registry's deepest.

    3. Corpus authoring gap. comment_lines 14 vs 30 (−53%, lowest of all 46): the cobol shells
    were the only corpus language authored with zero blank lines (fortran/ada siblings carry ~12;
    blanks are legal COBOL). Re-authored with idiomatic spacing + neutral banners (signal placement
    unchanged) → 33, in-band (PR #10).

    4. Intended morphology — ledgered.

    • args 1 vs 13: new validated entry cobol-args-clause-match-morphology. Bucket-3 test run
      first (the jcl PARM= precedent): verified empirically the file-level metric counts
      USING/RETURNING clause matches, not captured names — a 13-name PROCEDURE DIVISION USING
      still records struct_args 1 — and every per-probe alternative (CALL/ENTRY/INVOKE … USING) is also an api keyword → overlap-cost rejection (jcl DISP= precedent).
    • globals +50%: WORKING-STORAGE SECTION in the globals rule — deliberate shared-state
      design, already ledgered (cobol-working-storage-globals); keeping the rule confirmed.

    5. Median inflation / cross-cutting — cobol is the honest one.

    Artifacts

    Close criterion

    Every remaining deviation is ledgered as intended morphology (args, globals) or blocked on a
    named cross-cutting issue (state_mutation → #2546; high_risk_execution/io → #2535; §3 →
    downstream). Per the epic, that satisfies the close condition — recommending close once #2622 and
    rosetta PR #10 merge; closing is your call.

  3. squid-protocol commented on Sep 1, 2026

    @squid-protocol
    OwnerAuthor

    Closing per the sweep summary above: 6🔴/4🟡 → 3🔴/4🟡, and every remaining deviation is ledgered as intended morphology (args → cobol-args-clause-match-morphology, globals → cobol-working-storage-globals) or blocked on a named cross-cutting issue (state_mutation → #2546, high_risk_execution/io → #2535, §3 → downstream re-baseline). Choreography landed: gitgalaxy#2622 + #2623 merged, keyword-rosetta#10 merged, KEYWORD_ROSETTA_REF → 89911a8, rosetta-audit green on main against the new pin.

  4. squid-protocol commented on Sep 3, 2026

    @squid-protocol
    OwnerAuthor

    Status: 0🔴 / 1🟡 unexplained, 8 further out-of-band cell(s) accounted for

    Generated from docs/bias_data.json + deviation_ledger.json by tools/issue_status.py, using the same verdict machinery bias_report.py --gate runs on (gitgalaxy#2669 E.1), so this comment and the gate cannot disagree about what is left.

    Still unexplained — the work this issue tracks

    metric value median dev group
    🟡 encapsulation_ratio 0.5 0.75 -33% signals

    Out of band, but accounted for

    derived — the deviation entered through an input that is itself out of band -- the same finding counted twice

    • structural_mass — inherits args

    ledgered — a validated ledger entry names this language and this metric

    • args — cobol-args-clause-match-morphology, args-no-parameter-surface-morphology
    • avg_func_args — args-no-parameter-surface-morphology
    • avg_func_loc — function-body-length-morphology
    • control_flow_ratio — control-flow-ratio-denominator-is-a-vocabulary-tally
    • func_internal_density — function-body-length-morphology
    • globals — cobol-working-storage-globals
    • risk_safety_score — path-and-extension-modifiers

    Close criterion (gitgalaxy#2669 Batch E.4)

    python tools/language_deviations.py cobol exits 1: 1 unexplained cell(s) remain. Each needs a fix, or a validated ledger entry saying why it is correct, before this issue can close.

  5. squid-protocol commented on Sep 5, 2026

    @squid-protocol
    OwnerAuthor

    Reopen flag resolved (E.4 had noted this issue was closed pre-E.1 but no longer passed the machine gate): as of keyword-rosetta#54's n/a sweep, language_deviations.py cobol exits 0 again — every cobol deviation carries a recorded reason. No reopen owed; F.6's loop reopens automatically on future drift.

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

    core-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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions