elizaos--eliza
426e9eeabd
Voice Workbench / headless workbench (mocked backends) (push) Has been cancelled
Voice Workbench / real acoustic lane (nightly, provisioned only) (push) Has been cancelled
ci / test (push) Has been cancelled
ci / lint-and-format (push) Has been cancelled
ci / build (push) Has been cancelled
ci / dev-startup (push) Has been cancelled
gitleaks / gitleaks (push) Has been cancelled
Markdown Links / Relative Markdown Links (push) Has been cancelled
Quality (Extended) / Homepage Build (PR smoke) (push) Has been cancelled
Quality (Extended) / Comment-only diff guard (push) Has been cancelled
Quality (Extended) / Format + Type Safety Ratchet (push) Has been cancelled
Quality (Extended) / Develop Gate (secret scan + UI determinism) (push) Has been cancelled
Quality (Extended) / Develop Gate (lint) (push) Has been cancelled
Chat shell gestures / Chat shell gesture + parity e2e (push) Has been cancelled
Cloud Gateway Discord / Test (push) Has been cancelled
Benchmark Bridge Tests / benchmark (bunx @biomejs/biome check packages/lifeops-bench/src, benchmark-lint) (push) Has been cancelled
Benchmark Bridge Tests / benchmark (bunx vitest run --config packages/lifeops-bench/vitest.config.ts --root packages/lifeops-bench --passWithNoTests, benchmark-tests) (push) Has been cancelled
Build Agent Image / build-and-push (push) Has been cancelled
Dev Smoke / bun run dev onboarding chat (push) Has been cancelled
Dev Smoke / Vite HMR dependency-level smoke (push) Has been cancelled
Electrobun Submodule Guard / electrobun gitlink is fetchable (push) Has been cancelled
Publish @elizaos/example-code / check_npm (push) Has been cancelled
Publish @elizaos/example-code / publish_npm (push) Has been cancelled
Publish @elizaos/plugin-elizacloud / verify_version (push) Has been cancelled
Publish @elizaos/plugin-elizacloud / publish_npm (push) Has been cancelled
Sandbox Live Smoke / Sandbox live smoke (push) Has been cancelled
Snap Build & Test / Build Snap (amd64) (push) Has been cancelled
Snap Build & Test / Build Snap (arm64) (push) Has been cancelled
Test Packaging / elizaos CLI global-install smoke (node + bun) (push) Has been cancelled
Cloud Gateway Webhook / Test (push) Has been cancelled
Cloud Tests / lint-and-types (push) Has been cancelled
Cloud Tests / unit-tests (push) Has been cancelled
Cloud Tests / integration-tests (push) Has been cancelled
Cloud Tests / e2e-tests (push) Has been cancelled
CodeQL Advanced / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Apps Worker (Product 2) / Determine environment (push) Has been cancelled
Deploy Apps Worker (Product 2) / Deploy apps worker to apps-control host (${{ needs.determine-env.outputs.environment }}) (push) Has been cancelled
Deploy Eliza Provisioning Worker / Determine environment (push) Has been cancelled
Deploy Eliza Provisioning Worker / Deploy worker to Hetzner host (${{ needs.determine-env.outputs.environment }} @ ${{ needs.determine-env.outputs.deployment_sha }}) (push) Has been cancelled
Dev Smoke / Classify changed paths (push) Has been cancelled
supply-chain / sbom (push) Has been cancelled
supply-chain / vulnerability-scan (push) Has been cancelled
Build, Push & Deploy to Phala Cloud / build-and-push (push) Has been cancelled
Test Packaging / Validate Packaging Configs (push) Has been cancelled
Test Packaging / Build & Test PyPI Package (push) Has been cancelled
Test Packaging / PyPI on Python ${{ matrix.python }} (push) Has been cancelled
Test Packaging / Pack & Test JS Tarballs (push) Has been cancelled
UI Fixture E2E / ui-fixture-e2e (push) Has been cancelled
UI Fixture E2E / fixture-e2e (push) Has been cancelled
UI Story Gate / story-gate (push) Has been cancelled
vault-ci / test (macos-latest) (push) Has been cancelled
vault-ci / test (ubuntu-latest) (push) Has been cancelled
vault-ci / test (windows-latest) (push) Has been cancelled
vault-ci / app-core wiring tests (push) Has been cancelled
verify-patches / verify patches/CHECKSUMS.sha256 (push) Has been cancelled
Voice Benchmark Smoke / voice-emotion fixture smoke (push) Has been cancelled
Voice Benchmark Smoke / voiceagentbench fixture smoke (push) Has been cancelled
Voice Benchmark Smoke / voicebench-quality unit smoke (push) Has been cancelled
Voice Benchmark Smoke / voicebench TypeScript unit (no audio) (push) Has been cancelled
Voice Benchmark Smoke / voice bench smoke summary (push) Has been cancelled
Windows CI / windows ([bun run --cwd packages/app-core test bun run --cwd packages/elizaos test bun run --cwd packages/cloud/shared test], app-and-cli) (push) Has been cancelled
Windows CI / windows ([bun run --cwd packages/scenario-runner test bun run --cwd packages/vault test bun run --cwd packages/security test bun run --cwd plugins/plugin-coding-tools test], framework-packages) (push) Has been cancelled
Windows CI / windows ([bun run --cwd plugins/plugin-elizacloud test bun run --cwd plugins/plugin-discord test bun run --cwd plugins/plugin-anthropic test bun run --cwd plugins/plugin-openai test bun run --cwd plugins/plugin-app-control test bun run --cwd plugins/pl… (push) Has been cancelled
Windows CI / windows ([node packages/scripts/run-turbo.mjs run build --filter=@elizaos/core --filter=@elizaos/shared --filter=@elizaos/agent --concurrency=4 node packages/scripts/run-bash-linux-only.mjs scripts/verify-riscv64-buildpaths.sh node packages/scripts/run… (push) Has been cancelled
Windows CI / windows ([node packages/scripts/run-turbo.mjs run typecheck --filter=@elizaos/core --filter=@elizaos/shared --filter=@elizaos/cloud-shared --concurrency=4 bun run --cwd packages/core test bun run --cwd packages/shared test], core-runtime, 75) (push) Has been cancelled
179 行
5.6 KiB
JavaScript
179 行
5.6 KiB
JavaScript
#!/usr/bin/env node
|
|
/**
|
|
* One-command local certification fallback (#14548). Runs the exact chain
|
|
* the vast.ai onstart runs — packages/evidence bundle:create →
|
|
* certify:rollup → certify:sign — on this machine, so when vast is down or
|
|
* the API key is dead a certifier holding ELIZA_CERT_SIGNING_KEY can produce
|
|
* the same signed certification.json the develop→main gate verifies. Same
|
|
* commands, same output; the gate cannot tell the difference (by design —
|
|
* the signature is what matters).
|
|
*
|
|
* Signing enforces its own honesty: certify:sign refuses to sign
|
|
* mechanically non-pass subjects as pass, so "one command" cannot fabricate
|
|
* a green certification. Use --no-sign to stop after rollup, hand-review
|
|
* verdicts.json (waivers require notes), then run certify:sign yourself —
|
|
* that is the diligent-reviewer path the trust model expects.
|
|
*/
|
|
|
|
import { spawnSync } from "node:child_process";
|
|
import fs from "node:fs";
|
|
import os from "node:os";
|
|
import path from "node:path";
|
|
import { fileURLToPath } from "node:url";
|
|
|
|
const REPO_ROOT = path.resolve(
|
|
path.dirname(fileURLToPath(import.meta.url)),
|
|
"../..",
|
|
);
|
|
const SIGNING_KEY_ENV_VAR = "ELIZA_CERT_SIGNING_KEY";
|
|
const TIERS = ["cpu", "gpu", "full"];
|
|
|
|
const USAGE = `Usage: node scripts/vast/local-certify.mjs [--tier cpu|gpu|full] [options]
|
|
|
|
Options:
|
|
--tier <cpu|gpu|full> Certification tier (default: full)
|
|
--reviewer-id <id> Reviewer identity in the signed cert (default: $USER@host)
|
|
--no-sign Stop after rollup for hand review of verdicts.json
|
|
--help This text
|
|
|
|
Requires env ${SIGNING_KEY_ENV_VAR} (PEM or base64-wrapped PEM) unless --no-sign.
|
|
Output: the bundle dir under evidence/runs/ with certification.json inside,
|
|
plus a copy of certification.json at the repo root ready to commit on the
|
|
promotion branch (bundle → evidence/bundle/ per .github/certification/README.md).`;
|
|
|
|
function parseArgs(argv) {
|
|
const opts = {
|
|
tier: "full",
|
|
reviewerId: `${os.userInfo().username}@${os.hostname()}`,
|
|
sign: true,
|
|
};
|
|
for (let index = 0; index < argv.length; index += 1) {
|
|
const arg = argv[index];
|
|
if (arg === "--tier") {
|
|
opts.tier = argv[++index];
|
|
if (!TIERS.includes(opts.tier)) {
|
|
throw new Error(
|
|
`--tier must be one of ${TIERS.join("|")}, got: ${opts.tier}`,
|
|
);
|
|
}
|
|
} else if (arg === "--reviewer-id") {
|
|
const value = argv[++index];
|
|
if (!value) throw new Error("--reviewer-id requires a value");
|
|
opts.reviewerId = value;
|
|
} else if (arg === "--no-sign") {
|
|
opts.sign = false;
|
|
} else if (arg === "--help") {
|
|
opts.help = true;
|
|
} else {
|
|
throw new Error(`unknown argument: ${arg}\n\n${USAGE}`);
|
|
}
|
|
}
|
|
return opts;
|
|
}
|
|
|
|
function run(label, command, args) {
|
|
console.log(`\n[local-certify] ${label}: ${command} ${args.join(" ")}`);
|
|
const result = spawnSync(command, args, { cwd: REPO_ROOT, stdio: "inherit" });
|
|
if (result.status !== 0) {
|
|
throw new Error(`${label} failed (exit ${result.status ?? "signal"})`);
|
|
}
|
|
}
|
|
|
|
function newestBundleDir() {
|
|
const runsDir = path.join(REPO_ROOT, "evidence", "runs");
|
|
const entries = fs
|
|
.readdirSync(runsDir, { withFileTypes: true })
|
|
.filter((entry) => entry.isDirectory())
|
|
.map((entry) => {
|
|
const dir = path.join(runsDir, entry.name);
|
|
return { dir, mtimeMs: fs.statSync(dir).mtimeMs };
|
|
})
|
|
.sort((a, b) => b.mtimeMs - a.mtimeMs);
|
|
if (entries.length === 0) {
|
|
throw new Error(`no bundle directory appeared under ${runsDir}`);
|
|
}
|
|
return entries[0].dir;
|
|
}
|
|
|
|
function main(argv, env) {
|
|
const opts = parseArgs(argv);
|
|
if (opts.help) {
|
|
console.log(USAGE);
|
|
return 0;
|
|
}
|
|
if (opts.sign && !env[SIGNING_KEY_ENV_VAR]) {
|
|
console.error(
|
|
`[local-certify] no signing key: export ${SIGNING_KEY_ENV_VAR} (or use --no-sign to produce reviewable verdicts without signing)`,
|
|
);
|
|
return 2;
|
|
}
|
|
|
|
run("bundle:create", "bun", [
|
|
"run",
|
|
"--cwd",
|
|
"packages/evidence",
|
|
"bundle:create",
|
|
"--",
|
|
"--tier",
|
|
opts.tier,
|
|
]);
|
|
const bundleDir = newestBundleDir();
|
|
const verdictsPath = path.join(bundleDir, "verdicts.json");
|
|
run("certify:rollup", "bun", [
|
|
"run",
|
|
"--cwd",
|
|
"packages/evidence",
|
|
"certify:rollup",
|
|
"--",
|
|
"--bundle",
|
|
bundleDir,
|
|
"--out",
|
|
verdictsPath,
|
|
]);
|
|
|
|
if (!opts.sign) {
|
|
console.log(`\n[local-certify] stopped before signing (--no-sign).`);
|
|
console.log(`[local-certify] review ${verdictsPath}, then:`);
|
|
console.log(
|
|
` bun run --cwd packages/evidence certify:sign -- --bundle ${bundleDir} --verdicts ${verdictsPath} --reviewer-id <you> --reviewer-kind human`,
|
|
);
|
|
return 0;
|
|
}
|
|
|
|
run("certify:sign", "bun", [
|
|
"run",
|
|
"--cwd",
|
|
"packages/evidence",
|
|
"certify:sign",
|
|
"--",
|
|
"--bundle",
|
|
bundleDir,
|
|
"--verdicts",
|
|
verdictsPath,
|
|
"--reviewer-id",
|
|
opts.reviewerId,
|
|
"--reviewer-kind",
|
|
"human",
|
|
]);
|
|
|
|
const certSource = path.join(bundleDir, "certification.json");
|
|
const certTarget = path.join(REPO_ROOT, "certification.json");
|
|
fs.copyFileSync(certSource, certTarget);
|
|
console.log(`\n[local-certify] done.`);
|
|
console.log(`[local-certify] bundle: ${bundleDir}`);
|
|
console.log(
|
|
`[local-certify] certification: ${certTarget} (copied from the bundle)`,
|
|
);
|
|
console.log(
|
|
`[local-certify] for a promotion PR also commit the bundle: rm -rf evidence/bundle && mkdir -p evidence && cp -R '${bundleDir}' evidence/bundle`,
|
|
);
|
|
return 0;
|
|
}
|
|
|
|
try {
|
|
process.exitCode = main(process.argv.slice(2), process.env);
|
|
} catch (error) {
|
|
console.error(`[local-certify] ${error.message}`);
|
|
process.exitCode = 1;
|
|
}
|