Skip to content

feat(warp-core): add filesystem runtime WAL ack path#597

Merged
flyingrobots merged 3 commits into
mainfrom
cycle/555-filesystem-runtime-wal-ack-path
Jun 21, 2026
Merged

feat(warp-core): add filesystem runtime WAL ack path#597
flyingrobots merged 3 commits into
mainfrom
cycle/555-filesystem-runtime-wal-ack-path

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • add TrustedRuntimeWalConfig::filesystem(...) and TrustedRuntimeWalStoreKind::Filesystem for host-owned filesystem runtime WAL roots
  • route the trusted runtime WAL adapter through FilesystemWalStore while keeping TrustedRuntimeApp limited to submit/observe surfaces
  • add a filesystem ACK/recovery witness that reopens a fresh trusted host over the WAL root and rebuilds submission, receipt, and recovery-certificate indexes
  • update the trusted-host reference, hardening matrix, changelog, and nondeterminism guard waiver for the test-only filesystem fixture

Closes #555

Validation

  • cargo test -p warp-core --features "native_rule_bootstrap trusted_runtime host_test" --test trusted_runtime_host_loop_tests filesystem_runtime_wal_ack
  • cargo test -p warp-core --features "native_rule_bootstrap trusted_runtime host_test" --test trusted_runtime_host_loop_tests runtime_wal_ack
  • cargo clippy -p warp-core --features "native_rule_bootstrap trusted_runtime host_test" --test trusted_runtime_host_loop_tests -- -D warnings
  • cargo check -p warp-core --features "native_rule_bootstrap trusted_runtime host_test"
  • cargo fmt --check
  • pnpm exec prettier --check CHANGELOG.md docs/design/reference-trusted-runtime-host-loop.md docs/design/causal-wal-hardening-matrix.md
  • pnpm exec markdownlint-cli2 CHANGELOG.md docs/design/reference-trusted-runtime-host-loop.md docs/design/causal-wal-hardening-matrix.md
  • scripts/check_spdx.sh CHANGELOG.md docs/design/reference-trusted-runtime-host-loop.md docs/design/causal-wal-hardening-matrix.md crates/warp-core/src/trusted_runtime_host.rs crates/warp-core/tests/trusted_runtime_host_loop_tests.rs
  • scripts/ban-nondeterminism.sh
  • DETERMINISM_FORCE_NO_RG=1 scripts/ban-nondeterminism.sh
  • bash tests/hooks/test_verify_local.sh
  • git diff --check

@coderabbitai

coderabbitai Bot commented Jun 21, 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 10 minutes and 43 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 refill rate.

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, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

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: 9694610c-9773-4691-a85b-75d5d0d60e43

📥 Commits

Reviewing files that changed from the base of the PR and between 0275bc1 and 94d5221.

📒 Files selected for processing (6)
  • .ban-nondeterminism-allowlist
  • CHANGELOG.md
  • crates/warp-core/src/trusted_runtime_host.rs
  • crates/warp-core/tests/trusted_runtime_host_loop_tests.rs
  • docs/design/causal-wal-hardening-matrix.md
  • docs/design/reference-trusted-runtime-host-loop.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cycle/555-filesystem-runtime-wal-ack-path

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 and usage tips.

@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: 047656bdef

ℹ️ 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 thread crates/warp-core/src/trusted_runtime_host.rs
Comment thread crates/warp-core/src/trusted_runtime_host.rs
Comment thread crates/warp-core/src/trusted_runtime_host.rs
Comment thread crates/warp-core/src/trusted_runtime_host.rs
Comment thread crates/warp-core/src/trusted_runtime_host.rs
@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex Activity Summary for review-fix commit 94d52211.

Severity Source File Finding Resolution Commit
P1 PR thread crates/warp-core/src/trusted_runtime_host.rs Filesystem WAL reopened at genesis cursors and could append overlapping LSNs. Recovered writer cursor now derives next_lsn, frame digest, commit digest, and runtime indexes from committed WAL history before appends. 94d52211
P2 PR thread crates/warp-core/src/trusted_runtime_host.rs Read-only filesystem runtime recovery lost torn-tail posture. Filesystem read-only recovery now uses recover_filesystem_store(..., ReadOnly) and preserves WouldTruncate* posture. 94d52211
P2 PR thread crates/warp-core/src/trusted_runtime_host.rs Filesystem commits were labeled Buffered. Store-owned durability mode now marks filesystem commits as StrictFilesystem. 94d52211
P1 PR thread crates/warp-core/src/trusted_runtime_host.rs Clone rollback could diverge from already-written filesystem evidence. Filesystem append error paths recover from disk truth, and unsafe multi-transaction scheduler batches are rejected before any partial filesystem append. 94d52211
P2 PR thread crates/warp-core/src/trusted_runtime_host.rs Corrupt filesystem reads could recover as empty clean history. Filesystem recovery now propagates store/validation errors through the runtime recovery path. 94d52211

