Skip to content

Add WSC causal-history bundle CLI - #617

Merged
flyingrobots merged 1 commit into
mainfrom
cycle/568-wsc-export-import-cli
Jun 28, 2026
Merged

flyingrobots merged 1 commit into
mainfrom
cycle/568-wsc-export-import-cli

Conversation

@flyingrobots

Copy link
Copy Markdown
Owner

Summary

  • Add read-only echo-cli wsc causal-history commands for ref-only and self-contained WAL WSC bundle export, bundle inspection, and verification.
  • Verify self-contained bundles without the original WAL root and report ref-only missing segment bytes as typed JSON material obstructions.
  • Regenerate echo-cli man pages and wire the focused WSC CLI witness into the durability-release test slice.

Closes #568.

Validation

  • cargo fmt --check
  • cargo check -p warp-cli
  • cargo clippy -p warp-cli --lib --tests -- -D warnings
  • cargo clippy -p xtask -- -D warnings
  • cargo test -p warp-cli parse_wsc_causal_history
  • cargo test -p warp-cli --test cli_integration wsc_causal_history
  • cargo test -p warp-cli --test cli_integration
  • cargo test -p xtask test_slice_durability_release_stays_explicit
  • cargo xtask man-pages --check
  • cargo xtask test-slice durability-release
  • npx markdownlint-cli2 CHANGELOG.md crates/warp-cli/README.md
  • git diff --check

Test-loop note

The new WSC CLI acceptance coverage uses one shared projectable WAL fixture and the release slice runs the filtered wsc_causal_history integration witness instead of expanding to the full CLI integration file.

@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 13 minutes and 57 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: d095c7f2-4f2c-4da8-bf17-af2e3e5f25f6

📥 Commits

Reviewing files that changed from the base of the PR and between 5b6ff3b and 998b42a.

📒 Files selected for processing (15)
  • CHANGELOG.md
  • crates/warp-cli/README.md
  • crates/warp-cli/src/cli.rs
  • crates/warp-cli/src/main.rs
  • crates/warp-cli/src/wsc.rs
  • crates/warp-cli/tests/cli_integration.rs
  • crates/warp-cli/tests/golden/echo-cli-help.txt
  • docs/man/echo-cli-wsc-causal-history-export-ref-only.1
  • docs/man/echo-cli-wsc-causal-history-export-self-contained.1
  • docs/man/echo-cli-wsc-causal-history-inspect.1
  • docs/man/echo-cli-wsc-causal-history-verify.1
  • docs/man/echo-cli-wsc-causal-history.1
  • docs/man/echo-cli-wsc.1
  • docs/man/echo-cli.1
  • xtask/src/main.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cycle/568-wsc-export-import-cli

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 update

Issue Resolution Resolving commit
No unresolved review threads GraphQL review-thread scan returned zero threads; CI checks are passing; CodeRabbit reported rate-limit/out-of-credits only. 998b42a

Validation highlights:

  • cargo xtask test-slice durability-release
  • cargo test -p warp-cli --test cli_integration wsc_causal_history
  • cargo test -p warp-cli --test cli_integration
  • cargo clippy -p warp-cli --lib --tests -- -D warnings
  • cargo xtask man-pages --check

@flyingrobots
flyingrobots merged commit 5a84b15 into main Jun 28, 2026
36 checks passed
@flyingrobots
flyingrobots deleted the cycle/568-wsc-export-import-cli branch June 28, 2026 02:36

@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: 998b42a16d

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

}

fn read_envelope(bundle: &Path, name: &str) -> Result<WscStoreEnvelope> {
let path = bundle.join(name);

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 Keep bundle envelope paths inside the bundle

When a bundle manifest supplies an absolute path or a .. path for any envelope, bundle.join(name) will read that location outside the bundle. For self-contained verification this means the CLI can pass by depending on segment material stored elsewhere, or fail after moving the directory, so the bundle is not actually self-contained. Reject absolute paths and parent components before reading manifest-provided envelope names.

Useful? React with 👍 / 👎.

obstructions: Vec::new(),
},
)),
Err(error) => Ok(verify_output(

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 Don't mask CAS integrity failures as obstructions

For cas-addressed manifests, this Err(error) arm converts every validation failure into a successful result: obstructed report. Missing CAS blobs fit that posture, but malformed or tampered projection/receipt envelopes and incomplete causal history are integrity failures; they will currently be reported as a material obstruction with exit 0, unlike ref-only and self-contained verification. Only downgrade explicit missing-CAS-material errors.

Useful? React with 👍 / 👎.

root.segments
.iter()
.map(|segment| {
let path = canonical_segment_path(wal_root, segment.segment_id);

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 Read segment bytes from the projected locator

When the WAL root uses legacy root-level segment files, recovery and projection still succeed because the scanner supports roots without a segments/ directory, but this exporter then unconditionally reads root/segments/segment-.... In that supported layout, export-self-contained fails even though the projected root has a valid segment locator; read through the projected storage_locator instead of assuming the canonical path.

Useful? React with 👍 / 👎.

&manifest.envelopes.receipt_correlations,
)?,
};
let imported = validate_wsc_self_contained_wal_export(&export, root)?;

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 Bind exported records back to embedded WAL bytes

For a self-contained bundle, this validation proves the segment bytes match the projection and that the accepted/receipt envelopes are internally consistent, but it never compares those envelopes with the records recovered from the embedded WAL segment bytes. If the accepted-submission or receipt envelopes are swapped for another valid set, verify still reports pass; compare the imported records with the records recovered from imported.segment_recoveries before accepting the bundle.

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-S6] WSC Export/Import CLI

1 participant