Skip to content

Lock retained evidence crosswalk - #618

Merged
flyingrobots merged 1 commit into
mainfrom
cycle/569-retained-ref-crosswalk
Jun 28, 2026
Merged

Lock retained evidence crosswalk#618
flyingrobots merged 1 commit into
mainfrom
cycle/569-retained-ref-crosswalk

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Jun 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a retained-evidence regression that explicitly crosswalks CAS BlobHash, SemanticBlobCoordinate, RetainedEvidenceRef, WAL RetainedMaterialRecord, and ReadingRefRecord.
  • Prove equal bytes under different semantic coordinates keep distinct retained evidence refs.
  • Prove a retained reading ID is indexed separately from the retained payload digest and cannot stand in for payload availability.

Closes #569.

Validation

  • cargo fmt --check
  • cargo clippy -p warp-core --test retained_evidence_ref_tests -- -D warnings
  • cargo test -p warp-core --test retained_evidence_ref_tests
  • cargo test -p warp-core --test optic_retention_tests
  • commit hook: cargo clippy -p warp-core --lib
  • commit hook: cargo check -p warp-core
  • pre-push hook: cargo test -p warp-core --test retained_evidence_ref_tests

Test-loop note

I kept the release witness focused on retained_evidence_ref_tests; the new crosswalk assertion lives in the named #569 witness instead of broadening the suite.

Summary by CodeRabbit

  • Tests
    • Added a regression test to verify retention and recovery logic keeps content data separate from semantic coordinate data.
    • Confirmed records with the same content but different coordinates remain distinguishable in lookups.
    • Added checks to prevent incorrect key swapping and ensure recovered entries map to the expected content and reading references.

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ddc1c9d8-cb3e-4e29-8be1-2ef8485f7ecf

📥 Commits

Reviewing files that changed from the base of the PR and between 5a84b15 and f883f61.

📒 Files selected for processing (1)
  • crates/warp-core/tests/retained_evidence_ref_tests.rs

📝 Walkthrough

Walkthrough

Adds a single regression test file change: new imports, a semantic_blob_coordinate helper, and a #[test] that verifies RecoveredRetentionIndex keeps reading/payload axes distinct when two RetainedEvidenceRef instances share the same content hash but differ in semantic coordinate.

Retained Ref Crosswalk Regression Test

Layer / File(s) Summary
Crosswalk regression test
crates/warp-core/tests/retained_evidence_ref_tests.rs
Imports EvidenceMaterialPosture, ReadingRefRecord, RecoveredRetentionIndex, and related types; adds semantic_blob_coordinate(role, semantic_seed) helper; adds wal_retention_crosswalk_keeps_coordinate_reading_and_payload_axes_distinct which constructs two refs with identical content hash but distinct semantic coordinates, builds the index, and asserts correct axis separation and that no swapped keys exist.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

Two refs, same bytes, but worlds apart,
Their coordinates differ — that's the art.
The crosswalk holds, the axes stay,
No swapped key sneaks into the fray.
Determinism wins the day. 🔒

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and directly reflects the retained evidence crosswalk regression added by this PR.
Linked Issues check ✅ Passed The regression test matches #569 by separating semantic coordinates, reading identity, and payload digest, and by keeping equal bytes under distinct refs.
Out of Scope Changes check ✅ Passed Changes stay within the test slice and add no unrelated code or public API changes.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cycle/569-retained-ref-crosswalk

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.

@flyingrobots

Copy link
Copy Markdown
Owner Author

Code Lawyer update

Issue Resolution Resolving commit
No unresolved review threads GraphQL review-thread scan returned zero threads; CI checks are passing; CodeRabbit reported no actionable comments. f883f61

Validation highlights:

  • cargo test -p warp-core --test retained_evidence_ref_tests
  • cargo test -p warp-core --test optic_retention_tests
  • cargo clippy -p warp-core --test retained_evidence_ref_tests -- -D warnings

@flyingrobots
flyingrobots merged commit d2c1c9c into main Jun 28, 2026
36 checks passed
@flyingrobots
flyingrobots deleted the cycle/569-retained-ref-crosswalk branch June 28, 2026 02:52
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.

[GP4-S1] Retained Ref Crosswalk

1 participant