Wave 3 polish: clippy-clean, unit tests, CI#1
Merged
Conversation
- Collapse three redundant `.map_err(...).or_else(|_| Err(...))` chains in the CLI HTTP helpers to a single `map_err`, clearing the clippy `bind_instead_of_map` warnings. - Remove unused `tower-http` dependency (cors feature was imported but never used anywhere in the code). - Apply `cargo fmt`. - Add 20 unit tests covering the pure logic: command parsing (quoting, whitespace, literal shell metachars), output truncation (limit + UTF-8 boundary safety), CLI display truncation, priority-queue ordering, history eviction (oldest-first, never evicts pending/running, disabled at 0), and the hand-rolled URL parser. - Add standard Rust CI workflow (.github/workflows/ci.yml) running build, test, clippy -D warnings, and fmt --check on push and pull_request. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Owner
Author
Independent verification — VERDICT: solid ✅Re-cloned
Adversarial checks:
One nit (non-blocking): the PR body says "No behavioral changes." Strictly speaking the CI workflow looks correct and the PR honestly flags it as locally-unverified. No required fixes — good to merge. |
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.
Full polish pass on
npu-sched(part of the Phosphor suite). No behavioral changes to the scheduler — this is cleanup, tests, and CI.What changed
.map_err(...).or_else(|_| Err(...))chains in the CLI HTTP helpers (cli_get/cli_post/cli_delete) to a singlemap_err, clearing thebind_instead_of_mapwarnings.tower-http(cors feature) was declared inCargo.tomlbut never referenced in code. Dropped it and updatedCargo.lock.cargo fmt.parse_command— simple split, quoted segments, whitespace collapse, empty input, shell metachars passed as literal argv (no shell interpretation).truncate_output— under-limit passthrough, over-limit marker, UTF-8 char-boundary safety.truncate(CLI display) — ellipsis + length bound.PendingJobordering — higher priority first, FIFO tiebreak on equal priority.evict_old_jobs— oldest-completed-first, never evicts pending/running, disabled whenmax_history == 0.url::Urlparser — host/port/path, default path, missing port, unsupported scheme rejected..github/workflows/ci.yml(push + pull_request) running build, test,clippy --all-targets -D warnings, andfmt --checkon the stable toolchain (rustup component add clippy rustfmt).Verification (run locally, cargo 1.95.0)
cargo build— passescargo test— 20 passed, 0 failedcargo clippy --all-targets -- -D warnings— cleancargo fmt --check— cleancargo run -- --help— runsCI itself is unverified (not executed locally); it will run on this PR.
🤖 Generated with Claude Code