Repository navigation
immutability_locks contract (#2772, rule half): the ordinary binding keyword is not a lock - #2891
Merged
Merged
Conversation
…keyword is not a lock One hit is an added marker or lock call that prevents a binding or value from being changed after initialisation, where the language's default would permit it -- a modifier or qualifier, a restricted constant form distinct from the general-purpose binding, a runtime lock call, or a reference pin; a language whose bindings are immutable by default records the stated absence (docs/immutability_locks_rule_contract.md). The rule was inverted between the two languages making the same guarantee: rust's let invisible, swift's let scoring 11 -- and the signal is the subtrahend in _calc_state_flux, whose low tail (swift -62%, kotlin/scala/ ts -46% on identical planted mutations) was entirely this. 16 rules edited: C1 ordinary bindings dropped (js const 2002->0, ts 6041->2617, scala val 1151->2, dart final 1768->235, kotlin val 39->0), C2 non-data locks dropped (solidity view/pure 63->8, html disabled/inert 76->8, abap FINAL), C3 names dropped (shell echo-string readonly 88->65, cobol hyphenated CONSTANT, powershell pattern strings, rust 'static lifetimes and *const 153->40), C4 haskell (counted monadic return, 84)/swift/zig -> None + stated absence, C5 scheme datum quotes (987->0). Corpus residue: every edited language's idiomatic count -> 0/n-a; the state-flux mitigation term is now ~uniform. The formula half of #2772 (raw-count subtraction vs a ratio) stays open for Phase 4; this PR does not close the issue. Golden masters re-blessed; bless_scope: Immutable Data Declarations + State Flux Exposure/state_flux only; newly parsed/excluded none (one 0.1pt identity-confidence drift on an already-excluded extensionless sconstruct). Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012zPD39y58Bfrr2Q45Z6djL
Contributor
This was referenced Sep 8, 2026
The label turns audit regressions into warnings but na_check --ci stayed a hard gate, so a label-declared rule absence (#2772's haskell/swift/zig None, ledgered in the cross-linked corpus PR) sat red: the workflow checks the corpus out at MAIN, where the reviewing ledger entry cannot exist yet by construction. Under the label a new absence is now a warning; the corpus PR's own na_check (verify.yml) still gates the entry's merge, so nothing can be nulled quietly. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012zPD39y58Bfrr2Q45Z6djL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 3 family (#2812). Sheet row
immutability_locksdraft → stated (15/68):The signal is unplanted and ungated but is the half-weight subtrahend in
_calc_state_flux— the corpus's worst gated metric — and its low tail was entirely this rule: swift −62%, kotlin/scala/typescript −46% against the median, on identical planted mutations, because the shell was written withlet/val/constinstead ofvar. The rule was inverted between the two languages making the same guarantee: rust's immutable-by-defaultletwas invisible while swift'sletscored 11. This contract takes the issue's drop-side resolution: a hit must be a deliberate act distinguishable from simply declaring a variable.16 rules edited
const2002 → 0 (freeze/seal stay), ts 6041 → 2617 (readonly/as const/freeze stay), scalaval1151 → 2 (final val/immutable.*stay), dartfinal1768 → 235 (const/@immutablestay), kotlinval39 → 0 (const valstays).view/pure(purity, 63 → 8), htmldisabled/inert/aria-disabled(interactivity, 76 → 8;readonlystays), abapFINAL(hierarchy).readonly='readonly'(88 → 65, command position now), cobol hyphenatedAN-CONSTANT(guards, 15 → 10), powershell pattern strings (6 → 0, the-Option Constant/ReadOnlyact stays), rust&'staticlifetimes and*constpointers (153 → 40;const/staticitems stay).None+ stated absence: haskell (its rule counted monadicreturn— 84 hits, all noise), swift, zig (whoseconstis the binding form for everything, 16468 crucible hits) — the io/solidity precedent;_calc_state_fluxalready treats a missing signal as 0, exactly how rust always read.string->immutable-stringstays).Corpus idiomatic residue after: js 17→0, ts 14→0, swift 11→n/a, kotlin 6→0, scala 3→0, zig 3→n/a, dart 2→0, abap 1→0 — the mitigation term is now ~uniform, so the state-flux low tail collapses toward the median with no formula change. The formula half of #2772 (raw-count subtraction vs a ratio) stays open for Phase 4; this PR does not close the issue.
Verified
rule_probebefore/after per language is the doc's audit table.Immutable Data Declarations+State Flux Exposure/state_flux(the one consumer) only; newly parsed/excluded none — the single queue diff is a 0.1-point identity-confidence drift on an already-excluded extensionlesssconstruct.rosetta_auditvs the corpus branch (which includes kr#106's base): 46/46, 0 regressions. Full gauntlet green at baseline; ruff/mypy/dead-key/audit_check clean;signal_contract_audit --cigreen, baseline 54.tests/extraction/languages/test_immutability_locks_contract_2772.py(24 tests incl. the three stated absences and a ReDoS sweep).Cross-repo
Corpus PR: squid-protocol/keyword-rosetta#107 (ledger record only — the input is unplanted, no manifest moves; branch includes kr#106's base, so merge kr#106 → this engine PR → the corpus PR).
bias-history.ymlre-runs after.Part of #2812 (does not close #2772 — the formula half is Phase 4's).
🤖 Generated with Claude Code
https://claude.ai/code/session_012zPD39y58Bfrr2Q45Z6djL