Repository navigation
refactor: keep findings typed through driver results - #1015
Merged
Merged
Conversation
Carry each finding's typed severity and code alongside its serialized
row instead of re-parsing the wire projection downstream:
- `SemanticService::findings_meta()` derives `FindingMeta` (severity,
code, span file index) once, index-aligned with `findings_json()`;
- `LintResult::findings_meta`, `AnalyzeResult::risks_meta`,
`CostResult::findings_meta`, and `EssentialResult::findings_meta`
carry the typed identities in-process (`#[serde(skip)]` — the wire
shape is unchanged);
- `FindingSelection::apply_findings_meta` zips rows with metas so the
severity threshold and withheld-count reading stay typed;
- `essential::{lint,analyze}` return the projected payload plus the
metas aligned to the emitted rows after sort/cap;
- `EssentialResult::command` declares which command produced the
projection, so renderers select their report by the tag rather than
probing JSON keys;
- renderers take typed `Severity` (`finding_head`, `severity_label`,
`sorted_findings`, `grouped_findings`, `meta_severity_counts`,
`github_findings`); severity is never read back out of `serde_json`;
- `SourceDiagnostic::severity` carries `lpp::DiagnosticSeverity`
(re-exported via wright-language) instead of a `String` match — the
LSP conversion maps the enum directly and `hint` no longer
collapses to `information`.
JSON output is byte-identical: verified against main on real fixtures.
Fixes #1001
Teakowa
approved these changes
Oct 27, 2026
Teakowa
left a comment
Contributor
There was a problem hiding this comment.
LGTM after independent review.
e54-bot
pushed a commit
that referenced
this pull request
Oct 27, 2026
Keep the shared LPP connect path from this branch: the language service still connects through `CompilerSession::connect_provider` (no `installed()` fallback, `provider-refusal-<code>` classification via the shared `provider_failure_code`). Take main's typed `DiagnosticSeverity` findings (#1015): `SourceDiagnostic.severity` stays typed, the dead `lpp_severity`/`provider_failure_code` free functions both drop, and the `Severity`/`DiagnosticSeverity` imports merge. `pub mod connect` / `ConnectFloor` exports coexist with main's `pub mod store` promotion.
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
Issue #1001: typed findings ride through the driver boundary instead of being re-parsed out of the serialized payload downstream.
Mechanism
SemanticService::findings_meta()(#[serde(skip)]per-rowFindingMeta { severity, code, span_file }) is produced once, index-aligned withfindings_json(); selection (apply_findings_meta) zips rows+metas so the severity threshold, code filter, withheld counting andmax_severityread typed values.LintResult::findings_meta,AnalyzeResult::risks_meta,CostResult::findings_meta,EssentialResult::findings_meta/max_severitycarry the typed channel in-process only (#[serde(skip)]/ customSerialize— wire shapes unchanged).EssentialResult::commanddeclares which command produced the projection (EssentialCommand::{Lint,Inspect,Analyze}); renderers select their report by the tag rather than probingresultkeys.Severity/FindingMeta(finding_head,severity_label,finding_severity_rank,sorted_findings,grouped_findings,meta_severity_counts,github_findings,finding_annotation);essential::envelopesorts diagnostics by typed severity;SourceDiagnostic::severityis nowlpp::DiagnosticSeverity(re-exported through wright-language) — the LSP conversion maps the enum directly, fixinghintcollapsing toinformation.present/findings.rs, shared helpers topresent/common.rs; deadfinding_severity()/findings_severity_counts()/group_runs()/lpp_severity()removed.Serialization: byte-identical verified —
diffoflint --format jsonoutput vsmainontests/fixtures/workshop/synthetic/declarations-numbers.wsis empty;wright-result/v1/wright-agent/v1shapes unchanged (all new fields#[serde(skip)]or behindSerializeimpls emittingself.resultverbatim).Verification
cargo fmt --all -- --check— cleancargo clippy --workspace --all-targets --all-features -- -D warnings— cleancargo test --workspace --all-targets— 65 binaries, all pass, 0 failuresgit diff --check— cleanwright lint tests/fixtures/workshop/real-world/overpy-cake.wsrenders identical warnings/text output;--format jsonbyte-identical to main.Fixes #1001