Govern Specv0.1

Conformance Suite

@govern/conformance is the offline verifier for Govern audit packs. It implements the verifier protocol from the audit-pack signing spec. The CLI exits 0 on a verified pack, 1 on any verification failure, and 2 on usage error.

Not yet published to npm. @govern/conformance ships as open source alongside the v1 Connector spec (Workstream A.0). In the interim, clone the repo and run from packages/conformance.

CLI

# Once published:
npx @govern/conformance verify pack.zip

Prints structured JSON to stdout:

{
  "ok": true,
  "pack_id": "019e17ee-5c08-7d67-83ec-77e609e6abb0",
  "firm_id": "firm_6ad64466-62c6-40e1-a3cc-4923f2761138",
  "key_id": "019e17da-0f8a-7a75-8837-3b226337a016",
  "key_state": "active",
  "key_fingerprint_sha256_hex": "695de6a2...0eb484",
  "period": { "from": "2026-04-11T00:00:00Z", "to": "2026-05-11T23:59:59Z" },
  "files_verified": 4,
  "chain_tip": { "row_hash": "7f20959a...196bbe", "row_id": 5216 }
}

On failure:

{
  "ok": false,
  "error": "signature_invalid",
  "detail": "Ed25519 signature did not verify against the published public key",
  "stage": "verify_signature"
}

Library

import { readFile } from 'node:fs/promises';
import { verifyPack } from '@govern/conformance';

const bytes = await readFile('pack.zip');
const result = await verifyPack(new Uint8Array(bytes));

if (result.ok) {
  console.log('verified: pack', result.pack_id, 'from firm', result.firm_id);
} else {
  console.error('verification failed:', result.error, 'at', result.stage);
}

Options

verifyPack(bytes, options) accepts:

Conformance test corpus

All 8 cases must pass for a connector implementation to be considered spec-compliant. External implementers (other languages, other runtimes) MUST emit the same error codes.

CaseExpected outcome
Happy path — well-formed pack, active key, valid signature, valid chainok: true
Tampered events.csv — single row mutated post-signingfile_hash_mismatch
Tampered manifest.jsonchain_tip.row_hash rewrittensignature_invalid
Pack signed by revoked keykey_revoked
Pack signed by verified_only key (rotated out)ok: true
Pack references unknown key_idkey_not_found
Pack with future spec_version the verifier doesn’t know aboutunsupported_spec_version
Cross-firm replay — pack from firm A presented as if from firm Bsignature_invalid

Runtime compatibility

The library is pure JS — no Node-only APIs except node:fs (used only by the CLI wrapper, not the core library). Runs in Node 18+, Cloudflare Workers, and modern browsers.

Error vocabulary (normative)

The following error codes are the public contract. Verifiers in other languages MUST emit the same codes for the same conditions:

License

Apache 2.0.

Conformance Suite — Govern Spec