Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

topic agents
type decision
status research-complete
last-validated 2026-07-30
related-docs 2124, 2030, 2064
original-query Brandon DreamNet Phase 3: bidirectional receipt.v1 cross-runtime verification against the now-public dreamnet-spore-sdk
tier DEEP

2138 - Spore Phase 3 CONFIRMED - bidirectional cross-runtime verification vs the public SDK

Goal: Execute Phase 3 of Brandon's v0.2 federation spec (doc 2124) against the now-public github.com/BrandonDucar/dreamnet-spore-sdk, prove bidirectional receipt verification, and land permanent conformance fixtures.

Result: PASS - 47/47 checks, both directions, live SDK execution

Run: npx tsx scripts/spore-conformance.ts (with SPORE_SDK_PATH set, the DreamNet runtime itself executes). SDK pinned at commit 4072102ace9c4ccf1dda40302f685ac5d8e01268 (2026-07-28).

ZAO is the first independently-operated conformant Spore node at the hash and receipt layers. DreamNet's own runtime is the reference implementation; ZAO is the first organism NOT operated by DreamNet whose serialization, subject hashes, and receipt digests are proven byte-identical to it, both directions, with tamper and unsupported-schema rejection. Attested by a verifiable receipt: conformance-receipt.json in this doc (digest sha256:dreamnet-sorted-json:v0:697e5322b7293ed0d4f87f640a469afeb7e6363d2e23d14f644695ef5312879d) - any party can re-verify it with either runtime.

What was proven

Contract Direction Proof
Canonical bytes (10 vectors: sorting, nesting, integer-like keys, unicode, undefined-omission, numbers) both src/lib/spore/__tests__/fixtures/cross-runtime-vectors.json - every dreamnet* value generated by EXECUTING the SDK; ZAO recomputes byte-identically. Live mode re-executes the SDK against ZAO output.
SHA-256 subject hashes both same fixtures; subjectHashByDreamnet = DreamNet recomputing a ZAO spore's content hash
ZAO receipt digest zao->dreamnet digestInputHashByDreamnet - the SDK's computeCanonicalHash reproduces computeReceiptDigest exactly
receipt.v1 interop digest both sha256(canonical({issuer, subjectHash})) - computed by both runtimes, identical
proof-artifact.v1 verification dreamnet->zao SDK-produced artifact verified by ZAO primitives (verifyDreamNetArtifact)
Tamper rejection both mutated issuer / payload / subjectHash / digest all rejected
Fail-closed both receipt.v2 / proof-artifact.v2 rejected; non-finite numbers throw in BOTH runtimes

The bug Phase 3 caught (why this mattered)

Differential testing found ZAO's canonicalize was NOT byte-identical to DreamNet's reference in 4 edge cases, despite the Phase 1 golden vector passing:

  1. Integer-like keys - {"2":4,"10":3}: ZAO emitted numeric order (JS object key reordering after rebuild), DreamNet emits lexicographic ("10" < "2"). A real cross-org hash break on any payload with numeric string keys.
  2. toJSON - ZAO's JSON.stringify honored it; DreamNet hashes the enumerable shape.
  3. NaN/Infinity - ZAO silently serialized null (fail-open); DreamNet throws (fail-closed).
  4. The same pre-fix impl was duplicated in bot/src/zoe/receipt-envelope.ts.

Fix: both copies now build the canonical string manually with DreamNet-identical semantics (src/lib/eyes/observation.ts:canonicalize, bot/src/zoe/receipt-envelope.ts:canonicalize). All 19 previously-compatible behaviors unchanged (Phase 1 golden vector byte-identical before and after); only the 4 divergent edges changed. Note: any HISTORICAL digest computed over a payload containing integer-like keys or non-finite numbers would no longer recompute - no known stored payloads have either shape (receipts store flat string/ID fields).

Honest scope

  • The SDK at the pinned commit defines the receipt.v1 SHAPE (contracts/index.ts:87-95) but ships NO reference digest formula. The interop digest (sha256(canonical({issuer, subjectHash}))) is defined in src/lib/spore/interop.ts and proven recomputable by the DreamNet runtime with its own primitives - genuine cross-runtime, but the formula is ZAO-proposed, pending Brandon ratifying it in the SDK.
  • No signatures yet - identity attestation (keys) is a later phase; verification today is content + digest integrity.
  • Replay protection is at the receipt-id layer (UUID per issue, digest stable) per Phase 2 - unchanged here.

Files

  • src/lib/spore/interop.ts - receipt.v1 / proof-artifact.v1 mapping + fail-closed verifiers
  • src/lib/spore/__tests__/fixtures/cross-runtime-vectors.json - PERMANENT cross-org vectors (do not edit)
  • src/lib/spore/__tests__/phase3-cross-runtime.test.ts - app-side suite
  • bot/src/zoe/__tests__/spore-conformance.test.ts - bot-copy pinned to the same fixtures
  • scripts/spore-conformance.ts - executable gate (works while app vitest is broken)
  • research/agents/2138-.../conformance-receipt.json - the verifiable attestation

Next Actions

Action Owner Type By When
Tell Brandon: Phase 3 PASS + propose ratifying the receipt.v1 interop digest in the SDK @Zaal Message (gated) 2026-07-30
Phase 4-5: federation protocol + claim.v1 (references receipts) @Zaal (ZOE) Build next iteration
Wire receipts into live Vacuum Spike emissions (Phase 2 completion in prod path) @Zaal (ZOE) Build with Heart wiring

Sources

  • github.com/BrandonDucar/dreamnet-spore-sdk @ 4072102 [FULL - cloned, executed live both directions]
  • Doc 2124 - the v0.2 federation spec + Phase 1 confirmation [FULL]
  • First-party: differential + conformance runs this session (47/47 PASS output captured)