Certificate JSON Shape
The governance-certificate.json file is the cryptographic proof of a factory run. Its shape is defined by the GovernanceCertificate Data Transfer Object (DTO).
Core Structure
The JSON payload contains several key sections:
- Metadata:
certificateVersion(pinned to1.5.0),pipelineRunId,timestamp, andstatus. - Intent & Specs:
intent(requirements hash) andbuildSpec(hash of the frozen build specification). - Stages: An array of
StageRecordobjects. Each stage contains anartifactHashesmap, which is a lexicographic dictionary of every file in that stage and its SHA-256 hash. - Signer: The identity of the principal that drove the run (
subject,identityProvider,sessionId). - Corpus Binding: (Optional) The hash of the spec-spine corpus attestation in effect during the run.
Cryptographic Fields
The integrity of the certificate is secured by three fields at the bottom of the JSON payload:
certificateHash: The SHA-256 hash of the canonical JSON of the certificate.signingPublicKey: The base64-encoded Ed25519 public key.certSignature: The base64-encoded Ed25519 signature.
Canonicalization
To compute the certificateHash and the certSignature, the emitter and verifier must agree on the exact byte representation of the JSON.
Before hashing or signing, the payload is canonicalized:
- The
certificateHashandcertSignaturefields are set to empty strings. - The
platformCountersignfield (if present) is zeroed. - The JSON object keys are sorted lexicographically.
- The JSON is serialized without whitespace.
The signature is computed over this canonical byte string, and the resulting hash and signature are then injected back into the final JSON written to disk.