Repository navigation
Description
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
- Corpus folder:
data/shell/—expected_signals.jsoncarries the shape-by-shape accounting - Gate:
GALAXYSCOPE_BIN=<venv>/bin/galaxyscope python tools/verify_language.py shellin the corpus repo - Full context: findings_by_language.md#shell · bias_report.md · bias chart
Activity
squid-protocol commentedon Sep 3, 2026
Status: clean — every out-of-band metric is accounted for
Generated from
docs/bias_data.json+deviation_ledger.jsonbytools/issue_status.py, using the same verdict machinerybias_report.py --gateruns 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 branchledgered — a validated ledger entry names this language and this metric
avg_func_complexity— synthetic-global-context-bucket-counts-as-a-functionbranch— string-literal-selective-shielding, shell-test-brackets-in-branchcog_raw— synthetic-global-context-bucket-counts-as-a-functionglobals— shell-trap-signal-env-collisionmax_func_complexity— synthetic-global-context-bucket-counts-as-a-functionClose criterion (gitgalaxy#2669 Batch E.4)
python tools/language_deviations.py shellexits 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.squid-protocol commentedon Sep 3, 2026
Closing per gitgalaxy#2669 Batch E.4:
python tools/language_deviations.py shellexits 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 shellafter any future regen; if a new unexplained cell appears, this issue should be reopened rather than a new one filed.