Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit c271cea. Configure here.
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.

Summary
Recorded instrumentation events could not be read back at all: the encoder wrote its fields flat and the decoder demanded a SEQUENCE that was never written. The wire matrix had public fields whose documented
data.len() == n * nrule nothing enforced, while a second type in the same crate already enforced it.Related Issues
None
Changes Made
TbEventdecodes back into the event that was writtenMetadata.matrixcarriesMatrixDyninstead ofAsn1MatrixTesting
make test-allpasses across all 54 feature selectionscargo test --lib instrumentation::covers the round trip and both hash lengthscargo hack check --each-featurecatches imports the all-features build cannotBreaking Changes
Asn1Matrixis deleted.Metadata.matrixisOption<MatrixDyn>.MatrixDyn::from_row_major(n, bytes)TbEventwhose payload hash is not 32 bytes now fails to decode instead of decoding with no hash.Note
Medium Risk
Breaking API removal of Asn1Matrix and stricter TbEvent/matrix decode behavior can reject previously tolerated wire data; changes touch metadata encoding and instrumentation evidence paths.
Overview
Replaces the V3 metadata matrix wire type by removing
Asn1Matrixand usingMatrixDyneverywhere (Metadata.matrix, builders, chess/fault-matrix helpers). Matrix DER encode/decode and then*nlength rule now live onMatrixDynviafrom_row_major, so decoded values match constructed ones.Hardens instrumentation
TbEventDER decoding: the decoder respects the SEQUENCE declared length (read_nested), rejects truncated or padded bodies, and treats a present payload hash that is not exactly 32 bytes as malformed instead of decoding as absent. New tests cover round-trip, length tampering, and hash-length cases.Breaking:
Asn1Matrixis gone; build matrices withMatrixDyn::from_row_major(n, bytes). Non–32-byte payload hashes on the wire now fail decode.Reviewed by Cursor Bugbot for commit 5d8d971. Bugbot is set up for automated code reviews on this repo. Configure here.