Skip to content

test(lsp): pin identity-law edges and share fingerprint authority (#1932) - #4830

Merged
EffortlessSteven merged 1 commit into
mainfrom
cursor/lsp-identity-edge-tests-1a7d
Oct 2, 2026
Merged

EffortlessSteven merged 1 commit into
mainfrom
cursor/lsp-identity-edge-tests-1a7d

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Summary

Pins the landed agentic-LSP identity laws with discriminating edge-case tests, then uses that coverage to share one fingerprint and canonical-identity-text authority.

Verified on origin/main f6aa0ab8c: the original typed taxonomy (CanonicalItemId, InstructionSemanticId, …) has not landed. This PR does not absorb #4804–#4809. Current truth is on #1932.

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Proposal: n/a
Spec: RIPR-SPEC-0129, RIPR-SPEC-0142, RIPR-SPEC-0124
ADR: n/a
Plan item: n/a
Governing issue or accepted claim: Advances #1932 (does not close; identity train remains #4804–#4809)
Acceptance delta (one sentence): existing action/input/result identity owners have discriminating edge-case tests and one shared fingerprint/canonical-text formula.

Candidate Relationships

Candidate branch: cursor/lsp-identity-edge-tests-1a7d
Stack parent or prerequisite PR: none
Proposed replacement of PR: none

Scope

  • action_contract.rs: one fingerprint_action_id / addressed-identity key list; tests that action_id ignores title/range/message/snapshot/capability/disabled reason, trims/falls through canonical ids, and that parse rejects a swapped sibling id
  • input_identity.rs: shared canonical identity text and git fixture helper; tests for separator spelling, volatile-key exclusion, deadline/encoding exclusion, and semantic session flags
  • diagnostics.rs: result IDs ignore refresh clock and attempt snapshot_id; message-only and profile changes invalidate them
  • spec test mappings, traceability, slice, changelog

Scope Classification

  • One architectural seam (landed LSP identity laws on existing owners)

Production delta: shared fingerprint/canonical-text helpers; no wire-format or execution change.

Evidence/support delta: edge-case tests, spec test-mapping, traceability, slice.

Single acceptance criterion: the new tests fail if title/snapshot/capability enter action_id, if parse/build fingerprints diverge, if deadlines enter analysis input identity, or if refresh clock enters diagnostic result IDs.

Non-goals: #4804–#4809 identity train; typed wrapper migration; action/edit execution; goldens.

Support-tier Impact

  • none

Policy Impact

  • none

Proof

cargo test -p ripr --lib -- action_contract::tests input_identity::tests diagnostic_result_ids_ignore_refresh_clock diagnostic_result_ids_change_for_message_only action_id_ignores_title parse_validated_action_data_round_trips
cargo xtask precommit

25 selected tests passed on a590dc506. cargo xtask precommit passed (precommit.md / precommit-v2.md), including cargo clippy -p ripr --all-targets -- -D warnings and cargo clippy -p xtask --all-targets -- -D warnings.

What the proof establishes: identity-law edge cases on the landed owners; build/parse share one fingerprint; policy/traceability/spec-format gates for the changed files.

What the proof does not establish: hosted merge-gate completion; typed-taxonomy delivery; runtime mutation outcomes.

Negative controls:

  • Title/range/message/snapshot/capability/disabled reason do not change action_id
  • Lower-precedence identities do not change action_id when canonical_gap_id is present
  • A swapped sibling action_id is rejected by parse_validated_action_data
  • Git timeout, refresh deadline, and position encoding do not change input identity
  • Include-unchanged-tests and seam-diagnostics flags still do
  • Refresh clock and attempt snapshot_id do not change diagnostic result IDs; message and profile still do

Claim Boundary

May claim: the landed action/input/result identity laws are now discriminated by edge-case tests, and build/parse share one fingerprint formula.

Must not claim: the #1932 typed taxonomy landed; #4804–#4809 is done; identities are runtime mutation results.

Rollback

Revert the squash commit. No schema or golden change.

Spec-Test-Code Traceability

  • Spec: RIPR-SPEC-0129, RIPR-SPEC-0142, RIPR-SPEC-0124
  • Tests: action_contract.rs, input_identity.rs, diagnostics.rs delivery tests
  • Code: same modules (shared fingerprint / canonical text)
  • Golden outputs: none
  • Slice: ripr.slice.lsp-identity-law-edges.v1

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.

CI Economics

n/a

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • No new panic, unwrap, expect, todo, or unimplemented in tests.
  • Errors are reported with actionable context.

Candidate SHA

a590dc5064a22d83e63f710fe8dd5cd3475e2187

Open in Web Open in Cursor 

)

