plaincompile

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:

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>"
}

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:

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):

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 0793ed6ecb08dddfd6f0d88a388330ee2245524d70d27acb7cd8855398c9cfb9

Or 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);
'