feat(core): route invocation presentations through grant validation obstruction#346
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR adds a capability presentation validation routing abstraction to optic invocation admission. A new ChangesValidator-Routed Invocation Admission
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
🔍 Code Lawyer Audit Summary
Local validation run: All listed local checks passed. CI checks are green. Merge gate remains blocked by review policy ( Cc: @codex |
Summary
Testing
|
|
@coderabbitai review please |
|
✅ Actions performedReview triggered.
|
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 `@crates/warp-core/src/optic_artifact.rs`:
- Around line 1103-1105: The code clones a RegisteredOpticArtifact from
self.resolve_optic_artifact_handle(&invocation.artifact_handle) before
validation, causing an unnecessary allocation on the hot path; instead obtain a
reference (e.g. match to get registered as ®istered or use .as_ref()) and
pass a &RegisteredOpticArtifact into your validation routine (or change the
validation function signature to accept &RegisteredOpticArtifact) so the clone
is removed; update any callees (validation functions/methods) that currently
take Owned RegisteredOpticArtifact to accept a borrow and adjust lifetimes/uses
accordingly (references: resolve_optic_artifact_handle, RegisteredOpticArtifact,
invocation.artifact_handle, and the validation function you call).
In `@docs/design/invocation-grant-validation-obstruction-routing.md`:
- Around line 47-50: Update the diagram so Validator invocation is shown as
conditional rather than unconditional: change the arrow from Presentation to
Validator to a conditional/guarded edge (e.g., annotate with “[if presentation
posture available]” or use a decision node) and add an alternative path for the
CapabilityValidationUnavailable case that bypasses Validator and leads to the
appropriate handling (e.g., Registry or ValidationFact path). Specifically
adjust the relations involving Presentation, Validator,
CapabilityValidationUnavailable, ValidationFact, and Registry so the flow only
goes through Validator when presentation posture is structurally available, and
mirror the same conditional change for the similar flow at lines referenced
(68-69).
🪄 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: 275c2d6b-2cb0-4586-b881-26055e29c6ca
📒 Files selected for processing (5)
CHANGELOG.mdcrates/warp-core/src/lib.rscrates/warp-core/src/optic_artifact.rscrates/warp-core/tests/optic_invocation_admission_tests.rsdocs/design/invocation-grant-validation-obstruction-routing.md
|
Summary
Routes bound optic invocation capability presentations through a narrow
CapabilityPresentationValidatorso Echo can publish sharper grant-validation obstruction evidence while keeping invocation admission conservative.Doctrine:
Behavior
CapabilityPresentationValidatoras the narrow invocation-time validation boundary.CapabilityGrantIntentGateusing existing narrow identity coverage checks.OpticArtifactRegistry::admit_optic_invocation_with_capability_validator(...).GraphFact::CapabilityGrantValidationObstructedfor failed presentation validation.OpticInvocationObstruction::CapabilityValidationUnavailablefor invocation admission.Non-goals
AdmissionTicketLawWitnessVerification
Pre-push also ran the critical local gate and passed: fmt, guards, clippy-core, tests-warp-core, rustdoc.
Summary by CodeRabbit
Release Notes
New Features
Documentation
Tests