Add discriminating tests for the landed action_id, analysis-input, and
diagnostic-result identity laws, then share one fingerprint and canonical
identity text so build/parse cannot drift. Does not absorb #4804–#4809.

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

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 5966ad9b-61ee-4a56-9dad-326417d33db9

📥 Commits

Reviewing files that changed from the base of the PR and between df1b435 and a590dc5.

📒 Files selected for processing (9)
  • .allow/spec-system/slices/ripr.slice.lsp-identity-law-edges.v1.toml
  • .ripr/traceability.toml
  • CHANGELOG.md
  • crates/ripr/src/lsp/action_contract.rs
  • crates/ripr/src/lsp/diagnostics.rs
  • crates/ripr/src/lsp/input_identity.rs
  • docs/specs/RIPR-SPEC-0124-lsp-diagnostic-delivery-stability.md
  • docs/specs/RIPR-SPEC-0129-editor-integration-contract.md
  • docs/specs/RIPR-SPEC-0142-lsp-git-input-authority.md
 __________________________________________________
< Your stack overflowed; I brought a bigger stack. >
 --------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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

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

review-pr (pre-publication / published-head pending CI)

reviewed_head_sha: a590dc5064a22d83e63f710fe8dd5cd3475e2187
integration_basis: PR base main (GitHub head of main has moved to df1b435f7; this branch is behind-only from f6aa0ab8c — no restack)
claim_boundary: Discriminating identity-law tests plus shared fingerprint/canonical-text on existing action_id / LspAnalysisInputIdentity / diagnostic result IDs. Does not close #1932 or absorb #4804–#4809.

changed_surfaces_and_semantic_owners_inspected:

  • lsp/action_contract.rs — fingerprint_action_id is the sole build/parse formula; ADDRESSED_IDENTITY_KEYS owns copy + first-present canonical subject; parse_validated_action_data remains the resolve consumer
  • lsp/input_identity.rs — canonical_identity_text / canonical_root_spelling feed stable_id and status root_identity
  • lsp/diagnostics.rs — document/workspace result IDs still hash served payload + profile + delivery selection; refresh metadata is not an input
  • consumers: resolve_action (stale input_identity vs action_id), refresh scheduler (still Eqs full config, not only stable_id)
  • specs 0129/0142/0124, traceability, slice

blocking_findings: none on source/oracle for this claim

non_blocking_suggestions:

  • RefreshInputIdentity still includes the full LspAnalysisConfig, so git timeout / refresh deadline / position encoding still defeat scheduler dedup even though they are excluded from LspAnalysisInputIdentity. Out of this claim; do not fold into #4804.
  • Volatile-key exclusion on canonical text is a closed-field substring check, not a PID-numeric proof.

refuted_or_stale_findings: none yet (hosted review threads not complete)

proof_and_ci_observed:

  • cargo test -p ripr --lib -- identity selectors: 25 passed
  • cargo xtask precommit: pass (target/ripr/reports/precommit.md, precommit-v2.md); clippy -p ripr --all-targets and -p xtask --all-targets -D warnings
  • Hosted: source-of-truth, spec-maintenance-digest, rust-only feature lane, cargo-deny, pr-plan, GitGuardian success; skipped-by-policy lanes named skipped; Ripr Rust Small on GitHub Hosted / Rust gates in_progress; droid-review queued; ub-review in_progress

proof_or_review_missing:

  • exact-head required merge-gate completion
  • external/droid review outcome

affected_currentness_dimensions: production implementation, test stimulus, test oracle, public claim (spec test mapping), generated relationships (traceability/slice)

