@orchestraworks/worker-darwin-arm64 0.0.141 → 0.0.142

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchestraworks/worker-darwin-arm64",
3
- "version": "0.0.141",
3
+ "version": "0.0.142",
4
4
  "description": "Orchestra worker for darwin arm64.",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Living Computers",
@@ -5,8 +5,8 @@
5
5
  //
6
6
  // Each turn ends by setting the session's outcome claim from the command's exit code, sent with the agent's
7
7
  // own token when the harness has one. A machine with no edge of ours in front of it, which the worker
8
- // declares by setting `SFDK_MACHINE_ENROLLED`, refuses a bare claim: with no token there the harness makes
9
- // no call at all and ends the turn on the script's own answer.
8
+ // declares on each harness process, refuses a bare claim: with no token there the harness makes no call at
9
+ // all and ends the turn on the script's own answer.
10
10
 
11
11
  import { spawn } from "node:child_process";
12
12
  import { randomUUID } from "node:crypto";
@@ -18,7 +18,7 @@ import { createInterface } from "node:readline";
18
18
  import { describeFetchFailure } from "./fetch-failure.js";
19
19
 
20
20
  const HARNESS_NAME = "software-factory-script-harness";
21
- const HARNESS_VERSION = "0.0.141";
21
+ const HARNESS_VERSION = "0.0.142";
22
22
 
23
23
  const IS_WINDOWS = process.platform === "win32";
24
24
 
@@ -267,11 +267,13 @@ function agentApiBaseUrl() {
267
267
 
268
268
  // The worker declares this on a machine the customer enrolled, and on no machine the platform launched.
269
269
  // Presence is the declaration. The worker answers it from that machine's own bootstrap rather than
270
- // passing a value through, so nothing running inside the machine can declare it of itself.
271
- const MACHINE_ENROLLED = "SFDK_MACHINE_ENROLLED";
270
+ // passing a value through, so nothing running inside the machine can declare it of itself. A worker built
271
+ // before the rename declares it under the former name alone, which is read second.
272
+ const MACHINE_ENROLLED = ["ORCHESTRA_MACHINE_ENROLLED", "SFDK_MACHINE_ENROLLED"];
272
273
 
273
- function machineIsEnrolled() {
274
- return (process.env[MACHINE_ENROLLED] || "").trim() !== "";
274
+ /** The name the worker declared this machine enrolled under, or undefined on a machine the platform launched. */
275
+ function enrolledDeclaration() {
276
+ return MACHINE_ENROLLED.find((name) => (process.env[name] || "").trim() !== "");
275
277
  }
276
278
 
277
279
  // The worker renews the file in place, so it is read on every call. Behind our edge the edge replaces
@@ -699,9 +701,10 @@ async function claimPlatformState({
699
701
  // that stamp too, and there the refusal is a deployment fault to surface rather than a turn to settle
700
702
  // quietly.
701
703
  const token = agentToken();
702
- if (machineIsEnrolled() && !token) {
704
+ const declaration = enrolledDeclaration();
705
+ if (declaration !== undefined && !token) {
703
706
  logDiagnostic(
704
- `${MACHINE_ENROLLED} is set and no agent token is readable, so nothing authorizes this machine's ` +
707
+ `${declaration} is set and no agent token is readable, so nothing authorizes this machine's ` +
705
708
  `calls to the platform: this turn claims no session state and settles on its answer`,
706
709
  );
707
710
  succeed(answerText);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "software-factory-script-harness",
3
3
  "type": "module",
4
- "version": "0.0.141",
4
+ "version": "0.0.142",
5
5
  "scripts": {
6
6
  "test": "node --test test/*.test.js"
7
7
  }
package/worker CHANGED
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/worker
3
- size: 46402946 bytes
4
- sha256: 9ec494f672f281a0b883ff7146ff5aa286e5382732198139822d748f247959f2
3
+ size: 46512002 bytes
4
+ sha256: 7cbdd29779395d8ea71bb971f6810ebc09ec453f17388419b4c2a7f13f7b6e61