Skip to content

Go encapsulation: lowercase names in package main are no visibility decision (Part of #5897) - #6701

Merged
squid-shepherd[bot] merged 2 commits into
mainfrom
churn/5897-20261026T0120Z
Oct 26, 2026
Merged

squid-shepherd[bot] merged 2 commits into
mainfrom
churn/5897-20261026T0120Z

Conversation

@squid-protocol

Copy link
Copy Markdown
Owner

Part of #5897 (first acceptance item: the rule). Does NOT close it.

What

Go encapsulation no longer counts lowercase func/type/var/const declarations in a package main file (nothing in a main package can be imported, so the spelling is no visibility decision). Library packages count exactly as before. Mechanism: a new go_package_main entry in go's existing _scope_filters (detector.py _apply_scope_filter), declared for encapsulation in go.py. Tests in test_go_strict.py cover func, method, type and var in package main (0) and in package render, package maintenance, package main_test (4 each; Exported not counted).

Evidence

  • language-crucible has no Go package main file: crucible_check.py passes both legs with zero drift, no re-bless.
  • pr_gates --fast 7/7, --ratchets 9/9 (0 skipped).
  • Fixture from the issue: file and function def_encapsulation are 0 under a real galaxyscope scan.

The issue's premise does not hold for gore (re-measured, this engine)

gore (doom-study/repos/gore @3e18c5d) has 63 funcs in package main (7 files) and 962 of 1,025 in package 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. Go package main_test / internal/: not special-cased (a _test package can't be imported either, but it is a library-shaped package; left counting, stated by the test). Rust: encapsulation counts only pub(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):

  • Option 2: down-weight def_encapsulation in the function-archetype model for visibility-morphology languages (go, perl). Touches analysis_lens.GENERAL_FUNCTION_INFERENCE_MODEL/archetype brains: golden re-bless of the archetype distribution. Needed to meet the 10-point target.
  • keyword-rosetta 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).
  • Perl and Rust rule review against the same question.

Cross-repo

Companion: keyword-rosetta PR (Go expected counts), merges after this one; re-run rosetta-audit then.

🤖 Generated with Claude Code

…ility decision (Part of #5897)

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
@squid-protocol squid-protocol added the shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md label Oct 26, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot marked this pull request as ready for review October 26, 2026 01:51
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd
squid-shepherd Bot enabled auto-merge (squash) October 26, 2026 01:51
@github-actions

Copy link
Copy Markdown
Contributor

🐦‍⬛ Muninn Security Scan

✅ No security issues found.

🐦‍⬛ Powered by Muninn · Skald Lab

@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #6701 @ 608cd8a: 1 failed check(s)

== rosetta-audit (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/40256265631/job/121358663889
repro: no local equivalent; read the check page
errors:
REG go FAIL go: 1 mismatch(es)
pre haskell FAIL haskell: 8 mismatch(es)
pre shell FAIL shell: 6 mismatch(es)
##[error]go: this build moves the control corpus -- FAIL go: 1 mismatch(es)
##[error]Process completed with exit code 1.
log tail:
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Post job cleanup.
[command]/usr/bin/git version
git version 2.55.0
Temporarily overriding HOME='/home/runner/work/_temp/4eb41597-62f1-40d3-8a55-055c692b9d19' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy-baseline
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Post job cleanup.
[command]/usr/bin/git version
git version 2.55.0
Temporarily overriding HOME='/home/runner/work/_temp/637f0f58-c381-4cb0-814e-e15faef642b7' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

@squid-shepherd squid-shepherd Bot added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 26, 2026
@squid-protocol squid-protocol added rosetta:rebless-owed Intentionally moves keyword-rosetta counts; audit warns, corpus re-blesses after merge shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md and removed shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md labels Oct 26, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd squid-shepherd Bot removed the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 26, 2026
@squid-shepherd

Copy link
Copy Markdown
Contributor

No description provided.

@squid-shepherd

Copy link
Copy Markdown
Contributor

PR #6701 @ 7418d57: 1 failed check(s)

== shard 1 (1669449 LOC) (failure) -- real
https://github.com/squid-protocol/gitgalaxy/actions/runs/40258030173/job/121364483391
repro: python tests/tools/pr_gates.py --fast
failing tests: tests/doom_rosetta/test_doom_rosetta.py::test_port_matches_golden[dartdoom]
errors:
E AssertionError:
tests/doom_rosetta/test_doom_rosetta.py:47: AssertionError
FAILED tests/doom_rosetta/test_doom_rosetta.py::test_port_matches_golden[dartdoom] - AssertionError:
##[error]Process completed with exit code 1.
log tail:
file test/boss_ai_test.dart: func_hash 'cf2e842db8c6aced' -> '78a21e610a7a6f23'
file test/music_smoke_test.dart: func_hash 'd71d076866ff66e6' -> '835e0df2e118ab60'
file test/render_masked_fuzz_test.dart: func_hash '2612a7d9716308b5' -> '35d68bbb83f9f33b'
file test/sound_smoke_test.dart: func_hash '9ecdb3f8671f1570' -> '74c21262c7282ff3'
(bless an intended change with tests/tools/doom_rosetta_check.py --update --yes)
assert not "dartdoom: 37 difference(s) from the golden\n file lib/doom/am_map.dart: func_hash '8dec377071244a34' -> '9aa027533f8...716308b5' -> '35d68bbb83f9f33b'\n file test/sound_smoke_test.dart: func_hash '9ecdb3f8671f1570' -> '74c2126
1 failed, 9 passed, 26 deselected in 159.42s (0:02:39)
##[error]Process completed with exit code 1.
##[group]Run s=$(( $(date +%s) - T0 ))
s=$(( $(date +%s) - T0 ))
echo "shard 1 (1669449 LOC): ${s}s" >> "$GITHUB_STEP_SUMMARY"
shell: /usr/bin/bash -e {0}
env:
GITGALAXY_LICENSE_KEY: COMMUNITY_FREE_TIER
DOOM_SPEEDRUN_WORK: /home/runner/work/gitgalaxy/gitgalaxy/../doom-work
DOOM_ROSETTA_PORTS: chocolate-doom,cssdoom,dartdoom,doomgeneric,doomsday,edge-classic,mood,room4doom,rust-doom,sdl-doom
T0: 1792981121
pythonLocation: /opt/hostedtoolcache/Python/3.12.15/x64
PKG_CONFIG_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib/pkgconfig
Python_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python2_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
Python3_ROOT_DIR: /opt/hostedtoolcache/Python/3.12.15/x64
LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.12.15/x64/lib
##[endgroup]
Post job cleanup.
[command]/usr/bin/git version
git version 2.55.0
Temporarily overriding HOME='/home/runner/work/_temp/b27385e5-8e89-44ef-bef5-5dcf27699b75' before making global git config changes
Adding repository directory to the temporary git global config as a safe directory
[command]/usr/bin/git config --global --add safe.directory /home/runner/work/gitgalaxy/gitgalaxy/gitgalaxy
Removing SSH command configuration
[command]/usr/bin/git config --local --name-only --get-regexp core.sshCommand
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core.sshCommand' && git config --local --unset-all 'core.sshCommand' || :"
Removing HTTP extra header
[command]/usr/bin/git config --local --name-only --get-regexp http.https://github.com/.extraheader
[command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http.https://github.com/.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
Removing includeIf entries pointing to credentials config files
[command]/usr/bin/git config --local --name-only --get-regexp ^includeIf.gitdir:
[command]/usr/bin/git submodule foreach --recursive git config --local --show-origin --name-only --get-regexp remote.origin.url
Cleaning up orphan processes

@squid-shepherd squid-shepherd Bot added the shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md label Oct 26, 2026
@squid-shepherd
squid-shepherd Bot merged commit 4113edf into main Oct 26, 2026
74 of 77 checks passed
@squid-shepherd
squid-shepherd Bot deleted the churn/5897-20261026T0120Z branch October 26, 2026 02:28
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 shepherd:merge Maintainer: merge when green (auto-merge, squash). Guide: docs/ci.md shepherd:needs-fix Bot: a real failure on this head; see the digest comment. Guide: docs/ci.md

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant