Supply exact private platform source to sealed checks without private evaluator egress

This commit is contained in:
Timothy J. Aveni
2026-10-11 15:54:44 -07:00
parent fa698dd306
commit 0f41b12ca0
4 changed files with 44 additions and 4 deletions
+15
View File
@@ -1,5 +1,20 @@
#!/usr/bin/env node
import { loadQuixosLock } from "./loader.js";
import { parseQuixosLockDocument } from "./parser.js";
import { readFile, stat } from "node:fs/promises";
// A trusted fetcher can inspect the root's declared platform pin without
// following authored import paths or evaluating Nix. The input is a fetched
// Git blob, not a filesystem tree provided by an author.
if (process.argv[2] === "--platform-only") {
const filename = process.argv[3];
if (process.argv.length !== 4 || !filename || (await stat(filename)).size > 1024 * 1024)
throw Error("INVALID_PLATFORM_SOURCE_LOCK");
const result = parseQuixosLockDocument(await readFile(filename, "utf8"));
if (!result.ok || result.document.kind !== "root") throw Error("INVALID_PLATFORM_SOURCE_LOCK");
console.log(JSON.stringify({ repository: result.document.quixos.repository, commit: result.document.quixos.commit }));
process.exit(0);
}
const fileName = process.argv[2];
if (!fileName || process.argv.length !== 3) {