feat: per-call response verification at the proxy (v0.2.0) - #15
Conversation
….2.0) The proxy verifies every tools/call response it forwards, not just schemas at list time. Reference hierarchy: declared outputSchema -> core fingerprint (intersection of baselined probe fingerprints) -> unverifiable, counted. Only output-side BREAKING classes block; --observe is the rollout escape hatch; two-bucket quarantine survives the in-band tools/list sync; SSE frame interception holds only the matching result frame; 1 MiB verify cap; verifier exceptions forward original bytes. Includes the clarifications from CodeRabbit review: additionalProperties deliberately not enforced, response bucket in-memory only, a stream ending without the matching frame counts unverified, the cap bounds verification cost not proxy buffering. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Every forwarded tools/call response is verified against a per-tool reference:
declared outputSchema, else the core fingerprint (intersection of baselined
probe fingerprints). Output-side BREAKING classes (missing field, structural
retype, forbidden null, pinned value mismatch) block the response and
response-quarantine the tool; scalar retypes record DEGRADED and forward.
- covenant/verify.py: pure verifier (Layer 0) - references, tiers, pins
- quarantine: two buckets; sync() owns schema only, refresh clears response
- proxy: JSON + SSE interception (only the matching result frame is held),
1 MiB verify cap, verifier exceptions forward original bytes
- metrics: covenant_response_verifications_total{tool, outcome}
- cli: covenant proxy --observe; snapshot embeds expect pins into the lock
- examples: COVENANT_SHEKEL_DRIFT lever; lock re-snapshotted with the pin
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 5 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (14)
✨ 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 |
The implementation commit that PR #13 was merged without - the merge landed while the branch history was being cleaned up, so main received the spec docs only. This PR carries the single squashed implementation commit; the spec file is identical on both sides, so the diff is code + tests only.
What
Every
tools/callresponse the proxy forwards is verified against a per-tool reference: declaredoutputSchema, else the core fingerprint (intersection of baselined probe fingerprints), else countedunverified. Output-side BREAKING classes (missing field, structural retype, forbidden null, pinned value mismatch) block the response and response-quarantine the tool; scalar retypes record DEGRADED and forward; extra fields pass.covenant/verify.py- pure verifier (Layer 0)sync()owns schema only;POST /covenant/refreshclears the response bucket;/covenant/statusshows sourcescovenant proxy --observefor monitor-only rolloutsnapshotembedsexpectpins into the lock; lock re-snapshotted (diff is exactly the pin)covenant_response_verifications_total{tool, outcome}COVENANT_SHEKEL_DRIFTdemo lever: currency swap the pin catches per-callTests
37 new tests; full suite, ruff, and strict mypy green.
🤖 Generated with Claude Code