Pool host-approved restricted code with scoped and fair graph execution

This commit is contained in:
Timothy J. Aveni
2026-10-07 16:47:19 -07:00
parent c8c56d8ea7
commit 391f02f78a
5 changed files with 160 additions and 45 deletions
+6 -2
View File
@@ -11,8 +11,12 @@ import {
} from "./metadata.js";
const rootPattern = /^\/nix\/store\/[a-z0-9]{32}-[^/\s]+$/;
async function readJson(root: string, file: string, scope: CandidateMetadataScope): Promise<any> {
const bytes = await readCandidateMetadata(join(root, file), scope, 32 * 1024 * 1024);
return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(bytes));
const input = await readCandidateMetadata(join(root, file), scope, 32 * 1024 * 1024);
try {
return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(input.bytes));
} finally {
input.releaseInput();
}
}
/** Load the checked Nix output, preserving its original compilation and provenance.
* The selected toolchain validates generated code during the build. This loader