Skip to content

Epic: contracts at every layer — stream, count, score (the rosetta roadmap; child of #2560) #2812

Description

@squid-protocol

Child of #2560; supersedes #2669 as the handoff surface for cross-language consistency work. Strategy approved 2026-09-06. The document is docs/contract_roadmap.md (lands with #2811; formatted copy: https://claude.ai/code/artifact/debf7286-7958-48d6-91e5-48b1bbc4abc0). Read it before claiming anything here.

Why this epic exists (one paragraph)

The bias report's consistency badge paints every out-of-band cell the same red, whether the ledger validated it as "this language cannot express that" or as an open engine defect — so the scoreboard could not tell an extraction problem from a language fact, and the work kept looking like an extraction problem. Rolling the 267 gated red cells up by cause: 102 echo (derived), ~45 language inherency, ~50 extraction defects, 38 proximity-correlation effects, ~32 scoring choices. The largest engine-side finding is a layer leak, not a regex: core/spatial_correlation.py edits recorded signal counts in place (×3 cascading flux, silencer dampeners, ×5/×100 amplifiers; documented and pinned by #2631), so the count the corpus reads is never the raw count. The fix is a stated contract at each of the engine's three layers — what text a rule sees (stream), what one hit means (count), how counts combine (score) — and tooling that enforces them.

The goal restated: equal counts for equal constructs. Every remaining cross-language difference comes from one of three declared sources — a strictness stratum (design), an n/a (the language cannot express it), or a filed defect. After that a red dot is a defect by construction. The close criterion is open-defect share 0 and no draft row in the contract sheet, replacing "nothing unexplained".

Session start protocol (every session, every time)

  1. gh issue view <this> --comments — the last comment per item is its true state. Claim by comment: claiming <item> — <model> — branch <name>; stop with status <item>: <done|blocked|partial> — <branch/PR> — <what remains>. Unfinished branches are pushed, never left local.
  2. Read keyword-rosetta docs/bias_report.md from main (regenerated on every corpus push and nightly): the "What the red cells are" section and the open-defect share. Do not regenerate locally to triage; regenerate only to verify a change before a PR.
  3. Read the signal's row in gitgalaxy/standards/signal_contracts.py and the ledger entries naming it before calling any rule a defect (two of the four issues filed from the args audit were already settled in the ledger).
  4. One layer per engine PR (rule regex | slicer/DAG | correlation | scoring). One Closes #N per line. Label rosetta:rebless-owed when the corpus moves; corpus re-bless PR opens against engine main after the engine PR merges (no pins since Cross-repo choreography is circular, and every way it broke today failed green — drop the ENGINE_REF dance, machine-check the invariants #2682/ci: rosetta-audit without pins -- baseline-classified, refuses to no-op (#2682) #2699).
  5. Claim a family (one signal, or one formula), never a language. The per-language issues rosetta[abap]: cross-language consistency — 3 red / 3 amber metrics, 2 ledgered shapes #2561rosetta[zig]: cross-language consistency — 4 red / 2 amber metrics, 5 ledgered shapes #2607 are closed; per-language classification is the keyword-rosetta rosetta-language-sweep skill, called from a family audit, and live standing is python tools/language_deviations.py <lang>.

Decisions (approved 2026-09-06)

Phases

Housekeeping owed (not blocking)

  • gitgalaxy/standards/fidelity_table.py is stale against corpus main (tests/tools/fidelity_table.py --check fails on main since keyword-rosetta#74) — regen owed by the next PR touching the fidelity layer.
  • Untracked scratch files in the engine working tree (gitgalaxy/tests.py, gen_tests.py, parse_regex.py, regexes.txt, temp_search.txt) trip the local ruff/mypy audits; CLAUDE.md's scratch rule applies.

Issue disposition

issues action
#2561#2607 (40 open) + #2560 closed 2026-09-06 as superseded (D2)
#2669 closed with final status; F.4 → Phase 3 families, F.5 → the STRUCTURE COUNTS issues, F.6 retired
#2765 #2766 #2772 #2804 #2805 Phase 3
#2770 #2771 Phase 4
#2792 #2801 #2803 #2806 engine defects, unchanged
keyword-rosetta#75 closed via Phase 0

Activity

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 engineepicLarge-scale architectural milestone or multi-issue initiativemetricsHeuristics, risk exposures, and topological math updates

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions