Skip to content

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    core-engineModifications to the central physics and parsing enginemetricsHeuristics, risk exposures, and topological math updates

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions