test(canonicalization): a second vector for the form a careful implementer reaches - #170
Merged
imran-siddique merged 1 commit intoAug 14, 2026
Conversation
…enter reaches `test_every_adhoc_form_is_caught_by_some_vector` asserts every ad-hoc form is separated by some vector, and every form is. Counting how many separate each one gives a different answer: `sort_keys_compact_utf8`, the form left after compact separators and ensure_ascii are both set correctly, was separated by `03` alone. One vector is coverage until that vector changes. Weaken or retire `03` and the closest non-conformant canonicalizer passes the whole set with every other assertion here still green, which is the margin rule of agentrust-io#124 applied to the set that measures the section 3.2.2 MUST. `04` moves the divergence inside a nested object. It is a distinct defect rather than a restatement of `03`: a canonicalizer sorting by UTF-16 code units at the outer levels and by code points below them accepts `03` and rejects `04`, measured at depth 2. The margin this adds is positional rather than mechanistic. Key ordering is the only RFC 8785 divergence this schema can reach, since no field is typed `number`, which test_number_divergence_is_still_unreachable already pins. Load-bearing, checked rather than assumed: remove `04` and the new assertion fails. 379 pass; ruff clean. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Louielunz <48041247+lywinged@users.noreply.github.com>
Contributor
|
❔ Contributor Check: UNKNOWN
Automated check by AgenTrust Contributor Check. |
imran-siddique
approved these changes
Aug 14, 2026
imran-siddique
left a comment
Member
There was a problem hiding this comment.
The new nested-key vector creates positional margin against a depth-dependent non-RFC-8785 sorter, the generator and committed fixture move together, and the test now requires every modeled ad-hoc form to be separated by at least two vectors.
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.
test_every_adhoc_form_is_caught_by_some_vectorasserts that every ad-hoc form is separated by some vector, and every form is. Counting how many vectors separate each one gives a different answer.sort_keys_defaultsort_keys_compactsort_keys_compact_utf8sort_keys_compact_utf8is the form left after compact separators andensure_asciiare both set correctly, which is to say the one a careful implementer actually reaches. It was separated by03alone. One vector is coverage until that vector changes: weaken or retire03and the closest non-conformant canonicalizer passes the whole set, with every other assertion in the module still green. That is the margin rule of #124 applied to the set that measures the section 3.2.2 MUST.04moves03's divergence inside a nested object, so it is a distinct defect rather than a restatement. A canonicalizer that sorts by UTF-16 code units at the outer levels and by code points below them accepts03and rejects04.The margin this adds is positional rather than mechanistic, and worth naming as such: key ordering is the only RFC 8785 divergence this schema can reach at all, since no field is typed
numberand IEEE 754 serialization is therefore unreachable, whichtest_number_divergence_is_still_unreachablealready pins.Reproduction
git fetch origin pull/170/head:pr170 && git checkout pr170The count in the table:
On
HEAD~1that printssort_keys_compact_utf8 1; on this branch it prints2.The distinct defect. A canonicalizer sorting by code units only to a given depth, then falling back to the default sort:
Load-bearing:
Full suite on 3.11: 379 passed, 1 skipped.
ruff checkclean. Scope isexamples/andtests/only.