Vendor OpenClaw source as Adolf fork baseline
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled

Adolf is a fork/vendored clone of github.com/openclaw/openclaw (v2026.6.11),
free to diverge. Tree copied sans upstream .git; upstream remote added for
future syncs. Node pinned to 24 (.nvmrc); engines already require >=22.19.
Preserves docs/ARCHITECTURE.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LeqyaxJF2nbRXJtae2kNB2
This commit is contained in:
2026-07-05 09:36:54 +00:00
parent 3216769225
commit bedb527145
21108 changed files with 6010766 additions and 0 deletions

View File

@@ -0,0 +1,222 @@
#!/usr/bin/env node
// Verifies Docker image attestations cover required platforms and predicates.
import { execFileSync } from "node:child_process";
import process from "node:process";
const ATTESTATION_REFERENCE_TYPE = "attestation-manifest";
const EXPECTED_ATTESTATION_ARTIFACT_TYPE = "application/vnd.docker.attestation.manifest.v1+json";
const REQUIRED_PREDICATES = ["https://spdx.dev/Document", "https://slsa.dev/provenance/v1"];
/**
* Rewrites an image reference to use the provided digest.
*/
export function imageRefForDigest(imageRef, digest) {
const atIndex = imageRef.indexOf("@");
if (atIndex >= 0) {
return `${imageRef.slice(0, atIndex)}@${digest}`;
}
const lastSlash = imageRef.lastIndexOf("/");
const tagIndex = imageRef.indexOf(":", lastSlash + 1);
const base = tagIndex >= 0 ? imageRef.slice(0, tagIndex) : imageRef;
return `${base}@${digest}`;
}
/**
* Parses os/architecture[/variant] platform strings.
*/
export function parsePlatform(value) {
const [os, architecture, variant] = value.split("/");
if (!os || !architecture || value.split("/").length > 3) {
throw new Error(`Invalid platform ${JSON.stringify(value)}. Expected os/architecture.`);
}
return { architecture, os, variant };
}
function formatPlatform(platform) {
return platform.variant
? `${platform.os}/${platform.architecture}/${platform.variant}`
: `${platform.os}/${platform.architecture}`;
}
function platformMatches(actual, expected) {
return (
actual?.os === expected.os &&
actual?.architecture === expected.architecture &&
(expected.variant ? actual?.variant === expected.variant : true)
);
}
function parseJson(raw, label) {
try {
return JSON.parse(raw);
} catch (error) {
const reason = error instanceof Error ? error.message : String(error);
throw new Error(`Failed to parse ${label}: ${reason}`, { cause: error });
}
}
/**
* Collects missing/mismatched attestation errors for required image platforms.
*/
export function collectDockerAttestationErrors(params) {
const {
imageRef,
index,
inspectAttestation,
requiredPlatforms,
requiredPredicates = REQUIRED_PREDICATES,
} = params;
const errors = [];
const manifests = Array.isArray(index?.manifests) ? index.manifests : [];
if (manifests.length === 0) {
return [`${imageRef}: expected an image index with manifest descriptors`];
}
for (const platform of requiredPlatforms) {
const platformLabel = formatPlatform(platform);
const imageManifest = manifests.find((entry) => platformMatches(entry.platform, platform));
if (!imageManifest?.digest) {
errors.push(`${imageRef}: missing image manifest for ${platformLabel}`);
continue;
}
const attestationDescriptors = manifests.filter(
(entry) =>
entry?.annotations?.["vnd.docker.reference.type"] === ATTESTATION_REFERENCE_TYPE &&
entry?.annotations?.["vnd.docker.reference.digest"] === imageManifest.digest &&
typeof entry.digest === "string" &&
entry.digest.length > 0,
);
if (attestationDescriptors.length === 0) {
errors.push(`${imageRef}: missing attestation manifest for ${platformLabel}`);
continue;
}
const predicates = new Set();
for (const descriptor of attestationDescriptors) {
const attestation = inspectAttestation(descriptor.digest);
if (
attestation?.artifactType !== undefined &&
attestation.artifactType !== EXPECTED_ATTESTATION_ARTIFACT_TYPE
) {
errors.push(
`${imageRef}: ${platformLabel} attestation ${descriptor.digest} has unexpected artifactType ${JSON.stringify(
attestation?.artifactType,
)}`,
);
}
for (const layer of attestation?.layers ?? []) {
const predicate = layer?.annotations?.["in-toto.io/predicate-type"];
if (typeof predicate === "string") {
predicates.add(predicate);
}
}
}
for (const predicate of requiredPredicates) {
if (!predicates.has(predicate)) {
errors.push(`${imageRef}: ${platformLabel} missing predicate ${predicate}`);
}
}
}
return errors;
}
function inspectRaw(imageRef) {
return execFileSync("docker", ["buildx", "imagetools", "inspect", "--raw", imageRef], {
encoding: "utf8",
maxBuffer: 20 * 1024 * 1024,
stdio: ["ignore", "pipe", "pipe"],
});
}
function readOptionValue(argv, index, optionName) {
const value = argv[index + 1];
if (value === undefined || value === "" || value.startsWith("-")) {
throw new Error(`${optionName} requires a value`);
}
return value;
}
export function parseArgs(argv) {
const imageRefs = [];
const requiredPlatforms = [];
for (let i = 0; i < argv.length; i += 1) {
const arg = argv[i];
if (arg === "--platform") {
requiredPlatforms.push(parsePlatform(readOptionValue(argv, i, arg)));
i += 1;
continue;
}
if (arg === "--help" || arg === "-h") {
return { help: true, imageRefs, requiredPlatforms };
}
if (arg?.startsWith("-")) {
throw new Error(`Unknown option: ${arg}`);
}
imageRefs.push(arg);
}
return { help: false, imageRefs, requiredPlatforms };
}
function printHelp() {
console.log(
`Usage: node scripts/verify-docker-attestations.mjs --platform linux/amd64 --platform linux/arm64 IMAGE...`,
);
}
async function main() {
const parsed = parseArgs(process.argv.slice(2));
if (parsed.help) {
printHelp();
return;
}
if (parsed.imageRefs.length === 0) {
throw new Error("At least one image reference is required.");
}
if (parsed.requiredPlatforms.length === 0) {
throw new Error("At least one --platform is required.");
}
const allErrors = [];
for (const imageRef of parsed.imageRefs) {
const index = parseJson(inspectRaw(imageRef), `${imageRef} index`);
const errors = collectDockerAttestationErrors({
imageRef,
index,
requiredPlatforms: parsed.requiredPlatforms,
inspectAttestation(digest) {
return parseJson(
inspectRaw(imageRefForDigest(imageRef, digest)),
`${imageRef} attestation ${digest}`,
);
},
});
if (errors.length === 0) {
console.log(
`Verified Docker attestations for ${imageRef}: ${parsed.requiredPlatforms
.map(formatPlatform)
.join(", ")}`,
);
}
allErrors.push(...errors);
}
if (allErrors.length > 0) {
for (const error of allErrors) {
console.error(`[docker-attestations] ${error}`);
}
process.exit(1);
}
}
if (import.meta.url === `file://${process.argv[1]}`) {
main().catch(
/** @param {unknown} error */ (error) => {
console.error(error instanceof Error ? error.message : String(error));
process.exit(1);
},
);
}