Skip to content

fix(robot-repo-automaton): satisfy clippy needless_bool in confidence.rs - #705

Closed
hyperpolymath wants to merge 2 commits into
mainfrom
fix/clippy-needless-bool-confidence
Closed

hyperpolymath wants to merge 2 commits into
mainfrom
fix/clippy-needless-bool-confidence

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Return the any() result directly in confidence.rs instead of an if guard that returns true, followed by a literal false. Behaviour is unchanged. The CI toolchain's clippy (Rust 1.100) rejects the old form under -D warnings (clippy::needless_bool), which turned build · test · clippy (robot-repo-automaton) red on every PR, including #704.

One file, one commit, nothing else changed.

Test results

  • cargo clippy --release --all-targets -- -D warnings: clean locally (Rust 1.97).
  • cargo test --release --lib confidence: 22 passed.
  • The newer-clippy result will come from this PR's own CI, which is the first run of that lint on main-based code.

Generated by Claude Code

Return the any() result directly instead of an if guard that returns a
bool literal followed by a literal false. Behaviour is unchanged; newer
stable clippy rejects the old form under -D warnings.

Copy link
Copy Markdown
Owner Author

The red GSBot build, tests and dependency security and CI/gate here are not from this diff (a one-line change in robot-repo-automaton/src/confidence.rs). The GSBot audit fails on RUSTSEC-2026-0592 (url), RUSTSEC-2026-0543 (chrono) and RUSTSEC-2024-0388 (derivative) in bots/gsbot/Cargo.lock. #706 patches url and records the other two as departure rows, per the owner ruling. The clippy job is the one this PR fixes.


Generated by Claude Code

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 22, 2026 12:05
@hyperpolymath hyperpolymath assigned Copilot and unassigned Copilot Nov 22, 2026
Repository owner deleted a comment from coderabbitai Bot Nov 22, 2026
@sonarqubecloud

Copy link
Copy Markdown

Repository owner deleted a comment from coderabbitai Bot Nov 22, 2026
@hyperpolymath
hyperpolymath deleted the fix/clippy-needless-bool-confidence branch November 25, 2026 23:19
hyperpolymath added a commit that referenced this pull request Nov 26, 2026
…+ url 2.5.9 (carries #705 and #706 fixes) (#707)

## Why
`main` fails three required checks and each fix sat in a different PR,
so none could merge. This PR carries all three fixes (owner chose "Fold
into #707").

| Fix | Commit | Origin |
|---|---|---|
| Pinned source closure: re-attest hypatia `credential-read-check.yml`
at f2c06048 | 6e64d5a | this PR |
| robot-repo-automaton clippy `needless_bool` in `confidence.rs` |
76a2155 | cherry-pick -x from #705 (6ddc6dc) |
| GSBot audit: `url` 2.5.9 (RUSTSEC-2026-0592), `bots/gsbot/Cargo.lock`
only | 7388520 | cherry-pick -x from #706 (6bfdde7) |

Original authorship kept on the cherry-picks. The departures commit from
#706 is **not** included; #706 keeps it.

## Closure fix (details)
#699 bumped `hypatia-scan.yml` job `scanner-credential` to
`hyperpolymath/hypatia/.github/workflows/credential-read-check.yml@f2c06048…`
without updating `scripts/lib/pinned-reusable-sources.json`. **Pin
only:** the file's blob is `15c597ea720a5affb861dab058084f7245ee4cbd` at
both 29a9e4a8 and f2c06048, so the nested `uses:` closure is unchanged.
No generator exists; same approach as #698 (manifest binding + receipts
row).

## Local evidence
- `audit-pinned-reusable-sources.sh --fetch-sources`: findings=0
verified-roots=6 (was 1 finding)
- `audit-lock-closure.sh`: fatal=0; pinned-reusable-sources-test 55/0;
lock-closure-test 47/0
- `cargo clippy --locked -- -D warnings` in robot-repo-automaton: clean
- pinned-source-entrypoints-test: 7 pass, 2 fail locally
(historical-source cache that CI fetches, as in #698)

## After merge
Owner: close #705 (superseded); update #706's branch from main so it
shrinks to the departures ledger. #704 untouched. #706 and #705 are
unchanged by this PR.


---
_Generated by [Claude Code](https://claude.ai/code)_

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Refactor**
* Streamlined protected-file checks without changing which files are
protected.
* **Chores**
* Updated a pinned reusable source reference; its path and other
recorded metadata remain unchanged.
* **Tests**
* Added coverage for confidence classification of protected paths and
for detecting stale references after a source is repinned.
  * No user-facing behavior changes are included in this update.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: CLAUDE <355856132+HoTT-stuff@users.noreply.github.com>
hyperpolymath added a commit that referenced this pull request Nov 26, 2026
…ve departures (#706)

## Summary

Owner ruling by selector, 22 Nov: "patch url, record the rest". Two
commits, each in its own change.

1. **`fix(gsbot): update url to 2.5.9`**: clears RUSTSEC-2026-0592
(`url` <= 2.5.8, `Url::origin()` recursion on `blob:` URLs). Only
`bots/gsbot/Cargo.lock` changes: `url` 2.5.8 to 2.5.9, and
`form_urlencoded` 1.2.2 to 1.2.3 with it. Done with `cargo update -p url
--precise 2.5.9`, because plain `cargo update -p url` locked nothing
here (stale index).
2. **`chore(departures)`**: adds `.machine_readable/departures.jsonl`
(the ledger path in `DEPARTURES.adoc` section 5) with two `blocked`
rows, one defect per row, each with a `grep-present` check that the
package is still in `bots/gsbot/Cargo.lock`:
- `gsbot-rustsec-2026-0543-chrono`: chrono 0.4.44 unmaintained, no safe
upgrade.
- `gsbot-rustsec-2024-0388-derivative`: derivative 2.2.0 unmaintained,
no safe upgrade, pulled in by poise 0.6.2.
- Both: "upstream serenity/poise/sqlx still depend; replace with
jiff/time when they move".

## The GSBot audit and the two unmaintained advisories

No `deny.toml` ignore entries are added (`deny.toml` still ignores
nothing). `.github/workflows/rust.yml` runs `cargo deny … check
advisories --warn unmaintained`, and RUSTSEC-2026-0543 (`chrono`) and
RUSTSEC-2024-0388 (`derivative`) are both "unmaintained" advisories, so
they only warn and do not fail the job. The `url` patch clears the one
advisory that does fail it. The departure rows stay because the debt is
real; a row records a defect, it is not a waiver of the gate.

## Test results

- `cargo build --locked` in `bots/gsbot`: OK. `cargo test --locked`: all
pass.
- `departures.sh validate`: 2 rows valid. `departures.sh check` at this
commit: 2 present, 0 RESOLVED, 0 unevaluated.
- Not run locally: `cargo deny` (not installed here); the audit result
comes from this PR's CI.

## Notes

- This adds the ledger file only. It does not copy `departures.sh` /
`issue-evidence.sh` into `scripts/` (adoption step 1) or wire `check`
into a gate (step 3). Say if the owner wants those added.
- Independent of #705 (the clippy fix) and #704.


---
_Generated by [Claude Code](https://claude.ai/code)_

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Chores**
* Recorded two dependency advisories for unmaintained libraries; no safe
upgrades are currently available.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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.

3 participants