Repository navigation
Remove stray dbg! from the privacy checker - #50
Merged
Merged
Conversation
`privacy.rs` carried a live `dbg!` on the `private_constants` branch, so any pack configured with `private_constants` emitted two lines to stderr per checked reference, in released builds as well as debug. It also leaked internal file and line numbers into user-facing output. No fixture configured `private_constants`, so nothing exercised the branch. Add `tests/fixtures/privacy_violations_with_private_constants`, covering all three combinations of the two flags the `dbg!` was printing: ::Bar listed in private_constants -> violation ::Bar::Inner inside the private namespace -> violation ::SomeConcern absent from the list -> no violation The last case is the one that had no coverage: a non-empty `private_constants` list narrows privacy to that list, leaving everything else in the pack public. `test_check_with_private_constants` asserts those outcomes and that stderr is empty, so the `dbg!` cannot come back unnoticed. Fixes #49
perryqh
approved these changes
Aug 19, 2026
dduugg
added a commit
that referenced
this pull request
Sep 26, 2026
Retitle `## Unreleased` to `## 0.5.0`, since cargo-dist builds the GitHub Release notes by matching that heading against the tag, and drop the reminder comment #45 left for whoever cut this release. Add entries for the other user-visible changes since v0.4.0: the recorded-violation matching fix in strict packs (#43), the stray `dbg!` in the privacy checker (#50), the inflector regex speedup (#54), and the switch to cargo-dist release artifacts (#33).
dduugg
added a commit
that referenced
this pull request
Sep 27, 2026
* Bump version to 0.5.0 The strict-mode change in #45 is breaking, and pre-1.0 that wants a minor bump rather than 0.4.x. Also rewrite INSTALLATION.md for the cargo-dist release artifacts. 0.5.0 is the first release through cargo-dist (#33), which publishes installer scripts and per-target archives but no dotslash `pks` file. And `cargo install pks` has only ever installed the original alexevanczuk/packs crate from crates.io, not this repository. * Prepare the CHANGELOG for 0.5.0 Retitle `## Unreleased` to `## 0.5.0`, since cargo-dist builds the GitHub Release notes by matching that heading against the tag, and drop the reminder comment #45 left for whoever cut this release. Add entries for the other user-visible changes since v0.4.0: the recorded-violation matching fix in strict packs (#43), the stray `dbg!` in the privacy checker (#50), the inflector regex speedup (#54), and the switch to cargo-dist release artifacts (#33). * Restore the DotSlash file on releases #33 replaced ci.yml's release jobs with cargo-dist and dropped the generate-dotslash-files job along with them, so 0.5.0 would have been the first release without a DotSlash `pks` file. cargo-dist creates the GitHub Release with GITHUB_TOKEN, and events from GITHUB_TOKEN don't trigger other workflows, so this can't be a separate `on: release` workflow. Instead, publish-dotslash.yml is a reusable workflow that dist calls once the release is announced (`post-announce-jobs` in dist-workspace.toml), and release.yml is regenerated with `dist generate` to add that call. dotslash-config.json now matches cargo-dist's asset names exactly. The tarballs put the binary under a `pks-<target>/` directory, the Windows zip is flat, and Windows is new. zizmor's secrets-inherit and self-repository findings come from dist's template for the call, so they're ignored for release.yml alongside the existing ones. Checked locally by running the action's process_config.py, at the pinned commit, against a real cargo-dist archive for aarch64-apple-darwin, then running the generated file with dotslash 0.5.9, which printed `pks 0.5.0`. * Note DotSlash re-run recovery, pin the CHANGELOG link dotslash-publish-release uploads without --clobber, so re-running the job once the `pks` asset is on the release fails. Say how to clear it in the workflow's header. The 0.5.0 CHANGELOG section becomes the release body, so link the INSTALLATION.md that shipped with it rather than main's.
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.
Fixes #49.
The bug
src/packs/checker/privacy.rs:64carried a livedbg!:It fired once per reference checked against a pack's
private_constants, in released builds as well as debug, writing two lines to stderr each time and leaking internal file and line numbers into user-facing output.The fix is deleting the line.
src/now contains nodbg!at all.Why it survived
Nothing in the suite reached the branch — no fixture configured
private_constants. Onmain,grep -rl private_constants tests/fixtures/returned nothing, against three hits undersrc/.So this adds
tests/fixtures/privacy_violations_with_private_constants, exercising all three combinations of the two flags thedbg!was printing:::Barconstant_is_private::Bar::Innerconstant_is_in_private_namespace::SomeConcernThe third row is the one worth having. A non-empty
private_constantslist narrows privacy to that list, so anything in the pack but absent from it stays public — behaviour that previously had no coverage.test_check_with_private_constantsasserts those three outcomes and that stderr is empty, so thedbg!can't return unnoticed.Verification
I checked the test actually guards the regression rather than merely passing: with the
dbg!reinstated it fails on the stderr assertion, reporting all 6 noise lines; with the line removed it passes.Note on the
auditcheckThe failing
auditjob is unrelated to this change and pre-dates it.actions-rs/audit-check@v1cannot compilecargo-audit: the pinned toolchain is rustc 1.92.0 andkstring@2.0.4now requires 1.96.0. That action has been unmaintained for years (it targets Node 12 and the workflow still pinsactions/checkout@v2), and the workflow has never completed successfully on this repo — every earlier run isaction_required. This diff touches noCargo.tomlorCargo.lock, so it cannot affect that job. Being addressed separately.Sent with Claude Code