Skip to content

fix(warp-core): reject unrecoverable provider evidence before install#681

Merged
flyingrobots merged 3 commits into
mainfrom
fix/provider-evidence-recoverability
Jul 18, 2026
Merged

fix(warp-core): reject unrecoverable provider evidence before install#681
flyingrobots merged 3 commits into
mainfrom
fix/provider-evidence-recoverability

Conversation

@flyingrobots

@flyingrobots flyingrobots commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Apply shared pure structural validators at provider installation and retained-evidence reconstruction.
  • Reject empty operation or Target IR coordinates, empty Target IR digest domains, and every non-canonical Target IR SHA-256 rendering before any Engine index changes.
  • Construct live provider invocation evidence through the same fallible retained-parts boundary used by WAL recovery.
  • Repair full local verification so the provider admission integration target retains its required feature set.

This addresses the unresolved provider installation/WAL recoverability finding from #678.

Executable claim

Every provider evidence identity accepted for installation and capable of entering a receipt or WAL record is lawful under the same structural validation required during recovery.

The new witness admits self-consistent malformed registries under exact policy equality, then proves installation fails with stable typed errors before package, operation, or writable-evidence indexes exist and without invoking provider callbacks.

Evidence

  • cargo +1.90.0 test -p warp-core --features native_rule_bootstrap,trusted_runtime --test provider_contract_admission_tests
  • cargo +1.90.0 xtask test-slice contract-path-release
  • cargo +1.90.0 test -p warp-core --features native_rule_bootstrap,trusted_runtime --test provenance_retention_codec_tests legacy_contract_state_delta_encoding_remains_byte_stable -- --exact
  • cargo +1.90.0 clippy -p warp-core --lib --features native_rule_bootstrap,trusted_runtime -- -D warnings -D missing_docs
  • cargo +1.90.0 clippy -p warp-core --features native_rule_bootstrap,trusted_runtime --test provider_contract_admission_tests -- -D warnings
  • scripts/verify-edict-provider-host-v1.sh
  • bash tests/hooks/test_verify_local.sh
  • VERIFY_FORCE=1 VERIFY_LOCAL_FULL_TESTS=1 VERIFY_LOCAL_RUSTDOC=1 cargo +1.90.0 xtask pr-preflight
  • canonical pre-commit and pre-push hooks

Compatibility and authority

  • Legacy installed-contract tag-1 WAL bytes remain unchanged.
  • Valid provider tag-2 install, invocation, persistence, recovery, idempotency, and no-callback recovery remain green.
  • No WAL decoder weakening, Jedit semantics, Gate C work, provider reads, inverses, or authorization changes are included.
  • Generated artifacts remain evidence only; Echo remains the installation and runtime authority.

Documentation

Updated the existing architecture, Generated Rules, WAL, threat-model, crate/root entrances, API documentation, and changelog. The documentation-accuracy audit found no stale current-state claims in the relevant guide, docs map, invariants, specifications, or ADR 0015.

Summary by CodeRabbit

  • Bug Fixes

    • Provider package installation now rejects malformed coordinates and digests before updating engine indexes.
    • Invalid provider evidence produces stable, structured installation errors.
    • Existing valid tag-1 and tag-2 evidence behavior remains unchanged.
  • Documentation

    • Clarified installation-time validation, recovery behavior, and security safeguards across user and architecture documentation.
  • Tests

    • Added coverage for malformed provider evidence and confirmed no artifacts or callbacks are created after rejection.
    • Updated full verification to run provider admission tests with the required feature configuration.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@flyingrobots, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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 reviews.

How do review 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 refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 21b81b9f-8af4-4b0c-88cf-a476bf4bf8f9

📥 Commits

Reviewing files that changed from the base of the PR and between 8e6d5c8 and 46857c6.

📒 Files selected for processing (2)
  • docs/topics/WAL.md
  • docs/topics/security/ThreatModel.md
📝 Walkthrough

Walkthrough

Provider contract evidence validation is centralized and applied during trusted installation before engine index mutation. Malformed package, operation, and Target IR identities produce typed failures, with regression tests, documentation, changelog entries, and local verification feature wiring updated accordingly.

Changes

Provider evidence validation

Layer / File(s) Summary
Centralized evidence validation
crates/warp-core/src/provider_contract.rs
Shared validators enforce package-reference and operation Target IR structure, while installation maps failures to typed errors before state mutation.
Malformed evidence regression coverage
crates/warp-core/tests/provider_contract_admission_tests.rs
Admission tests cover malformed evidence, typed error subjects and references, unchanged engine state, and absent callbacks.
Documentation and local verification wiring
README.md, crates/warp-core/README.md, docs/..., CHANGELOG.md, scripts/verify-local.sh, tests/hooks/test_verify_local.sh
Documentation and changelog text describe pre-mutation validation, and full verification enables native_rule_bootstrap,trusted_runtime for provider admission tests and Clippy.

Estimated code review effort: 3 (Moderate) | ~30 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: rejecting invalid provider evidence before installation in warp-core.
Docstring Coverage ✅ Passed Docstring coverage is 85.71% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/provider-evidence-recoverability

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 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/topics/WAL.md`:
- Around line 72-76: Update docs/topics/WAL.md lines 72-76 to narrow the “every
field” claim to package-reference and operation/Target-IR structural validation,
and state that reserved operation IDs are rejected during proposal construction
rather than installation preparation. Update docs/topics/security/ThreatModel.md
lines 299-301 to scope the retained-evidence decoder’s structural law to only
the validators reused during installation; no code changes are needed.
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 32a0ac23-2138-4e02-8a62-d621f61f7b9d

📥 Commits

Reviewing files that changed from the base of the PR and between fd028a9 and 8e6d5c8.

📒 Files selected for processing (11)
  • CHANGELOG.md
  • README.md
  • crates/warp-core/README.md
  • crates/warp-core/src/provider_contract.rs
  • crates/warp-core/tests/provider_contract_admission_tests.rs
  • docs/architecture/application-contract-hosting.md
  • docs/topics/GeneratedRules.md
  • docs/topics/WAL.md
  • docs/topics/security/ThreatModel.md
  • scripts/verify-local.sh
  • tests/hooks/test_verify_local.sh

Comment thread docs/topics/WAL.md Outdated
@flyingrobots
flyingrobots enabled auto-merge July 18, 2026 06:07
@flyingrobots
flyingrobots disabled auto-merge July 18, 2026 06:09
@flyingrobots
flyingrobots merged commit 6615d3a into main Jul 18, 2026
40 checks passed
@flyingrobots
flyingrobots deleted the fix/provider-evidence-recoverability branch July 18, 2026 06:09
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