Skip to content

feat(warp-core): add WAL evidence segment catalog#644

Open
flyingrobots wants to merge 7 commits into
mainfrom
echo/wal-evidence-segment-catalog
Open

feat(warp-core): add WAL evidence segment catalog#644
flyingrobots wants to merge 7 commits into
mainfrom
echo/wal-evidence-segment-catalog

Conversation

@flyingrobots

Copy link
Copy Markdown
Owner

Summary

  • Adds a rebuildable CausalSegmentCatalog over committed WAL recovery evidence, with one base evidence segment per committed WAL transaction.
  • Adds a non-authoritative live catalog cache in TrustedRuntimeWal; cache update failures mark the catalog NeedsRebuild without turning successful WAL commits into failures.

Scope

  • Tests only
  • Docs only
  • Runtime code

Links

Checklist

  • CI green (fmt, clippy, tests, rustdoc, audit/deny)
  • Kept PR small and focused (one thing)

Local verification

  • git diff --check
  • cargo fmt --all -- --check
  • cargo clippy -p warp-core --lib
  • cargo clippy -p warp-core --features "native_rule_bootstrap trusted_runtime host_test" --test trusted_runtime_host_loop_tests
  • cargo xtask test-slice runtime-wal-ack
  • cargo xtask test-slice durable-runtime-wal

Notes

  • RED/GREEN was missed for this slice: the implementation landed before the focused witnesses were added. The added witnesses prove the current patched branch behavior, not that the tests failed before the implementation.
  • The catalog is intentionally a derived read model. RecoveryScanReport remains the canonical rebuild seam, and live catalog updates are cache-only posture.
  • No derived WscBundle, CheckpointRange, or ZkWormhole coverage is implemented in this PR; those segment kinds are reserved for later covering evidence.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

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

Next review available in: 36 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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

How do review 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 refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 09a08034-020f-4d9f-97eb-544bf0668c78

📥 Commits

Reviewing files that changed from the base of the PR and between 5c968a4 and b168e48.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • AGENTS.md
  • CHANGELOG.md
  • Cargo.toml
  • crates/echo-trace/Cargo.toml
  • crates/echo-trace/src/lib.rs
  • crates/warp-core/src/evidence.rs
  • crates/warp-core/src/lib.rs
  • crates/warp-core/src/trusted_runtime_host.rs
  • crates/warp-core/tests/trusted_runtime_host_loop_tests.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch echo/wal-evidence-segment-catalog

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.

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

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

self.next_lsn = next_lsn;
self.previous_frame_digest = last_frame_digest;
self.previous_committed_transaction_digest = commit.commit_digest;
self.try_update_evidence_catalog_after_commit(&commit, &frames);

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 Rebuild the live catalog after recovered WAL commits

When filesystem append reports an error after the commit marker is recoverable, the existing recover_filesystem_*_after_error paths can still treat the transaction as accepted, but this live-cache update is skipped because it only runs on the normal Ok path. In that case evidence_catalog_posture() remains Fresh and evidence_catalog() omits a committed transaction that recover_evidence_catalog_read_only() will include, so the recovery-success path should rebuild the catalog or mark it NeedsRebuild before acknowledging the recovered commit.

Useful? React with 👍 / 👎.

if catalog.observe_committed_wal(view).is_err() {
self.evidence_catalog_posture = EvidenceCatalogPosture::NeedsRebuild {
reason: *blake3::hash(b"catalog_update_error").as_bytes(),
last_good_commit: self.previous_committed_transaction_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 Preserve the real last-good commit on catalog failure

If observe_committed_wal fails, previous_committed_transaction_digest has already been advanced to commit.commit_digest before this helper is called, so last_good_commit points at the transaction that failed to enter the catalog rather than the last transaction where the cache was known fresh. Consumers using NeedsRebuild to reconcile from the last fresh commit can skip the missing segment; capture the prior digest before advancing it or update the catalog before mutating the cursor.

Useful? React with 👍 / 👎.

Comment on lines +11 to +12
[lints]
workspace = true

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 Add required package metadata for the new crate

Because this new workspace crate opts into the shared lint policy here, clippy::cargo_common_metadata is denied for it; I checked cargo clippy -p warp-core --lib and it now fails before checking warp-core because echo-trace lacks package.description, package.readme, package.keywords, and package.categories. Add the required metadata or an explicit lint override, otherwise the advertised clippy witness for this PR stays red.

Useful? React with 👍 / 👎.

Comment on lines +93 to +94
fn begin_run(&mut self, _meta: &TraceRunMeta) -> Result<(), TraceError> { Ok(()) }
fn append_delta(&mut self, _delta: &CanonicalGraphDelta<'_, N, E, A>) -> Result<(), TraceError> { Ok(()) }

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 Format the new trace crate before merging

This new file is not rustfmt-compliant; I ran cargo fmt --all -- --check, and it fails on this impl formatting as well as the doc-comment blank lines in the same file. Since the PR's own verification lists that exact command, leaving this unformatted will keep the formatting witness red until the crate is run through rustfmt.

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.

1 participant