Skip to content

fix(lsp): project producer-owned Rust diagnostic origins - #4851

Merged
EffortlessSteven merged 16 commits into
mainfrom
cursor/lsp-producer-owned-origin-fbc2
Sep 29, 2026
Merged

EffortlessSteven merged 16 commits into
mainfrom
cursor/lsp-producer-owned-origin-fbc2

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Carry parser start_byte with 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-repo ripr work. Confirm the change belongs here:

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm
  • repair or follow-up for a same-repo swarm PR
  • swarm-only CI, runner, routing, source-of-truth, or agent-operating surface
  • other swarm-scoped work:

Source-of-truth Links

Proposal:
Spec: LSP diagnostic range construction (crates/ripr/src/lsp/position.rs, crates/ripr/src/lsp/diagnostics.rs); #4464 origin admission rules
ADR:
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-fbc2
Stack 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_findings always inserts a Rust record. captured_file_index borrows decoder Cow and 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:

  • One production behavior
  • One public contract
  • One architectural seam
  • Docs/spec/test-only evidence package
  • Other:

Production delta:

  • Crate-private RustDiagnosticOrigins sidecar
  • Always-insert exact vs coarse records
  • Borrowed captured UTF-8 plus one-pass UTF-8/16/32 coordinates
  • Numeric-only LSP projection when a record exists

Evidence/support delta:

  • Unit origins including coincident-offset cache, no-span coarse, BOM-borrow vs lossy-own, same-line two-predicate Unicode coordinate sharing with an independent second-prefix encoding_width oracle
  • Producer-path LSP tests including disk-B retained-A and stored coarse origin
  • Empty-origin diagnostic_for_finding* heuristic preserved

Single acceptance criterion:

  • For a current Rust predicate with a string decoy of the same text earlier on the line, the published diagnostic starts at the producer if-condition, not the first substring, in UTF-8/16/32.

Non-goals:

Support-tier Impact

  • none

Claim/proof notes:

No public API, JSON schema, or editor package claim changes. Origins are crate-private.

Policy Impact

  • none

Ledger or exception notes:

No new panic-family allowlist entries. Tests use Result oracles instead of expect.

Proof

cargo test -p ripr --lib diagnostic_origin
cargo test -p ripr --lib source_origin_tests
cargo test -p ripr --lib canonical_parser_span_skips_string_decoy
cargo test -p ripr --locked --no-default-features --features lang-rust --lib diagnostic_origin
cargo xtask check-fast
cargo xtask precommit

Result, failures, or skipped proof:

  • diagnostic_origin: 20 passed
  • source_origin_tests: 8 passed
  • canonical_parser_span_skips_string_decoy_on_the_same_line: passed
  • rust-only feature compile of diagnostic_origin: passed
  • check-fast: 10 gates, 19 changed files, clippy -D warnings
  • precommit: passed
  • Hosted required Ripr Rust Small Result SUCCESS on this SHA (job 109381396139)
  • Hosted required Ripr Rust Small on GitHub Hosted / Rust gates SUCCESS (job 109370124596)
  • Advisory rust-only feature lane SUCCESS (job 109370378000); policy-routed extra lanes SKIPPED, not treated as passed

Exact candidate SHA: db4d2a8109953d1895e9fca9e037901499f88d5c

Claim Boundary

May claim: current Rust LSP finding ranges use producer start_byte when 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

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.
  • Unknowns include stop reasons where applicable.

CI Economics

n/a — ordinary analyzer/LSP PR; no workflow or protection change in this claim.

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • No new panic, unwrap, expect, todo, or unimplemented in tests.

Gates

  • cargo xtask precommit

Hosted required GitHub Actions passed on this exact published head.

Open in Web Open in Cursor 

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>
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 853f5b15-6d54-438e-ae88-deb072811124


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

cursoragent and others added 4 commits September 29, 2026 06:28
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 EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member Author

Source-only counterreview of exact 7ded8b71ae234736881ebeb9545c70138d70de85: REPAIR_REQUIRED; native/hosted proof not independently established. Active candidate ownership is preserved.

  1. diagnostic_origin.rs::origin_for_finding returns None for a current Rust finding without a parser span (let span = span?). diagnostics.rs::diagnostic_range_for_finding then rereads the saved file and searches its first matching expression. The test candidate_current_without_parser_span_keeps_heuristic explicitly approves this behavior. The accepted #4464 boundary requires explicit bounded coarse Rust records for refused canonical/binding/multiline origins, with numeric-only projection and no renderer reread. Preserve legacy conversion for absent/default context and other languages, while distinguishing a refused Rust origin.

  2. cached_facts_from_another_source_cannot_authorize_captured_input selects cached byte offset 64 against a 59-byte captured input. It would still refuse on bounds if whole-source equality were removed. Add a producer/cache control with a valid coincident offset and identical selected expression in different whole-file bytes, requiring coarse refusal. Retained producer-A projection after disk-B is a separate missing discriminator.

  3. Origin construction clones decoded source buffers and runs whole-source equality/CR/line scans per finding. Reconcile this with the accepted borrowed per-file indexing boundary; no measured performance regression is asserted.

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.