Validation repeated locally:

  • cargo test -p warp-core --features "native_rule_bootstrap trusted_runtime host_test" --test trusted_runtime_host_loop_tests filesystem_runtime_wal_ack
  • cargo test -p warp-core --features "native_rule_bootstrap trusted_runtime host_test" --test trusted_runtime_host_loop_tests runtime_wal_ack
  • cargo clippy -p warp-core --features "native_rule_bootstrap trusted_runtime host_test" --test trusted_runtime_host_loop_tests -- -D warnings
  • cargo check -p warp-core --features "native_rule_bootstrap trusted_runtime host_test"
  • cargo fmt --check
  • scripts/ban-nondeterminism.sh
  • DETERMINISM_FORCE_NO_RG=1 scripts/ban-nondeterminism.sh
  • bash tests/hooks/test_verify_local.sh
  • pre-commit and pre-push hooks

@flyingrobots
flyingrobots merged commit 7201f53 into main Jun 21, 2026
36 checks passed
@flyingrobots
flyingrobots deleted the cycle/555-filesystem-runtime-wal-ack-path branch June 21, 2026 05:35
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Continuum Stack Convergence Jun 21, 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

if handle.duplicate {
match runtime_wal.has_submission_acceptance(handle.submission_id, envelope.ingress_id())
{

P2 Badge Check WAL acceptance before appending after recovery

After a process restart over an existing filesystem WAL, the fresh in-memory runtime has no duplicate-submission index, so submit_app_intent returns duplicate == false for the same envelope even though the WAL already contains the durable acceptance. Because the durable idempotency check is gated on handle.duplicate, a client retry after an ACK/crash appends another SubmissionIntake transaction for the same submission instead of returning from recovered WAL evidence. The WAL acceptance check needs to run for the derived handle before appending, not only when the volatile runtime noticed the duplicate.

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

) -> Hash {
let mut hasher = blake3::Hasher::new();
hasher.update(TRUSTED_RUNTIME_WAL_DOMAIN);
hasher.update(b"runtime-state-frontier:recovered");

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 Replay runtime frontiers with the same digest law

When a filesystem WAL is reopened after any committed scheduler tick, TrustedRuntimeWalCursor::from_recovery rebuilds the runtime-state cursor through this helper, but the helper uses a different domain and a reduced input set from runtime_state_frontier_digest used when the tick was originally committed. Any ticks appended after recovery therefore branch from a synthetic frontier rather than the previous tick's committed after_digest, and subsequent recoveries will keep deriving a different chain than the one committed before restart. This makes post-restart scheduler-tick WAL evidence unreplayable/unauditable; persist enough tick correlation data to recompute the original digest, or make the original commit use the recoverable digest law.

Useful? React with 👍 / 👎.

next_lsn,
} = config;
let TrustedRuntimeWalConfig { store, next_lsn } = config;
let mut store = TrustedRuntimeWalStore::open(store)?;

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 Fence simultaneous filesystem WAL writers

If two trusted hosts are configured against the same filesystem root before either one appends, each call opens an independent store and recovers the same writer cursor, but no filesystem lock or lease is acquired before the adapters are returned. Both adapters can then build and append transactions starting at the same next_lsn, leaving duplicate LSNs in the segment and making later recovery fail continuity validation. The filesystem-backed runtime WAL should reject or serialize a second writer for the same root before exposing an appendable adapter.

Useful? React with 👍 / 👎.

fn read_commits(&self) -> Vec<WalTransactionCommit> {
match self {
Self::InMemory(store) => store.read_commits(),
Self::Filesystem(store) => store.read_commits(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3 Badge Propagate filesystem inspection read errors

For filesystem-backed adapters, this delegates to FilesystemWalStore::read_commits, which returns an empty vector on any segment read/decode error. That means host evidence helpers such as commits(), submission_acceptance_count(), and scheduler_tick_count() can report a corrupt WAL as having zero committed history even though recover_read_only() correctly surfaces the corruption. These inspection paths should return an error or share the recovery scan so corrupt filesystem history is not indistinguishable from an empty root.

Useful? React with 👍 / 👎.

@flyingrobots flyingrobots mentioned this pull request Jun 21, 2026
7 tasks
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.

[GP1-S2] Filesystem Runtime WAL ACK Path

1 participant