@ship.zone/runner 1.1.0 → 2.1.0

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/dist_npm/mod.d.ts CHANGED
@@ -159,11 +159,11 @@ export interface IRunnerCapabilities { executionProfiles: TExecutionProfile[];
159
159
  networks: TNetworkMode[];
160
160
  sourceFormats: TSourceFormat[];
161
161
  limits: ITransferLimits;
162
- /** Defined from specification 1.1.0 on. */
162
+ /** The largest resource ceilings the runner enforces per attempt. */
163
163
  resources?: IResourceLimits;
164
- /** Defined from specification 1.2.0 on: the lease contents the runner uses. */
164
+ /** The lease contents the runner uses. */
165
165
  leaseFeatures?: TLeaseFeature[];
166
- /** Defined from specification 1.2.0 on: the largest job `timeoutMs` the runner executes. */
166
+ /** The largest job `timeoutMs` the runner executes. */
167
167
  maximumTimeoutMs?: number;
168
168
  }
169
169
  export interface IRegisterRunnerRequest { registrationRequestId: string;
@@ -913,11 +913,6 @@ export interface IRunnerDependencies { api: IRunnerCoordinatorClient;
913
913
  * image grants, candidate bindings, or npm read grants), and its configured longest job timeout.
914
914
  */
915
915
  export declare const runnerCapabilities: (config: IRunnerConfig, runtime: Pick<IOciRuntimeFacts, "os" | "architecture">) => IRunnerCapabilities;
916
- /**
917
- * Restricts capabilities to the constructs defined at the lower of the coordinator and runner
918
- * specification versions, the version every non-job message may use.
919
- */
920
- export declare const capabilitiesForCoordinator: (capabilities: IRunnerCapabilities, discovery: Pick<IDiscoveryResponse, "spec">) => IRunnerCapabilities;
921
916
  export declare const reconcileProtocolLimits: (config: IRunnerConfig, discovery: IDiscoveryResponse, capabilities: IRunnerCapabilities) => void;
922
917
  export declare class ShipRunner { private readonly config;
923
918
  private readonly dependencies;
@@ -959,10 +954,6 @@ export declare const runnerSpecVersion: string;
959
954
  export declare const acceptSpecVersion: (implemented: string, declared: unknown) => TSpecAcceptance;
960
955
  /** Returns whether two canonical versions share a major version, the coordinator session rule. */
961
956
  export declare const specMajorVersionsMatch: (left: string, right: string) => boolean;
962
- /** Compares two canonical specification versions numerically. */
963
- export declare const compareSpecVersions: (left: string, right: string) => number;
964
- /** The lower of two canonical versions: the version whose constructs a message may use. */
965
- export declare const lowerSpecVersion: (left: string, right: string) => string;
966
957
  export declare const scavengeRunnerStaging: (stateDirectory: string) => Promise<void>;
967
958
  /** OpenAPI component schemas of the published runner protocol that this runner validates. */
968
959
  export declare const wireSchemaNames: readonly ["AbandonJobRequest", "AcceptJobRequest", "ClaimJobRequest", "ClaimJobResponse", "CompleteJobRequest", "CompleteJobResponse", "DiscoveryResponse", "ErrorResponse", "ImageBinding", "ImageGrant", "ImageRecord", "JobHeartbeatRequest", "JobHeartbeatResponse", "JobLease", "LogAcknowledgement", "LogChunk", "NpmGrant", "RecordImageRequest", "RecoverAttemptRequest", "RegisterRunnerRequest", "RegisterRunnerResponse", "RunnerCapabilities", "RunnerHeartbeatRequest", "RunnerHeartbeatResponse", "StartSessionRequest", "StartSessionResponse", "TransferRecord"];
package/dist_npm/mod.js CHANGED
@@ -104,17 +104,17 @@ var init_errors = __esm({
104
104
  });
105
105
 
106
106
  // ts/plugins.ts
107
- import { ciSpecStatus, ciSpecVersion, executionProfileIdentifiers, maximumArchivePathMetadataBytes, runnerProtocolBasePath } from "@foss.global/ci-spec";
107
+ import { ciSpecStatus, ciSpecVersion, executionProfileIdentifiers, maximumArchivePathMetadataBytes, runnerProtocolBasePath } from "@ship.zone/ci-spec";
108
108
  import { Ajv2020 } from "ajv/dist/2020.js";
109
- import runnerJobSchema from "@foss.global/ci-spec/runner-job.schema.json" with { type: "json" };
110
- import runnerOpenApi from "@foss.global/ci-spec/runner.openapi.json" with { type: "json" };
109
+ import runnerJobSchema from "@ship.zone/ci-spec/runner-job.schema.json" with { type: "json" };
110
+ import runnerOpenApi from "@ship.zone/ci-spec/runner.openapi.json" with { type: "json" };
111
111
  var init_plugins = __esm({
112
112
  "ts/plugins.ts"() {
113
113
  }
114
114
  });
115
115
 
116
116
  // ts/spec-version.ts
117
- var canonicalSpecVersionPattern, parseSpecVersion, requireCanonical, compareParts, runnerSpecVersion, acceptSpecVersion, specMajorVersionsMatch, compareSpecVersions, lowerSpecVersion;
117
+ var canonicalSpecVersionPattern, parseSpecVersion, requireCanonical, compareParts, runnerSpecVersion, acceptSpecVersion, specMajorVersionsMatch;
118
118
  var init_spec_version = __esm({
119
119
  "ts/spec-version.ts"() {
120
120
  init_errors();
@@ -155,8 +155,6 @@ var init_spec_version = __esm({
155
155
  return compareParts(declaredParts, implementedParts) > 0 ? "newer" : "accepted";
156
156
  }, "acceptSpecVersion");
157
157
  specMajorVersionsMatch = /* @__PURE__ */ __name((left, right) => requireCanonical(left, "Specification version").major === requireCanonical(right, "Specification version").major, "specMajorVersionsMatch");
158
- compareSpecVersions = /* @__PURE__ */ __name((left, right) => compareParts(requireCanonical(left, "Specification version"), requireCanonical(right, "Specification version")), "compareSpecVersions");
159
- lowerSpecVersion = /* @__PURE__ */ __name((left, right) => compareSpecVersions(left, right) <= 0 ? left : right, "lowerSpecVersion");
160
158
  }
161
159
  });
162
160
 
@@ -220,7 +218,7 @@ var init_validation = __esm({
220
218
  });
221
219
 
222
220
  // ts/wire-schema.ts
223
- var wireSchemaNames, isWireSchemaName, openApiSchemaId, runnerJobSchemaKey, rewriteComponentReferences, componentSchemas, ajv, validatorCache, validatorFor, componentValidator, sanitizeErrorText, safeErrorDetails, assertValid, isValidWireMessage, validateWireMessage, validateCompiledJobSchema;
221
+ var wireSchemaNames, isWireSchemaName, openApiSchemaId, runnerJobSchemaId, rewriteComponentReferences, componentSchemas, ajv, validatorCache, validatorFor, componentValidator, sanitizeErrorText, safeErrorDetails, assertValid, isValidWireMessage, validateWireMessage, validateCompiledJobSchema;
224
222
  var init_wire_schema = __esm({
225
223
  "ts/wire-schema.ts"() {
226
224
  init_errors();
@@ -256,8 +254,8 @@ var init_wire_schema = __esm({
256
254
  "TransferRecord"
257
255
  ];
258
256
  isWireSchemaName = /* @__PURE__ */ __name((value) => typeof value === "string" && wireSchemaNames.includes(value), "isWireSchemaName");
259
- openApiSchemaId = "https://foss.global/spec/runner.openapi.json";
260
- runnerJobSchemaKey = "https://foss.global/schemas/runner-job.schema.json";
257
+ openApiSchemaId = "https://ship.zone/spec/ci/spec/runner.openapi.json";
258
+ runnerJobSchemaId = "https://ship.zone/spec/ci/schemas/runner-job.schema.json";
261
259
  rewriteComponentReferences = /* @__PURE__ */ __name((value) => {
262
260
  if (Array.isArray(value)) return value.map(rewriteComponentReferences);
263
261
  if (!isRecord(value)) return value;
@@ -285,7 +283,7 @@ var init_wire_schema = __esm({
285
283
  type: "string",
286
284
  validate: isProtocolTimestamp
287
285
  });
288
- ajv.addSchema(runnerJobSchema, runnerJobSchemaKey);
286
+ ajv.addSchema(runnerJobSchema);
289
287
  ajv.addSchema({
290
288
  $schema: "https://json-schema.org/draft/2020-12/schema",
291
289
  $id: openApiSchemaId,
@@ -326,7 +324,7 @@ var init_wire_schema = __esm({
326
324
  }, "assertValid");
327
325
  isValidWireMessage = /* @__PURE__ */ __name((name, value) => componentValidator(name)(value) === true, "isValidWireMessage");
328
326
  validateWireMessage = /* @__PURE__ */ __name((name, value) => assertValid(componentValidator(name), value, name), "validateWireMessage");
329
- validateCompiledJobSchema = /* @__PURE__ */ __name((value) => assertValid(validatorFor(runnerJobSchemaKey), value, "Compiled runner job"), "validateCompiledJobSchema");
327
+ validateCompiledJobSchema = /* @__PURE__ */ __name((value) => assertValid(validatorFor(runnerJobSchemaId), value, "Compiled runner job"), "validateCompiledJobSchema");
330
328
  }
331
329
  });
332
330
 
@@ -4960,20 +4958,20 @@ var init_deno = __esm({
4960
4958
  "deno.json"() {
4961
4959
  deno_default = {
4962
4960
  name: "@ship.zone/runner",
4963
- version: "1.1.0",
4961
+ version: "2.1.0",
4964
4962
  exports: "./mod.ts",
4965
4963
  nodeModulesDir: "none",
4966
4964
  minimumDependencyAge: {
4967
4965
  age: "P1D",
4968
4966
  exclude: [
4969
- "npm:@foss.global/*",
4970
4967
  "npm:@git.zone/*",
4971
- "npm:@push.rocks/*"
4968
+ "npm:@push.rocks/*",
4969
+ "npm:@ship.zone/*"
4972
4970
  ]
4973
4971
  },
4974
4972
  tasks: {
4975
4973
  dev: "deno run --allow-all mod.ts",
4976
- bundle: "deno bundle --frozen --check --platform=deno --keep-names --external '@foss.global/ci-spec' --external '@foss.global/ci-spec/*' --external 'ajv/*' --declaration --outdir dist_npm mod.ts",
4974
+ bundle: "deno bundle --frozen --check --platform=deno --keep-names --external '@ship.zone/ci-spec' --external '@ship.zone/ci-spec/*' --external 'ajv/*' --declaration --outdir dist_npm mod.ts",
4977
4975
  test: "deno test --allow-env --allow-net --allow-read --allow-write --allow-run test/",
4978
4976
  check: "deno check mod.ts test/ scripts/",
4979
4977
  fmt: "deno fmt",
@@ -5000,15 +4998,15 @@ var init_deno = __esm({
5000
4998
  strict: true
5001
4999
  },
5002
5000
  imports: {
5003
- "@foss.global/ci-spec": "npm:@foss.global/ci-spec@1.2.0",
5004
- "@foss.global/ci-spec/archive-cases.json": "npm:@foss.global/ci-spec@1.2.0/archive-cases.json",
5005
- "@foss.global/ci-spec/digest-cases.json": "npm:@foss.global/ci-spec@1.2.0/digest-cases.json",
5006
- "@foss.global/ci-spec/runner-cases.json": "npm:@foss.global/ci-spec@1.2.0/runner-cases.json",
5007
- "@foss.global/ci-spec/runner-job.schema.json": "npm:@foss.global/ci-spec@1.2.0/runner-job.schema.json",
5008
- "@foss.global/ci-spec/runner-messages.json": "npm:@foss.global/ci-spec@1.2.0/runner-messages.json",
5009
- "@foss.global/ci-spec/runner.openapi.json": "npm:@foss.global/ci-spec@1.2.0/runner.openapi.json",
5010
- "@foss.global/ci-spec/version-cases.json": "npm:@foss.global/ci-spec@1.2.0/version-cases.json",
5011
- "@foss.global/ci-spec/conformance/runner-jobs/": "npm:/@foss.global/ci-spec@1.2.0/conformance/runner-jobs/",
5001
+ "@ship.zone/ci-spec": "npm:@ship.zone/ci-spec@2.0.0",
5002
+ "@ship.zone/ci-spec/archive-cases.json": "npm:@ship.zone/ci-spec@2.0.0/archive-cases.json",
5003
+ "@ship.zone/ci-spec/digest-cases.json": "npm:@ship.zone/ci-spec@2.0.0/digest-cases.json",
5004
+ "@ship.zone/ci-spec/runner-cases.json": "npm:@ship.zone/ci-spec@2.0.0/runner-cases.json",
5005
+ "@ship.zone/ci-spec/runner-job.schema.json": "npm:@ship.zone/ci-spec@2.0.0/runner-job.schema.json",
5006
+ "@ship.zone/ci-spec/runner-messages.json": "npm:@ship.zone/ci-spec@2.0.0/runner-messages.json",
5007
+ "@ship.zone/ci-spec/runner.openapi.json": "npm:@ship.zone/ci-spec@2.0.0/runner.openapi.json",
5008
+ "@ship.zone/ci-spec/version-cases.json": "npm:@ship.zone/ci-spec@2.0.0/version-cases.json",
5009
+ "@ship.zone/ci-spec/conformance/runner-jobs/": "npm:/@ship.zone/ci-spec@2.0.0/conformance/runner-jobs/",
5012
5010
  "@std/assert": "jsr:@std/assert@^1.0.14",
5013
5011
  "@std/path": "jsr:@std/path@^1.1.2",
5014
5012
  "ajv/dist/2020.js": "npm:ajv@8.20.0/dist/2020.js"
@@ -5452,8 +5450,8 @@ var init_oci_executor = __esm({
5452
5450
  hostTmpfsProbeMaximumAgeMs = 60 * 60 * 1e3;
5453
5451
  runtimeProbeVolumeMaximumAgeMs = 60 * 60 * 1e3;
5454
5452
  runtimeProbeOwnerIdPattern = /^[a-f0-9]{32}$/;
5455
- hostTmpfsProbeNamePattern = /^foss-ci-probe-([a-f0-9]{32})-[a-f0-9]{16}$/;
5456
- runtimeProbeVolumeNamePattern = /^foss-ci-volume-[a-f0-9]{32}$/;
5453
+ hostTmpfsProbeNamePattern = /^shipzone-ci-probe-([a-f0-9]{32})-[a-f0-9]{16}$/;
5454
+ runtimeProbeVolumeNamePattern = /^shipzone-ci-volume-[a-f0-9]{32}$/;
5457
5455
  workspaceHelperDirectoryName = "workspace-helpers";
5458
5456
  workspaceHelperLockName = ".workspace-helper.lock";
5459
5457
  runtimeProbeOwnerMarkerPrefix = ".runtime-probe-owner_";
@@ -5780,7 +5778,7 @@ var init_oci_executor = __esm({
5780
5778
  }
5781
5779
  }, "validateStepCommand");
5782
5780
  validateGeneratedName = /* @__PURE__ */ __name((value, kind) => {
5783
- const pattern = kind === "container" ? /^foss-ci-(?:helper|probe|step)-[a-f0-9]{32}$/ : /^foss-ci-volume-[a-f0-9]{32}$/;
5781
+ const pattern = kind === "container" ? /^shipzone-ci-(?:helper|probe|step)-[a-f0-9]{32}$/ : /^shipzone-ci-volume-[a-f0-9]{32}$/;
5784
5782
  if (!pattern.test(value)) throw new ProtocolError(`Runner generated an invalid OCI ${kind} name`);
5785
5783
  return value;
5786
5784
  }, "validateGeneratedName");
@@ -5950,8 +5948,8 @@ var init_oci_executor = __esm({
5950
5948
  sessionId: context.sessionId,
5951
5949
  lease: context.lease,
5952
5950
  step,
5953
- containerName: `foss-ci-step-${"0".repeat(32)}`,
5954
- volumeName: `foss-ci-volume-${"0".repeat(32)}`
5951
+ containerName: `shipzone-ci-step-${"0".repeat(32)}`,
5952
+ volumeName: `shipzone-ci-volume-${"0".repeat(32)}`
5955
5953
  });
5956
5954
  }
5957
5955
  }, "validateLeasePolicy");
@@ -6422,7 +6420,7 @@ var init_oci_executor = __esm({
6422
6420
  requireSuccess(containers, "Unable to enumerate orphan OCI containers");
6423
6421
  for (const line of decode(containers.stdout).split("\n").filter(Boolean)) {
6424
6422
  const [name, sessionId] = line.split("|", 2);
6425
- if (/^foss-ci-(?:helper|probe|step)-[a-f0-9]{32}$/.test(name) && sessionId !== currentSessionId) {
6423
+ if (/^shipzone-ci-(?:helper|probe|step)-[a-f0-9]{32}$/.test(name) && sessionId !== currentSessionId) {
6426
6424
  await this.stopAndRemoveContainer(name);
6427
6425
  }
6428
6426
  }
@@ -6439,7 +6437,7 @@ var init_oci_executor = __esm({
6439
6437
  requireSuccess(volumes, "Unable to enumerate orphan OCI volumes");
6440
6438
  for (const line of decode(volumes.stdout).split("\n").filter(Boolean)) {
6441
6439
  const [name, sessionId] = line.split("|", 2);
6442
- if (/^foss-ci-volume-[a-f0-9]{32}$/.test(name) && sessionId !== currentSessionId) {
6440
+ if (/^shipzone-ci-volume-[a-f0-9]{32}$/.test(name) && sessionId !== currentSessionId) {
6443
6441
  await this.removeVolume(name);
6444
6442
  }
6445
6443
  }
@@ -7107,7 +7105,7 @@ var init_oci_executor = __esm({
7107
7105
  await scavengeHostTmpfsProbes("/dev/shm", {}, runtimeProbeOwnerId);
7108
7106
  path = await Deno.makeTempDir({
7109
7107
  dir: "/dev/shm",
7110
- prefix: `foss-ci-probe-${runtimeProbeOwnerId}-`
7108
+ prefix: `shipzone-ci-probe-${runtimeProbeOwnerId}-`
7111
7109
  });
7112
7110
  const before = await this.readFilesystemProbe(helperPath, path);
7113
7111
  const first = join3(path, "first");
@@ -7819,7 +7817,7 @@ var init_oci_executor = __esm({
7819
7817
  }
7820
7818
  }
7821
7819
  createResourceName(kind) {
7822
- const name = `foss-ci-${kind}-${this.randomHex()}`;
7820
+ const name = `shipzone-ci-${kind}-${this.randomHex()}`;
7823
7821
  return validateGeneratedName(name, kind === "volume" ? "volume" : "container");
7824
7822
  }
7825
7823
  randomHex() {
@@ -7849,8 +7847,8 @@ var init_protocol_validator = __esm({
7849
7847
  init_wire_schema();
7850
7848
  sha256Pattern3 = /^[a-f0-9]{64}$/;
7851
7849
  reservedEnvironmentNames = [
7852
- "FOSS_CI_INPUTS_JSON",
7853
- "FOSS_CI_MATRIX_JSON"
7850
+ "SHIPZONE_CI_INPUTS_JSON",
7851
+ "SHIPZONE_CI_MATRIX_JSON"
7854
7852
  ];
7855
7853
  npmUserConfigEnvironmentName = "NPM_CONFIG_USERCONFIG";
7856
7854
  maximumCommandArgumentBytes2 = 16 * 1024;
@@ -8128,8 +8126,8 @@ var init_protocol_validator = __esm({
8128
8126
  const secretTargets = Object.keys(job.secrets);
8129
8127
  const npmRead = job.npmRead !== void 0;
8130
8128
  for (const secretName of secretTargets) {
8131
- if (secretName.startsWith("FOSS_CI_")) {
8132
- throw new ProtocolError("Secret targets may not use reserved FOSS_CI names");
8129
+ if (secretName.startsWith("SHIPZONE_CI_")) {
8130
+ throw new ProtocolError("Secret targets may not use reserved SHIPZONE_CI names");
8133
8131
  }
8134
8132
  if (npmRead && secretName === npmUserConfigEnvironmentName) {
8135
8133
  throw new ProtocolError(`Secret targets may not use the reserved ${secretName}`);
@@ -8152,8 +8150,8 @@ var init_protocol_validator = __esm({
8152
8150
  for (const step of job.steps) {
8153
8151
  const environmentNames = Object.keys(step.environment);
8154
8152
  for (const name of environmentNames) {
8155
- if (name.startsWith("FOSS_CI_") && !reservedEnvironmentNames.includes(name)) {
8156
- throw new ProtocolError("Step environment uses an unknown reserved FOSS_CI name");
8153
+ if (name.startsWith("SHIPZONE_CI_") && !reservedEnvironmentNames.includes(name)) {
8154
+ throw new ProtocolError("Step environment uses an unknown reserved SHIPZONE_CI name");
8157
8155
  }
8158
8156
  if (npmRead && name === npmUserConfigEnvironmentName) {
8159
8157
  throw new ProtocolError(`Step environment may not define the reserved ${name}`);
@@ -8596,7 +8594,7 @@ var init_staging_scavenger = __esm({
8596
8594
  });
8597
8595
 
8598
8596
  // ts/runner.ts
8599
- var identifierPattern4, genericSystemError, containsControlCharacter, defaultSleep2, identityFor, safeIdentityFromUnknown, isDefinitiveConflict, LeaseGuard, resourceLimitsSpecVersion, leaseMatchingSpecVersion, runnerCapabilities, capabilitiesForCoordinator, reconcileProtocolLimits, ShipRunner;
8597
+ var identifierPattern4, genericSystemError, containsControlCharacter, defaultSleep2, identityFor, safeIdentityFromUnknown, isDefinitiveConflict, LeaseGuard, runnerCapabilities, reconcileProtocolLimits, ShipRunner;
8600
8598
  var init_runner = __esm({
8601
8599
  "ts/runner.ts"() {
8602
8600
  init_attempt_state();
@@ -8705,8 +8703,6 @@ var init_runner = __esm({
8705
8703
  if (this.timer !== void 0) clearTimeout(this.timer);
8706
8704
  }
8707
8705
  };
8708
- resourceLimitsSpecVersion = "1.1.0";
8709
- leaseMatchingSpecVersion = "1.2.0";
8710
8706
  runnerCapabilities = /* @__PURE__ */ __name((config, runtime) => {
8711
8707
  const artifactEnabled = config.maximumArtifacts > 0 && config.maximumArtifactBytes > 0 && config.maximumArtifactExtractedBytes > 0 && config.maximumArtifactEntries > 0;
8712
8708
  const cacheEnabled = config.maximumCaches > 0 && config.maximumCacheArchiveBytes > 0 && config.maximumCacheExtractedBytes > 0 && config.maximumCacheEntries > 0;
@@ -8765,23 +8761,6 @@ var init_runner = __esm({
8765
8761
  maximumTimeoutMs: config.oci.maximumTimeoutMs
8766
8762
  });
8767
8763
  }, "runnerCapabilities");
8768
- capabilitiesForCoordinator = /* @__PURE__ */ __name((capabilities, discovery) => {
8769
- const messageSpec = lowerSpecVersion(discovery.spec, runnerSpecVersion);
8770
- const defines = /* @__PURE__ */ __name((since) => compareSpecVersions(messageSpec, since) >= 0, "defines");
8771
- const { resources, leaseFeatures, maximumTimeoutMs, ...defined } = capabilities;
8772
- return createRunnerCapabilitySnapshot({
8773
- ...defined,
8774
- ...resources !== void 0 && defines(resourceLimitsSpecVersion) ? {
8775
- resources
8776
- } : {},
8777
- ...leaseFeatures !== void 0 && defines(leaseMatchingSpecVersion) ? {
8778
- leaseFeatures
8779
- } : {},
8780
- ...maximumTimeoutMs !== void 0 && defines(leaseMatchingSpecVersion) ? {
8781
- maximumTimeoutMs
8782
- } : {}
8783
- });
8784
- }, "capabilitiesForCoordinator");
8785
8764
  reconcileProtocolLimits = /* @__PURE__ */ __name((config, discovery, capabilities) => {
8786
8765
  if (!specMajorVersionsMatch(discovery.spec, runnerSpecVersion)) {
8787
8766
  throw new ProtocolError(`Coordinator specification ${discovery.spec} is incompatible with runner specification ${runnerSpecVersion}`);
@@ -8829,7 +8808,7 @@ var init_runner = __esm({
8829
8808
  this.dependencies.api.setRunnerToken(this.config.runnerToken);
8830
8809
  const runtime = await this.dependencies.executor.verifyRuntime();
8831
8810
  const discovery = await this.dependencies.api.discover(options.signal);
8832
- const capabilities = capabilitiesForCoordinator(runnerCapabilities(this.config, runtime), discovery);
8811
+ const capabilities = runnerCapabilities(this.config, runtime);
8833
8812
  reconcileProtocolLimits(this.config, discovery, capabilities);
8834
8813
  const validator = new RunnerProtocolValidator(capabilities);
8835
8814
  const session = await this.dependencies.api.startSession({
@@ -9903,7 +9882,7 @@ Bootstrap credentials must be supplied through SHIP_RUNNER_BOOTSTRAP_TOKEN or th
9903
9882
  const executor = new OciExecutor(config);
9904
9883
  const runtime = await executor.verifyRuntime();
9905
9884
  const discovery = await api.discover();
9906
- const capabilities = capabilitiesForCoordinator(runnerCapabilities(config, runtime), discovery);
9885
+ const capabilities = runnerCapabilities(config, runtime);
9907
9886
  reconcileProtocolLimits(config, discovery, capabilities);
9908
9887
  const registered = await registerRunnerDurably({
9909
9888
  configPath: path,
@@ -10047,8 +10026,6 @@ export {
10047
10026
  buildOciRunCommand,
10048
10027
  calculateWorkspaceVolumeLimits,
10049
10028
  canonicalizeJson,
10050
- capabilitiesForCoordinator,
10051
- compareSpecVersions,
10052
10029
  computeCompiledPlanDigest,
10053
10030
  copyOciConfig,
10054
10031
  createRunnerCapabilitySnapshot,
@@ -10056,7 +10033,6 @@ export {
10056
10033
  isValidWireMessage,
10057
10034
  isWireSchemaName,
10058
10035
  loadRunnerConfig,
10059
- lowerSpecVersion,
10060
10036
  maskRunnerConfig,
10061
10037
  minimumRedactionMemberBytes,
10062
10038
  parseRunnerConfig,
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "format": "tsrust.build-provenance.v2",
3
- "binarySha256": "d69a00882fd822a2afecf456c38dcf828c164ec7241ce1ecfb0365d94061932b",
3
+ "binarySha256": "cfa82f9b6cc4794786822c28b816dc8cced8477bd94794036fcc3b3cdb5ce843",
4
4
  "buildInfo": {
5
5
  "projectName": "@ship.zone/runner",
6
- "projectVersion": "1.1.0",
7
- "gitCommit": "c4c2e312d0a24e51b2dd6e73e69d8e81a2296b00",
6
+ "projectVersion": "2.1.0",
7
+ "gitCommit": "aa3d0f5a51d6f846c8a73fb84f1eed7ebd003f0a",
8
8
  "gitDirty": false,
9
- "builtAt": "2026-09-27T15:46:35.628Z",
10
- "tsrustVersion": "1.15.1",
9
+ "builtAt": "2026-10-13T13:05:50.189Z",
10
+ "tsrustVersion": "4.4.0",
11
11
  "binary": "runnerworkspace",
12
12
  "target": "linux_amd64_musl"
13
13
  }
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "format": "tsrust.build-provenance.v2",
3
- "binarySha256": "7775abaf87eeaaf41bc47607734e704e8c63b99fdcceeb6c692397536ba7b394",
3
+ "binarySha256": "c161d5fe0fe38c37fc3fbd3290161821bd420195296a16d22389bd2efd6d10bf",
4
4
  "buildInfo": {
5
5
  "projectName": "@ship.zone/runner",
6
- "projectVersion": "1.1.0",
7
- "gitCommit": "c4c2e312d0a24e51b2dd6e73e69d8e81a2296b00",
6
+ "projectVersion": "2.1.0",
7
+ "gitCommit": "aa3d0f5a51d6f846c8a73fb84f1eed7ebd003f0a",
8
8
  "gitDirty": false,
9
- "builtAt": "2026-09-27T15:46:43.725Z",
10
- "tsrustVersion": "1.15.1",
9
+ "builtAt": "2026-10-13T13:07:10.387Z",
10
+ "tsrustVersion": "4.4.0",
11
11
  "binary": "runnerworkspace",
12
12
  "target": "linux_arm64_musl"
13
13
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ship.zone/runner",
3
- "version": "1.1.0",
3
+ "version": "2.1.0",
4
4
  "description": "The isolated OCI job runner for ship.zone CI/CD",
5
5
  "homepage": "https://code.foss.global/ship.zone/runner",
6
6
  "bugs": {
@@ -29,11 +29,11 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@foss.global/ci-spec": "1.2.0",
32
+ "@ship.zone/ci-spec": "2.0.0",
33
33
  "ajv": "^8.20.0"
34
34
  },
35
35
  "devDependencies": {
36
- "@git.zone/tsrust": "^1.15.1"
36
+ "@git.zone/tsrust": "^4.4.0"
37
37
  },
38
38
  "files": [
39
39
  "changelog.md",
@@ -56,6 +56,7 @@
56
56
  ],
57
57
  "scripts": {
58
58
  "build": "deno task check && deno task bundle && deno run --allow-read=dist_npm/mod.js scripts/verify-npm-entrypoint.ts && tsrust",
59
+ "build:release": "deno task check && deno task bundle && deno run --allow-read=dist_npm/mod.js scripts/verify-npm-entrypoint.ts && tsrust --configured-targets && tsrust verify",
59
60
  "test": "deno task test && cargo test --manifest-path rust/Cargo.toml"
60
61
  }
61
62
  }
package/readme.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @ship.zone/runner
2
2
 
3
3
  `@ship.zone/runner` is the outbound-only OCI execution agent for ship.zone CI/CD. It implements the
4
- runner protocol of `@foss.global/ci-spec` (1.2.0) for the `oci` execution profile, validates leases
4
+ runner protocol of `@ship.zone/ci-spec` (2.0.0) for the `oci` execution profile, validates leases
5
5
  and compiled jobs against the published schemas, and runs one fenced attempt at a time on a local
6
6
  Docker or Podman engine.
7
7
 
@@ -226,15 +226,15 @@ terminates the attempt as `system_error`; output is never silently truncated.
226
226
 
227
227
  ## Runner Protocol
228
228
 
229
- The runner implements the specification version of the `@foss.global/ci-spec` package it is built
230
- against (its `ciSpecVersion`, currently 1.2.0), and sends it as `spec` in registration and session
229
+ The runner implements the specification version of the `@ship.zone/ci-spec` package it is built
230
+ against (its `ciSpecVersion`, currently 2.0.0), and sends it as `spec` in registration and session
231
231
  requests. It refuses a coordinator whose discovery, registration, or session `spec` has another
232
- major version, and a coordinator answers a runner of another major version with HTTP 409
233
- `spec_incompatible`. Messages other than compiled jobs use only constructs of the lower of both
234
- versions: against a coordinator before 1.2.0 the capability snapshot omits `leaseFeatures` and
235
- `maximumTimeoutMs`, and against a 1.0.0 coordinator also `resources`. A leased job is accepted only
236
- when its `spec` has the same major version and is not newer than the implemented version; any other
237
- job is abandoned as `runner_error`.
232
+ major version, so a 2.x runner never talks to a 1.x (`@foss.global/ci-spec`) coordinator, and a
233
+ coordinator answers a runner of another major version with HTTP 409 `spec_incompatible`. Every
234
+ capability the runner advertises is defined in 2.0.0, so it sends the same capability snapshot to
235
+ every coordinator of major version 2. A leased job is accepted only when its `spec` has the same
236
+ major version and is not newer than the implemented version; any other job is abandoned as
237
+ `runner_error`.
238
238
 
239
239
  The runner advertises the `oci` profile, `container` isolation, the native `linux/<arch>` platform
240
240
  of its verified OCI engine, the `none` network mode, its transfer limits, `resources` maxima for
@@ -243,9 +243,11 @@ grants, candidate bindings, or npm read grants, and `maximumTimeoutMs`, its conf
243
243
  `oci.maximumTimeoutMs`. It refuses, by abandoning the lease as `runner_error` before acceptance,
244
244
  every lease it cannot execute as specified: the `vm` and `oci-image` profiles, `microvm` isolation,
245
245
  `egress` networks, candidate images with `bindings`, image `grants`, jobs with `npmRead` and their
246
- `npmGrants`, and jobs whose `timeoutMs` exceeds `oci.maximumTimeoutMs`. Leases with grants,
247
- bindings, or npm grants are refused whatever the session version, also when the capability snapshot
248
- carries no `leaseFeatures`.
246
+ `npmGrants`, and jobs whose `timeoutMs` exceeds `oci.maximumTimeoutMs`.
247
+
248
+ The reserved step environment names are `SHIPZONE_CI_MATRIX_JSON` and `SHIPZONE_CI_INPUTS_JSON`,
249
+ each carrying canonical RFC 8785 JSON. A job whose step environment defines any other
250
+ `SHIPZONE_CI_*` name, or whose secret targets use any `SHIPZONE_CI_*` name, is rejected.
249
251
 
250
252
  All endpoints are below `/api/runner`. Registration uses the one-time bootstrap bearer token;
251
253
  subsequent requests use the renewable runner credential. Every request body is validated against its
package/rust/Cargo.lock CHANGED
@@ -8,6 +8,16 @@ version = "2.13.1"
8
8
  source = "registry+https://github.com/rust-lang/crates.io-index"
9
9
  checksum = "b588b76d00fde79687d7646a9b5bdf3cc0f655e0bbd080335a95d7e96f3587da"
10
10
 
11
+ [[package]]
12
+ name = "cc"
13
+ version = "1.8.0"
14
+ source = "registry+https://github.com/rust-lang/crates.io-index"
15
+ checksum = "6651c9ed80effdc7db0ff72512157f901af5e3549e341e24b1dd4887d836d838"
16
+ dependencies = [
17
+ "find-msvc-tools",
18
+ "shlex",
19
+ ]
20
+
11
21
  [[package]]
12
22
  name = "cfg-if"
13
23
  version = "1.0.4"
@@ -20,6 +30,12 @@ version = "0.2.2"
20
30
  source = "registry+https://github.com/rust-lang/crates.io-index"
21
31
  checksum = "f079e83a288787bcd14a6aea84cee5c87a67c5a3e660c30f557a3d24761b3527"
22
32
 
33
+ [[package]]
34
+ name = "find-msvc-tools"
35
+ version = "0.1.14"
36
+ source = "registry+https://github.com/rust-lang/crates.io-index"
37
+ checksum = "aedcfb3409746eddb02b9e19ebda1c3394f759a152e48ee875a0844d1b955484"
38
+
23
39
  [[package]]
24
40
  name = "itoa"
25
41
  version = "1.0.18"
@@ -75,6 +91,7 @@ dependencies = [
75
91
  "nix",
76
92
  "serde",
77
93
  "serde_json",
94
+ "tikv-jemallocator",
78
95
  ]
79
96
 
80
97
  [[package]]
@@ -120,6 +137,12 @@ dependencies = [
120
137
  "zmij",
121
138
  ]
122
139
 
140
+ [[package]]
141
+ name = "shlex"
142
+ version = "2.0.1"
143
+ source = "registry+https://github.com/rust-lang/crates.io-index"
144
+ checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
145
+
123
146
  [[package]]
124
147
  name = "syn"
125
148
  version = "3.0.3"
@@ -131,6 +154,26 @@ dependencies = [
131
154
  "unicode-ident",
132
155
  ]
133
156
 
157
+ [[package]]
158
+ name = "tikv-jemalloc-sys"
159
+ version = "0.7.1+5.3.1-0-g81034ce1f1373e37dc865038e1bc8eeecf559ce8"
160
+ source = "registry+https://github.com/rust-lang/crates.io-index"
161
+ checksum = "1a2825c78386b4ae0314074867860ba9577875de945f05992c38815cbec327f0"
162
+ dependencies = [
163
+ "cc",
164
+ "libc",
165
+ ]
166
+
167
+ [[package]]
168
+ name = "tikv-jemallocator"
169
+ version = "0.7.0"
170
+ source = "registry+https://github.com/rust-lang/crates.io-index"
171
+ checksum = "249f09e49ab1609436f34c776e84231bead18d6a955f119f939bdc1d847561bd"
172
+ dependencies = [
173
+ "libc",
174
+ "tikv-jemalloc-sys",
175
+ ]
176
+
134
177
  [[package]]
135
178
  name = "unicode-ident"
136
179
  version = "1.0.24"
package/rust/Cargo.toml CHANGED
@@ -10,6 +10,9 @@ nix = { version = "0.30.1", default-features = false, features = ["fs", "signal"
10
10
  serde = { version = "1.0.229", features = ["derive"] }
11
11
  serde_json = "1.0.149"
12
12
 
13
+ [target.'cfg(not(target_env = "msvc"))'.dependencies]
14
+ tikv-jemallocator = { version = "0.7.0", features = ["background_threads"] }
15
+
13
16
  [profile.release]
14
17
  strip = true
15
18
  lto = true
package/rust/src/main.rs CHANGED
@@ -1,3 +1,7 @@
1
+ #[cfg(not(target_env = "msvc"))]
2
+ #[global_allocator]
3
+ static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
4
+
1
5
  fn main() {
2
6
  if let Err(error) = runnerworkspace::run(std::env::args_os().skip(1)) {
3
7
  eprintln!("runnerworkspace: {error}");