Skip to content

feat: add RFC 8785 canonicalization interop vectors and fix ADR-0003 (#322) - #409

Closed
SnehD wants to merge 6 commits into
agentrust-io:mainfrom
SnehD:fix/rfc8785-interop-fresh
Closed

feat: add RFC 8785 canonicalization interop vectors and fix ADR-0003 (#322)#409
SnehD wants to merge 6 commits into
agentrust-io:mainfrom
SnehD:fix/rfc8785-interop-fresh

Conversation

@SnehD

@SnehD SnehD commented Sep 9, 2026

Copy link
Copy Markdown

Description

Resolves #322

Adds RFC 8785 canonicalization-boundary vectors from trace-spec for cross-implementation verification and resolves merge conflict in ADR-0003.

Motivation

The previous PR (#404) was closed because the canonicalizer implementation has already been merged upstream. This PR contains ONLY the valuable interop test vectors and the ADR documentation correction that were requested by the maintainer.

Cross-implementation canonicalization testing is critical for verifying RFC 8785 conformance without depending on implementation internals.

Changes

  • ✅ Add four canonicalization-boundary vectors (signed by trace-spec)

    • 01-non-ascii-values.json - Tests literal UTF-8 output for BMP non-ASCII characters (e.g., "modèle", "机密")
    • 02-non-bmp-values.json - Tests literal UTF-8 output for non-BMP characters (e.g., 🤖, 🔒 emojis)
    • 03-utf16-key-order.json - Tests RFC 8785's UTF-16 code-unit based key sorting (catches naive UTF-8 sorters)
    • 04-utf16-key-order-nested.json - Tests recursive UTF-16 sorting at all nesting levels
  • ✅ Add interop test runner (test_trace_canonicalization_boundary.py)

    • Black-box verification using EdDSA signatures from trace-spec
    • Signature fails if canonicalization is incorrect
    • Gracefully skips if vectors not yet fetched
  • ✅ Add interop directory README

    • Explains purpose of vectors
    • Provides fetch instructions for trace-spec examples
    • Documents how to run tests
  • ✅ Resolve merge conflict in ADR-0003

    • Add missing reference to Section 3.2.2 (composite policy sub-bundles)
    • Clarify that domain separation applies to all levels

Scope Restrictions (Maintained)

  • ✅ ONLY python/tests/interop/ and docs/adr/0003-rfc9162-merkle-domain-separation.md modified
  • _canonicalize.py untouched (implementation already merged)
  • test_canonicalize.py untouched (existing tests preserved)
  • ✅ No canonicalizer implementation changes
  • ✅ No CI configuration changes
  • ✅ No dependency updates

Testing

  • ✅ All 4 interop vectors pass signature verification (test_canonicalize_matches_trace_spec_signature)
  • ✅ All 47 existing canonicalize tests pass (no regressions)
  • ✅ Total: 48 tests passed
$ pytest python/tests/interop/test_trace_canonicalization_boundary.py python/tests/test_canonicalize.py -v
============================== 48 passed in 1.11s ==============================

SnehD added 6 commits August 24, 2026 22:52
ADR-0003 listed the two approved RFC 9162 Merkle hash operations
(leaf hash and interior-node hash) alongside rejected alternatives
(plain concatenation, BLAKE3, flat hash) without clearly separating
the two. This could be misread as four supported constructions.

Also removed outdated leaf-content wording that no longer matches
the current specification, and pointed readers to spec sections
4.1.1, 3.2.3, and 3.2.5.1 as the source of truth for those details.

Documentation only. No code, hashing, or API changes.
# Conflicts:
#	docs/adr/0003-rfc9162-merkle-domain-separation.md
…(issue agentrust-io#322)

- Add four canonicalization-boundary vectors to validate RFC 8785 conformance
- Vectors test: non-ASCII UTF-8 output, non-BMP characters, UTF-16 key ordering
- Each vector signed by trace-spec for cross-implementation verification
- Add interop test runner to verify signatures
- Resolve merge conflict in ADR-0003
- Add Section 3.2.2 reference to normative sections list

Signed-off-by: Sneha Dalvi <sneha.dalvi2000@gmail.com>
@SnehD
SnehD requested review from a team, carloshvp and zohebk8s as code owners September 9, 2026 03:33
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Thanks for this, @SnehD. Closing it for now, and it is not about the change itself.

This repository asks first-time contributors to be vouched by a maintainer before opening a pull request. That is because agent-written contributions are easy to produce and expensive to review, and we would rather talk to you first than review something neither of us can explain.

To get vouched: open an issue saying what you want to change and why, in your own words. A maintainer will reply, and add you with /vouch. After that, reopen this pull request or open a new one.

See CONTRIBUTING.md for the detail.

@github-actions github-actions Bot closed this Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agent-manifest rejects a TRACE record that trace-spec signed: the canonical form is not RFC 8785

1 participant