Repository navigation
feat(cli): expose detached standing receipt v0 - #168
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
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. Comment |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a88fa33ead
ℹ️ 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".
| let history_bytes = std::fs::read(&input.history)?; | ||
| let history = StandingReceiptHistoryIdentityV0::of(&history_bytes) | ||
| .map_err(|error| CliError::Io(error.to_string()))?; |
There was a problem hiding this comment.
Preflight the complete key before reading history
With a lexically valid but structurally inadmissible key (for example 0200…0000), lower_hex accepts the argument and this read happens before produce_standing_receipt_v0 reaches the complete external-key gate. Consequently, a missing history returns exit 3 instead of the required ExternalKey refusal, while a large readable history is unnecessarily acquired and hashed. This violates the frozen first-failure order in docs/design/detached-standing-receipt-v0.md:76-81 and bypasses the purpose of prepare_portable_history_v0, whose API explicitly preflights the key before history acquisition; perform that complete preflight before std::fs::read.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Base:
fbde58b65e5d0a5d7bf1476867d96d74bb25863aCandidate:
74eeaf02deca80a3ebf4efdad488f312aeef2f1eImplements thin CLI transport for detached-standing-receipt-v0, using merged/reviewed #167.
For
exactorcontains-checkpoint, both--checkpoint-event-count <u64>and--checkpoint-sha256 <64-lowercase-hex>are mandatory;noneforbids them.Changed only
crates/magpie-cli/{src/args.rs,src/commands.rs,src/lib.rs,src/receipt.rs,tests/cli.rs}.Complete library key preflight precedes file acquisition. History is acquired once, unchanged; profile, policy, external key, expectation and selector are explicit. Detached bytes cannot select checking coordinates. Dispatch bypasses Store/Snapshot/config/saved checkpoints and ambient state;
--storeis rejected. No filesystem writes.Both successes emit only the library's
canonical_bytes(), without newline;--jsonis inert. Diagnostics stay on stderr. Exits: 0 success, 1 refusal, 2 usage, 3 operational. Output-device failure can leave partial stdout.Ten new binary tests plus one error-mapping unit test cover exact CLI/library bytes, checking/newline mutations, expectations/suffix/truncation, malformed histories/selectors, ambient-state isolation, file inventories, closed argument shapes, acquisition/output failures and raw CRLF bytes.
Passed with Rust 1.98.1: fmt, workspace check, Clippy (-D warnings), workspace tests (1,090 passed; one existing ignored), CLI tests (60), receipt tests, frozen fixture, both 432-case corpus paths, golden tests, corpus manifest and 43 A-018 witnesses.
No library semantics, dependencies, format, identifiers, writers, MCP or integration changes. Endophasia, other repositories and user-local experiments/computer are untouched.
Fresh candidate CI and Codex review pending. Additional checks passed: Python corpus (432), release inventories, log package, log doctests and governed-standing tour.
Draft; independent Codex review required before owner merge.