Verification & Trust
How PlainCompile proves what passed, and what remains unverified
A buyer or engineering team should never have to trust a self-signed claim inside a file. PlainCompile separates three distinct guarantees, requires an independently pinned signer key, and binds the contract, source revision, and acceptance output into the signed payload.
1. Protected contract baseline (and deployment condition)
The local agent kit stores intent, architecture, and observable requirements under .plaincompile/ and locks them with SHA-256 hashes and optional Ed25519 signatures. In team setups, keep the baseline outside the coding agent’s write authority—on a protected git branch (--baseline-ref origin/main), an external read-only file (--baseline-file), or signed by an approver key kept outside the repository (.plaincompile/approver.pub).
Deployment condition: Local unlocked runs are permitted during initial setup unless baseline enforcement is turned on. In CI and enforced workflows, set PLAINCOMPILE_REQUIRE_BASELINE=1 (or pass --require-baseline) together with an external baseline/key so the agent cannot bypass approval by leaving .plaincompile/contract.lock.json absent.
2. Behavioral acceptance checks (authenticated from signed artifact hashes)
For hosted Windows apps, behavioral checks run against the compiled installer in a disposable clean Windows x64 VM with network disabled. Results are written to out/acceptance.json inside the sealed build:
- Passed automated check: Confirms the listed assertion ran against fresh test data inside the installed application.
- Failed check (stops acceptance): Prevents a green verdict and surfaces assertion output; failed
heldOutchecks redact expected details as"did not pass (held-out check)". - Unverified condition: Hardware devices (printers, scales, serial ports), external paid APIs, and untested edge cases stay listed as
unverified.
3. Independent Ed25519 witness verdict & what is authenticated
Once the clean-machine build container stops, an isolated witness container signs the canonical payload using Ed25519:
{
"version": 1,
"jobId": "<32-hex>",
"attemptId": "<32-hex>",
"challenge": "<64-hex>",
"projectSha256": "<sha256 of canonical projectJson (contains contract + sourceRevision)>",
"artifacts": [{ "path", "role", "sha256", "bytes" }],
"reportSha256": "<sha256 of witness reportJson>"
}- Signer authentication: Any embedded key inside a bundle is ignored unless it matches an independently supplied public key or pinned SHA-256 fingerprint. Substituting a different signing key fails verification even if its signature is mathematically valid.
- Authenticated fields:
witness.verdict.payload,projectSha256,authenticatedInputs.projectJson(plaincompile.contract.json&plaincompile.source-revision.json),artifacts[],authenticatedArtifacts["out/acceptance.json"](all per-check statuses), andwitness.reportJson. - Unauthenticated display metadata: Top-level convenience fields not reproduced inside the signed inputs/artifacts—such as prose
environment,signatureScope, and top-levellimitationsoutsidewitness.reportJson—are flagged asunauthenticatedFieldsby the verifier.
Out-of-band key & representative evidence bundles
Live release & production witness key
Before running or trusting a hosted build, inspect the deployed commit, downloadable agent-kit ZIP checksum, and live production witness key independently:
- Deployed commit:
loading… - Agent kit ZIP (
/downloads/plaincompile-agent-kit.zip):loading… - Production witness key fingerprint:
loading… - Release metadata JSON (/api/release) · Download witness-keys.json · Download production-witness.pub
For evaluating the sample bundles below, pin the sample witness key independently using either the out-of-band key manifest or its SHA-256 fingerprint (distinct from live production witness keys):
- Sample key ID:
sample-witness-2026-v1(representative sample only) - Pinned SPKI PEM SHA-256 fingerprint:
0793ed6ecb08dddfd6f0d88a388330ee2245524d70d27acb7cd8855398c9cfb9 - Download witness-keys.json (out-of-band key manifest) · Download sample-witness.pub
- Download passing evidence bundle (JSON, Ed25519 signed)
- Download rejected build & contract-drift bundle (JSON)
Verify independently on your machine
With Node.js 22+ installed, verify against the independent key manifest or pinned fingerprint (omitting both fails closed):
npx -y plaincompile verify-evidence evidence-passing-bundle.json --trust-keys witness-keys.json
# or pin the fingerprint directly:
npx -y plaincompile verify-evidence evidence-passing-bundle.json --key-fingerprint 0793ed6ecb08dddfd6f0d88a388330ee2245524d70d27acb7cd8855398c9cfb9Or run this zero-dependency Node.js check directly. It pins the expected signer fingerprint, verifies the Ed25519 signature, authenticates contract and sourceRevision from projectSha256, and authenticates acceptance from out/acceptance.json:
node -e '
const fs = require("node:fs"), crypto = require("node:crypto");
const PINNED_KEY_SHA256 = "0793ed6ecb08dddfd6f0d88a388330ee2245524d70d27acb7cd8855398c9cfb9";
const b = JSON.parse(fs.readFileSync("evidence-passing-bundle.json", "utf8"));
const sha = x => crypto.createHash("sha256").update(x).digest("hex");
const normPub = crypto.createPublicKey(b.witness.publicKeyPem).export({ type: "spki", format: "pem" }).toString();
const keyFp = sha(Buffer.from(normPub, "utf8"));
const signerOk = crypto.timingSafeEqual(Buffer.from(keyFp, "hex"), Buffer.from(PINNED_KEY_SHA256, "hex"));
const obs = JSON.parse(b.witness.reportJson);
const artifacts = [...b.artifacts].map(({path,role,sha256,bytes}) => ({path,role,sha256,bytes})).sort((a,c) => a.path.localeCompare(c.path,"en"));
const expected = { version: 1, jobId: b.witness.verdict.payload.jobId, attemptId: b.witness.verdict.payload.attemptId, challenge: b.witness.verdict.payload.challenge, projectSha256: b.projectSha256, artifacts, reportSha256: sha(Buffer.from(b.witness.reportJson, "utf8")) };
const payloadOk = JSON.stringify(expected) === JSON.stringify(b.witness.verdict.payload);
const sigOk = signerOk && crypto.verify(null, Buffer.from(JSON.stringify(expected), "utf8"), normPub, Buffer.from(b.witness.verdict.signature, "base64"));
const projOk = sha(Buffer.from(b.authenticatedInputs.projectJson, "utf8")) === b.projectSha256;
const projFiles = JSON.parse(b.authenticatedInputs.projectJson).files;
const embContract = JSON.parse(projFiles.find(f => f.path === "plaincompile.contract.json").content);
const embRev = JSON.parse(projFiles.find(f => f.path === "plaincompile.source-revision.json").content);
const contractOk = projOk && JSON.stringify(b.contract) === JSON.stringify(embContract);
const revOk = projOk && JSON.stringify(b.sourceRevision) === JSON.stringify(embRev);
const accRaw = b.authenticatedArtifacts["out/acceptance.json"];
const accMeta = artifacts.find(a => a.path === "out/acceptance.json");
const accOk = sha(Buffer.from(accRaw, "utf8")) === accMeta.sha256 && JSON.stringify(b.acceptance) === JSON.stringify(JSON.parse(accRaw));
console.log({ signerOk, payloadOk, sigOk, contractOk, revOk, accOk, coverage: obs.coverage });
if (!signerOk || !payloadOk || !sigOk || !contractOk || !revOk || !accOk) process.exit(1);
'