Skip to content

feat(core-engine): language-strictness table + measured fidelity coefficients replace the three-bucket tiers (#2718) - #2721

Merged
squid-protocol merged 2 commits into
mainfrom
feat/2718-strictness-fidelity
Sep 4, 2026
Merged

feat(core-engine): language-strictness table + measured fidelity coefficients replace the three-bucket tiers (#2718)#2721
squid-protocol merged 2 commits into
mainfrom
feat/2718-strictness-fidelity

Conversation

@squid-protocol

@squid-protocol squid-protocol commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Child of #2716 (design pass approved 2026-09-04). Same equations; the two constants they read now come from a documented table and a measured table instead of a three-bucket lookup on the language's name.

What changed

analysis_lens.LANGUAGE_STRICTNESS replaces _get_tier + TIER_VARS (Irc / Ot). One row per language, four yes/no columns checkable against the language's documentation — static types · enforced errors · memory safe · no implicit globals. Irc = number of gaps (0–4), Ot = 1 + 0.1·Irc. None rows (yaml, json, css, html, …) have no runtime and carry no language-level term; an unknown language also gets none — the opposite of the old fall-through to the harshest bucket. LANGUAGE_FAMILY resolves dialects first, so embedded_python reads python's row (#2653). The dead FIDELITY_TIERS (one occurrence repo-wide, disagreeing with the live sets for ~20 languages) is deleted.

gitgalaxy/standards/fidelity_table.py replaces the single per-language Fc. Generated by tests/tools/fidelity_table.py from keyword-rosetta: fc(lang, signal) = min(1, planted / measured), where planted is the SPEC's plant (the corpus-wide median of the manifests) and measured is what the rule found. A safety rule that fires 3 times on 2 planted constructs now credits each hit at 2/3; under-firing stays at 1.0 on purpose (a rule to fix, never compensated). The engine reads it per signal — safety, test, doc, ownership — at each defence site. One deliberate consequence in _calc_documentation: only the rule hits (doc, ownership) carry the coefficient; doc_loc and the GuideStar umbrella are structural evidence, not rule hits, and are no longer scaled (they used to sit inside the × Fc bracket). --check fails when the committed module is stale against the sibling corpus (test_committed_fidelity_table_is_fresh_against_the_corpus, skipped without the corpus); --docs renders both tables into 08-03.

_calc_safety's systems_buffer_ratio is retired (closes #2717). Keyed on fc < 1.0 it made every non-tier-1 file score safer than tier 1 above 6/15 attack-weighted hits — 592 crucible files. The over-firing it compensated for (C's pointer syntax) is now scaled at the source by the fidelity coefficient.

Docs. 08-03's tier paragraph is now the chain — what a regex can't see → the three inputs and where each is sourced → the invariants → the pilot that will validate the strictness weight — with the strictness and fidelity tables rendered from the data files between <!-- generated:… --> markers, never typed. 03-02's hand-written "Tier" column is labelled as the retired 2025 buckets and points at the live table; 08-08 / 08-09 / 08-15 / 08-16 say where Irc and Fc come from.

What moved, and why it's the expected shape

Golden master regenerated in both venvs and attributed with golden_diff.deep_compare (uncapped): 8,803 substantive diffs, 0 topological — risk columns only, no structural or coordinate movement.

Gauntlet

Not in this PR

Closes #2718
Closes #2717
Closes #2653

🤖 Generated with Claude Code

…ficients replace the three-bucket tiers (#2718)

Same equations; the constants they read come from different places. `_get_tier`'s two
inline hand lists (45 of 59 languages fell through to fc 0.60 / irc 5 / ot 1.40) and the
dead `FIDELITY_TIERS` are replaced by:

- `analysis_lens.LANGUAGE_STRICTNESS`: one row per language, four yes/no columns
  (static types, enforced errors, memory safe, no implicit globals); Irc = gaps,
  Ot = 1 + 0.1*Irc; `None` for data/markup/config (no term); `LANGUAGE_FAMILY`
  resolves dialects so embedded_python reads python's row (#2653).
- `gitgalaxy/standards/fidelity_table.py`, generated by tests/tools/fidelity_table.py
  from keyword-rosetta: fc(lang, signal) = min(1, planted / measured), read per
  signal (safety, test, doc, ownership) at every defence site. `--check` guards
  staleness; `--docs` renders both tables into docs/wiki/08-03.
- `_calc_safety`'s systems_buffer_ratio retired (#2717): keyed on fc < 1.0 it scored
  592 crucible files SAFER than tier 1 for identical evidence.
- `_calc_documentation` scales only rule hits by fidelity; doc_loc and the umbrella
  are structural evidence and no longer sit inside the coefficient.

Golden master re-blessed in both venvs: 8,803 risk-column diffs, 0 topological;
rust/java/yaml/json untouched; ex-tier-3 languages down, ts/js/python/c/cpp slightly
up. rosetta_audit 46/46, tree-sitter 30/30, tri 3/3, audit_check clear.

Closes #2718
Closes #2717
Closes #2653

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@squid-protocol squid-protocol added metrics Heuristics, risk exposures, and topological math updates core-engine Modifications to the central physics and parsing engine labels Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

…NESS annotation -- Python 3.9 evaluates module-level annotations at import

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@squid-protocol
squid-protocol merged commit 3017110 into main Sep 4, 2026
29 checks passed
@squid-protocol
squid-protocol deleted the feat/2718-strictness-fidelity branch September 4, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core-engine Modifications to the central physics and parsing engine metrics Heuristics, risk exposures, and topological math updates

Projects

None yet

1 participant