cursoragent and others added 2 commits September 29, 2026 08:34
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>
@EffortlessSteven

Copy link
Copy Markdown
Member Author

Repaired on a52ed29ce92c0ea2e8ad83762740401ee96ce0bc through the same candidate. Source-backed responses to comment 5886532931:

  1. origin_for_finding always returns a Rust record. CandidateCurrent without a parser span is coarse zero-width on the current line; missing captured input is missing_input_origin. candidate_current_without_parser_span_stays_coarse and stored_coarse_origin_is_not_replaced_by_saved_line_search pin numeric-only projection. Empty/default origin maps still take the saved-line heuristic (diagnostic_for_finding*).
  2. cached_facts_from_another_source_cannot_authorize_captured_input now uses same-length fn a() / fn b() fixtures with a coincident in-bounds predicate offset and identical expression bytes. retained_origins_do_not_reread_disk_after_source_changes projects stored producer-A ranges after disk B and shows empty-origin heuristic ranges differ.
  3. captured_file_index decodes each loaded file once and stores source, standalone-CR flag, line table, facts equality, and lexical-fallback. Findings no longer clone or rescan the whole buffer. No measured performance claim.

#1765 and #3212 remain out of scope.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Source-only follow-up on exact a52ed29ce92c0ea2e8ad83762740401ee96ce0bc: the two earlier correctness findings are repaired in source. Refused current Rust findings now receive coarse numeric records, and projection returns those records before saved-file reads. The revised cache fixture uses equal-length fn a()/fn b() sources with a coincident valid predicate offset and identical selected expression, so bounds/line/expression checks no longer short-circuit the whole-source equality discriminator. The actual repo-producer A → disk-B test also requires retained ranges to remain unchanged and the empty-map heuristic to differ. These tests were source-inspected; no independent runtime result is claimed here.

One accepted source-contract requirement remains: #4464’s governing boundary explicitly says to borrow existing input buffers. CapturedFile.source: String and captured_file_index calling rust_source_text(bytes).text.into_owned() still force one whole-buffer clone for ordinary valid UTF-8 input. Moving indexing outside the finding loop correctly removes per-finding clones/rescans, but does not satisfy that borrowing requirement.

Please retain the decoder’s Cow<'a, str> in a lifetime-bound CapturedFile<'a>/index, borrowing valid captured UTF-8 and owning only when decoding requires it. Add focused controls through the actual captured_file_index constructor that distinguish borrowed ordinary UTF-8 (including the supported BOM slice) from a supported decode requiring ownership, while preserving exact geometry/facts agreement. This is a narrow source-contract repair; no measured memory or performance regression is asserted, and no broader indexing redesign is requested.

