Skip to content

rosetta[sqlite]: cross-language consistency — 8 red / 2 amber metrics, 4 ledgered shapes #2601

Closed as not planned

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%)
  • 🔴 functions_found: 28 vs median 13 (+115%)

2. Signal / keyword deviations

  • 🔴 io: 11 vs median 3 (+267%)
  • 🔴 keyword_hits: 116 vs median 247.5 (-53%)
  • 🔴 safety_bypasses: 0 vs median 2 (-100%)
  • 🟡 state_mutation: 3 vs median 6 (-50%)

3. Risk-exposure consequences (downstream)

  • 🔴 risk_cognitive_load: 5.53524 vs median 15.1444 (-63%)
  • 🔴 risk_state_flux: 0 vs median 19.9999 (-100%)
  • 🔴 risk_tech_debt: 60 vs median 39.9576 (+50%)
  • 🟡 risk_spec_match: 64 vs median 96 (-33%)

Ledgered shapes touching sqlite

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
sqlite-dot-read-dual-import-io keyword-overlap — (notes) ^.read counts BOTH import and io (finditer-confirmed) — every corpus chain link adds +1 io in sqlite
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.sql 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.sql · never detaches a database and no shell word (comment): stripped: contributed 0
  • b.sql · SELECT 'IF UPDATE FAILS TRY SELECT AGAIN' (string): UPDATE and SELECT inside the literal COUNT (io +2, state +1); IF/TRY inert (sqlite has no bare IF/TRY keywords). io 5 = planted UPDATE + carrier SELECT + .read + 2 from the literal. Ledger: string-literal-selective-shielding
  • c.sql · hack_level; (code): inert (underscore + lowercase)

Reproduce / evidence

Activity

  1. added
    metricsHeuristics, risk exposures, and topological math updates
    core-engineModifications to the central physics and parsing engine
    on Aug 31, 2026
  2. squid-protocol commented on Sep 3, 2026

    @squid-protocol
    OwnerAuthor

    Status: 3🔴 / 3🟡 unexplained, 12 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
    🔴 functions_found 30 13 +131% structure
    🔴 keyword_hits 67 148 -55% structure
    🟡 coding_loc 8.75 17.12 -49% signals
    🟡 total_loc 16 24.75 -35% signals
    🔴 risk_api_exposure 0 5.289 -100% risk
    🟡 risk_tech_debt 24.55 46.57 -47% risk

    Out 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_loc — inherits total_loc, coding_loc
    • cog_raw — inherits branch, args, total_loc, coding_loc
    • control_flow_ratio — inherits branch
    • func_internal_density — inherits branch, args
    • max_func_complexity — inherits branch

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

    • args — args-no-parameter-surface-morphology
    • avg_func_args — args-no-parameter-surface-morphology
    • branch — string-literal-selective-shielding
    • io — string-literal-selective-shielding, sqlite-dot-read-dual-import-io
    • risk_cognitive_load — path-and-extension-modifiers
    • risk_documentation — path-and-extension-modifiers
    • risk_state_flux — path-and-extension-modifiers

    Close criterion (gitgalaxy#2669 Batch E.4)

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

  3. squid-protocol commented on Sep 6, 2026

    @squid-protocol
    OwnerAuthor

    Closed 2026-09-06 as superseded by #2812 (docs/contract_roadmap.md, decision D2). Every out-of-band cell for sqlite 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's docs/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 sqlite in keyword-rosetta, or docs/findings_by_language.md#sqlite.

    This is a change of axis, not a claim that sqlite is green. The §10 capstone in docs/language_status/sqlite.md is written when the language reads clean by language_deviations.py, by whichever family PR gets it there — no longer tied to this issue.

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 enginemetricsHeuristics, risk exposures, and topological math updates

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions