Skip to content

Cover runtime WAL recovery CLI contract#599

Merged
flyingrobots merged 3 commits into
mainfrom
cycle/557-runtime-wal-recovery-cli-contract
Jun 21, 2026
Merged

Cover runtime WAL recovery CLI contract#599
flyingrobots merged 3 commits into
mainfrom
cycle/557-runtime-wal-recovery-cli-contract

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary

  • Adds runtime-produced filesystem WAL fixtures for warp-cli integration tests.
  • Extends echo-cli wal submission-posture --format json coverage for runtime ACK roots reporting AcceptedPending and DecidedApplied posture, receipt digest, and ticket digest.
  • Locks the remaining WAL read-model taxonomy labels, DecidedRejected and Obstructed, through direct filesystem WAL fixtures until the trusted host can emit those decisions through filesystem runtime roots without expanding this CLI slice.
  • Updates the runtime WAL ACK changelog note to specify filesystem runtime WAL root coverage.

Closes #557.

Self-Code Review

  • Lockdown: clean git status --porcelain, git fetch origin succeeded, GitHub auth valid.
  • Reviewed git diff origin/main...HEAD; no unresolved self-review findings remain.
  • One P5 clarity issue was addressed in commit 92dc74aa by documenting why rejected/obstructed posture tests are direct WAL taxonomy fixtures rather than runtime-produced filesystem roots today.

Validation

  • cargo test -p warp-cli --test cli_integration wal_submission_posture
  • cargo clippy -p warp-cli --test cli_integration -- -D warnings
  • cargo xtask test-slice runtime-wal-ack
  • cargo fmt --check
  • npx prettier --check CHANGELOG.md
  • npx markdownlint-cli2 CHANGELOG.md
  • git diff --check origin/main...HEAD
  • pre-commit hook: cargo clippy -p warp-cli --lib --tests, cargo check -p warp-cli, markdownlint
  • pre-push hook: cargo fmt --all -- --check, cargo check -p warp-cli --quiet, cargo test -p warp-cli --test cli_integration, Prettier

Summary by CodeRabbit

  • Tests

    • Expanded integration test coverage for runtime WAL submission posture validation across multiple recovery scenarios.
    • Added test utilities for runtime WAL fixture generation.
  • Chores

    • Updated test dependencies and infrastructure.
    • Clarified documentation for runtime WAL test coverage.

@coderabbitai

coderabbitai Bot commented Jun 21, 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: c1be13b7-231f-45c9-a694-715df342e196

📥 Commits

Reviewing files that changed from the base of the PR and between a0a7298 and c2d0675.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • CHANGELOG.md
  • crates/warp-cli/Cargo.toml
  • crates/warp-cli/tests/cli_integration.rs
  • crates/warp-cli/tests/support/runtime_wal_fixture.rs

📝 Walkthrough

Walkthrough

Adds a runtime_wal_fixture.rs test support module that builds minimal TrustedRuntimeHost-backed WAL roots for accepted-pending and decided-applied scenarios. Parameterizes the existing filesystem WAL decided-submission fixture by label. Introduces JSON CLI helpers and four new integration tests covering all recoverable submission postures. Updates warp-cli dev-dependencies and narrows a changelog entry.

Changes

Runtime WAL CLI submission-posture coverage

Layer / File(s) Summary
Dev-dependencies and runtime WAL fixture constants
crates/warp-cli/Cargo.toml, crates/warp-cli/tests/support/runtime_wal_fixture.rs
Adds echo-registry-api, echo-wasm-abi, and feature-flagged warp-core (native_rule_bootstrap, trusted_runtime, host_test); defines module constants and Registry provider for the single mutation op.
Runtime fixture engine, contract, and envelope builders
crates/warp-cli/tests/support/runtime_wal_fixture.rs
Implements empty_engine, runtime, eint_envelope, admission_ticket, contract_rule, package, contract_matches, contract_execute, and contract_footprint — all primitives needed to drive the runtime WAL in fixture scenarios.
accepted_pending_fixture and decided_applied_fixture
crates/warp-cli/tests/support/runtime_wal_fixture.rs
accepted_pending_fixture submits an EINT envelope without executing; decided_applied_fixture drives the host to idle and captures receipt/ticket digests from IntentOutcome::Applied. Both return RuntimeWalSubmissionFixture.
JSON CLI helpers and parameterized filesystem WAL fixture
crates/warp-cli/tests/cli_integration.rs
Adds wal_doctor_json and wal_submission_posture_json helpers; refactors filesystem_wal_with_decided_submission into a wrapper over a new label-parameterized filesystem_wal_with_decided_submission_decision that threads label through all computed digests and IDs.
New submission-posture integration tests
crates/warp-cli/tests/cli_integration.rs
Four tests validate wal submission-posture --format json output for AcceptedPending, DecidedApplied, Obstructed, and DecidedRejected postures, asserting retry/recovered posture strings and receipt/ticket digest presence or exact values.
Changelog
CHANGELOG.md
Narrows the runtime-wal-ack test-slice bullet to filesystem runtime WAL roots.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related issues

  • #557 [GP1-S4] Runtime WAL Recovery CLI Contract: This PR directly implements the acceptance criteria: wal submission-posture --format json for filesystem runtime WAL roots across accepted-pending, decided-applied, decided-rejected, and obstructed postures, with the specified cargo test witness command.

Possibly related PRs

  • flyingrobots/echo#379: This PR's new tests exercise the WalCommands::SubmissionPosture command path and JSON reporting implemented in PR #379.
  • flyingrobots/echo#358: The admission_ticket fixture and IntentOutcome::Applied receipt/ticket digest capture depend on admission-evidence and ticket issuance contracts established in PR #358.

Suggested labels

tooling

A WAL walks into a fixture room,
Pending or Applied, it knows its doom.
JSON fields tell the tale — receipt and ticket in hand,
Obstructed, rejected — all postures planned.
--format json never lies. 🔍

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.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 Title accurately describes the main change: adding runtime WAL recovery CLI contract coverage through new test fixtures and integration tests.
Linked Issues check ✅ Passed All acceptance criteria from #557 are met: CLI reports recovery posture, retry posture, receipt digest, and ticket digest for runtime WAL roots; witness test target included.
Out of Scope Changes check ✅ Passed All changes directly support #557 runtime WAL recovery CLI contract: fixtures, integration tests, dependencies, and changelog clarification are within scope.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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/557-runtime-wal-recovery-cli-contract

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.

@flyingrobots

Copy link
Copy Markdown
Owner Author

@codex Self-Code Review findings for PR #599.

Severity File Lines Type Finding Recommended mitigation prompt
P5 Nit crates/warp-cli/tests/support/runtime_wal_fixture.rs 164-166 Test fixture precision contract_matches accepts any EINT payload for op 7001 and ignores the fixture's declared MUTATION_VARS. That means a future change could alter the canonical variables while the runtime still applies the submission, weakening the fixture's proof that the WAL root came from the intended invocation envelope. Tighten the runtime WAL CLI fixture so contract_matches only accepts op MUTATION_OP_ID when eint_vars_for_op(...) exactly equals MUTATION_VARS; rerun the warp-cli WAL submission posture integration tests and the relevant CI checks.

Summary: 1 issue found, all P5. No P0-P4 correctness, determinism, durability, or Markdown-style blockers found in the diff against origin/main.

@chatgpt-codex-connector

Copy link
Copy Markdown

Summary

  • Tightened the runtime WAL CLI fixture matcher so contract_matches only accepts MUTATION_OP_ID when the canonical EINT vars exactly match MUTATION_VARS. crates/warp-cli/tests/support/runtime_wal_fixture.rsL164-L166
  • Committed the change on the current branch with commit 1a1ab5b test(warp-cli): tighten runtime WAL contract match.
  • Created a pull request titled “Tighten runtime WAL fixture contract matching”.

Testing

  • cargo fmt --check
  • cargo test -p warp-cli --test cli_integration wal_submission_posture
  • cargo clippy -p warp-cli --test cli_integration -- -D warnings
  • git diff --check
  • cargo check -p warp-cli

View task →

@flyingrobots

Copy link
Copy Markdown
Owner Author

Resolved the self-review P5 from #599 (comment) in c2d06759.

Fix: contract_matches now requires the recovered EINT vars to exactly equal MUTATION_VARS, so the runtime WAL fixture can no longer apply an arbitrary op-7001 payload.

Local validation:

  • cargo test -p warp-cli --test cli_integration wal_submission_posture
  • cargo clippy -p warp-cli --test cli_integration -- -D warnings
  • cargo fmt --check
  • git diff --check origin/main...HEAD

@flyingrobots flyingrobots merged commit f25a7ec into main Jun 21, 2026
36 checks passed
@flyingrobots flyingrobots deleted the cycle/557-runtime-wal-recovery-cli-contract branch June 21, 2026 07:20
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Continuum Stack Convergence Jun 21, 2026
@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-S4] Runtime WAL Recovery CLI Contract

1 participant