Active candidate ownership remains with this PR. Native/hosted acceptance, cache authenticity, publication freshness (#1765), and deleted-source remapping (#3212) remain separate boundaries.
The same governing boundary also requires numeric UTF-8/16/32 endpoints in one pass per loaded file. exact_origin currently calls encoded_span(prefix, expression, ...) for all three encodings; encoding_width(prefix) rescans each finding's prefix with .chars().count() and .chars().map(...).sum(). The stored per-file line table removes repeated line-table construction, but not repeated character-coordinate computation, especially for several findings on one line. Please compute scalar-boundary coordinates once per captured file and derive admitted endpoints from that index, retaining the existing scalar-safe 120-unit cap. A focused same-line multi-finding/Unicode-prefix control should exercise that shared index and distinguish UTF-8/16/32 geometry. This is the accepted algorithm boundary, not an observed performance regression; Cow alone does not complete it.

cursoragent and others added 2 commits September 29, 2026 09:12
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>
@EffortlessSteven

Copy link
Copy Markdown
Member Author

Repaired on ea40c564e656b7619f50bdd3f486ff7760487871 through the same candidate.

  1. CapturedFile<'a> now stores rust_source_text(...).text as Cow<'a, str> with no into_owned(). captured_index_borrows_ordinary_utf8_including_bom requires Cow::Borrowed for ordinary UTF-8 and a supported BOM strip. captured_index_owns_lossy_non_utf8 requires Cow::Owned only for a required lossy decode.
  2. ScalarIndex is built once per captured file. exact_origin derives UTF-8/16/32 endpoints from that index and keeps the scalar-safe 120-unit cap. two_predicates_on_one_unicode_line_share_file_coordinates puts two exact findings on one Unicode-prefix line and requires both published spans to equal the shared index lookup, with UTF-8/16/32 geometry distinguished.

No measured memory or performance claim. #1765 and #3212 remain out of scope.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Exact-head source follow-up at ea40c564e656b7619f50bdd3f486ff7760487871: the two remaining source findings in my previous review are repaired. The captured decoder Cow remains borrowed for valid UTF-8/BOM and owns only required decoding; the scalar coordinate index is built once per file and exact origins no longer rescan line prefixes per finding. Indexed scalar capping retains the bound.

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.

cursoragent and others added 2 commits September 29, 2026 09:47
…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>
@EffortlessSteven

Copy link
Copy Markdown
Member Author

Follow-up on comment 5887706742 at bb4491c71.

The same-line Unicode test now pins origin_b UTF-8/16/32 starts against encoding_width of the constructed {prefix_a}{PREDICATE}{between} prefix. That oracle walks the prefix independently of ScalarIndex, so a wrong shared-index result cannot self-confirm the second span.

This head also merges current origin/main to clear the dirty tree: Rust adapter keeps producer origins together with #4775 lexical_test_grip, #4435 unreached-module limitations, and the committed-source overlay.

Focused compile/test and required gates remain outstanding on this SHA. SOURCE_CLEAR on ea40c564e does not transfer; this is still REVIEW_INCOMPLETE until exact-head proof and required Actions are current.

cursoragent and others added 3 commits September 29, 2026 09:51
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>
@EffortlessSteven

Copy link
Copy Markdown
Member Author

Hosted rust-only / GitHub-hosted rust gates on 7394e5e81 failed combined-tree compile: FunctionFact on current main (#4897) requires impl_context, and this candidate's unique same-line decoy fixture in probes/diff.rs did not set it.

Repaired on 07c784cd73e218dc2856ab27359cca78fcef704e by merging current origin/main and setting impl_context: Default::default() on that fixture. Local rust-only diagnostic_origin (20), canonical_parser_span_skips_string_decoy_on_the_same_line, and source_origin_tests (8) pass. Independent second-prefix encoding_width assertions from comment 5887706742 remain.

This is still REVIEW_INCOMPLETE until required Actions are terminal on this SHA.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@EffortlessSteven

Copy link
Copy Markdown
Member Author

Hosted required checks were green on 07c784cd7, but GitHub then reported DIRTY/CONFLICTING against current main (#4810 progress stderr and related work). That is a real combined-tree conflict in app.rs / app/check.rs, not behind-only movement.

Repaired on db4d2a8109953d1895e9fca9e037901499f88d5c: check_with_progress remains the public owner; crate-private check_with_progress_and_origins returns the existing origin sidecar; check_workspace_repo_with_origins is cfg(test) because only producer-path tests use it. Local diagnostic_origin 20, source_origin_tests 8, rust-only compile, check-fast, and precommit pass.

Cannot squash 07c784cd7. This head is REVIEW_INCOMPLETE until required Actions are terminal here.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@EffortlessSteven EffortlessSteven left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#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 EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review September 29, 2026 11:40
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-29T11:45:03.710784Z db4d2a8 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@EffortlessSteven
EffortlessSteven merged commit 3510e1f into main Sep 29, 2026
28 of 29 checks passed
@EffortlessSteven
EffortlessSteven deleted the cursor/lsp-producer-owned-origin-fbc2 branch September 29, 2026 11:41

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

Devin Review

Comment on lines +290 to +303
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))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +241 to +255
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,
},

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 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.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +1 to +18
//! 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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Record origin rules in traceability

CONTRIBUTING.md calls for a spec entry and spec-to-test-to-code traceability for behavior changes. The new origin rules and producer-path tests have no corresponding spec update in this diff.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_spans per-iteration so equivalent retention relies on captured_file_index being rebuilt per call. run_pipeline_for_diff_text builds 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_coordinates asserts origin_b UTF-8/16/32 starts against a prefix_b constructed by format!, not against ScalarIndex::line_span. format! cannot split scalars, so prefix width via encoding_width equals ScalarIndex width — 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants