Skip to content

chore(work-graph): satisfy current clippy#4560

Merged
Hmbown merged 2 commits into
mainfrom
agent/091-work-graph-clippy
Jul 19, 2026
Merged

chore(work-graph): satisfy current clippy#4560
Hmbown merged 2 commits into
mainfrom
agent/091-work-graph-clippy

Conversation

@Hmbown

@Hmbown Hmbown commented Jul 19, 2026

Copy link
Copy Markdown
Owner

Summary

  • collapse four nested conditionals flagged by the current Rust toolchain
  • preserve Work Graph reducer and validation behavior
  • unblock clean TUI clippy verification for subsequent v0.9.1 lanes

Verification

  • cargo fmt --all -- --check
  • cargo test -p codewhale-tui --bin codewhale-tui --locked work_graph (16 passed)
  • cargo clippy -p codewhale-tui --bin codewhale-tui --locked -- -D warnings
  • git diff --check

Collapse the four nested conditionals flagged by the current Rust toolchain without changing reducer or validation behavior.\n\nVerified with the focused Work Graph tests and TUI clippy under -D warnings.

Signed-off-by: Hunter B <hmbown@gmail.com>
Copilot AI review requested due to automatic review settings July 19, 2026 01:53
@cursor

cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@claude

claude Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Claude finished @Hmbown's task in 1m 20s —— View job


Review: chore(work-graph): satisfy current clippy

  • Gather context (diff, PR body, custom review instructions)
  • Read changed files: reducer.rs, validate.rs
  • Check clippy claims and behavior preservation
  • Post review feedback

Summary: This is a clean, purely mechanical collapsible_if clippy fix — nested if let / if pairs are collapsed into single-condition let-chains (if let ... && ... {). I traced all four hunks against their originals and confirmed the control flow is unchanged in every case:

  • crates/tui/src/work_graph/reducer.rs:35-52 (idempotency dedup) — same early-return-on-duplicate logic.
  • crates/tui/src/work_graph/reducer.rs:284-290 (reconcile, terminal-state guard) — same !is_terminal() gate before mutating node.state.
  • crates/tui/src/work_graph/validate.rs:225-238 (check_v2_live_operations_rooted) — note this hunk also reshapes nesting (moves frontier.push(&parent.id) out from under the inner if), but it's still only reached when parent is found, matching the original — behavior preserved.
  • crates/tui/src/work_graph/validate.rs:400-415 (check_v8_history_bounded_monotonic) — same strictly-increasing revision check.

Toolchain fit: Cargo.toml pins edition = "2024" / rust-version = "1.88", and let-chains are already an established pattern elsewhere in this crate (project_context.rs, core/engine.rs), so this isn't introducing a new idiom — it's consistent with the codebase.

Other review dimensions (provider/model routing safety, dead code, test coverage, security): not applicable — this diff touches no provider/model logic, adds no new code paths, and needs no new tests since behavior is unchanged by design.

I wasn't able to run cargo build/clippy myself in this sandbox (build commands required approval I couldn't grant), but the PR description's verification output (cargo test ... work_graph 16 passed, cargo clippy -D warnings, cargo fmt --check) combined with my manual trace gives me confidence this is correct. No changes requested.

@claude

claude Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Claude finished @Hmbown's task in 1m 4s —— View job


Review: chore(work-graph): satisfy current clippy

  • Gather context (diff, PR body, custom review instructions)
  • Read changed files: reducer.rs, validate.rs
  • Check clippy claims and behavior preservation
  • Post review feedback

Note: This re-run picked up the same diff as the earlier review — the only new commit (71b5088) is a merge of origin/main, adding no additional code changes. I independently re-read the current file content (not just the diff) at both hunk sites to confirm behavior is unchanged.

Summary: Purely mechanical collapsible_if clippy fix — nested if let / if pairs collapsed into if let ... && ... { } let-chains. All four hunks preserve control flow:

  1. crates/tui/src/work_graph/reducer.rs:38-54 (apply, idempotency dedup) — same early-return-on-duplicate-key logic.
  2. crates/tui/src/work_graph/reducer.rs:287-291 (reconcile, terminal-state guard) — same !is_terminal() gate before mutating node.state.
  3. crates/tui/src/work_graph/validate.rs:228-236 (check_v2_live_operations_rooted) — reshapes nesting (moves frontier.push(&parent.id) out from under the inner if matches!(...)), but it's still only reached when parent is found via snapshot.node(&edge.from) — same reachability, same push, same rooted assignment.
  4. crates/tui/src/work_graph/validate.rs:404-416 (check_v8_history_bounded_monotonic) — same strictly-increasing revision check with early break.

Review against custom instructions:

  • Correctness: No bugs found; no new unwrap/expect, no new match arms, no behavior change.
  • Provider/model routing safety (EPIC v0.8.65 EPIC: Separate provider facts, model facts, offerings, and route resolution #2608): N/A — this diff touches no provider/model/route logic.
  • Reuse/simplification: N/A — mechanical clippy fix, no duplication introduced.
  • Tests: No new behavior, so no new tests needed. Existing work_graph suite (16 tests per PR description) already covers apply, reconcile, and both validators.
  • Security: N/A — no secret handling, exec, or input-validation paths touched.

Toolchain fit: Cargo.toml pins edition = "2024" / rust-version = "1.88", and let-chains are already used elsewhere in this crate (project_context.rs, core/engine.rs), so this is consistent with existing idiom, not a new pattern.

I wasn't able to run cargo fmt --check / cargo test / cargo clippy myself in this sandbox (build commands required approval I couldn't grant), so I'm relying on the PR description's stated verification output plus my manual line-by-line trace. No changes requested.

@Hmbown
Hmbown merged commit a6070db into main Jul 19, 2026
22 checks passed
@Hmbown
Hmbown deleted the agent/091-work-graph-clippy branch July 24, 2026 21:10
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