Repository navigation
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new test helper unhex can panic despite returning Result, and should validate/return errors consistently to avoid fragile fixture parsing.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates onomancy_keyhive to use the same content-reference type as keyhive_wasm (browser peers), threading that type through the crate’s Keyhive instantiations and carriage parsing so real-world carriages with non-empty after_content decode/verify correctly.
Changes:
- Introduce
ContentRef = Vec<u8>and parameterize Keyhive/Carriage APIs over it instead of[u8; 32]. - Update authority verification and carriage encoding/decoding paths to use
ContentRef. - Add a browser-captured carriage fixture and tests to ensure decoding and signing-bar authorization behavior matches browser-emitted evidence.
File summaries
| File | Description |
|---|---|
| onomancy_keyhive/tests/fixtures/ark_owner_carriage.hex | Adds a real browser-captured carriage entry set used as a decoding/authorization fixture. |
| onomancy_keyhive/tests/authority.rs | Updates tests to use ContentRef in event/carriage plumbing. |
| onomancy_keyhive/tests/ark_carriage.rs | Adds end-to-end tests validating a browser-emitted carriage decodes and authorizes correctly. |
| onomancy_keyhive/src/mint.rs | Mints delegations using StaticDelegation<ContentRef> to align with the new content-ref parameterization. |
| onomancy_keyhive/src/lib.rs | Defines and documents the ContentRef alias to match keyhive_wasm’s bincode layout expectations. |
| onomancy_keyhive/src/carriage.rs | Re-keys Carriage to StaticEvent<ContentRef> so parsing matches browser-emitted encoding. |
| onomancy_keyhive/src/authority.rs | Updates the verifier’s internal Keyhive Instance type parameters to use ContentRef. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Keyhive is generic over its content-reference type, and bincode encodes `[u8; 32]` bare but `Vec<u8>` length-prefixed. A peer instantiating Keyhive over a variable-width reference therefore emits a different wire format under the same Keyhive version, and `kh0` — Keyhive's default `[u8; 32]` hash — cannot read it. Minted carriages always have an empty `after_content`, which encodes identically under either type, so no existing test could observe the mismatch. Freeze a browser-captured carriage whose root delegation carries a 10-byte reference and pin the outcome: `UndecodableEvent` at entry 0, nobody authorized, nothing on path. Undecodable vouches nothing and is never misread into an acceptance. Document the `[u8; 32]` commitment on `ENVELOPE_TAG` and add a fixture README with the capture's provenance.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.