Skip to content

feat(test-vectors): KU interop fixtures for APS cross-verify#6

Merged
tomjwxf merged 1 commit intomainfrom
feat/ku-test-vectors
Apr 21, 2026
Merged

feat(test-vectors): KU interop fixtures for APS cross-verify#6
tomjwxf merged 1 commit intomainfrom
feat/ku-test-vectors

Conversation

@tomjwxf
Copy link
Copy Markdown
Contributor

@tomjwxf tomjwxf commented Apr 18, 2026

Closes the ask in #2: ship test-vectors/jcs-test-vectors.json, test-vectors/cross-verify-bundle.json, and test-vectors/selective-disclosure-salted-commit.json so the agent-passport-system round-trip described by @aeoess is runnable.

What's in the box

test-vectors/jcs-test-vectors.json — 9 JCS conformance cases. Each has {name, input, canonical, sha256}. Case #9 is the AIP-0001 ASCII-only key restriction (expected to throw on non-ASCII keys — matches APS v1.41.0 canonicalizer behavior).

test-vectors/cross-verify-bundle.json — one complete Knowledge Unit:

  • 4 models × Round 1 (independent responses)
  • 4 models × Round 2 (cross-critiques with dissent markers)
  • 1 Round 3 synthesis
  • 1 aggregate receipt binding all 9 prior receipts by hash

Every receipt Ed25519-signed, hash-chained via payload.previousReceiptHash over JCS-canonical bytes. Includes external_receipts.aps slot — an APS DecisionLineageReceipt pointing at ku_id=ku_4b3f7c2a9d8e1f05 drops in directly.

Verifies clean:

$ npx @veritasacta/verify test-vectors/cross-verify-bundle.json --bundle
✓ Bundle: VALID
  Total: 10  Passed: 10  Failed: 0

test-vectors/selective-disclosure-salted-commit.json — AIP-0002 reference. Grok-4.20's Round 1 dissenting response is published with response.position and response.confidence replaced by salted SHA-256 commitments. Unsigned witness block carries salts + plaintext. Commitment algorithm is sha256(salt + ":" + JSON.stringify(plaintext)) — stable across JSON-shape plaintexts (strings and numbers both work).

Per the conversation on #2, this lives alongside (not instead of) a future Merkle-tree reference contribution from the APS side. Different disclosure models, same bundle.

Determinism

test-vectors/generate.mjs derives all Ed25519 keys from a fixed seed via SHA-256, uses constant salts and timestamps, and produces byte-identical output across runs. If @veritasacta/artifacts canonicalization changes incompatibly, these fixtures surface it as a diff.

Interop procedure @aeoess proposed

  1. Feed each JCS fixture through APS's jcs-canonicalize, compare bytes + SHA-256.
  2. Run cross-verify-bundle.json through both verifiers independently — both should exit 0 over the same 10 receipts.
  3. Drop an APS DecisionLineageReceipt with ku_id=ku_4b3f7c2a9d8e1f05 into external_receipts.aps.receipt; the second verifier run covers it.
  4. AIP-0002 commitments in selective-disclosure-salted-commit.json are independently checkable from the witness — no signing-key access needed beyond verifying the redacted receipt's Ed25519 signature.

Refs #2.

🤖 Generated with Claude Code

Ships the three test-vector files referenced in issue #2 so the
agent-passport-system round-trip can run against a reachable target.

- jcs-test-vectors.json: 9 JCS conformance cases (empty, nested sort,
  array order, numbers, primitives, unicode values, receipt-shaped,
  and the AIP-0001 ASCII-only key restriction as the explicit
  rejection case aeoess asked for).
- cross-verify-bundle.json: one complete Knowledge Unit — 4 models ×
  2 rounds + 1 synthesis + 1 aggregate = 10 Ed25519 receipts, hash-
  chained via previousReceiptHash, with an external_receipts.aps slot
  for a DecisionLineageReceipt to drop in. Verifies clean with
  `npx @veritasacta/verify --bundle`.
- selective-disclosure-salted-commit.json: AIP-0002 reference. The
  Grok-4.20 round-1 dissenting response is published with position +
  confidence as salted SHA-256 commitments; the unsigned witness block
  carries the salts + plaintext. Complementary to APS's Merkle-tree
  approach, not a substitute.

generate.mjs is deterministic — same seed, byte-identical output —
so regressions in @veritasacta/artifacts canonicalization will surface
as test-vector diffs.

Refs: #2
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.

2 participants