Skip to content

chore(rust): enforce warning-free Clippy baseline - #640

Open
Harry19081 wants to merge 2 commits into
developfrom
dev/rust-clippy-warning-cleanup
Open

chore(rust): enforce warning-free Clippy baseline#640
Harry19081 wants to merge 2 commits into
developfrom
dev/rust-clippy-warning-cleanup

Conversation

@Harry19081

@Harry19081 Harry19081 commented Aug 1, 2026

Copy link
Copy Markdown
Member

Problem

The Rust workspace emitted 37 warnings under default-target Clippy plus additional test-target warnings under --all-targets. CI ran cargo clippy --workspace with advisory warnings, so warning regressions, duplicate test-module registration, and test-only lint debt could accumulate without failing the build. Rust 1.97 also introduced additional lint coverage that the prior 1.96 local baseline did not expose.

Solution

  • Resolve the workspace-owned warnings with mechanical simplifications, semantic type aliases, corrected naming, and test-module ordering.
  • Remove duplicate test-module registration in test-runner and perf-utils while keeping each suite registered at its owning module.
  • Preserve intentional trait, Tauri command, registry, and orchestration signatures with narrow documented Clippy allowances where a relay struct would not add a domain invariant.
  • Pass the existing PushRequest into the private Git push helper instead of forwarding eight individual fields; the HTTP request and response shape is unchanged.
  • Resolve the additional Rust 1.97 question_mark, for_kv_map, and useless_borrows_in_formatting findings.
  • Enforce cargo clippy --workspace --all-targets -- -D warnings in CI.

The resulting invariant is that all workspace-owned Rust targets compile without Clippy warnings under the exact CI command and current CI toolchain.

Potential risks

The private Git push helper now receives the canonical request DTO directly, so a regression there could affect remote, branch, force, upstream, or authentication forwarding. The Git API library suite passed, and the public route payload is unchanged. Test modules moved within source files and duplicate registrations were removed, which changes test discovery structure but not the test bodies; the affected suites passed exactly once. The stricter CI gate can expose newly introduced compiler lints after a Rust toolchain update, which is intentional but may require follow-up maintenance.

Cargo still reports the transitive block v0.1.6 future-incompatibility notice through tauri-plugin-liquid-glass -> cocoa. The latest published plugin and its current upstream main branch remain at 0.1.6 and explicitly retain the legacy Cocoa stack, so there is no safe dependency-only upgrade to land in this PR. Removing that notice requires an upstream migration or a separately reviewed local fork. Rollback is a direct revert of these commits; there are no data, persistence, configuration, or public wire migrations.

Architecture audit

Covered compilation and warning boundaries, structural test registration, naming, and source clarity (layers 1, 2, 3, and 7). Semantic behavior, wire schemas, initialization ownership, resolver boundaries, serialization, and test-contract redesign (layers 4-6 and 8-10) were intentionally left unchanged. Tauri command and trait callback signatures remain stable.

Verification

  • PASS: CARGO_TARGET_DIR=/private/tmp/orgii-clippy-1-97-target-20260801 cargo +1.97.0 clippy --workspace --all-targets -- -D warnings
  • PASS: affected library suites for agent_core, browser, key_vault, lsp, and orgtrack_core — 4,141 passed, 0 failed, 9 ignored
  • PASS: targeted org2 session-directory display suite — 12 passed, 0 failed
  • PASS: changed Rust files checked with rustfmt --edition 2021 --check
  • PASS: git diff --check and added-line scan for secrets, personal paths, debug macros, and generated artifacts
  • PARTIAL: CARGO_TARGET_DIR=/private/tmp/orgii-clippy-warning-cleanup-target-20260801 cargo test --workspace --lib --no-fail-fast -- --quiet ran every workspace library target. Every target passed except org2 --lib, where 1,020 tests passed, 2 failed, and 1 was ignored.
    • orgtrack::history_commands::tests::reduced_prewarm_never_displaces_full_projection_and_is_invisible_to_full_readers
    • orgtrack::session_provenance::tests::codex_lifecycle_maps_actor_to_independently_loadable_transcript
  • BASELINE CONFIRMATION: both failing tests reproduce individually on the untouched starting base b800b7810; neither failing source file is changed by this PR. The same two failures remained after integration onto latest develop (b231b4c5b).
  • The first hosted Rust check exposed Rust 1.97-only lints after the 1.96 local pass. Those findings were fixed, then the exact Rust 1.97 command above passed locally; the hosted rerun is attached to the updated commit.
  • Git hooks were unavailable in the isolated worktree because .husky/_/husky.sh was absent; commits used a one-command hook bypass after the direct checks above passed.
  • Not run: rendered UI or live E2E checks, because this PR has no user-visible UI behavior and changes no rendered E2E surface.

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.

1 participant