Repository navigation
fix(lsp): project producer-owned Rust diagnostic origins - #4851
Conversation
Carry parser start_byte with seeded probes into a crate-private origin sidecar keyed by final probe id. Exact geometry is admitted only when captured analysis bytes equal cached facts, the finding is candidate-current, and the expression is a same-line slice at that offset. Standard diagnostics select those numbers instead of the first substring on the saved line. Non-current and refused Rust records stay zero-width so a deleted expression cannot paint a current line. Closes #4464 Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Replace panic-family expects with Result oracles, add discriminating refusal cases, and share same-line parser-span construction across diff/repo seeding. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
Keep producer origins on the standard diagnostic path without crossing Clippy's argument-count gate, and elide needless origin admission syntax. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
The architecture gate matches crate::lsp in analysis sources, including comments, so the span-cap note now names the adapter without that path. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
No source change. GitHub Actions never registered a run for this branch after the earlier pushes. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
EffortlessSteven
left a comment
There was a problem hiding this comment.
Current-head review (review-pr)
reviewed_head_sha: 7ded8b71ae234736881ebeb9545c70138d70de85
integration_basis: origin/main 13c7ec58a (local); GitHub PR base currently 6ce04820
claim_boundary: #4464 producer-owned parser start_byte origins for current Rust expression diagnostics; no public DTO/schema; no #1765/#3212
changed_surfaces_and_semantic_owners_inspected:
- analysis::diagnostic_origin (admission owner: exact vs coarse)
- analysis::probes::{diff,repo,mod} (ParserByteSpan::same_line, SeededProbe::record_span)
- analysis::language::rust (span map keyed after final-id dedup)
- analysis::pipeline (Rust origins not overwritten by preview adapters)
- app::check (public CheckOutput drops origins; crate-private with_origins)
- lsp::{diagnostics,position} (project stored numbers; heuristic only when absent)
- producer tests in lsp::source_origin_tests and diagnostic_origin unit refusals
blocking_findings: none in source/oracle for this bounded claim
non_blocking_suggestions:
- empty retrigger commit 7ded8b71a exists because hosted Actions never queued on prior heads
refuted_or_stale_findings:
- Gemini quota comment is missing review, not a source defect
- CodeRabbit skip is missing review for that provider, not clean review
proof_and_ci_observed: local check-fast and precommit passed; hosted required Actions not established at first inspection
proof_or_review_missing: hosted required GitHub Actions; Gemini quota; CodeRabbit OSS skip
affected_currentness_dimensions: production implementation, test stimulus, test oracle, candidate head identity
residual_assumptions_and_non_claims: exact origin requires captured==facts, CandidateCurrent, same-line exact slice; no-span keeps #4688 heuristic; public CheckOutput unchanged; not #1765/#3212
disposition: REVIEW_INCOMPLETE until hosted required checks exist on this SHA
Author self-review uses COMMENT because GitHub cannot request-changes from the author; that is not approval.
|
Source-only counterreview of exact
Valid admitted spans and final-ID custody are coherent in source. These findings do not qualify a release, establish cache authenticity, or expand into #1765 publication authority. The parent lane retains useful independent controls and is diagnosing its own saved-diff test failure; that candidate is also not merge-ready. |
Keep projection numeric-only when a Rust origin record exists, including no-span current findings. Index captured files once, and prove coincident cache offsets plus retained producer-A ranges after disk B changes. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
Resolve the python/rust/probes/LSP content conflict by keeping #4464 SeededProbe span custody and origin projection, plus main's rust/mod.rs split, lexical-fallback limitations, and saved-edit sequence tests. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
|
Repaired on
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
Current-head review (review-pr)
reviewed_head_sha: a52ed29ce92c0ea2e8ad83762740401ee96ce0bc
integration_basis: origin/main 8a224a87e (merged into this candidate to clear a real rust/mod.rs, probes, and LSP conflict)
claim_boundary: #4464 producer-owned parser start_byte origins for current Rust expression diagnostics; no public DTO/schema; no #1765/#3212
changed_surfaces_and_semantic_owners_inspected:
- analysis::diagnostic_origin (always-insert exact vs coarse; per-file captured index)
- analysis::probes::{diff,repo,mod} (SeededProbe::record_span after main merge)
- analysis::language::rust::mod (span map keyed after final-id; limitations kept from main)
- analysis::pipeline (Rust origins not overwritten by preview adapters)
- app::check (public CheckOutput drops origins; crate-private with_origins)
- lsp::{diagnostics,position} (numeric-only when a record exists; heuristic only when absent)
- producer tests in lsp::source_origin_tests and diagnostic_origin unit refusals
blocking_findings: none in source/oracle for this bounded claim after the counterreview repair
non_blocking_suggestions: none
refuted_or_stale_findings:
- Comment 5886532931 REPAIR_REQUIRED on 7ded8b71a is repaired and replied; not stale
- Gemini quota comment is missing review, not a source defect
- CodeRabbit skip is missing review for that provider, not clean review
proof_and_ci_observed: local diagnostic_origin 17, source_origin_tests 8, diagnostic_for_finding 13, check-fast 19 files, precommit pass; hosted Ripr Rust Small on GitHub Hosted in progress on this SHA
proof_or_review_missing: hosted required GitHub Actions not yet terminal; Gemini quota; CodeRabbit OSS skip
affected_currentness_dimensions: production implementation, test stimulus, test oracle, conflict resolution, integration basis, candidate head identity
residual_assumptions_and_non_claims: exact origin requires captured==facts, CandidateCurrent, same-line exact slice; no-span current is coarse; empty maps keep #4688 heuristic; public CheckOutput unchanged; not #1765/#3212; no measured perf claim
disposition: REVIEW_INCOMPLETE until hosted required checks are terminal on this SHA
Author self-review uses COMMENT because GitHub cannot request-changes from the author; that is not approval.
|
Source-only follow-up on exact One accepted source-contract requirement remains: #4464’s governing boundary explicitly says to borrow existing input buffers. Please retain the decoder’s Active candidate ownership remains with this PR. Native/hosted acceptance, cache authenticity, publication freshness (#1765), and deleted-source remapping (#3212) remain separate boundaries. |
Keep rust_source_text's Cow in CapturedFile so valid UTF-8, including a BOM strip, is borrowed from loaded buffers. Build UTF-8/16/32 scalar coordinates once per file and derive admitted endpoints from that index. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
|
Repaired on
No measured memory or performance claim. #1765 and #3212 remain out of scope. |
EffortlessSteven
left a comment
There was a problem hiding this comment.
Current-head review (review-pr)
reviewed_head_sha: ea40c564e656b7619f50bdd3f486ff7760487871
integration_basis: origin/main merged earlier at a52ed29ce; this head is origin-contract repair only
claim_boundary: #4464 producer-owned parser start_byte origins for current Rust expression diagnostics; no public DTO/schema; no #1765/#3212
changed_surfaces_and_semantic_owners_inspected:
- analysis::diagnostic_origin (Cow-bound CapturedFile, per-file ScalarIndex, always-insert exact vs coarse)
- lsp projection still numeric-only when a record exists (unchanged this head)
- captured_file_index constructor tests for borrowed UTF-8/BOM vs owned lossy decode
- same-line two-predicate Unicode control against the shared coordinate index
blocking_findings: none in source/oracle for the accepted borrow + one-pass coordinate contract
non_blocking_suggestions: none
refuted_or_stale_findings:
- Comment 5887147024 is repaired on this SHA
- Comment 5886532931 remains repaired (coarse records, coincident cache, disk-B)
proof_and_ci_observed: local diagnostic_origin 20, source_origin_tests 8, check-fast and precommit pass; hosted required Actions not yet terminal on this SHA
proof_or_review_missing: hosted required GitHub Actions; Gemini quota; CodeRabbit OSS skip
affected_currentness_dimensions: production implementation, test stimulus, test oracle, candidate head identity
residual_assumptions_and_non_claims: exact origin requires captured==facts, CandidateCurrent, same-line exact slice; no-span current is coarse; empty maps keep #4688 heuristic; Cow borrow is valid UTF-8 only; no measured perf claim; not #1765/#3212
disposition: REVIEW_INCOMPLETE until hosted required checks are terminal on this SHA
Author self-review uses COMMENT because GitHub cannot request-changes from the author; that is not approval.
|
Exact-head source follow-up at The new ownership controls and indexed cap assertion discriminate the repairs. The same-line Unicode test independently checks the first prefix; an independent second-prefix expectation would strengthen it further, since the second span currently compares against the same index implementation. This is SOURCE_CLEAR / REVIEW_INCOMPLETE, not merge approval: please retain current-head owning compile/test results for origin producers/validators and diagnostic projection, plus current required gates. No measured memory/latency or installed/editor qualification is established by this source review. Active ownership remains yours. |
…wned-origin-fbc2 # Conflicts: # crates/ripr/src/analysis/language/rust/mod.rs Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
…width The same-line coordinate test already compared the second span to the shared ScalarIndex lookup. Pin origin_b starts against encoding_width of the constructed prefix so a wrong shared-index result cannot self-confirm. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
|
Follow-up on comment 5887706742 at The same-line Unicode test now pins This head also merges current Focused compile/test and required gates remain outstanding on this SHA. SOURCE_CLEAR on |
Keep the merged Rust adapter in the repository rustfmt shape so check-fast's fmt --check gate matches the combined tree. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
…wned-origin-fbc2 Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
GitHub-hosted rust-only tests compile the PR against current main, which added FunctionFact.impl_context. The same-line decoy span control is unique to this candidate and must set the new field. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
|
Hosted rust-only / GitHub-hosted rust gates on Repaired on This is still REVIEW_INCOMPLETE until required Actions are terminal on this SHA. |
EffortlessSteven
left a comment
There was a problem hiding this comment.
Current-head review (review-pr)
reviewed_head_sha: 07c784cd73e218dc2856ab27359cca78fcef704e
integration_basis: origin/main merged through bda41a814 (#4897 FunctionImplContext plus later catalog/doctor work)
claim_boundary: #4464 producer-owned parser start_byte origins for current Rust expression diagnostics; no public DTO/schema; no #1765/#3212
changed_surfaces_and_semantic_owners_inspected:
- analysis::diagnostic_origin (Cow-bound CapturedFile, per-file ScalarIndex, independent second-prefix encoding_width oracle)
- probes/diff same-line decoy fixture now fills FunctionFact.impl_context for combined-tree compile
- rust adapter still always inserts origins after #4775 lexical_test_grip and #4435 unreached-module limitations
- lsp projection remains numeric-only when a record exists
blocking_findings: none in source/oracle for the accepted origin contract
non_blocking_suggestions: none remaining from 5887706742 (second-prefix independent width is now asserted)
refuted_or_stale_findings:
- Comment 5887147024 remains repaired (Cow + one-pass coordinates)
- Comment 5886532931 remains repaired (coarse records, coincident cache, disk-B)
- Hosted E0063 missing impl_context on 7394e5e81 is repaired on this SHA
proof_and_ci_observed: local diagnostic_origin 20, source_origin_tests 8, canonical_parser_span decoy, rust-only feature diagnostic_origin compile; check-fast/precommit passed on 7394e5e81; hosted required Actions not yet terminal on this SHA
proof_or_review_missing: hosted required GitHub Actions on this SHA; Gemini quota; CodeRabbit OSS skip
affected_currentness_dimensions: production implementation, test stimulus, test oracle, conflict resolution, integration basis, candidate head identity
residual_assumptions_and_non_claims: exact origin requires captured==facts, CandidateCurrent, same-line exact slice; no-span current is coarse; empty maps keep #4688 heuristic; Cow borrow is valid UTF-8 only; no measured perf claim; not #1765/#3212
disposition: REVIEW_INCOMPLETE until hosted required checks are terminal on this SHA
Author self-review uses COMMENT because GitHub cannot request-changes from the author; that is not approval.
…wned-origin-fbc2 # Conflicts: # crates/ripr/src/app.rs # crates/ripr/src/app/check.rs Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
check_workspace_repo_with_origins is only used by producer-path tests. Mark it cfg(test) so clippy -D warnings on the library target stays honest while worktree LSP still uses the production origin helper. Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
|
Hosted required checks were green on Repaired on Cannot squash |
EffortlessSteven
left a comment
There was a problem hiding this comment.
Current-head review (review-pr)
reviewed_head_sha: db4d2a8109953d1895e9fca9e037901499f88d5c
integration_basis: origin/main merged through 3cb7e5428 (#4810 check_with_progress); prior green hosted CI was 07c784cd7 and does not transfer
claim_boundary: #4464 producer-owned parser start_byte origins for current Rust expression diagnostics; no public DTO/schema; no #1765/#3212
changed_surfaces_and_semantic_owners_inspected:
- app::check: check_with_progress wraps check_with_progress_and_origins; public CheckOutput still drops origins
- LSP still consumes check_workspace_worktree_with_origins; repo helper is cfg(test)
- origin admission/projection contract unchanged from 07c784cd7 source inspection
blocking_findings: none in source/oracle for the progress-merge origin plumbing
non_blocking_suggestions: none
refuted_or_stale_findings:
- Hosted green on 07c784cd7 is stale for merge after DIRTY repair
- 5887706742 second-prefix independent width remains asserted
proof_and_ci_observed: local diagnostic_origin 20, source_origin_tests 8, rust-only compile, check-fast 10 gates, precommit pass; hosted required Actions not yet terminal on this SHA
proof_or_review_missing: hosted required GitHub Actions on this SHA; Gemini quota; CodeRabbit OSS skip
affected_currentness_dimensions: production implementation, conflict resolution, integration basis, candidate head identity
residual_assumptions_and_non_claims: exact origin requires captured==facts, CandidateCurrent, same-line exact slice; no-span current is coarse; empty maps keep #4688 heuristic; no measured perf claim; not #1765/#3212
disposition: REVIEW_INCOMPLETE until hosted required checks are terminal on this SHA
Author self-review uses COMMENT because GitHub cannot request-changes from the author; that is not approval.
There was a problem hiding this comment.
#4851 exact db4d substantive review packet
Disposition: bounded ordinary REVIEW_READY exact db4d. Root full source/integration review and primary raw/context/JUnit/named-control counterread are complete. External active owner retained. This COMMENT is not human approval, owner readiness, merge authorization, or public qualification; no READY, thread resolution or merge action.
Head db4d2a8109953d1895e9fca9e037901499f88d5c, tree 83a712cc74706ac8cd1c055f9da9202bec5c158f; one-parent successor of reviewed40b. Entire40b→db4d delta is #[cfg(test)] on app/check.rs check_workspace_repo_with_origins, preserving production progress route. Root full40b source/integration review and prior numeric/Cow contracts carry by identical owning blobs. Fresh PR base aad6028a5527602306a2c93331595a1970c6eb9c, DRAFT OPEN; mergeability UNKNOWN at inspection, not a content-conflict conclusion.
Current integration and proof subject
Required and feature both use checkout 203d4ab8ab00263af45d2e1da58ac8e53d52172b, tree 25858b8bba6e5ba86804b66f2e05bf4dd72a2c23, parents aad602+db4d. Full19-own-file blob comparison retained 4851-db4d-checkout-parity.json:18 identical; sole differing Python.rs blob adds upstream mod parametrize and PythonTest parametrize: Option<...> DTO field. Entire actual diff retained 4851-db4d-python-integration.diff; no diagnostic-origin authority/projection change. Rust origin, probe, app, LSP projection and controls match exact head. This is not full inherited-tree source review.
Feature36557485577/job109370378000 SUCCESS. Raw 4851-db4d-feature.log SHA D87EC92292315376B54F7054C15B8B2975695A100BDA6B1085A0BA6875177AA3:28 groups,6452 pass/0 fail/2 ignored. Actual named20 diagnostic_origin and8 lsp::source_origin tests pass, plus canonical parser string-decoy test. Retained 4851-db4d-named-controls.log includes borrowing ordinary UTF8/BOM versus owned lossy decoding, captured-source cache rejection with coincident geometry, standalone CR refusal/CRLF precision, deleted zero-width, two Unicode predicates with independent coordinates, saved-source mismatch refusal, cold/warm geometry, stored-coarse refusal and disk-change no-reread. No owning control skipped. Ignore counts remain honest aggregate exclusions; no ignored example is credited as execution.
Required36557485554/job109370124596 SUCCESS. Raw 4851-db4d-required.log SHA D9AC0155B916FB5DC29B2D12F6B0A430A35F55E90FC73836CD63933530D69096 executes full precommit, workspace all-targets, strict workspace Clippy, nextest10121 pass/one excluded, doctests2 pass/one ignored, goldens and fixtures. Summary PRECOMMIT_RESULT success. JUnit10121 cases/0 failures/errors/skipped entries SHA 48717465840D02F657A6E6F4972A572EB9F70258E7AA86FE2408D50F250256A6. Excluded executable is the explicit committed-fixture regeneration writer, not origin proof. Artifact11029439267 digest 98571e609a9acfeb97b0e8f03eb97e4810ded4840c9f41ae6322314491f80098, retained 4851-db4d-nextest/; run-context binds exact checkout/run/profile/input blobs/native exit0. Feature API returned no uploaded artifacts; only raw logs establish its counts. No hosted precommit-v2 packet is invented.
Source and owner contract
Exact source honors producer-loaded byte/source identity, parser-span occurrence rather than line substring, borrowed Cow UTF8/BOM and owned required lossy decode, per-file scalar coordinate index with no per-finding prefix rescans, and authoritative coarse-origin refusal without renderer IO inference. Prior root5887147024/5887706742 concerns are source-repaired by unchanged reviewed owner implementation and reached current hosted controls. Root source inspection covers current consumer projection paths; this packet does not strengthen source clearance by green status alone.
Fresh remote gates and boundaries
Current head unchanged. No inline review threads; current exact-db4d review is COMMENTED (not human approval). Latest required result and applicable checks SUCCESS; policy-routed advisory lanes explicitly SKIPPED. Classic main protection requires Ripr Rust Small Result, strictfalse/0approvals; repository ruleset18845973 requires review-thread resolution,0approvals, permits squash. No rule changes or bypass.
No installed/editor-version qualification, native current-head execution, release/publishing claim or parent-goal completion. Root synthesis is complete for this bounded claim. Active external owner remains accountable; fresh mergeability/ownership/rules/checks must be inspected before any finish action. Current UNKNOWN does not authorize a behind-only restack.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Current-head review (review-pr)
reviewed_head_sha: db4d2a8109953d1895e9fca9e037901499f88d5c
integration_basis: origin/main aad6028a5527602306a2c93331595a1970c6eb9c (PR base); GitHub mergeability MERGEABLE/CLEAN
claim_boundary: #4464 producer-owned parser start_byte origins for current Rust expression diagnostics; crate-private sidecar; no public DTO/schema; no #1765/#3212
changed_surfaces_and_semantic_owners_inspected:
- analysis::diagnostic_origin: always-insert exact vs CoarseZeroWidth/missing_input; CapturedFile keeps decoder Cow; ScalarIndex once per file; independent second-prefix encoding_width oracle
- analysis::probes::{diff,repo,mod}: ParserByteSpan::same_line, SeededProbe::record_span; decoy FunctionFact.impl_context filled for combined-tree compile
- analysis::language::rust: parser_spans keyed after final-id, origins after lexical_test_grip and unreached_module_limitations
- app::check: public check_with_progress drops origins; crate-private check_with_progress_and_origins returns sidecar; repo helper cfg(test)
- lsp::{diagnostics,position}: diagnostic_range_for_finding numeric-only when a record exists; empty maps keep #4688 saved-line heuristic
- producer tests: diagnostic_origin (20) and source_origin_tests (8), including decoy, coincident cache, disk-B retained-A, BOM-borrow vs lossy-own, standalone CR, BaseDeleted coarse
blocking_findings: none
non_blocking_suggestions: none remaining from 5887706742 / 5887147024 / 5886532931
refuted_or_stale_findings:
- COMMENT threads 5886532931, 5887147024, 5887706742 are source-repaired on this lineage; no inline review threads remain
- Gemini quota and CodeRabbit OSS skip remain missing review for those providers, not source defects and not a merge blocker (ruleset 18845973 requires 0 approvals and thread resolution)
- Hosted green on 07c784cd7 is stale after DIRTY repair; this pass binds db4d only
proof_and_ci_observed:
- Required Ripr Rust Small Result SUCCESS (job 109381396139) on this SHA
- Required Ripr Rust Small on GitHub Hosted / Rust gates SUCCESS (job 109370124596): full precommit, workspace all-targets, strict clippy, nextest 10121 pass / one excluded
- Advisory Rust-only feature lane SUCCESS (job 109370378000): 6452 pass / 0 fail / 2 ignored; named 20 diagnostic_origin + 8 source_origin + canonical decoy pass
- Policy-routed lanes (docs, vscode, msrv, coverage, windows, perl/release, extra rust-small runners) SKIPPED, not treated as passed
- Combined-tree checkout 203d4ab8 (aad602+db4d); mergeStateStatus CLEAN
proof_or_review_missing: Gemini quota; CodeRabbit skip; no installed-editor or native current-head re-execution in this published pass (hosted named controls and required matrix stand in)
affected_currentness_dimensions: candidate head identity, integration basis, exact-head CI receipts (production/oracle unchanged from inspected db4d source)
residual_assumptions_and_non_claims: exact origin requires captured==facts, CandidateCurrent, same-line exact slice, no standalone CR, not lexical fallback; no-span current is coarse; empty maps keep #4688 heuristic; no cache authenticity, unsaved-buffer (#1765), deleted remapping (#3212), measured perf, or parent-epic completion
disposition: REVIEW_READY
Author self-review uses COMMENT because GitHub cannot request-changes from the author; that is not approval. External SOURCE_CLEAR packet 5351892457 is corroborated: required and feature jobs succeeded on this SHA, mergeability is now CLEAN, and no inline threads remain. Merge convergence may proceed by ordinary protected squash.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: db4d2a8109
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| findings: &[Finding], | ||
| context: &OriginBuildContext<'_>, | ||
| ) -> RustDiagnosticOrigins { | ||
| let captured = captured_file_index(context.loaded_files, context.index); |
There was a problem hiding this comment.
Build coordinate indexes only for finding files
When Instant/Draft analysis loads an entire touched package or dependent scope but only changed files seed findings, this call builds three scalar-length arrays for every loaded Rust file before examining the findings. The arrays consume roughly 16 bytes per scalar (usize plus two u32s), so a mostly ASCII 50–100 MB working set adds about 0.8–1.6 GB on every LSP refresh and can exhaust the constrained runners that the existing index-file guard is intended to protect. Filter loaded_files to paths referenced by findings, and preferably build coordinates only for exact-span candidates.
AGENTS.md reference: AGENTS.md:L253-L255
Useful? React with 👍 / 👎.
| if !finding.source_currentness.permits_candidate_action() { | ||
| return coarse_on_line(&captured.lines, finding.probe.location.line); | ||
| } | ||
| let Some(span) = span else { | ||
| return coarse_on_line(&captured.lines, finding.probe.location.line); | ||
| }; | ||
| if captured.has_standalone_cr { | ||
| return missing_input_origin(); | ||
| } | ||
| if captured.used_lexical_fallback || !captured.facts_match { | ||
| return coarse_on_line(&captured.lines, finding.probe.location.line); | ||
| } | ||
| exact_origin(captured, span, finding) | ||
| .unwrap_or_else(|| coarse_on_line(&captured.lines, finding.probe.location.line)) |
There was a problem hiding this comment.
🟡 Coarse findings cannot be hovered
When origin_for_finding refuses precision, its zero-width range never contains a cursor position. The hover fallback excludes published findings, so their evidence cannot open from the source line.
Learn more
Rust findings without a parser span, including lexical fallbacks and retargeted bindings, receive a zero-width origin. The hover matcher position_in_range uses an exclusive end position, so zero-width diagnostics never match the cursor. The hover fallback also excludes findings that already have published diagnostics. These findings therefore lose their finding-specific hover.
Example: A retargeted binding finding publishes a range at character 0..0. Hovering anywhere on that line never opens its evidence, unlike the previous saved-line range.
Recommended fix: Handle published coarse diagnostics explicitly in the hover path, using the finding's line as a fallback hover target without claiming an exact expression range.
Was this helpful? React with 👍 or 👎 to provide feedback.
| let mut captured = BTreeMap::new(); | ||
| for (path, bytes) in loaded_files { | ||
| let source = rust_source_text(bytes).text; | ||
| let facts = index.files.get(path); | ||
| let text = source.as_ref(); | ||
| captured.insert( | ||
| path.clone(), | ||
| CapturedFile { | ||
| has_standalone_cr: has_standalone_cr(text), | ||
| lines: lsp_lines(text), | ||
| coords: ScalarIndex::build(text), | ||
| facts_match: facts.is_some_and(|facts| facts.source == text), | ||
| used_lexical_fallback: facts.is_some_and(|facts| facts.used_lexical_fallback), | ||
| source, | ||
| }, |
There was a problem hiding this comment.
🔍 Index only files needing diagnostic coordinates
Diff analysis loads unchanged files for evidence. captured_file_index allocates scalar arrays for them even when they produce no findings, adding roughly sixteen bytes per ASCII byte on 64-bit hosts. Restricting coordinate construction to files with eligible findings avoids this overhead.
Was this helpful? React with 👍 or 👎 to provide feedback.
| //! Producer-owned numeric diagnostic origins for current Rust findings (#4464). | ||
| //! | ||
| //! Parser byte intervals travel with the seeded probe through final-ID | ||
| //! assignment. Exact geometry is admitted only when the captured analysis | ||
| //! bytes, cached file facts, candidate-current disposition, and the parser | ||
| //! span all agree. Projection later selects these numbers; it does not search | ||
| //! source text or reread the filesystem. | ||
| //! | ||
| //! Every current Rust finding in this map receives a record. Missing parser | ||
| //! span, mismatched facts, lexical fallback, and other refusals stay coarse | ||
| //! zero-width. Absent or default-empty maps, and other languages, keep the | ||
| //! saved-line heuristic. Non-current records stay bounded so a deleted | ||
| //! expression cannot paint a current line. | ||
| //! | ||
| //! Captured files keep the decoder `Cow`: valid UTF-8, including a supported | ||
| //! leading BOM strip, is borrowed from the loaded buffer; only a required | ||
| //! lossy decode owns. UTF-8/16/32 scalar-boundary coordinates are built once | ||
| //! per file and admitted endpoints are derived from that index. |
There was a problem hiding this comment.
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- stored_coarse_origin_is_not_replaced_by_saved_line_search bypasses origin_for_finding and inserts a synthetic EncodedOrigin; coarse refusal end-to-end through the LSP projection path is not covered by this producer-path suite (covered only as unit).
Verification questions
- Confirm same-line Unicode two-predicate test shares ScalarIndex between build and check (self-confirmation) but is not load-bearing because origin_a is independently pinned to encoding_width.
- Confirm coarse-record test inserts a synthetic CoarseZeroWidth for one finding while reusing the same repo-produced output.findings vector for ids; if repo producer changes, discriminator may stop being one.
- Confirm producer-A → disk-B origin retention test only exercises the repo producer; diff producer path retains
parser_spansper-iteration so equivalent retention relies oncaptured_file_indexbeing rebuilt per call.run_pipeline_for_diff_textbuilds analysis on each tick; no caching makes the test less adversarial but also proves nothing about cross-tick retention. - Confirm
two_predicates_on_one_unicode_line_share_file_coordinatesassertsorigin_bUTF-8/16/32 starts against aprefix_bconstructed byformat!, not againstScalarIndex::line_span.format!cannot split scalars, so prefix width viaencoding_widthequalsScalarIndexwidth — assertion cannot fail for an off-by-one in the index.
Refuted
- This PR introduces a JS-backed worker hand-off that could leak, race, or mis-transfer Rust-owned diagnostic origins across a structured-clone boundary.; refuted because: The diff is a synchronous Rust-only patch inside the ripr crate. There are no Web Worker APIs, no SharedArrayBuffer, no transferable objects, no wasm-bindgen / napi / neon FFI, no async runtime spawns, and no cross-thread channels in the changed lines. RustDiagnosticOrigins is passed by shared reference (FindingDiagnosticProjection<'a>) and Owned only when an AnalysisResult is constructed locally in pipeline.rs. No memory crosses a worker or transfer boundary in this PR.
- SeededProbe duplicates responsibilities across diff and repo paths, creating two parallel probe builders; refuted because: Both paths now go through SeededProbe (diff.rs uses probes_for_file_with_relations -> SeededProbe; repo.rs uses probes_for_repo_file_seeded -> SeededProbe). The crate-private probes_for_repo_file shim remains cfg(test). The contract is single-shape, with optional parser_span recorded once; dedup_probe_ids handles collisions identically.
Parked follow-ups
- Each FindingDiagnosticProjection::new caller uses an empty RustDiagnosticOrigins::default(), so profile_status and saved-prefix tests in tests.rs cannot exercise the producer path; coverage of the live origins route is concentrated in source_origin_tests.rs and is sufficient per claim boundary, but a profile-vs-origins interaction test would be a parked follow-up.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Summary
Carry parser
start_bytewith seeded Rust probes into a crate-private origin sidecar and project those numbers through standard LSP diagnostics, so a first-substring match on the saved line cannot steal the range from a later producer occurrence.Refused current Rust findings get an explicit coarse record so projection stays numeric-only. Captured files keep the decoder
Cow(borrow valid UTF-8, including BOM strip; own only a required lossy decode). UTF-8/16/32 scalar coordinates are built once per file. Absent/default empty maps and other languages keep the #4688 heuristic.Swarm / Source Boundary
This PR targets
EffortlessMetrics/ripr-swarm, the normal development trunk for trusted same-reporiprwork. Confirm the change belongs here:ripr-swarmSource-of-truth Links
Proposal:
Spec: LSP diagnostic range construction (
crates/ripr/src/lsp/position.rs,crates/ripr/src/lsp/diagnostics.rs); #4464 origin admission rulesADR:
Plan item:
Governing issue or accepted claim: #4464
Acceptance delta (one sentence): Current Rust expression diagnostics use producer-owned parser byte origins when captured analysis bytes, cached facts, and candidate-current disposition agree; refused current records stay coarse; projection selects stored numbers with no renderer reread.
Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication):
cursor/lsp-producer-owned-origin-fbc2Stack parent or prerequisite PR (if any): none; #4688 already landed the heuristic fallback
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): none
Accepted winner and losing candidate disposition (when decided): n/a
Scope
Rust diff/repo probe seeding attaches optional
ParserByteSpan. Classification keeps the span keyed by final probe id.origins_for_rust_findingsalways inserts a Rust record.captured_file_indexborrows decoderCowand builds a per-file scalar coordinate index. Exact endpoints are derived from that index with the existing 120-unit scalar-safe cap. LSP selects stored numbers when a record exists; missing maps keep the saved-line heuristic.Scope Classification
This PR is scoped by:
Production delta:
RustDiagnosticOriginssidecarEvidence/support delta:
encoding_widthoraclediagnostic_for_finding*heuristic preservedSingle acceptance criterion:
Non-goals:
Support-tier Impact
Claim/proof notes:
No public API, JSON schema, or editor package claim changes. Origins are crate-private.
Policy Impact
Ledger or exception notes:
No new panic-family allowlist entries. Tests use
Resultoracles instead ofexpect.Proof
Result, failures, or skipped proof:
diagnostic_origin: 20 passedsource_origin_tests: 8 passedcanonical_parser_span_skips_string_decoy_on_the_same_line: passeddiagnostic_origin: passedcheck-fast: 10 gates, 19 changed files, clippy-D warningsprecommit: passedRipr Rust Small ResultSUCCESS on this SHA (job 109381396139)Ripr Rust Small on GitHub Hosted / Rust gatesSUCCESS (job 109370124596)Exact candidate SHA:
db4d2a8109953d1895e9fca9e037901499f88d5cClaim Boundary
May claim: current Rust LSP finding ranges use producer
start_bytewhen exact-origin rules hold; refused current Rust records stay coarse; projection does not reread or search when a record exists; captured valid UTF-8 is borrowed; encoding coordinates are per-file.Must not claim: runtime mutation results, public schema change, cache authentication, unsaved-buffer freshness (#1765), deleted-code remapping (#3212), measured performance, or parent-epic completion.
Rollback
Revert the commits. Public CheckOutput and finding wire fields are unchanged; diagnostics fall back to the previous first-verbatim heuristic.
Spec-Test-Code Traceability
analysis/diagnostic_origin.rs,lsp/source_origin_tests.rsanalysis/diagnostic_origin.rs, probes seeding,analysis/language/rust/mod.rs,app/check.rs,lsp/diagnostics.rs,lsp/position.rsStatic Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a — ordinary analyzer/LSP PR; no workflow or protection change in this claim.
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Gates
cargo xtask precommitHosted required GitHub Actions passed on this exact published head.