Skip to content

rosetta[shell]: cross-language consistency — 1 red / 5 amber metrics, 5 ledgered shapes #2599

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)

In band — no structure-level deviations.

2. Signal / keyword deviations

  • 🟡 globals: 3 vs median 2 (+50%)
  • 🟡 io: 4 vs median 3 (+33%)
  • 🟡 keyword_hits: 169 vs median 247.5 (-32%)
  • 🟡 safety_bypasses: 3 vs median 2 (+50%)

3. Risk-exposure consequences (downstream)

  • 🔴 risk_cognitive_load: 29.5468 vs median 15.1444 (+95%)
  • 🟡 risk_documentation: 74.608 vs median 57.1208 (+31%)

Ledgered shapes touching shell

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
shell-test-brackets-in-branch engine-semantic — (notes) shell's branch rule counts the test brackets [ and ] as branch tokens (finditer on main.sh: if,[,],then,fi = 5 for one conditional) — every bracketed test costs +2 branc…
shell-trap-signal-env-collision keyword-overlap — (notes) 'trap : TERM' counts globals: the TERM signal name collides with the TERM env-var keyword in shell's globals rule (a.sh globals 3 for 2 planted)
orphan-conversion-opaque-counts upstream-question #2547 (notes) On languages without a same-file call graph the orphan census includes non-function shapes, so the orphan->api conversion count diverges from visible function counts: sh…
string-literal-selective-shielding upstream-question #2535 b.sh 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.sh · never needs root and the disk words stay in prose (comment): stripped: contributed 0
  • b.sh · note="if eval fails, try curl" (string): if (branch +1), curl (io +1) AND eval (safety_bypasses +1) all COUNT — eval is a shell BYPASS keyword, not high-risk-family, and it is not shielded here, supporting the theory that only the high-risk family gets literal shielding in the python/js profile. Phantom branch context triples state: counter=/note= 2 raw -> 6. Ledger: string-literal-selective-shielding, state-flux-branch-weighting
  • c.sh · : "$hack_level" (code): inert (underscore + lowercase)

Reproduce / evidence

Activity

  1. added
    metrics
    core-engine
    on Aug 31, 2026
  2. squid-protocol commented on Sep 3, 2026

    @squid-protocol
    OwnerAuthor

    Status: clean — every out-of-band metric is 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.

    Out of band, but accounted for

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

    • control_flow_ratio — inherits branch

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

    • avg_func_complexity — synthetic-global-context-bucket-counts-as-a-function
    • branch — string-literal-selective-shielding, shell-test-brackets-in-branch
    • cog_raw — synthetic-global-context-bucket-counts-as-a-function
    • globals — shell-trap-signal-env-collision
    • max_func_complexity — synthetic-global-context-bucket-counts-as-a-function

    Close criterion (gitgalaxy#2669 Batch E.4)

    python tools/language_deviations.py shell exits 0: nothing is unexplained and no n/a cell is unreviewed. That is not the same as "no metric deviates" — deviations remain, and each is named above with the reason it is not a defect. This issue has nothing language-specific left to do.

  3. squid-protocol commented on Sep 3, 2026

    @squid-protocol
    OwnerAuthor

    Closing per gitgalaxy#2669 Batch E.4: python tools/language_deviations.py shell exits 0 against the current corpus (keyword-rosetta main) and engine main.

    The criterion is not "no metric deviates" — shell still has out-of-band metrics, and the status comment above lists every one of them. It is that each carries a recorded reason it is not a defect: a validated ledger entry naming this language and metric, an inherited deviation from an input that is itself out of band, or a per-function descriptor for a language with no functions. Nothing is left that is specific to shell.

    That criterion only became machine-checkable in this batch: E.1 (keyword-rosetta#40) taught the report to read the ledger it already had, and Batch D (keyword-rosetta#41) supplied the five entries the shape-descriptor family needed. Re-run tools/issue_status.py shell after any future regen; if a new unexplained cell appears, this issue should be reopened rather than a new one filed.

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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions