Skip to content

Commit 1895f49

Browse files
committed
Repair public launch CI readiness checks
1 parent ccb53bd commit 1895f49

5 files changed

Lines changed: 55 additions & 16 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ jobs:
149149
node-version: "24"
150150
cache: npm
151151

152+
- name: Install Foundry
153+
uses: foundry-rs/foundry-toolchain@v1
154+
152155
- name: Install services dependencies
153156
run: npm ci
154157

‎infra/scripts/agent-bonds-operator-bundle.mjs‎

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/usr/bin/env node
2-
import { cpSync, existsSync, mkdirSync, writeFileSync } from "node:fs";
2+
import { cpSync, existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
33
import { dirname, resolve } from "node:path";
44
import { fileURLToPath } from "node:url";
55

66
const REPO_ROOT = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
77
const OUT_DIR = resolve(REPO_ROOT, "out/agent-bonds-operator-bundle");
88

9-
const FILES = [
9+
const REQUIRED_FILES = [
1010
"fixtures/agent-bonds/agent-bonds-v1.json",
1111
"fixtures/agent-bonds/replay-report.json",
1212
"fixtures/agent-bonds/economic-sim-report.json",
@@ -28,8 +28,6 @@ const FILES = [
2828
"schemas/flowmemory/agent-bonds-owner-inputs.schema.json",
2929
"infra/scripts/agent-bonds-public-launch-assemble.mjs",
3030
"infra/scripts/agent-bonds-owner-inputs-validate.mjs",
31-
"devnet/local/agent-bonds-readiness/agent-bonds-readiness-report.json",
32-
"devnet/local/agent-bonds-readiness/goal-audit-report.json",
3331
"docs/AGENT_BONDS_PUBLIC_LAUNCH_BOUNDARY.md",
3432
"docs/OPERATIONS/AGENT_BONDS_CAPPED_PILOT_RUNBOOK.md",
3533
"docs/OPERATIONS/AGENT_BONDS_MONITORING_AND_RECOVERY.md",
@@ -45,20 +43,53 @@ const FILES = [
4543
"docs/reviews/AGENT_BONDS_GOAL_COMPLETION_MATRIX.md",
4644
];
4745

46+
const OPTIONAL_GENERATED_FILES = [
47+
"devnet/local/agent-bonds-readiness/agent-bonds-readiness-report.json",
48+
"devnet/local/agent-bonds-readiness/goal-audit-report.json",
49+
];
50+
51+
function copyIntoBundle(relativePath) {
52+
const source = resolve(REPO_ROOT, relativePath);
53+
if (!existsSync(source)) {
54+
return false;
55+
}
56+
const destination = resolve(OUT_DIR, relativePath);
57+
mkdirSync(dirname(destination), { recursive: true });
58+
cpSync(source, destination, { force: true });
59+
return true;
60+
}
61+
4862
function main() {
4963
process.chdir(REPO_ROOT);
64+
rmSync(OUT_DIR, { recursive: true, force: true });
5065
mkdirSync(OUT_DIR, { recursive: true });
5166
const copied = [];
52-
for (const relativePath of FILES) {
53-
const source = resolve(REPO_ROOT, relativePath);
54-
if (!existsSync(source)) {
67+
const skippedOptional = [];
68+
69+
for (const relativePath of REQUIRED_FILES) {
70+
if (!copyIntoBundle(relativePath)) {
5571
throw new Error(`missing bundle file: ${relativePath}`);
5672
}
57-
const destination = resolve(OUT_DIR, relativePath);
58-
mkdirSync(dirname(destination), { recursive: true });
59-
cpSync(source, destination, { force: true });
6073
copied.push(relativePath);
6174
}
75+
76+
for (const relativePath of OPTIONAL_GENERATED_FILES) {
77+
if (copyIntoBundle(relativePath)) {
78+
copied.push(relativePath);
79+
} else {
80+
skippedOptional.push(relativePath);
81+
}
82+
}
83+
84+
writeFileSync(resolve(OUT_DIR, "manifest.json"), `${JSON.stringify({
85+
schema: "flowmemory.agent_bonds.operator_bundle_manifest.v1",
86+
requiredFiles: REQUIRED_FILES,
87+
optionalGeneratedFiles: OPTIONAL_GENERATED_FILES.map((path) => ({
88+
path,
89+
included: !skippedOptional.includes(path),
90+
})),
91+
}, null, 2)}\n`, "utf8");
92+
6293
writeFileSync(resolve(OUT_DIR, "README.txt"), [
6394
"FlowMemory Agent Bonds operator bundle",
6495
"",
@@ -71,7 +102,7 @@ function main() {
71102
"7. hand external reviewer the review packet",
72103
""
73104
].join("\n"), "utf8");
74-
console.log(JSON.stringify({ service: "flowmemory-agent-bonds-operator-bundle", outDir: OUT_DIR, files: copied.length }, null, 2));
105+
console.log(JSON.stringify({ service: "flowmemory-agent-bonds-operator-bundle", outDir: OUT_DIR, files: copied.length, skippedOptional }, null, 2));
75106
}
76107

77108
main();

‎infra/scripts/agent-bonds-public-launch-validate.mjs‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function main() {
106106

107107
const issues = [];
108108
requireExisting(approval.pilotConfigPath, "pilotConfigPath", issues);
109-
requireExisting(approval.readinessReportPath, "readinessReportPath", issues);
109+
const readinessReportExists = requireExisting(approval.readinessReportPath, "readinessReportPath", issues);
110110
requireExisting(approval.operatorBundlePath, "operatorBundlePath", issues);
111111

112112
if (approval.externalReview.completed !== true) {
@@ -143,9 +143,11 @@ function main() {
143143
issues.push("launch approval networkName must match pilot config networkName");
144144
}
145145

146-
const readiness = readJson(resolve(root, approval.readinessReportPath));
147-
if (readiness.ok !== true) {
148-
issues.push("readiness report must be green");
146+
if (readinessReportExists) {
147+
const readiness = readJson(resolve(root, approval.readinessReportPath));
148+
if (readiness.ok !== true) {
149+
issues.push("readiness report must be green");
150+
}
149151
}
150152

151153
validateAttestation(ajv, approval.externalReview, approval.externalReview.reportPath, externalReviewSchema, "externalReview", issues);

‎services/flowmemory/test/agent-bonds-packager.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import assert from "node:assert/strict";
2-
import { mkdtempSync, writeFileSync } from "node:fs";
2+
import { mkdtempSync, mkdirSync, writeFileSync } from "node:fs";
33
import { tmpdir } from "node:os";
44
import { join, resolve, dirname } from "node:path";
55
import { fileURLToPath } from "node:url";
@@ -14,6 +14,7 @@ const maybeMetaTest = process.env.FLOWMEMORY_SKIP_AGENT_BONDS_META === "1" ? tes
1414

1515

1616
function seedGreenReadinessReport(): void {
17+
mkdirSync(dirname(READINESS_REPORT_PATH), { recursive: true });
1718
writeFileSync(READINESS_REPORT_PATH, JSON.stringify({ schema: "flowmemory.agent_bonds.readiness_report.v1", ok: true, steps: [] }, null, 2));
1819
}
1920

‎services/flowmemory/test/agent-bonds-validation.test.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const maybeMetaTest = process.env.FLOWMEMORY_SKIP_AGENT_BONDS_META === "1" ? tes
1414

1515

1616
function seedGreenReadinessReport(): void {
17+
mkdirSync(dirname(READINESS_REPORT_PATH), { recursive: true });
1718
writeFileSync(READINESS_REPORT_PATH, JSON.stringify({ schema: "flowmemory.agent_bonds.readiness_report.v1", ok: true, steps: [] }, null, 2));
1819
}
1920

@@ -30,6 +31,7 @@ function runNodeScript(args: string[]): { status: number | null; stdout: string;
3031
}
3132

3233
maybeMetaTest("public launch validator fails on unresolved external sign-offs", () => {
34+
seedGreenReadinessReport();
3335
const result = runNodeScript([
3436
"infra/scripts/agent-bonds-public-launch-validate.mjs",
3537
"fixtures/agent-bonds/launch-approval.template.json",

0 commit comments

Comments
 (0)