Skip to content

fix(rules): widen globals residue forms + swift branch .default — closes #2859 - #2958

Merged
squid-protocol merged 2 commits into
mainfrom
fix/2859-globals-residue-wideners
Sep 11, 2026
Merged

fix(rules): widen globals residue forms + swift branch .default — closes #2859#2958
squid-protocol merged 2 commits into
mainfrom
fix/2859-globals-residue-wideners

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Residue of the globals contract (#2858, roadmap Phase 3, epic #2812). #2858 recorded a set of program-scope forms its rules could not yet see as conforming-by-absence-of-evidence and deferred them; this widens them — each gated on a rule_probe crucible measurement — plus the one concrete misfire the issue filed against another signal.

swift branch .default (C3, #2822)

A switch default: is a decision, but the dotted singleton accessor (FileManager.default, .default) is not — it is io/events' hit. The (?<!\.) guard is the mirror of the fix #2858 made on globals' side. Crucible 781 → 759.

globals wideners (contract C1 unless noted)

lang change crucible
go var (/const ( group members via a new go_declaration_group scope filter (over-match indented lines, keep only members directly inside a column-0 group; struct fields & body statements drop). \b(?![\w.(]) stops the over-match shadowing a same-line os.* handle 105 → 237
java / csharp any class-static field, not just public … SCREAMING_CASE =; [=;] excludes methods and static {}/auto-property blocks 8 → 22 / 0 → 5
dart static var and column-0 late final 25 (by-contract; no corpus instance)
assembly (C4) label-on-its-own-line two-line form (msg:.asciz) 226 → 478
tcl (C3) (?<!\$) drops the $global read, keeps global NAME… 193 (precision)
agc_assembly dead ERASABLE MEMORY/FIXED MEMORY/WORKING-STORAGE prose and routine-label COMMON out; NAME ERASE in 25 → 23
lua unchanged — the SCREAMING_CASE arm is a deliberate state_mutation dual

Narrowed from the original plan: agc EQUALS/= equates are not counted — a constant binding (C2) and a rosetta decoy; counting them would be the "widen blind" mistake #2858 warned against.

Verification

  • rule_probe before/after on the crucible for each language; new hits inspected — all genuine program-scope bindings, no false-positive floods.
  • 8314 tests pass (test_globals_contract_2858, test_branch_contract_2822, touched _strict suites, full tests/extraction + tests/core_engine).
  • Golden masters regenerated in both venvs; only globals/branch/control_flow_ratio cells moved.
  • Both contract docs' audit tables and deferred-residue sections updated.

Paired corpus re-bless

The only rosetta cell this moves vs engine main is agc a.agc (its planted 2 were COMMON labels). Re-planted on FLAGWRD reads in squid-protocol/keyword-rosetta#fix/2859-agc-globals-replant (verify_language.py agc_assembly: PASS). Labelled rosetta:rebless-owed.

🤖 Generated with Claude Code

https://claude.ai/code/session_01N9vXSpVqnMQfdxPREA2Z2Z

…closes #2859

Residue of the globals contract (#2858, roadmap Phase 3, epic #2812). #2858
recorded a set of program-scope forms its per-language rules could not yet see
as "conforming-by-absence-of-evidence" and deferred them; this widens them,
each gated on a rule_probe crucible measurement, plus the one concrete misfire
the issue filed against another signal.

swift branch (C3, #2822): a switch `default:` is a decision but the dotted
singleton accessor (`FileManager.default`, `.default`) is not -- it is io/events'
hit. The `(?<!\.)` guard is the mirror of the fix #2858 made on globals' side.
Crucible 781 -> 759.

globals wideners (contract C1 unless noted):
- go: `var (`/`const (` group members are indented, invisible to the column-0
  anchor. The middle arm over-matches indented declaration-shaped identifier
  lines and a new `go_declaration_group` scope filter (detector.py, the scheme
  `_scope_filters` shape) keeps only members directly inside a column-0 group,
  dropping struct-literal fields and body statements. `\b(?![\w.(])` stops the
  over-match shadowing a same-line os.* handle. 105 -> 237.
- java/csharp: any class-static FIELD, not just `public ... SCREAMING_CASE =`;
  the `[=;]` terminator excludes methods and `static {}`/auto-property blocks.
  8 -> 22, 0 -> 5.
- dart: `static var` and column-0 `late final`.
- assembly (C4 continuation): the label-on-its-own-line two-line form
  (`msg:` then `.asciz` on the next line). 226 -> 478.
- tcl (C3): `(?<!\$)` drops the `$global` variable read, keeps `global NAME...`.
- agc_assembly: the dead `ERASABLE MEMORY`/`FIXED MEMORY`/`WORKING-STORAGE`
  prose and the routine-label `COMMON` out; `NAME ERASE` (erasable allocation)
  in. The `EQUALS`/`=` equate is a constant binding (C2) and a rosetta decoy,
  so it stays out. 25 -> 23.
- lua: unchanged -- the SCREAMING_CASE arm is a deliberate state_mutation dual.

Golden masters regenerated (both legs); contract docs' audit tables and
deferred-residue sections updated; cross-language contract-test pins and the
go scope-filter tests added.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N9vXSpVqnMQfdxPREA2Z2Z
@squid-protocol squid-protocol added the rosetta:rebless-owed Intentionally moves keyword-rosetta counts; audit warns, corpus re-blesses after merge label Sep 11, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

ruff-audit (pinned 0.16.0): reflow two contract-test lists/quotes to ruff
format, and collapse the go filter's closer branch to a single
`elif c in ")}]" and stack:` (SIM102). No behavior change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N9vXSpVqnMQfdxPREA2Z2Z
@squid-protocol
squid-protocol marked this pull request as ready for review September 11, 2026 13:30
@squid-protocol
squid-protocol merged commit 020a33f into main Sep 11, 2026
32 checks passed
@squid-protocol
squid-protocol deleted the fix/2859-globals-residue-wideners branch September 11, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rosetta:rebless-owed Intentionally moves keyword-rosetta counts; audit warns, corpus re-blesses after merge

Projects

None yet

1 participant