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
- 🔴
doc: 2 vs median 1 (+100%) - 🟡
high_risk_execution: 3 vs median 2 (+50%) - 🟡
io: 4 vs median 3 (+33%) - 🟡
safety_bypasses: 3 vs median 2 (+50%)
3. Risk-exposure consequences (downstream)
- 🔴
risk_api_exposure: 9.73064 vs median 5.31104 (+83%) - 🔴
risk_cognitive_load: 6.37874 vs median 15.1444 (-58%) - 🔴
risk_safety_score: 70.1726 vs median 37.297 (+88%) - 🔴
risk_state_flux: 37.3978 vs median 19.9999 (+87%) - 🟡
risk_documentation: 75.9927 vs median 57.1208 (+33%)
Ledgered shapes touching fortran
| 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 |
state-flux-branch-weighting |
engine-semantic | #2546 | b.f90 | state_mutation is recorded x3 when branch context exists in the file ('flux' semantics, matching the state_flux column name) |
fortran-goto-dual-branch-highrisk |
keyword-overlap | — | (notes) | GOTO is in both fortran's branch rule and its high_risk_execution rule — one planted GOTO counts both |
fortran-use-case-insensitive-dag |
upstream-bug | #2540 | (notes) | 'USE A' does not resolve to a.f90 in the dependency DAG (popularity stays 0, orphan->api conversion never fires); 'USE a' resolves |
string-literal-selective-shielding |
upstream-question | #2535 | b.f90 | 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.f90 ·
never uses GOTO and no DO loop(comment): stripped: contributed 0 - b.f90 ·
NOTE = 'IF GOTO FAILS TRY OPEN AGAIN'(string): COUNTED like cobol: IF+GOTO (branch +2), GOTO (high_risk +1), OPEN (io +1); TRY inert (not a fortran keyword). Also triggers the flux weighting on this file's 2 assignments (state 2 -> 6). Ledger: string-literal-selective-shielding, state-flux-branch-weighting - c.f90 ·
HACK_LEVEL = LEV(code): inert (underscore tokenization, as python) — but the assignment itself counts state_mutation +1 (fortran counts every NAME = value)
Reproduce / evidence
- Corpus folder:
data/fortran/—expected_signals.jsoncarries the shape-by-shape accounting - Gate:
GALAXYSCOPE_BIN=<venv>/bin/galaxyscope python tools/verify_language.py fortranin the corpus repo - Full context: findings_by_language.md#fortran · bias_report.md · bias chart
Activity
squid-protocol commentedon Sep 1, 2026
Triaged this against the current engine state (
tools/verify_language.py fortranin keyword-rosetta passes 73/73 assertions vs.expected_signals.json— numbers above are current, not stale). No self-contained gitgalaxy fix is actionable right now; every §2 deviation traces to one of three buckets:Blocked on open cross-cutting issues
high_risk_execution(+50%, 3 vs 2) andio(+33%, 4 vs 3): both entirely from b.f90'sNOTE = 'IF GOTO FAILS TRY OPEN AGAIN'string literal being counted as real code (GOTO → high_risk_execution, OPEN → io). Root cause is prism/detector: string-literal shielding is selective by signal family (if/try/open count inside a literal, eval does not) #2535 (string-literal-selective-shielding). Once that lands, both drop to 2 and 3 respectively — back in band. Nothing fortran-specific to do here.Not a bug — already reviewed and blessed as intentional
safety_bypasses(+50%, 3 vs 2): I initially proposed droppingCOMMONfrom this rule (it's a plain shared-memory declaration, already captured byglobals; matches how C/Ada scope this signal to genuine unsafe-reinterpretation constructs likestrcpy/Unchecked_Conversion, not plain globals). That's wrong for this codebase specifically —tests/extraction/languages/test_fortran_strict.py::test_fortran_globals_vs_safety_bypasses_common_intentional_double_classificationexplicitly locks in COMMON firing bothglobalsandsafety_bypassesas an intentional double-classification, reviewed in Fix #581: Strict parsing tests for fortran structural signatures #764 (closing Strict parsing tests:fortranstructural signatures #581). Fortran's COMMON blocks are a real legacy unchecked-memory-sharing hazard (mismatched types/sizes across files is classic UB), not just a plain global var — the prior review's call stands. Reverted my change; no fix here.Corpus-content question, not a gitgalaxy defect
doc(+100%, 2 vs 1): main.f90 plants two doc-comment lines (Author:+Description:); thedocregex correctly matches both. Other languages' corpus files apparently plant only one. This is a keyword-rosetta content question (sibling repo), not an engine bug.Already ledgered, no active impact
fortran-goto-dual-branch-highrisk: GOTO's dual role doesn't currently pushbranchout of band (stays in-band at 4), and matches the corpus's own hand-verified expectations (main.f90's PROBE_RISK plants GOTO+ASSIGN as the two intended high-risk hits). Removing the overlap would swinghigh_risk_executionfurther from median, not closer — leaving as-is.census-requires-git-tracked: generic engine-semantic note, not fortran-specific.Leaving this open pending #2535 (and #2540/#2546 for the downstream §3 risk numbers) — re-run the gate once those land to see where fortran actually sits.
squid-protocol commentedon Sep 3, 2026
Status: 4🔴 / 0🟡 unexplained, 6 further out-of-band cell(s) 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.Still unexplained — the work this issue tracks
risk_api_exposurerisk_documentationrisk_safety_scorerisk_state_fluxOut of band, but accounted for
derived — the deviation entered through an input that is itself out of band -- the same finding counted twice
avg_func_complexity— inherits branchfunc_internal_density— inherits branchstructural_mass— inherits branchledgered — a validated ledger entry names this language and this metric
branch— string-literal-selective-shielding, fortran-goto-dual-branch-highrisksafety_bypasses— string-literal-selective-shielding, fortran-common-globals-safety-dual-classificationstate_mutation— string-literal-selective-shielding, state-flux-branch-weightingClose criterion (gitgalaxy#2669 Batch E.4)
python tools/language_deviations.py fortranexits 1: 4 unexplained cell(s) remain. Each needs a fix, or a validated ledger entry saying why it is correct, before this issue can close.squid-protocol commentedon Sep 6, 2026
Closed 2026-09-06 as superseded by #2812 (
docs/contract_roadmap.md, decision D2). Every out-of-band cell for fortran is accounted for (the gate reads 0 unexplained) and is now tracked by cause family, not by language: the ledger entry that explains it, its cause category in keyword-rosetta'sdocs/bias_data.json["cell_categories"](echo / inherency / extraction / correlation / scoring), and the family issue #2812 lists for that cause. Live standing at any time:python tools/language_deviations.py fortranin keyword-rosetta, ordocs/findings_by_language.md#fortran.This is a change of axis, not a claim that fortran is green. The §10 capstone in
docs/language_status/fortran.mdis written when the language reads clean bylanguage_deviations.py, by whichever family PR gets it there — no longer tied to this issue.