Repository navigation
test(lsp): pin identity-law edges and share fingerprint authority (#1932) - #4830
Conversation
) 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>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (9)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
EffortlessSteven
left a comment
There was a problem hiding this comment.
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_idis the sole build/parse formula;ADDRESSED_IDENTITY_KEYSowns copy + first-present canonical subject;parse_validated_action_dataremains the resolve consumerlsp/input_identity.rs—canonical_identity_text/canonical_root_spellingfeedstable_idand statusroot_identitylsp/diagnostics.rs— document/workspace result IDs still hash served payload + profile + delivery selection; refresh metadata is not an input- consumers:
resolve_action(staleinput_identityvsaction_id), refresh scheduler (still Eqs full config, not onlystable_id) - specs 0129/0142/0124, traceability, slice
blocking_findings: none on source/oracle for this claim
non_blocking_suggestions:
RefreshInputIdentitystill includes the fullLspAnalysisConfig, so git timeout / refresh deadline / position encoding still defeat scheduler dedup even though they are excluded fromLspAnalysisInputIdentity. 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 passedcargo xtask precommit: pass (target/ripr/reports/precommit.md,precommit-v2.md); clippy-p ripr --all-targetsand-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_idremains class+canonical+command+name; snapshot freshness stays the payloadinput_identityfield- 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.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
| let mut first = snapshot_for_identity( | ||
| "/workspace", | ||
| &[("file:///workspace/src/lib.rs", vec![diagnostic("same", 4)])], |
There was a problem hiding this comment.
🟡 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
| fn canonical_root_spelling(root: &Path) -> String { | ||
| root.to_string_lossy().replace('\\', "/") | ||
| } |
There was a problem hiding this comment.
🟡 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
| 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()); |
There was a problem hiding this comment.
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/mainf6aa0ab8c: the original typed taxonomy (CanonicalItemId,InstructionSemanticId, …) has not landed. This PR does not absorb #4804–#4809. Current truth is on #1932.Swarm / Source Boundary
ripr-swarmSource-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-1a7dStack parent or prerequisite PR: none
Proposed replacement of PR: none
Scope
action_contract.rs: onefingerprint_action_id/ addressed-identity key list; tests thataction_idignores title/range/message/snapshot/capability/disabled reason, trims/falls through canonical ids, and that parse rejects a swapped sibling idinput_identity.rs: shared canonical identity text and git fixture helper; tests for separator spelling, volatile-key exclusion, deadline/encoding exclusion, and semantic session flagsdiagnostics.rs: result IDs ignore refresh clock and attemptsnapshot_id; message-only and profile changes invalidate themScope Classification
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
Policy Impact
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 precommit25 selected tests passed on
a590dc506.cargo xtask precommitpassed (precommit.md/precommit-v2.md), includingcargo clippy -p ripr --all-targets -- -D warningsandcargo 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:
action_idaction_idwhencanonical_gap_idis presentaction_idis rejected byparse_validated_action_datasnapshot_iddo not change diagnostic result IDs; message and profile still doClaim 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
action_contract.rs,input_identity.rs,diagnostics.rsdelivery testsripr.slice.lsp-identity-law-edges.v1Static Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Candidate SHA
a590dc5064a22d83e63f710fe8dd5cd3475e2187