Skip to content

feat: exempt constant-table crates via rust-standards.toml, depub 3 stray constants (§18, check 49) - #44

Merged
vshengbro merged 1 commit into
masterfrom
chore/const-visibility-config
Oct 9, 2026
Merged

vshengbro merged 1 commit into
masterfrom
chore/const-visibility-config

Conversation

@vshengbro

Copy link
Copy Markdown
Member

Per the 2026-10-09 ruling: http-constant is a constant-table crate and gets an exemption from the pub-const ban — configured, not hardcoded:

  • rust-standards.toml (new, repo root): pub_const_exempt = ["http-constant"] — a string array of package identifiers. verify_const_visibility.py (check 49) skips flagging the listed crates' own constants while still counting them as readers for other crates' analysis. Verifier + self-test updated in .agents (separate commit).
  • Side effect of the exemption: with http-constant's 2111 hits out of the way, 3 real violations surfaced in other crates. Their external name-hits all resolve to http_constant's own copies, so depub is safe (cargo check --workspace --all-targets rc=0):
    • compress::CONTENT_ENCODING, compress::EMPTY_STR → pub(crate)
    • request::APP_NAME → pub(crate); common re-export switched to pub(crate) use (clippy: glob no longer re-exports anything pub)
    • test_app_name_constant deleted (§18: tests must not verify constants)

Gates: audit 51/51, clippy 0 warnings, fmt idempotent, http-request/http-compress/http-type/hyperlane-core tests all pass (486 total).

…tray constants (§18, check 49)

http-constant's entire API is the constants themselves: exempt it through
the new repo-root config field pub_const_exempt (string array of package
identifiers) instead of hardcoding. The same sweep surfaced three pub
constants outside the table crate with no real external readers (external
name hits all resolve to http_constant's own copies): depub CONTENT_ENCODING
and EMPTY_STR in http-compress, APP_NAME in http-request, switch the
request common re-export to pub(crate), and drop the constant-value
assertion test (§18: tests must not verify constants).

audit 51/51, clippy 0 warnings, fmt clean, affected-crate tests all pass.
@ghfind-review ghfind-review Bot added the review: high ghfind author score; see https://ghfind.com label Oct 9, 2026
@vshengbro
vshengbro merged commit 894e371 into master Oct 9, 2026
8 checks passed
@vshengbro
vshengbro deleted the chore/const-visibility-config branch October 9, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review: high ghfind author score; see https://ghfind.com

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant