You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #429. Wave 1 of the agent/CLI experience work.
Problem
Findings are returned and rendered whole. There is no way to ask for a subset, and repeats are not collapsed.
Measured with wright 0.2.41 on tests/fixtures/workshop/real-world/overpy-cake.ws:
10 findings, but only 2 distinct messages: 9x repeated-value with identical text, 1x min-wait-loop.
Text mode prints 44 lines, each finding carrying its own source-context line. On this fixture the quoted Workshop lines run past 200 columns, so the wrapped output for two real problems fills a screen.
--format json returns all 10 with no way to request only errors, only one rule, or only one file.
The agent operations have the same shape: findings, lint, and costEstimate take no request fields and always return everything. In a fix loop, an agent re-reads the full set every turn to find the one finding it is working on, and a large project's findings compete with the source it is editing for context budget.
This is one defect with two symptoms. Humans cannot read the output and agents cannot afford it, because both consume the same unfiltered driver result.
Scope
Add finding selection in wright-driver so the CLI and the agent contract share one implementation and one semantics.
Agent contract: the same selection as optional request fields on findings, lint, and costEstimate. Additive under wright-agent/v1; omitting them keeps current behaviour.
Text-mode grouping:
Consecutive findings sharing a rule id and message collapse into one entry that lists its locations, instead of repeating the message and a source-context line per occurrence.
The verdict line keeps reporting the true total, so collapsing never understates the result.
Truncation must be visible:
When a maximum count drops findings, the result states how many were withheld, in both text and JSON. A truncated result is never presented as complete.
Non-goals
Changing which findings the analyzer produces, or any rule's semantics.
The fixed rule-metadata payload in the lint envelope. Separate issue; it is a contract decision, not a filtering one.
Lint suggestions or fixes.
A config file for default selection. That belongs with project configuration.
Changing analyze's existing ranking and bounded-report behaviour.
Constraints
Selection belongs in wright-driver, not in the CLI renderer. A filter the CLI applies after the fact cannot serve the agent contract, and two implementations will drift.
Additive only on wright-agent/v1: no operation removed or renamed, no field's type or meaning changed. See docs/agent-contract.md versioning.
Exit codes stay driven by the true highest severity present, not by what survives selection. Filtering a result must not turn a failing project into exit 0. This is the main correctness hazard in this issue.
Output rules in docs/cli/presentation.md are unchanged: one envelope on stdout in JSON mode, no ANSI or progress in plain/CI/JSON rendering.
Acceptance criteria
Findings can be selected by severity threshold, rule id, source file, and maximum count, through both the CLI and the agent contract.
For each dimension, the CLI and agent paths return the same selected set for the same input and selection. A test compares the two paths.
Omitting every selection option reproduces current output byte-for-byte in JSON mode. A test asserts this against the existing expectations.
Selecting severity=error on overpy-cake.ws, whose findings are all warnings and info, yields an empty finding set and the unchanged non-zero-warning verdict and exit code. A test asserts the exit code is not affected by selection.
A maximum count that withholds findings reports the withheld count in text and JSON. A test asserts the count is present and correct.
Text mode collapses overpy-cake.ws's 9 identical repeated-value findings into one entry listing 9 locations, while the verdict still reports 10 findings total. A test asserts both.
An unknown rule id in a selection is a usage error, not a silent empty result.
capabilities still advertises wright-agent/v1 and every previously advertised operation; existing schema compatibility tests pass unchanged.
docs/cli/lint.md, docs/cli/presentation.md, and docs/agent-contract.md describe the selection options and the collapse behaviour.
Ablation: making exit codes depend on the selected set instead of the full set makes the exit-code test fail.
Follow-up to #429. Wave 1 of the agent/CLI experience work.
Problem
Findings are returned and rendered whole. There is no way to ask for a subset, and repeats are not collapsed.
Measured with wright 0.2.41 on
tests/fixtures/workshop/real-world/overpy-cake.ws:repeated-valuewith identical text, 1xmin-wait-loop.--format jsonreturns all 10 with no way to request only errors, only one rule, or only one file.The agent operations have the same shape:
findings,lint, andcostEstimatetake no request fields and always return everything. In a fix loop, an agent re-reads the full set every turn to find the one finding it is working on, and a large project's findings compete with the source it is editing for context budget.This is one defect with two symptoms. Humans cannot read the output and agents cannot afford it, because both consume the same unfiltered driver result.
Scope
Add finding selection in
wright-driverso the CLI and the agent contract share one implementation and one semantics.Selection dimensions:
Surfaces:
lint,check,analyze, andcost(Expose the semantic query surface through the CLI so humans and agents share one tooling surface #429), wherever the command reports findings.findings,lint, andcostEstimate. Additive underwright-agent/v1; omitting them keeps current behaviour.Text-mode grouping:
Truncation must be visible:
Non-goals
lintenvelope. Separate issue; it is a contract decision, not a filtering one.analyze's existing ranking and bounded-report behaviour.Constraints
wright-driver, not in the CLI renderer. A filter the CLI applies after the fact cannot serve the agent contract, and two implementations will drift.wright-agent/v1: no operation removed or renamed, no field's type or meaning changed. Seedocs/agent-contract.mdversioning.docs/cli/presentation.mdare unchanged: one envelope on stdout in JSON mode, no ANSI or progress in plain/CI/JSON rendering.Acceptance criteria
severity=erroronoverpy-cake.ws, whose findings are all warnings and info, yields an empty finding set and the unchanged non-zero-warning verdict and exit code. A test asserts the exit code is not affected by selection.overpy-cake.ws's 9 identicalrepeated-valuefindings into one entry listing 9 locations, while the verdict still reports 10 findings total. A test asserts both.capabilitiesstill advertiseswright-agent/v1and every previously advertised operation; existing schema compatibility tests pass unchanged.docs/cli/lint.md,docs/cli/presentation.md, anddocs/agent-contract.mddescribe the selection options and the collapse behaviour.Dependencies / ownership
wright-driver,wright-analyzer,wright-cli, docs).wright costis one of the surfaces), Roadmap to v1.0: stable Workshop tooling platform #134 (1.0 contract), Establish a product-level coding-agent benchmark for Workshop workflows #414 (benchmark measures the surface this changes).