Conversation
Finding selection (severity threshold, rule id, file, max) is implemented once in wright-driver and applied to envelope diagnostics and lint findings only after the verdict and exit code are fixed on the complete set, so a filtered view can never flip a failing project to exit 0. The CLI exposes --severity/--rule-id/--file/--max on check, analyze, and lint; the wright-agent/v1 findings, lint, and costEstimate requests accept the same fields flat in the request. Truncation is reported via selection.total/withheld, unknown rule ids are usage errors, and consecutive identical lint findings collapse into one rendered entry listing all locations. Fixes #430
This branch has not been deployed
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.
Summary
Implements #430: finding/diagnostic selection is implemented once in
wright-driver(FindingSelection+SelectionOutcome,select.rs) andshared by every finding surface.
severitythreshold,ruleid,file= resolvedspan.path,max): applied to envelope diagnostics (check,analyze,lint) and lint findings;wright-agent/v1findings,lint, andcostEstimaterequests accept the same fields as flat requestproperties.
exit/okare computedon the complete set, and
SelectionOutcomecarriestotal,withheld,and the full set's max severity, so PASS/WARN/ERROR and the exit code can
never be understated by a filtered view.
selection: {"total": N, "withheld": M}appearsnext to the filtered array in JSON; text mode prints
... N finding(s)/diagnostic(s) withheld (--max).collapse into one entry that lists all locations (the 9×
repeated-valuecake fixture now renders as one entry with 9
-->locations).--rule-id/ruleis a usage error (CLI exit 2, agentinvalid-selection), never a silent empty result.previous output byte-for-byte —
findingsstays a bare array, and noselectionmember appears.Schemas (
wright-agent-v1,wright-check-v1), the agent contract doc, andthe CLI docs/help are updated.
costCLI flags join with the query surfacein #429, which this PR does not implement.
Test plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test --workspace --all-targets --all-features— all greenCLI e2e (filtering,
--maxwithheld counts in text+JSON, grouping of thecake fixture, byte-identical envelope without options, unknown id exit 2,
and the ablation guard:
check --rule-idfiltering an error diagnostickeeps exit 1); CLI↔agent same-set equivalence test; stdio transport
selection test
tests/fixtures/workshop/real-world/overpy-cake.wsend to end (CLI text/JSON and
servestdio)Closes #430