feat(evidence): verify capture packages offline - #227
Draft
seonghobae wants to merge 6 commits into
Draft
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partial implementation of #199, stacked on exact current PR #222 head
649e30e19c3b9356061ef806d2b8e9b9b6e3ba8e.Buyer-visible boundary
This Draft implements one bounded offline-replay verification boundary.
verify_offline_capture_packageaccepts only already-materialized in-memory capture evidence: an expectedCaptureManifest, the exact persisted manifest bytes, the extraction schema, WARC/PROV pairs, and structured-value digest bindings. It verifies persisted manifest-byte identity first, then re-verifies the full schema/WARC/PROV/value identity, and returns a credential-safe receipt containing only the manifest digest and verified record/value counts.The verifier performs no DNS, network access, browser execution, JavaScript, external-reference traversal, secret access, persistence mutation, retention decision, signing, or authority escalation. It does not establish factual correctness beyond the supplied evidence contracts.
Test-first repair lineage
The first RED head
29c0dceefaa2d5cace63ea55c506728b94eaf68cintroduced realistic regressions for exact valid package verification, persisted-manifest byte drift, and structured-result identity drift. Canonical formatting was repaired after CI exposed a rustfmt-only failure.Exact RED head
0974ff49e1b8e9d1ae43e79707acf3f3b1d30eb4then passed repository contracts and rustfmt up to the workspace compile boundary and failed exactly becauseOfflineReplayVerificationErrorandverify_offline_capture_packagedid not yet exist. Rust-contracts job98094610394checked out that exact SHA and reportedE0432unresolved imports inoffline_capture_replay.rs, providing the causal implementation RED rather than predecessor or synthetic evidence.The production repair adds a pure in-memory verifier, typed fail-closed error variants separating persisted-manifest-byte failure from evidence-identity failure, and a bounded verification receipt. Tests execute both typed diagnostic paths and preserve their underlying
CaptureManifestVerificationErrorsources. Current-head hostile evidence also proves that replay with the expected persisted manifest but an empty WARC/PROV record set fails closed asEvidence(InvalidCandidate(MissingRecord)), directly exercising issue #199's missing-record corruption requirement. No catch-all suppression, retry, alternate authority, or weakened gate is introduced.Exact-current state and evidence
Current exact head:
ff1aded4ad9467b9bfc465a1cea92cb4865597a4.Current exact base:
649e30e19c3b9356061ef806d2b8e9b9b6e3ba8e.The branch remains dependency-bound on current Draft prerequisite #222. The unique production/test delta remains limited to
crates/originweave-evidence/src/lib.rs,src/offline_replay.rs, andtests/offline_capture_replay.rs.On the unchanged exact head:
32956553195: success;98139363293: repository contracts, canonical formatting, locked workspace/all-target check, full tests, strict Clippy, and rustdoc success;98139363003: exact owned-production function, line, region, and branch enforcement success;548/548, lines4653/4653, regions5830/5830, branches764/764— all 100%;9602238144, digestsha256:132dbdda506cf0db7efeafc33e1cedc3f325af7313341ff7b3cf76d22db7908e;The exact-current workflow inventory exposes CI only for this stacked head. Same-head SAST/Semgrep, Security Scan, Manifest V3, OpenCode, Noema, Strix, or independent approval success is absent and is not claimed. No predecessor result transfers to this head.
Keep this PR Draft while prerequisite #222 remains Draft.
Authority boundary
Offline verification is deterministic identity verification only. It does not parse or execute captured active content, contact origins, resolve DNS, authorize capture/replay/retention/export, grant browser/network/model/secret/persistence authority, or infer trust from the existence of WARC/PROV records. Protected-main
AGENTS.mdremains authoritative. This scheduled actor does not merge, self-approve, force-push, destructively rebase, alter workflows/rulesets/secrets, tag, release, publish, or promote stale evidence.