Define Keep's authenticated reconstruction contract - #77
Conversation
Summary by CodeRabbit
WalkthroughThe PR adds a normative authenticated reconstruction contract for Keep. It documents proof scopes, exact-byte output, receipts, refusal and failure behavior, ChangesAuthenticated reconstruction
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/invariants/authenticated-reconstruction/README.md`:
- Line 203: Update the invariant wording in the authenticated reconstruction
documentation to explicitly guarantee that required supporting evidence is not
garbage-collected, deleted, or otherwise invalidated during the read, replacing
the ambiguous “collected” terminology.
- Around line 10-16: Update the contract section around the “Keep either”
statement to distinguish three outcomes: authenticated success, an evidenced
content-related refusal, and operational failure. Align the wording with
ReferenceStore::reconstruct so output or other I/O errors are classified as
operational failures, do not count as precise refusals, and cannot support a
content conclusion.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: d886dc72-4668-44aa-9fda-339cb22ceea2
📒 Files selected for processing (2)
README.mddocs/invariants/authenticated-reconstruction/README.md
📜 Review details
🔇 Additional comments (2)
README.md (1)
8-10: LGTM!docs/invariants/authenticated-reconstruction/README.md (1)
1-9: LGTM!Also applies to: 17-202, 204-240
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b0469e05a5
ℹ️ 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".
Problem
Keep's core law promises exact named bytes or refusal, but the repository did
not have one governed invariant stating whole-object versus range proof scope,
ordinary
Writefailure visibility, receipt durability, or the distinctionbetween evidenced content refusals and operational failures.
Invariant affected
For a requested content identity, Keep returns authenticated exact bytes and a
receipt, returns a precise evidenced content refusal, or returns an operational
failure that makes no content claim. A failed ordinary writer may retain an
untrusted prefix; only a complete success receipt authenticates the emitted
sequence.
Approach
selected store view and state that ranges verify no profile boundaries.
prefix and then fail, verifying exact error coordinates and no receipt.
Alternatives rejected
Writeuntouched.complete durable logical-read API.
Failure modes
The contract covers untrusted output prefixes, incomplete views, unreadable or
inconsistent evidence, unsupported durable claims, exact-layout unavailability,
and the distinction between content evidence and operational failure.
Tests
cargo fmt --checkcargo clippy --all-targets --all-features -- -D warningscargo test --all-targets --all-featurescargo test --test streaming_cascargo test --test range_read_failuresPATH="scripts/documentation-tools/node_modules/.bin:$PATH" cargo xtask documentation-integrity-checkgit diff --checkBenchmark impact
No production path changes. The new deterministic writer fixtures affect tests
only; the all-target validation benchmark binaries completed successfully.
Format and API compatibility
No durable format, canonical bytes, identity law, or public Rust API changes.
Recovery implications
The contract requires future durable receipts to bind one immutable view and
protect the supporting evidence closure. Retention remains planned; the page
does not promote current lower-level durable machinery into a logical read API.
Security implications
Operational failure, partial proof, stale physical existence, or an uncommitted
caller layout cannot be promoted into a stronger content claim. Authenticated
bytes still do not prove authorship, authorization, provenance, or meaning.
Cross-repository consumer
Echo's experimental boundary is flyingrobots/echo#721; live implementation and
cutover work is flyingrobots/echo#722. Echo vocabulary remains outside Keep
core.