Skip to content

feat(evidence): verify capture packages offline - #227

Draft
seonghobae wants to merge 6 commits into
feat/capture-manifest-contractfrom
feat/offline-replay-verification
Draft

feat(evidence): verify capture packages offline#227
seonghobae wants to merge 6 commits into
feat/capture-manifest-contractfrom
feat/offline-replay-verification

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

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_package accepts only already-materialized in-memory capture evidence: an expected CaptureManifest, 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 29c0dceefaa2d5cace63ea55c506728b94eaf68c introduced 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 0974ff49e1b8e9d1ae43e79707acf3f3b1d30eb4 then passed repository contracts and rustfmt up to the workspace compile boundary and failed exactly because OfflineReplayVerificationError and verify_offline_capture_package did not yet exist. Rust-contracts job 98094610394 checked out that exact SHA and reported E0432 unresolved imports in offline_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 CaptureManifestVerificationError sources. Current-head hostile evidence also proves that replay with the expected persisted manifest but an empty WARC/PROV record set fails closed as Evidence(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, and tests/offline_capture_replay.rs.

On the unchanged exact head:

  • CI run 32956553195: success;
  • Rust contracts job 98139363293: repository contracts, canonical formatting, locked workspace/all-target check, full tests, strict Clippy, and rustdoc success;
  • Production coverage job 98139363003: exact owned-production function, line, region, and branch enforcement success;
  • Exact coverage totals: functions 548/548, lines 4653/4653, regions 5830/5830, branches 764/764 — all 100%;
  • exact coverage artifact 9602238144, digest sha256:132dbdda506cf0db7efeafc33e1cedc3f325af7313341ff7b3cf76d22db7908e;
  • current formal reviews: none;
  • current inline review threads: none.

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.md remains authoritative. This scheduled actor does not merge, self-approve, force-push, destructively rebase, alter workflows/rulesets/secrets, tag, release, publish, or promote stale evidence.

@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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.

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.

1 participant