residual_assumptions_and_non_claims:

  • action_id remains class+canonical+command+name; snapshot freshness stays the payload input_identity field
  • Typed taxonomy and registry remain #4804–#4809
  • No wire-format or golden change

disposition: REVIEW_INCOMPLETE until exact-head required checks finish. Author self-review uses COMMENT; GitHub cannot request-changes from the author. This is not approval.

Oracle challenge: swapping a sibling action_id onto an otherwise valid payload is rejected by parse_validated_action_data; blank canonical_gap_id falls through; deadline-only config clones keep the same input identity; refresh clock does not move document result IDs. Removing fingerprint_action_id sharing would not be caught if both sites were edited in lockstep — the parse/build round-trip plus swapped-id rejection is the discriminator for formula drift.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@EffortlessSteven
EffortlessSteven merged commit edef3aa into main Oct 2, 2026
27 of 31 checks passed
@EffortlessSteven
EffortlessSteven deleted the cursor/lsp-identity-edge-tests-1a7d branch October 2, 2026 09:46

@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 +4744 to +4746
let mut first = snapshot_for_identity(
"/workspace",
&[("file:///workspace/src/lib.rs", vec![diagnostic("same", 4)])],

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.

🟡 Unchanged seam reports receive new result IDs

When an unchanged refresh contains seam diagnostics, document_diagnostic_result_id changes despite this test passing. bind_seam_evidence_identity embeds the new snapshot handle in each seam diagnostic's hashed payload. Pull clients receive full reports instead of unchanged responses.

Learn more

Document result IDs hash serialized served diagnostics through normalized_diagnostic_payload_digest. The refresh transaction adds a per-generation snapshot_id to seam diagnostic data in bind_seam_evidence_identity. Thus an unchanged full refresh with seam diagnostics changes both document and workspace result IDs. This test uses a diagnostic with only diagnostic_id, so its changed refresh.snapshot_id never reaches the hashed payload.

Example: Two full refreshes produce the same seam seam:pricing, but the first embeds snapshot:1 and the second embeds snapshot:2. Their result IDs differ, so a pull client supplying its first previousResultId receives a full report instead of unchanged.

Recommended fix: Normalize only the attempt-specific seam data.evidence_identity.snapshot_id when computing diagnostic result identities, while preserving the actual payload for delivery and resolve freshness. Add a test using a real seam diagnostic passed through prepare_refresh_transaction, then assert equal document and workspace IDs across refresh generations and changed IDs when the semantic diagnostic changes.

Devin Review


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

Comment on lines +162 to +164
fn canonical_root_spelling(root: &Path) -> String {
root.to_string_lossy().replace('\\', "/")
}

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.

🟡 Distinct Unix roots share an input ID

On Unix, canonical_root_spelling gives distinct roots like /tmp/a\b and /tmp/a/b the same spelling. When other inputs match, their stable_id and status root identity collide, hiding a workspace switch from identity consumers.

Learn more

On Unix, backslash is a valid path character, not a separator. stable_id and the status root identity hash the root spelling returned here. Replacing backslash unconditionally makes distinct directories indistinguishable to consumers of these IDs. The new separator test also requires this collision on Unix.

Example: Two independent checkouts under /tmp/a\\b and /tmp/a/b have the same revision, configuration, and resolved base. Their path values differ, but both hash as /tmp/a/b; a client comparing input IDs cannot detect that it switched checkouts.

Recommended fix: Normalize Windows separators only on Windows, or encode paths in a platform-aware unambiguous form. Revise the separator test to distinguish literal Unix backslashes from Windows separators and test that distinct Unix roots receive different IDs.

Devin Review


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

Comment on lines +674 to +679
diagnostic.message = "completely different markdown **title**".to_string();
diagnostic.range.start.line = 99;
diagnostic.range.end.character = 3;
let mut presentation = inputs_for(Some(&diagnostic));
if action_id_of(&presentation)? != baseline {
return Err("title, message, and range must not enter action_id".to_string());

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.

🔍 Title exclusion lacks an action-level control

The test changes diagnostic.message, not CodeAction.title. A future title-dependent fingerprint in an action constructor can pass this test; an action-level control would distinguish it.

Devin Review


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

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