Skip to content

difftastic: pkgscan-allow the 0.72.0 sample-file .npmrc findings - #1263

Merged
bryan-minimal merged 1 commit into
mainfrom
pkgscan-allow-difftastic
Nov 3, 2026
Merged

bryan-minimal merged 1 commit into
mainfrom
pkgscan-allow-difftastic

Conversation

@bryan-minimal

Copy link
Copy Markdown
Member

Adds packages/difftastic/pkgscan-allow.toml so that the 0.71.0 -> 0.72.0 bot update can ship. Today's run (2026-11-02T17:14Z, updater_mirror_withheld, reason pkgscan-high) withheld the gs:// mirror because of two High CredentialAccess findings. Both are sample data.

Evidence

Every flagged file was read in full from the upstream 0.72.0 tag (gh api repos/Wilfred/difftastic/tarball/0.72.0), and each introducing commit was checked in compare/0.71.0...0.72.0.

Finding Gates? Verdict Evidence
High sample_files/flat_1.json:401 .npmrc yes (>= High withholds the mirror) FP: sample data Forgejo's es-ES locale JSON (710 key -> UI-string entries; the _comment key cites forgejo commit 8eb34c58). Line 401 is "packages.npm.registry": "Configura este registro en tu proyecto <code>.npmrc</code> archivo:". No URLs other than the forgejo/pagure references, no encoded blobs, no non-printable bytes. Added by the maintainer (Wilfred) in a2d6628, "Improve unchanged heuristics for flat sequences", together with src/diff/unchanged.rs
High sample_files/flat_2.json:401 .npmrc yes FP: sample data A later revision of the same locale file (882 entries), the second side of the same sample diff. Same line, same commit
Medium tests/cli.rs:57 .gitconfig no (Medium) FP: test .arg("sample_files/cli_tests/gitconfig_1.gitconfig"): the path of a diff input in an assert_cmd integration test. Added in e2e1e3b (DivvyCr, committed by Wilfred; fix for difftastic#978). The two fixtures are 8-line gitconfigs (alice@example.com, editor = vim/emacs, a url.insteadOf)
Medium tests/cli.rs:58 .gitconfig no FP: test Same test, the second argument (gitconfig_2.gitconfig)

Not part of the build or the shipped package. Cargo.toml's include list is build.rs, src/, the vendored parsers, LICENSE and README, so sample_files/ and tests/ are not even in the crate. build.rs and src/ never reference sample_files. packages/difftastic/build.sh builds only the release binary, which does not compile or run the tests, and the only output is usr/bin/difft.

Hashes. shasum -a 256 on the extracted 0.72.0 files gives a7097adf…3000fd (flat_1) and b21ce6e6…e7b59f (flat_2). Both match the hashes the gate printed. Each entry also satisfies the parser rules: all five fields are present, the hash is 64 lowercase hex characters, and the reason is at least 20 characters and cites a URL.

Why only two stanzas. Only findings at High or above gate: the mirror is withheld at High, and the PR becomes a draft at High. The two tests/cli.rs findings are Medium, so they would only appear in the PR body. stanzas() prints entries for gating findings only, and pinning tests/cli.rs, a file that changes often, would buy nothing.

After merge

The bot update has to be re-triggered (the next nightly run, or /pkgs from Slack). The allowlist is read when the gate runs, so the next run re-scans and regrades these two findings to Info. If either file changes, its hash stops matching and the finding gates again.

The CODEOWNERS change for pkgscan-allow.toml (#1113) is still open. If it merges with @bryan-minimal as the only owner, then this PR, which is opened from that account, cannot be approved; #1113 describes that deadlock.

The agent did not merge or approve this PR.

🤖 Generated with Claude Code

difftastic 0.72.0 adds sample_files/flat_{1,2}.json, two revisions of
Forgejo's es-ES locale file used as flat-JSON diff inputs (upstream
a2d6628cc739). Line 401 of each is the npm-registry help string, which
names `.npmrc` as text. pkgscan scored it High CredentialAccess and
withheld the 0.72.0 mirror. Nothing reads these files at build or run
time: they are outside Cargo.toml's include list, and build.sh only
compiles the release binary and installs difft.

Both entries are pinned to the files' sha256, recomputed from the 0.72.0
tag; they match the hashes the gate printed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bryan-minimal
bryan-minimal requested a review from a team as a code owner November 2, 2026 17:30
@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

  • Run on-demand review

This review includes 1 billable file and costs up to $0.25.

  • Ask an admin to make reviews automatic

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Or wait 12 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 75 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
Commits

Reviewing files that changed from the base of the PR and between 4613142 and e8f2fea.

Files selected for processing: 1
  • packages/difftastic/pkgscan-allow.toml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@mitodrummer mitodrummer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I downloaded the upstream 0.72.0 tag archive. sample_files/flat_1.json and flat_2.json hash to the two pinned sha256 values. Both are Forgejo es-ES locale JSON, and line 401 of each is a UI string that mentions .npmrc. Both files came in with Wilfred's commit a2d6628. They sit outside Cargo.toml's include list, nothing in build.rs or src/ reads them, and build.sh ships only target/release/difft. Each entry is one file and one pattern, pinned by hash, and passes the parser rules.

@bryan-minimal
bryan-minimal added this pull request to the merge queue Nov 2, 2026
Merged via the queue into main with commit 81fb468 Nov 3, 2026
13 checks passed
@bryan-minimal
bryan-minimal deleted the pkgscan-allow-difftastic branch November 3, 2026 00:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants