Repository navigation
Go encapsulation: lowercase names in package main are no visibility decision (Part of #5897) - #6701
Conversation
…ility decision (Part of #5897) Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
|
No description provided. |
|
No description provided. |
|
PR #6701 @ 608cd8a: 1 failed check(s) == rosetta-audit (failure) -- real |
|
No description provided. |
|
No description provided. |
|
PR #6701 @ 7418d57: 1 failed check(s) == shard 1 (1669449 LOC) (failure) -- real |
Part of #5897 (first acceptance item: the rule). Does NOT close it.
What
Go
encapsulationno longer counts lowercasefunc/type/var/constdeclarations in apackage mainfile (nothing in a main package can be imported, so the spelling is no visibility decision). Library packages count exactly as before. Mechanism: a newgo_package_mainentry in go's existing_scope_filters(detector.py_apply_scope_filter), declared forencapsulationin go.py. Tests intest_go_strict.pycover func, method, type and var inpackage main(0) and inpackage render,package maintenance,package main_test(4 each;Exportednot counted).Evidence
package mainfile:crucible_check.pypasses both legs with zero drift, no re-bless.pr_gates --fast7/7,--ratchets9/9 (0 skipped).def_encapsulationare 0 under a realgalaxyscopescan.The issue's premise does not hold for gore (re-measured, this engine)
gore (
doom-study/repos/gore@3e18c5d) has 63 funcs inpackage main(7 files) and 962 of 1,025 inpackage gore(2 files, a library). Option 1 therefore cannot move gore's share: 907 of 1,011 functions (>=3 LOC) still carry an encapsulation hit, 39.3% Stateful Encapsulated Methods + 30.7% Encapsulated Accessors = 70% (was 71.8%). In a library package a lowercase name IS unexported, so the rule is right there; the archetype classifier is what makes spelling dominate. The target (within ~10 points of C's 2%) needs option 2.Class / Sibling gaps
Class: languages whose file-level context decides whether a name-visibility rule means anything. Go
package main: handled here. Gopackage main_test/internal/: not special-cased (a_testpackage can't be imported either, but it is a library-shaped package; left counting, stated by the test). Rust:encapsulationcounts onlypub(crate|super|self)so rosetta's 3-vs-0 is the planted program, not lowercase spelling; unconfirmed here.Sibling gaps (not done, different mechanism or other repo):
def_encapsulationin the function-archetype model for visibility-morphology languages (go, perl). Touchesanalysis_lens.GENERAL_FUNCTION_INFERENCE_MODEL/archetype brains: golden re-bless of the archetype distribution. Needed to meet the 10-point target.visibility-morphology-encapsulation: re-lock Go expected counts (companion PR in keyword-rosetta, after this merges; the planted Go program's package clause decides whether its count moves).Cross-repo
Companion: keyword-rosetta PR (Go expected counts), merges after this one; re-run
rosetta-auditthen.🤖 Generated with Claude Code