Skip to content

Add self-contained WAL WSC export - #614

Merged
flyingrobots merged 1 commit into
mainfrom
cycle/565-self-contained-wsc-export-fixture
Jun 28, 2026
Merged

Add self-contained WAL WSC export#614
flyingrobots merged 1 commit into
mainfrom
cycle/565-self-contained-wsc-export-fixture

Conversation

@flyingrobots

Copy link
Copy Markdown
Owner

Summary

  • add self-contained WAL WSC export/import with embedded segment material
  • recover embedded WAL segment bytes through the shared WAL disk-record parser and compare digest, LSN range, commit-chain, commit-anchor, and tail evidence against the projected root
  • rebuild accepted-submission and receipt indexes from imported WSC evidence and reject tampered embedded segment bytes with a typed WAL recovery obstruction

Closes #565

Validation

  • cargo test -p warp-core --test causal_wal_tests wsc_self_contained_export_replays_segment_bytes
  • cargo test -p warp-core --test causal_wal_tests
  • cargo test -p warp-core --test wsc_store_tests
  • cargo clippy -p warp-core --lib --test causal_wal_tests --test wsc_store_tests -- -D warnings
  • cargo fmt --check
  • git diff --check
  • npx markdownlint-cli2 CHANGELOG.md
  • pre-commit hook: cargo clippy -p warp-core --lib; cargo check -p warp-core; markdownlint CHANGELOG.md
  • pre-push hook: cargo fmt --all -- --check; cargo check -p warp-core --quiet; cargo test -p warp-core --test causal_wal_tests; prettier --check CHANGELOG.md

@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 57 minutes and 32 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: c2ccc680-0d42-4fd0-ad7d-4b363a73121b

📥 Commits

Reviewing files that changed from the base of the PR and between 0db4b7b and 58be28d.

📒 Files selected for processing (5)
  • CHANGELOG.md
  • crates/warp-core/src/causal_wal.rs
  • crates/warp-core/src/wsc/mod.rs
  • crates/warp-core/src/wsc/store.rs
  • crates/warp-core/tests/causal_wal_tests.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cycle/565-self-contained-wsc-export-fixture

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
flyingrobots merged commit e7cb01c into main Jun 28, 2026
36 checks passed
@flyingrobots
flyingrobots deleted the cycle/565-self-contained-wsc-export-fixture branch June 28, 2026 00:49

@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: 58be28d7b4

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

Comment on lines +1272 to +1275
let submission_index = RecoveredSubmissionIndex::from_acceptance_and_receipt_records(
accepted_submissions.iter().copied(),
receipt_records.receipts.iter().copied(),
)

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 Reject sidecars that do not match embedded WAL records

For self-contained imports with malformed or adversarial sidecar envelopes, validation replays the embedded segment bytes but then builds the returned submission index solely from the accepted-submission/receipt WSC sidecars. Because those sidecars are only checked for internal consistency, an export can embed valid WAL bytes containing accepted submissions and receipts while passing empty or fabricated sidecars, and this function will still return a WscSelfContainedWalImport whose indexes disagree with the causal WAL history. Please derive these records from segment_recoveries (or compare the sidecars against the records recovered from the embedded WAL bytes) before accepting the import.

Useful? React with 👍 / 👎.

Comment on lines +2558 to +2559
if actual_previous_commit_digest != Some(segment.previous_commit_digest)
|| actual_final_commit_digest != Some(segment.final_commit_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.

P1 Badge Validate every embedded commit-chain link

For an embedded segment with four or more committed transactions, this endpoint-only check accepts reordered intermediate commit records such as 1,3,2,4: the first previous digest, final digest, LSN range, segment digest, and sorted anchor set still match, but the recovered transaction order no longer follows each commit's previous_committed_transaction_digest. Since recover_from_frames_and_commits preserves the commit-marker order it reads, validate each adjacent commit link before accepting the segment as matching the projected commit chain.

Useful? React with 👍 / 👎.

Comment on lines +2466 to +2467
for node_index in 0..view.nodes().len() {
for attachment in view.node_attachments(node_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.

P2 Badge Reject non-canonical segment-material WSC graphs

When importing a self-contained export from untrusted WSC bytes, this parser accepts any graph with the right schema and attachment type because it only scans every node's attachments; it never checks the expected warp id/root node, node types, edge membership, or that the bytes equal the canonical segment-material graph. As a result, validate_wsc_self_contained_wal_export can bless an envelope whose digest contains extra or miswired graph facts that are not represented in the returned segment materials, breaking the deterministic evidence boundary for this new segment-material schema.

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

None yet

Development

Successfully merging this pull request may close these issues.

[GP3-S3] Self-Contained WSC Export Fixture

1 participant