Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions scripts/checks/extract-installer-pins.mts
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,8 @@ const TRUSTED_OPENSHELL_RELEASES: readonly OpenShellReleaseTrust[] = [
runtimeTemplateSha256: [
...V00116_SUPERVISOR_TEMPLATE_BASELINE_SHA256,
"dceba5ee9bf6d9cd20adf637d63d008c932f751c073bbb0a83cdce087518e917",
// Exact 0.1.2 selection with the merged #12928 thread-group process reader.
"31e6923609575d64ac36943e58218c801be366b782def8d33406df6e938ef5dd",
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
],
},
pinLayout: V00116_OPENSHELL_PIN_LAYOUT,
Expand Down
21 changes: 15 additions & 6 deletions test/helpers/openshell-installer-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,14 +176,23 @@ export function removeV00106OperationalTrust(source: string): string {
return `${withoutIdentity.slice(0, capabilityStart)}${withoutIdentity.slice(fallbackStart)}`;
}

export function prepareReleaseFixtureRuntime(repoRoot: string, root: string): void {
export function prepareReleaseFixtureRuntime(
repoRoot: string,
root: string,
options: { currentProcessReader?: boolean } = {},
): void {
const runtimePath = "src/lib/onboard/docker-driver-gateway-runtime.ts";
const candidatePins = fs.readFileSync(path.join(root, runtimePath), "utf8");
// The 0.1.2 release fixture predates the shared process reader. Keep its
// operational runtime bytes on the independently trusted historical template.
const source = selectHistoricalGatewayProcessReader(
fs.readFileSync(path.join(repoRoot, runtimePath), "utf8"),
);
const checkoutSource = fs.readFileSync(path.join(repoRoot, runtimePath), "utf8");
// By default the 0.1.2 release fixture predates the shared process reader, so keep
// its operational runtime bytes on the independently trusted historical template.
// currentProcessReader selects the checkout's thread-group reader for 0.1.2 instead.
const source = options.currentProcessReader
? checkoutSource.replace(
'const QUALIFIED_STABLE_OPENSHELL_VERSION = "0.0.116";',
'const QUALIFIED_STABLE_OPENSHELL_VERSION = "0.1.2";',
)
: selectHistoricalGatewayProcessReader(checkoutSource);
const prepared = source.replace(
/const OPENSHELL_SUPERVISOR_MANIFEST_DIGESTS: Readonly<Record<string, string>> = \{[\s\S]*?\n\};/,
candidatePins.trim(),
Expand Down
8 changes: 8 additions & 0 deletions test/install/installer-hash-check.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,14 @@ describe("installer hash verification", () => {
]);
});

it("admits only the exact thread-group supervisor template with OpenShell 0.1.2", () => {
const root = createFixture("0.1.2");
prepareReleaseFixtureRuntime(REPO_ROOT, root, { currentProcessReader: true });
const run = () => spawnSync("node", preparedReleaseArgs(REPO_ROOT, root), { encoding: "utf8" });
expect(run().status).toBe(0);
fs.appendFileSync(path.join(root, "src/lib/onboard/docker-driver-gateway-runtime.ts"), "//x");
expect(run()).toMatchObject({ status: 1, stderr: expect.stringContaining("not base-trusted") });
});
it.each(V012_TRUST_MUTATIONS)(
"rejects an altered OpenShell 0.1.2 %s",
(_label, name, value, diagnostic) => {
Expand Down
Loading