[codex] Add encoder distortion manifest verification#152
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for verifying optional encoder_distortion profile references in index manifests, updating documentation, manifest schemas, SQLite caching logic, and adding comprehensive tests. The review feedback highlights two key improvements in ordvec-manifest/src/lib.rs: handling potential float overflow to infinity when calculating expected distortion bounds to prevent infinite tolerance checks, and trimming whitespace when comparing calibration profile IDs to avoid false mismatch errors.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Review Summary by QodoAdd encoder distortion manifest verification with profile artifact validation
WalkthroughsDescription• Adds strict optional encoder_distortion manifest block with comprehensive verification • Verifies encoder identity, tokenizer/pooling identity, finite bounds, scoped metric digests • Validates evidence metadata, profile artifact path/hash/size integrity, calibration linkage • Extends SQLite cache key to include encoder-distortion profile bytes for invalidation • Adds tokenizer_revision and pooling fields to Embedding struct for encoder tracking Diagramflowchart LR
A["Manifest Document"] -->|contains| B["EncoderDistortionProfileRef"]
B -->|validates| C["Encoder Identity"]
B -->|validates| D["Metric Specs"]
B -->|validates| E["Distortion Bounds"]
B -->|validates| F["Scope Metadata"]
B -->|validates| G["Evidence Kind"]
B -->|references| H["Profile Artifact"]
H -->|integrity check| I["SHA256 & Size"]
B -->|optional link| J["Calibration Profile"]
K["SQLite Cache"] -->|includes| L["EncoderDistortion Profile Hash"]
L -->|invalidates| M["Stale Reports"]
File Changes1. ordvec-manifest/src/lib.rs
|
Code Review by Qodo
1. Distortion profile hash unbounded
|
There was a problem hiding this comment.
Pull request overview
Adds optional, strict encoder_distortion manifest support to ordvec-manifest and extends verification + SQLite caching so distortion-profile artifact bytes participate in cache invalidation. This fits into the crate’s provenance/verifier lane by strengthening “verify before load” guarantees for additional (optional) sidecar provenance.
Changes:
- Introduces a typed
encoder_distortionmanifest block (schema v1) plus structured verification + report output. - Enforces verification of encoder/tokenizer/pooling identity, metric spec digests, finite bounds/scope/evidence fields, optional calibration linkage, and optional sidecar profile artifact integrity.
- Extends the SQLite verification cache key + schema to include encoder-distortion profile bytes, with tests ensuring drift invalidates cached reports.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
ordvec-manifest/src/lib.rs |
Adds encoder_distortion schema types, verification logic, and report fields; extends embedding identity fields used for cross-checks. |
ordvec-manifest/src/sqlite.rs |
Adds encoder_distortion_profile_sha256 to the verification cache key and SQLite schema/migration + lookup logic. |
ordvec-manifest/tests/manifest.rs |
Adds comprehensive tests for encoder-distortion schema strictness, verification rules, artifact enforcement, calibration linkage, and sqlite cache invalidation. |
ordvec-manifest/README.md |
Updates verifier scope description and sqlite cache behavior wording to include encoder-distortion profile bytes. |
docs/INDEX_PROVENANCE.md |
Documents encoder-distortion verification scope and clarifies it as scoped evidence (not a global theorem). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
73f25d3 to
ac3ab63
Compare
Signed-off-by: Nelson Spence <nelson@projectnavi.ai>
Signed-off-by: Nelson Spence <nelson@projectnavi.ai>
ac3ab63 to
60b735e
Compare
|
Rebased #152 onto current
Local validation:
|
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 60b735e |
Signed-off-by: Nelson Spence <nelson@projectnavi.ai>
|
Follow-up for the latest Qodo summary on #152:
Local validation after the compatibility fix:
|
Summary
encoder_distortionmanifest block with typed verifier/report supportScope notes
This is a narrow
ordvec-manifestprovenance/report lane. It is related to #143, #147, and #148, but it does not make the verifier crate publishable, expose a new programmatic cache API, or implement the full unified auxiliary-artifact report model. It does not implement #144, #145, #146, or #149.Validation
cargo fmt --checkcargo check -p ordvec-manifest --no-default-featurescargo test -p ordvec-manifestcargo test -p ordvec-manifest --features sqlitecargo clippy -p ordvec-manifest --all-targets --all-features -- -D warningsgit diff --checkReview
Adversarial review found no blocker for a draft PR, with the main guardrail that this PR should not be described as closing the broader manifest publication, cache API, auxiliary artifact, verified-load, or bounded-parser issues.