← Field notes & protocolsSPECIFIED

fold/2 Conformance

Deterministic serialization, bounded decoding, and fail-closed reconstruction

A fold/2 representation makes an exact recoverability claim. Conformance therefore includes more than successful decoding on one machine.

Serialization

The format defines:

  • deterministic CBOR profile;
  • key ordering;
  • integer and string rules;
  • unknown fields;
  • version negotiation;
  • digest algorithm IDs;
  • bounded lengths;
  • layer ordering;
  • gap/overlap policy;
  • canonical dependency order.

Encoder self-test

Before proof is sealed:

encode
→ normative decode
→ reconstruct exact bytes
→ digest
→ compare ContentId

Failure leaves a draft, not a valid fold.

Decoder policy

The decoder:

  • validates lengths before allocation;
  • rejects unknown proof algorithms;
  • enforces recursion and dependency limits;
  • verifies every layer;
  • checks execution capsule;
  • follows declared fallback;
  • never returns approximation in exact mode;
  • emits a typed error and receipt.

Golden vectors

Cross-language implementations must decode and re-encode fixed vectors. A Kotlin or TypeScript port cannot invent its own address or fold mathematics when Rust/WASM golden vectors exist.

Errors

Examples:

E_DIGEST_ALG
E_LAYER_OVERLAP
E_DEPENDENCY_MISSING
E_CAPSULE_UNREPRODUCIBLE
E_CONTENT_MISMATCH
E_RESOURCE_LIMIT

Fail closed, preserve fallback, and retain evidence.

Source register

  • N10-S01 — GlyphDrive OOC fold/2 Specification. GLYPHDRIVE-OOC-FOLD-SPEC-v0.2.md
  • N10-S02 — GlyphDrive v0.2 Ratification Gate. PASTE-INTO-OPUS-GLYPHDRIVE-V02-RATIFICATION-R0.md
  • N10-S03 — OOC Technical Assessment. GLYPHDRIVE-FOVEA-OOC-TECHNICAL-ASSESSMENT-v0.2-PLANNING.md