Skip to content

Export retained evidence through WSC#621

Merged
flyingrobots merged 1 commit into
mainfrom
cycle/572-retained-evidence-wsc-export
Jun 28, 2026
Merged

Export retained evidence through WSC#621
flyingrobots merged 1 commit into
mainfrom
cycle/572-retained-evidence-wsc-export

Conversation

@flyingrobots

Copy link
Copy Markdown
Owner

Closes #572

Summary

  • Carry retained material and reading-reference envelopes through ref-only, self-contained, and CAS-addressed WAL WSC export/import profiles.
  • Validate self-contained retained payload bytes against the WAL-retained material digest, and require retained CAS blobs during CAS-addressed import.
  • Include retained evidence envelopes in echo-cli wsc causal-history bundle manifests and verification paths.
  • Add the exact wsc_retained_evidence_export_modes witness to cargo xtask test-slice durability-release without using Cargo's package-level name filter.
  • Keep broad local scripts/verify-local.sh full Cargo test lanes CI-owned by default, with VERIFY_LOCAL_FULL_TESTS=1 as the explicit maintainer opt-in.

Validation

  • bash tests/hooks/test_verify_local.sh
  • cargo fmt --check
  • cargo test -p xtask test_slice_durability_release_stays_explicit
  • cargo test -p warp-core --test causal_wal_tests wsc_retained_evidence_export_modes
  • cargo test -p warp-cli --test cli_integration wsc_causal_history_exports_and_verifies_profiles
  • cargo clippy -p warp-core --test causal_wal_tests -- -D warnings
  • cargo clippy -p warp-cli --lib --tests -- -D warnings
  • cargo test -p warp-core --test causal_wal_tests
  • npx markdownlint-cli2 CHANGELOG.md crates/warp-cli/README.md docs/workflows.md
  • git diff --check
  • pre-commit hook: staged warp-cli/warp-core clippy/check and markdownlint
  • pre-push hook: shell syntax plus exact warp-cli/warp-core test slices and Prettier

@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@flyingrobots, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 44 minutes and 58 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a9e52500-4a5f-4f79-a685-6f461bd9ce99

📥 Commits

Reviewing files that changed from the base of the PR and between b1ff36d and d03b4b3.

📒 Files selected for processing (11)
  • CHANGELOG.md
  • crates/warp-cli/README.md
  • crates/warp-cli/src/wsc.rs
  • crates/warp-cli/tests/cli_integration.rs
  • crates/warp-core/src/wsc/mod.rs
  • crates/warp-core/src/wsc/store.rs
  • crates/warp-core/tests/causal_wal_tests.rs
  • docs/workflows.md
  • scripts/verify-local.sh
  • tests/hooks/test_verify_local.sh
  • xtask/src/main.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cycle/572-retained-evidence-wsc-export

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

Area Finding Resolution commit Evidence
Review threads No unresolved review threads. d03b4b3f cargo xtask pr-status 621 reports Unresolved threads: 0.
CI / required checks All checks are green. d03b4b3f gh pr checks 621 reports 36 passing checks, including CI, det-gates, DIND, rustdoc, musl, and CodeRabbit status.
CodeRabbit No actionable review comments. CodeRabbit status is pass; top-level comment says the review was rate-limited/out of credits. d03b4b3f Status context is passing; comment: #621 (comment)
Merge state Branch is mergeable; blocked only by review policy. d03b4b3f gh pr view 621 reports mergeable: MERGEABLE, reviewDecision: REVIEW_REQUIRED, mergeStateStatus: BLOCKED.

Ready for admin merge under the standing rule.

@flyingrobots
flyingrobots merged commit 2576de2 into main Jun 28, 2026
36 checks passed
@flyingrobots
flyingrobots deleted the cycle/572-retained-evidence-wsc-export branch June 28, 2026 04:28
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Continuum Stack Convergence Jun 28, 2026

@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: d03b4b3f9f

ℹ️ 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".

&projected.accepted_submissions,
&projected.receipts,
&projected.correlations,
&[],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Pass retained payloads to self-contained export

When the recovered WAL contains any Present retained material record, wsc_self_contained_wal_export now requires an embedded WscSelfContainedRetainedMaterial for that digest. This CLI path always passes &[], so export-self-contained fails with MissingRetainedMaterial for exactly the WALs containing retained evidence it now advertises, instead of producing a bundle with retained-payloads.ecwsc.

Useful? React with 👍 / 👎.

Comment on lines +1881 to +1882
let retention = retention_records_from_wsc_envelope(&export.retention_envelope)
.map_err(WscCasAddressedWalImportError::Retention)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require retained CAS refs for present materials

When a CAS-addressed bundle's retention envelope contains a Present retained material record but the CAS-reference envelope omits that material, or points at a different content hash, this import still succeeds after checking only the refs that were listed. With the segment blobs available, that lets CAS-addressed validation report success without the retained payload bytes that the retained evidence says are present; the parsed retention records need to be matched against retained CAS references before returning success.

Useful? React with 👍 / 👎.

Comment on lines +3434 to +3436
if let Some(extra) = retained_payloads
.iter()
.find(|payload| !material_by_digest.contains_key(&payload.material.material_digest))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require retained payload records to match retention

For self-contained imports, this extra-material check only proves that the embedded payload's digest appears somewhere in the retention envelope. A bundle can embed bytes whose hash matches a retained digest while carrying a different semantic coordinate/kind/posture in the WscSelfContainedRetainedMaterial record, or even include payload bytes for a non-Present retained record, and validation still reports success; compare the full retained record and reject payloads that contradict the retention posture.

Useful? React with 👍 / 👎.

projection: String,
accepted_submissions: String,
receipt_correlations: String,
retained_evidence: String,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve v1 bundle manifest compatibility

Because this new manifest field is a required String with no serde default while schema_version remains 1, read_manifest now fails to deserialize self-contained or ref-only v1 bundles created before this change, even when they simply had no retained evidence. That breaks inspect/verify for previously exported empty-retention bundles; make the field optional/defaultable or bump the manifest schema version.

Useful? React with 👍 / 👎.

Comment on lines +164 to +165
retained_materials: retention.material_by_digest.into_values().collect(),
reading_refs: retention.reading_by_id.into_values().collect(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid dropping conflicting retained WAL records

For WALs that contain conflicting retained-material digests or reading ids, recover_retention_index collapses them into maps before export, so these into_values() calls emit only one record and the WSC bundle no longer witnesses the conflict. Since retained evidence export is supposed to carry admitted WAL evidence, collect the raw retained frames or run the conflict-checking retention-record constructor instead of exporting the lossy recovered index.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[GP4-S4] Retained Evidence WSC Export

1 participant