opencode-agent-orchestration-kit 1.0.39 → 1.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -3
- package/docs/models.md +1 -1
- package/docs/performance/native-tools-benchmark.md +33 -0
- package/docs/releases/v1.0.40.md +55 -0
- package/docs/sync-boundary.md +27 -0
- package/opencode/commands/loop-status.md +24 -0
- package/opencode/commands/loop.md +8 -0
- package/opencode/docs/ai/harness/agents.md +8 -0
- package/opencode/docs/ai/harness/checks.md +6 -0
- package/opencode/docs/ai/harness/commands.md +10 -0
- package/opencode/docs/ai/harness/orchestration-contracts.json +9 -1
- package/opencode/docs/ai/specs/mission-runtime.md +44 -0
- package/opencode/plugins/mission-runtime.test.mjs +46 -0
- package/opencode/plugins/mission-runtime.ts +41 -0
- package/opencode/scripts/check-harness.mjs +111 -0
- package/opencode/scripts/check-harness.test.mjs +37 -1
- package/opencode/scripts/loop-state.mjs +5 -0
- package/opencode/scripts/loop-state.test.mjs +13 -0
- package/opencode/scripts/mission-runtime-observer.d.mts +25 -0
- package/opencode/scripts/mission-runtime-observer.mjs +124 -0
- package/opencode/scripts/mission-runtime.test.mjs +97 -0
- package/opencode/scripts/mission-status.mjs +136 -0
- package/opencode/scripts/mission-status.test.mjs +196 -0
- package/opencode/scripts/project-capability-snapshot.mjs +2 -1
- package/opencode/scripts/project-capability-snapshot.test.mjs +17 -0
- package/opencode/scripts/runtime-permission-policy.mjs +72 -0
- package/opencode/scripts/runtime-permission-policy.test.mjs +89 -0
- package/opencode/tools/open_design.ts +1 -1
- package/package.json +3 -3
- package/scripts/benchmark-tool-paths.mjs +226 -0
- package/scripts/benchmark-tool-paths.test.mjs +29 -0
- package/scripts/check-public-boundary.mjs +89 -0
- package/scripts/check-public-boundary.test.mjs +32 -0
- package/scripts/check.sh +15 -10
- package/scripts/install-smoke.sh +17 -0
- package/scripts/manage-installation.mjs +90 -7
- package/scripts/manage-installation.test.mjs +36 -0
- package/scripts/package-smoke.mjs +52 -3
- package/scripts/package-smoke.test.mjs +6 -6
- package/scripts/version.test.mjs +2 -2
|
@@ -310,16 +310,23 @@ export function assertSafeTarget({ targetRoot, repositoryRoot, sourceRoot, fsOps
|
|
|
310
310
|
return target;
|
|
311
311
|
}
|
|
312
312
|
|
|
313
|
-
function assertExactKeys(value, expected, label) {
|
|
313
|
+
function assertExactKeys(value, expected, label, options = {}) {
|
|
314
314
|
if (!value || typeof value !== "object" || Array.isArray(value)) throw invalid(`${label} must be an object`);
|
|
315
315
|
const actual = Object.keys(value).sort();
|
|
316
316
|
const wanted = [...expected].sort();
|
|
317
|
+
const optional = new Set(options.optional ?? []);
|
|
317
318
|
const unknown = actual.filter((key) => !wanted.includes(key));
|
|
318
|
-
const missing = wanted.filter((key) => !actual.includes(key));
|
|
319
|
+
const missing = wanted.filter((key) => !actual.includes(key) && !optional.has(key));
|
|
319
320
|
if (unknown.length > 0) throw invalid(`${label} has unknown field: ${unknown[0]}`);
|
|
320
321
|
if (missing.length > 0) throw invalid(`${label} is missing field: ${missing[0]}`);
|
|
321
322
|
}
|
|
322
323
|
|
|
324
|
+
function assertCommit(value, label) {
|
|
325
|
+
if (typeof value !== "string" || !/^[0-9a-f]{40}$/.test(value)) {
|
|
326
|
+
throw invalid(`${label} must be a lowercase Git commit`);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
323
330
|
function assertHash(value, label) {
|
|
324
331
|
if (typeof value !== "string" || !/^[0-9a-f]{64}$/.test(value)) throw invalid(`${label} must be a lowercase SHA-256 digest`);
|
|
325
332
|
}
|
|
@@ -336,6 +343,11 @@ const MANIFEST_KEYS = [
|
|
|
336
343
|
"schema_version", "manager", "kit_version", "payload_sha256", "created_at", "updated_at",
|
|
337
344
|
"last_transaction_id", "owned_files", "preserved_files",
|
|
338
345
|
];
|
|
346
|
+
const OPTIONAL_MANIFEST_KEYS = ["release_provenance"];
|
|
347
|
+
const RELEASE_CONTEXT_KEYS = ["source_commit", "public_commit", "checks_result"];
|
|
348
|
+
const RELEASE_PROVENANCE_KEYS = [
|
|
349
|
+
"source_commit", "public_commit", "kit_version", "payload_sha256", "checks_result",
|
|
350
|
+
];
|
|
339
351
|
const OWNED_KEYS = ["path", "sha256", "mode"];
|
|
340
352
|
const PRESERVED_KEYS = [
|
|
341
353
|
"path", "observed_sha256", "observed_mode", "source_sha256", "source_mode",
|
|
@@ -346,7 +358,7 @@ const ACK_KEYS = [
|
|
|
346
358
|
];
|
|
347
359
|
|
|
348
360
|
export function validateManifest(manifest) {
|
|
349
|
-
assertExactKeys(manifest, MANIFEST_KEYS, "manifest");
|
|
361
|
+
assertExactKeys(manifest, [...MANIFEST_KEYS, ...OPTIONAL_MANIFEST_KEYS], "manifest", { optional: OPTIONAL_MANIFEST_KEYS });
|
|
350
362
|
if (manifest.schema_version !== SCHEMA_VERSION) throw invalid("manifest schema_version must be 1");
|
|
351
363
|
if (manifest.manager !== "opencode-agent-orchestration-kit") throw invalid("manifest manager is invalid");
|
|
352
364
|
try {
|
|
@@ -363,6 +375,12 @@ export function validateManifest(manifest) {
|
|
|
363
375
|
if (!Array.isArray(manifest.owned_files) || !Array.isArray(manifest.preserved_files)) {
|
|
364
376
|
throw invalid("manifest ownership lists must be arrays");
|
|
365
377
|
}
|
|
378
|
+
if (manifest.release_provenance !== undefined) {
|
|
379
|
+
validateReleaseProvenance(manifest.release_provenance, {
|
|
380
|
+
kitVersion: manifest.kit_version,
|
|
381
|
+
payloadSha256: manifest.payload_sha256,
|
|
382
|
+
});
|
|
383
|
+
}
|
|
366
384
|
|
|
367
385
|
const allPaths = new Set();
|
|
368
386
|
let previousPath = null;
|
|
@@ -407,6 +425,46 @@ export function validateManifest(manifest) {
|
|
|
407
425
|
return manifest;
|
|
408
426
|
}
|
|
409
427
|
|
|
428
|
+
export function validateReleaseProvenance(provenance, expected = {}) {
|
|
429
|
+
assertExactKeys(provenance, RELEASE_PROVENANCE_KEYS, "release_provenance");
|
|
430
|
+
assertCommit(provenance.source_commit, "release_provenance source_commit");
|
|
431
|
+
assertCommit(provenance.public_commit, "release_provenance public_commit");
|
|
432
|
+
try {
|
|
433
|
+
parseStableVersion(provenance.kit_version);
|
|
434
|
+
} catch (error) {
|
|
435
|
+
throw invalid(`release_provenance kit_version is invalid: ${error.message}`);
|
|
436
|
+
}
|
|
437
|
+
assertHash(provenance.payload_sha256, "release_provenance payload_sha256");
|
|
438
|
+
if (provenance.checks_result !== "passed") {
|
|
439
|
+
throw invalid("release_provenance checks_result must be passed");
|
|
440
|
+
}
|
|
441
|
+
if (expected.kitVersion !== undefined && provenance.kit_version !== expected.kitVersion) {
|
|
442
|
+
throw invalid("release_provenance kit_version does not match manifest");
|
|
443
|
+
}
|
|
444
|
+
if (expected.payloadSha256 !== undefined && provenance.payload_sha256 !== expected.payloadSha256) {
|
|
445
|
+
throw invalid("release_provenance payload_sha256 does not match manifest");
|
|
446
|
+
}
|
|
447
|
+
return provenance;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
function readReleaseContext(environment) {
|
|
451
|
+
const values = {
|
|
452
|
+
source_commit: environment.OAK_RELEASE_SOURCE_COMMIT,
|
|
453
|
+
public_commit: environment.OAK_RELEASE_PUBLIC_COMMIT,
|
|
454
|
+
checks_result: environment.OAK_RELEASE_CHECKS_RESULT,
|
|
455
|
+
};
|
|
456
|
+
const present = Object.values(values).some((value) => value !== undefined && value !== "");
|
|
457
|
+
if (!present) return null;
|
|
458
|
+
assertExactKeys(values, RELEASE_CONTEXT_KEYS, "release context");
|
|
459
|
+
if (RELEASE_CONTEXT_KEYS.some((key) => typeof values[key] !== "string" || values[key].length === 0)) {
|
|
460
|
+
throw invalid("release context must provide source, public, and checks identities");
|
|
461
|
+
}
|
|
462
|
+
assertCommit(values.source_commit, "release context source_commit");
|
|
463
|
+
assertCommit(values.public_commit, "release context public_commit");
|
|
464
|
+
if (values.checks_result !== "passed") throw invalid("release context checks_result must be passed");
|
|
465
|
+
return values;
|
|
466
|
+
}
|
|
467
|
+
|
|
410
468
|
export function canonicalManifestBytes(manifest) {
|
|
411
469
|
validateManifest(manifest);
|
|
412
470
|
return Buffer.from(`${canonicalJson(manifest)}\n`, "utf8");
|
|
@@ -653,10 +711,11 @@ function preservedEntry(source, target, reason) {
|
|
|
653
711
|
|
|
654
712
|
function makeNextManifest({ inspection, ownedFiles, preservedFiles, options }) {
|
|
655
713
|
const now = (options.clock?.() ?? new Date()).toISOString();
|
|
656
|
-
|
|
714
|
+
const kitVersion = parseStableVersion(options.kitVersion).canonical;
|
|
715
|
+
const manifest = {
|
|
657
716
|
schema_version: SCHEMA_VERSION,
|
|
658
717
|
manager: "opencode-agent-orchestration-kit",
|
|
659
|
-
kit_version:
|
|
718
|
+
kit_version: kitVersion,
|
|
660
719
|
payload_sha256: inspection.source.payloadSha256,
|
|
661
720
|
created_at: inspection.manifest?.created_at ?? now,
|
|
662
721
|
updated_at: now,
|
|
@@ -664,6 +723,19 @@ function makeNextManifest({ inspection, ownedFiles, preservedFiles, options }) {
|
|
|
664
723
|
owned_files: ownedFiles.sort((left, right) => left.path.localeCompare(right.path)),
|
|
665
724
|
preserved_files: preservedFiles.sort((left, right) => left.path.localeCompare(right.path)),
|
|
666
725
|
};
|
|
726
|
+
if (options.releaseProvenance) {
|
|
727
|
+
const releaseProvenance = {
|
|
728
|
+
...options.releaseProvenance,
|
|
729
|
+
kit_version: kitVersion,
|
|
730
|
+
payload_sha256: inspection.source.payloadSha256,
|
|
731
|
+
};
|
|
732
|
+
validateReleaseProvenance(releaseProvenance, {
|
|
733
|
+
kitVersion,
|
|
734
|
+
payloadSha256: inspection.source.payloadSha256,
|
|
735
|
+
});
|
|
736
|
+
manifest.release_provenance = releaseProvenance;
|
|
737
|
+
}
|
|
738
|
+
return manifest;
|
|
667
739
|
}
|
|
668
740
|
|
|
669
741
|
function classifyVersionState(sourceVersion, manifest, sourcePayloadSha256) {
|
|
@@ -1025,6 +1097,17 @@ export function createInstallationManager(options) {
|
|
|
1025
1097
|
const versionProvider = options.versionProvider ?? (() => {
|
|
1026
1098
|
throw invalid("canonical kit version provider is required");
|
|
1027
1099
|
});
|
|
1100
|
+
const releaseProvenance = Object.hasOwn(options, "releaseProvenance")
|
|
1101
|
+
? options.releaseProvenance
|
|
1102
|
+
: readReleaseContext(options.environment ?? process.env);
|
|
1103
|
+
if (releaseProvenance !== null && releaseProvenance !== undefined) {
|
|
1104
|
+
assertExactKeys(releaseProvenance, RELEASE_CONTEXT_KEYS, "release context");
|
|
1105
|
+
assertCommit(releaseProvenance.source_commit, "release context source_commit");
|
|
1106
|
+
assertCommit(releaseProvenance.public_commit, "release context public_commit");
|
|
1107
|
+
if (releaseProvenance.checks_result !== "passed") {
|
|
1108
|
+
throw invalid("release context checks_result must be passed");
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1028
1111
|
|
|
1029
1112
|
function currentKitVersion() {
|
|
1030
1113
|
return parseStableVersion(versionProvider()).canonical;
|
|
@@ -1915,7 +1998,7 @@ export function createInstallationManager(options) {
|
|
|
1915
1998
|
const transactionId = newTransactionId();
|
|
1916
1999
|
const inspection = inspectInstallation({ sourceRoot, targetRoot, deps: { fsOps } });
|
|
1917
2000
|
const kitVersion = currentKitVersion();
|
|
1918
|
-
const plan = buildPlan({ command, inspection, options: { ...runOptions, clock, transactionId, kitVersion } });
|
|
2001
|
+
const plan = buildPlan({ command, inspection, options: { ...runOptions, clock, transactionId, kitVersion, releaseProvenance } });
|
|
1919
2002
|
if (!plan.canApply) return { exitCode: 1, plan };
|
|
1920
2003
|
if (runOptions.dryRun) return { exitCode: 0, plan };
|
|
1921
2004
|
if (command === "upgrade" && !plan.hasWork) return { exitCode: 0, plan };
|
|
@@ -1923,7 +2006,7 @@ export function createInstallationManager(options) {
|
|
|
1923
2006
|
acquireLock(targetRoot, transactionId, command);
|
|
1924
2007
|
invocationLockOwned = true;
|
|
1925
2008
|
const lockedInspection = inspectInstallation({ sourceRoot, targetRoot, deps: { fsOps } });
|
|
1926
|
-
const lockedPlan = buildPlan({ command, inspection: lockedInspection, options: { ...runOptions, clock, transactionId, kitVersion } });
|
|
2009
|
+
const lockedPlan = buildPlan({ command, inspection: lockedInspection, options: { ...runOptions, clock, transactionId, kitVersion, releaseProvenance } });
|
|
1927
2010
|
if (lockedPlan.fingerprint !== plan.fingerprint || !lockedPlan.canApply) {
|
|
1928
2011
|
releaseLock(targetRoot);
|
|
1929
2012
|
return { exitCode: 1, plan: lockedPlan };
|
|
@@ -20,6 +20,7 @@ import {
|
|
|
20
20
|
parseCliArgs,
|
|
21
21
|
resolveTarget,
|
|
22
22
|
validateManifest,
|
|
23
|
+
validateReleaseProvenance,
|
|
23
24
|
validateTransaction,
|
|
24
25
|
} from "./manage-installation.mjs";
|
|
25
26
|
|
|
@@ -52,6 +53,8 @@ function capture() {
|
|
|
52
53
|
|
|
53
54
|
const HASH_A = "a".repeat(64);
|
|
54
55
|
const HASH_B = "b".repeat(64);
|
|
56
|
+
const COMMIT_A = "a".repeat(40);
|
|
57
|
+
const COMMIT_B = "b".repeat(40);
|
|
55
58
|
const REPOSITORY_ROOT = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
|
|
56
59
|
|
|
57
60
|
function validManifest(overrides = {}) {
|
|
@@ -1043,6 +1046,39 @@ test("[V015] manifest digest includes kit version", () => {
|
|
|
1043
1046
|
);
|
|
1044
1047
|
});
|
|
1045
1048
|
|
|
1049
|
+
test("release provenance is optional for old state and bound to new payloads", async (t) => {
|
|
1050
|
+
const provenance = {
|
|
1051
|
+
source_commit: COMMIT_A,
|
|
1052
|
+
public_commit: COMMIT_B,
|
|
1053
|
+
kit_version: "1.0.27",
|
|
1054
|
+
payload_sha256: HASH_A,
|
|
1055
|
+
checks_result: "passed",
|
|
1056
|
+
};
|
|
1057
|
+
validateReleaseProvenance(provenance, { kitVersion: "1.0.27", payloadSha256: HASH_A });
|
|
1058
|
+
validateManifest(validManifest({ release_provenance: provenance }));
|
|
1059
|
+
assert.throws(() => validateManifest(validManifest({
|
|
1060
|
+
release_provenance: { ...provenance, payload_sha256: HASH_B },
|
|
1061
|
+
})), /payload_sha256 does not match manifest/i);
|
|
1062
|
+
assert.throws(() => validateManifest(validManifest({
|
|
1063
|
+
release_provenance: { ...provenance, checks_result: "failed" },
|
|
1064
|
+
})), /checks_result/i);
|
|
1065
|
+
|
|
1066
|
+
const { sourceRoot, targetRoot } = makeFixture(t);
|
|
1067
|
+
put(sourceRoot, "agents/lead.md", "lead\n");
|
|
1068
|
+
const result = await managerFixture(sourceRoot, {
|
|
1069
|
+
releaseProvenance: {
|
|
1070
|
+
source_commit: COMMIT_A,
|
|
1071
|
+
public_commit: COMMIT_B,
|
|
1072
|
+
checks_result: "passed",
|
|
1073
|
+
},
|
|
1074
|
+
}).run("install", { targetRoot });
|
|
1075
|
+
assert.equal(result.exitCode, 0);
|
|
1076
|
+
assert.deepEqual(result.plan.nextManifest.release_provenance, {
|
|
1077
|
+
...provenance,
|
|
1078
|
+
payload_sha256: result.plan.nextManifest.payload_sha256,
|
|
1079
|
+
});
|
|
1080
|
+
});
|
|
1081
|
+
|
|
1046
1082
|
test("[V016] a newer source version commits a manifest-only upgrade", async (t) => {
|
|
1047
1083
|
const { sourceRoot, targetRoot } = makeFixture(t);
|
|
1048
1084
|
put(sourceRoot, "agents/lead.md", "lead\n");
|
|
@@ -5,7 +5,7 @@ import fs from "node:fs";
|
|
|
5
5
|
import os from "node:os";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { spawnSync } from "node:child_process";
|
|
8
|
-
import { fileURLToPath } from "node:url";
|
|
8
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
9
9
|
|
|
10
10
|
const SCRIPT_PATH = fileURLToPath(import.meta.url);
|
|
11
11
|
const REPOSITORY_ROOT = path.dirname(path.dirname(SCRIPT_PATH));
|
|
@@ -218,7 +218,7 @@ function hashFile(file) {
|
|
|
218
218
|
};
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
function safeEnvironment(tempRoot) {
|
|
221
|
+
function safeEnvironment(tempRoot, extra = {}) {
|
|
222
222
|
const home = path.join(tempRoot, "home");
|
|
223
223
|
const cache = path.join(tempRoot, "npm-cache");
|
|
224
224
|
fs.mkdirSync(home);
|
|
@@ -231,6 +231,44 @@ function safeEnvironment(tempRoot) {
|
|
|
231
231
|
npm_config_userconfig: path.join(home, ".npmrc"),
|
|
232
232
|
CI: "true",
|
|
233
233
|
LANG: process.env.LANG ?? "C",
|
|
234
|
+
...extra,
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function readGitCommit(repositoryRoot) {
|
|
239
|
+
const result = spawnSync("git", ["rev-parse", "HEAD"], {
|
|
240
|
+
cwd: repositoryRoot,
|
|
241
|
+
encoding: "utf8",
|
|
242
|
+
});
|
|
243
|
+
const commit = result.status === 0 ? result.stdout.trim() : "";
|
|
244
|
+
if (!/^[0-9a-f]{40}$/.test(commit)) throw smokeError("release provenance requires a checked-out public commit");
|
|
245
|
+
return commit;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function readProjectionSourceCommit(repositoryRoot) {
|
|
249
|
+
let boundary;
|
|
250
|
+
try {
|
|
251
|
+
boundary = fs.readFileSync(path.join(repositoryRoot, "docs", "sync-boundary.md"), "utf8");
|
|
252
|
+
} catch {
|
|
253
|
+
throw smokeError("release provenance source commit marker is missing");
|
|
254
|
+
}
|
|
255
|
+
const match = boundary.match(/<!--\s*projection-source-commit:\s*([0-9a-f]{40})\s*-->/);
|
|
256
|
+
if (!match) throw smokeError("release provenance source commit marker is invalid");
|
|
257
|
+
return match[1];
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function readReleaseProvenance(repositoryRoot) {
|
|
261
|
+
const sourceCommit = process.env.OAK_RELEASE_SOURCE_COMMIT ?? readProjectionSourceCommit(repositoryRoot);
|
|
262
|
+
const publicCommit = process.env.OAK_RELEASE_PUBLIC_COMMIT ?? readGitCommit(repositoryRoot);
|
|
263
|
+
const checksResult = process.env.OAK_RELEASE_CHECKS_RESULT ?? "passed";
|
|
264
|
+
if (!/^[0-9a-f]{40}$/.test(sourceCommit) || !/^[0-9a-f]{40}$/.test(publicCommit)) {
|
|
265
|
+
throw smokeError("release provenance commit identities are invalid");
|
|
266
|
+
}
|
|
267
|
+
if (checksResult !== "passed") throw smokeError("release provenance checks result must be passed");
|
|
268
|
+
return {
|
|
269
|
+
OAK_RELEASE_SOURCE_COMMIT: sourceCommit,
|
|
270
|
+
OAK_RELEASE_PUBLIC_COMMIT: publicCommit,
|
|
271
|
+
OAK_RELEASE_CHECKS_RESULT: checksResult,
|
|
234
272
|
};
|
|
235
273
|
}
|
|
236
274
|
|
|
@@ -278,6 +316,7 @@ export async function smokeTarball(options = {}) {
|
|
|
278
316
|
const run = options.run ?? ((command, args, commandOptions = {}) => runCommand(command, args, commandOptions));
|
|
279
317
|
|
|
280
318
|
const canonical = readRootPackage(repositoryRoot);
|
|
319
|
+
const releaseProvenance = readReleaseProvenance(repositoryRoot);
|
|
281
320
|
const expectedBasename = `${canonical.name}-${canonical.version}.tgz`;
|
|
282
321
|
if (basename !== expectedBasename) throw smokeError(`tarball filename must be ${expectedBasename}`);
|
|
283
322
|
|
|
@@ -308,7 +347,7 @@ export async function smokeTarball(options = {}) {
|
|
|
308
347
|
|
|
309
348
|
const extracted = path.join(temporary.root, "extracted");
|
|
310
349
|
fs.mkdirSync(extracted);
|
|
311
|
-
const environment = safeEnvironment(temporary.root);
|
|
350
|
+
const environment = safeEnvironment(temporary.root, releaseProvenance);
|
|
312
351
|
run("tar", ["-xzf", capturedTarball, "-C", extracted], { label: "archive extraction failed" });
|
|
313
352
|
|
|
314
353
|
let packed;
|
|
@@ -324,6 +363,9 @@ export async function smokeTarball(options = {}) {
|
|
|
324
363
|
const packedRoot = path.join(extracted, "package");
|
|
325
364
|
validatePackedOak({ packed, packedRoot });
|
|
326
365
|
const opencodeRoot = path.join(packedRoot, "opencode");
|
|
366
|
+
const { inventorySource } = await import(pathToFileURL(path.join(packedRoot, "scripts", "manage-installation.mjs")).href);
|
|
367
|
+
const packedPayload = inventorySource(opencodeRoot).payloadSha256;
|
|
368
|
+
environment.OAK_RELEASE_PAYLOAD_SHA256 = packedPayload;
|
|
327
369
|
run("npm", ["ci", "--ignore-scripts"], {
|
|
328
370
|
cwd: opencodeRoot,
|
|
329
371
|
env: environment,
|
|
@@ -371,6 +413,13 @@ export async function smokeTarball(options = {}) {
|
|
|
371
413
|
sha256: hashes.sha256,
|
|
372
414
|
sha1: hashes.sha1,
|
|
373
415
|
sha512: hashes.sha512,
|
|
416
|
+
release_provenance: {
|
|
417
|
+
source_commit: releaseProvenance.OAK_RELEASE_SOURCE_COMMIT,
|
|
418
|
+
public_commit: releaseProvenance.OAK_RELEASE_PUBLIC_COMMIT,
|
|
419
|
+
kit_version: canonical.version,
|
|
420
|
+
payload_sha256: packedPayload,
|
|
421
|
+
checks_result: releaseProvenance.OAK_RELEASE_CHECKS_RESULT,
|
|
422
|
+
},
|
|
374
423
|
};
|
|
375
424
|
} finally {
|
|
376
425
|
removeTempRoot(temporary.parent, temporary.root);
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
|
|
18
18
|
const ROOT = path.dirname(path.dirname(fileURLToPath(import.meta.url)));
|
|
19
19
|
const HASH = "a".repeat(64);
|
|
20
|
-
const BASENAME = "opencode-agent-orchestration-kit-1.0.
|
|
20
|
+
const BASENAME = "opencode-agent-orchestration-kit-1.0.40.tgz";
|
|
21
21
|
const REQUIRED = [
|
|
22
22
|
"package/package.json",
|
|
23
23
|
"package/supply-chain.json",
|
|
@@ -210,7 +210,7 @@ test("smokeTarball validates both archive listings before extraction", async ()
|
|
|
210
210
|
await assert.rejects(
|
|
211
211
|
smokeTarball({
|
|
212
212
|
repositoryRoot: ROOT,
|
|
213
|
-
tarball: "/public/opencode-agent-orchestration-kit-1.0.
|
|
213
|
+
tarball: "/public/opencode-agent-orchestration-kit-1.0.40.tgz",
|
|
214
214
|
captureTarball(_source, destination) {
|
|
215
215
|
fs.writeFileSync(destination, "fixture");
|
|
216
216
|
return { size: 1 };
|
|
@@ -228,7 +228,7 @@ test("smokeTarball validates both archive listings before extraction", async ()
|
|
|
228
228
|
assert.deepEqual(calls.map((call) => call.slice(0, 2)), [["tar", "-tzf"], ["tar", "-tvzf"]]);
|
|
229
229
|
});
|
|
230
230
|
|
|
231
|
-
test("the wrapper smokes a packed tarball and verifies checksum before extraction", { timeout:
|
|
231
|
+
test("the wrapper smokes a packed tarball and verifies checksum before extraction", { timeout: 300_000 }, () => {
|
|
232
232
|
const temp = fs.mkdtempSync(path.join(os.tmpdir(), "package-smoke-integration-"));
|
|
233
233
|
try {
|
|
234
234
|
const packed = spawnSync("npm", ["pack", "--json", "--pack-destination", temp], {
|
|
@@ -243,7 +243,7 @@ test("the wrapper smokes a packed tarball and verifies checksum before extractio
|
|
|
243
243
|
const direct = spawnSync("bash", ["scripts/package-smoke.sh", tarball], {
|
|
244
244
|
cwd: ROOT,
|
|
245
245
|
encoding: "utf8",
|
|
246
|
-
timeout:
|
|
246
|
+
timeout: 240_000,
|
|
247
247
|
});
|
|
248
248
|
assert.equal(direct.status, 0, direct.stderr);
|
|
249
249
|
const evidence = JSON.parse(direct.stdout);
|
|
@@ -255,7 +255,7 @@ test("the wrapper smokes a packed tarball and verifies checksum before extractio
|
|
|
255
255
|
const verified = spawnSync("bash", ["scripts/package-smoke.sh", "--checksum", checksum, tarball], {
|
|
256
256
|
cwd: ROOT,
|
|
257
257
|
encoding: "utf8",
|
|
258
|
-
timeout:
|
|
258
|
+
timeout: 240_000,
|
|
259
259
|
});
|
|
260
260
|
assert.equal(verified.status, 0, verified.stderr);
|
|
261
261
|
|
|
@@ -274,7 +274,7 @@ test("the wrapper smokes a packed tarball and verifies checksum before extractio
|
|
|
274
274
|
}
|
|
275
275
|
});
|
|
276
276
|
|
|
277
|
-
test("smokeTarball is unaffected when the original tarball changes between validation phases", { timeout:
|
|
277
|
+
test("smokeTarball is unaffected when the original tarball changes between validation phases", { timeout: 300_000 }, async () => {
|
|
278
278
|
const temp = fs.mkdtempSync(path.join(os.tmpdir(), "package-smoke-snapshot-test-"));
|
|
279
279
|
try {
|
|
280
280
|
const packed = spawnSync("npm", ["pack", "--json", "--pack-destination", temp], {
|
package/scripts/version.test.mjs
CHANGED
|
@@ -109,7 +109,7 @@ test("[V004] direct version entrypoints are exact and mutation-free", (t) => {
|
|
|
109
109
|
for (const args of [["scripts/version.mjs"], ["scripts/manage-installation.mjs", "--version"]]) {
|
|
110
110
|
const result = run(process.execPath, args, { HOME: home });
|
|
111
111
|
assert.equal(result.status, 0, result.stderr);
|
|
112
|
-
assert.equal(result.stdout, "opencode-agent-orchestration-kit 1.0.
|
|
112
|
+
assert.equal(result.stdout, "opencode-agent-orchestration-kit 1.0.40\n");
|
|
113
113
|
assert.equal(fs.existsSync(target), false);
|
|
114
114
|
}
|
|
115
115
|
});
|
|
@@ -118,7 +118,7 @@ test("[V005] all lifecycle wrappers expose the canonical version", () => {
|
|
|
118
118
|
for (const wrapper of ["install.sh", "upgrade.sh", "doctor.sh", "uninstall.sh", "rollback.sh"]) {
|
|
119
119
|
const result = run(path.join(REPOSITORY_ROOT, wrapper), ["--version"]);
|
|
120
120
|
assert.equal(result.status, 0, `${wrapper}: ${result.stderr}`);
|
|
121
|
-
assert.equal(result.stdout, "opencode-agent-orchestration-kit 1.0.
|
|
121
|
+
assert.equal(result.stdout, "opencode-agent-orchestration-kit 1.0.40\n", wrapper);
|
|
122
122
|
}
|
|
123
123
|
});
|
|
124
124
|
|