@orchestraworks/worker 0.0.152 → 0.0.153

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.
Files changed (2) hide show
  1. package/docs/REFERENCE.md +41 -36
  2. package/package.json +6 -6
package/docs/REFERENCE.md CHANGED
@@ -22,8 +22,9 @@ The worker exposes no API of its own. Every route it calls is the platform's.
22
22
  | `stream/` | the queue: every placement message and every prompt, steer and cancel pulled off this machine's work consumer, the ACP client that opens a session's harness conversation and runs its turns, each turn's events batched to the platform and published live, and the answer every placement message is owed |
23
23
  | `mount/` | the volumes the launch declares, placed on the lanes that mount them: the home volume first, because anything written under a mount point before the mount is hidden by it |
24
24
  | `network/` | the transparent redirect the launch describes, as the worker's own nftables table written over netlink with no program from the image: what the worker's own uid reaches directly, and what every uid on the machine reaches through the egress edge |
25
- | `shim/` | the in-guest transparent proxy: the listener the redirect lands on, the recovery of the destination each connection was actually for, the hop to the egress edge under the machine-identity proof, the WinDivert half that is the Windows redirect, and the loopback feed a separate shim reads this machine's token from |
25
+ | `shim/` | the in-guest transparent proxy: the listener the redirect lands on, the recovery of the destination each connection was actually for, the hop to the egress edge under the machine-identity proof, and the WinDivert half that is the Windows redirect |
26
26
  | `egress/` | what puts that proxy in place on the virtual-machine lanes: the edge's certificate authority in this machine's trust store, the inbound firewall rule Windows needs, the redirect itself, and the state line an operator reads off the machine's console |
27
+ | `oneworker/` | the one-worker lock: the fixed loopback port whose bind stops a second worker on the machine |
27
28
  | `ingress/` | the machine's half of the preview tunnel: the connection this worker holds open to the preview gateway, the challenge and the signed upgrade that authenticate it, and the loopback pipe that carries each viewer request to a port this machine declared and refuses every other |
28
29
  | `termination/` | the cloud's notice that this machine is being reclaimed, delivered to the broker so the next status report carries it |
29
30
  | `paths/` | which native place a logical path denotes, and when two logical paths denote one place — pinned against the platform's own answer by committed vectors |
@@ -48,12 +49,12 @@ Each `ORCHESTRA_` machine variable this page names also has a former `SFDK_` spe
48
49
  work consumer and reports on the cadence.
49
50
 
50
51
  Before any of that, `run` starts what the launch describes: it places the declared volumes, puts
51
- the in-guest egress in place where the launch names an intercept set, opens the egress shim's token
52
- feed, and — on a machine the cloud can reclaim — watches for the notice that it is going away. Each
53
- is started only where it is described: an OpenSandbox pod places its own volumes and its egress
54
- sidecar installs its own redirect, so a launch there names neither. If one of those duties is
55
- installed and then dies, `run` ends rather than serving a machine the platform counts as healthy
56
- with no route off it; the service manager starts the worker again.
52
+ the in-guest egress in place where the launch names an intercept set, takes the one-worker lock, and —
53
+ on a machine the cloud can reclaim — watches for the notice that it is going away. Each is started
54
+ only where it is described: a launch that names no volumes places none, and one that names no
55
+ intercept set installs no redirect. If one of those duties is installed and then dies, `run` ends
56
+ rather than serving a machine the platform counts as healthy with no route off it; the service
57
+ manager starts the worker again.
57
58
 
58
59
  `--service` is how the process is hosted rather than what it does: on Windows it hands the body to
59
60
  the service control manager, which kills a service that does not answer its handshake, and on the
@@ -82,17 +83,31 @@ Each `ORCHESTRA_` machine variable this page names also has a former `SFDK_` spe
82
83
  forms fill the installer seam in `cmd/worker/install.go`; a build with none refuses rather than
83
84
  reporting an install it did not perform.
84
85
 
85
- **An install that names a family stops the running worker first.** When `--harness` names a family
86
- and `--service` is not `none`, the install stops the worker service in its scope, and the service an
87
- earlier release registered, before it changes anything under the root. A running service installs and
88
- runs harnesses from that same root, and nothing else keeps the two apart. The stop keeps each
89
- service's definition, and the install prints `the worker service is stopped while this install changes
90
- <root>`. The service starts again only after the whole install succeeds, and then at the time its role
91
- sets, below. When the stop fails, the install changes nothing. When a later step fails, or a signal
92
- interrupts the install after the stop, the service stays stopped and the error says so; for a `worker`,
93
- run `worker install` again to start it. A signal during the stop itself gives an error that says the
94
- service may still be stopping. A signal before the stop ends the install quietly, with nothing stopped
95
- and nothing changed.
86
+ **An install stops the running worker when it changes what the service reads.** When `--service` is not
87
+ `none`, the install may stop the worker service in its scope, and the service an earlier release
88
+ registered. It stops them in three cases. A named family, or the pinned Node the families run on, needs
89
+ installing. An enrollment token, or its file, is in its environment. The service definition it writes
90
+ differs from the one on disk, or, for a `worker`, the bootstrap file does. A file it cannot read counts
91
+ as different. On Windows the definition never counts as different: a changed one takes effect at the
92
+ next start. Otherwise it leaves the service as it is. A running service installs and runs harnesses
93
+ from the same root, and nothing else keeps the two apart. Only a fresh start redeems an enrollment
94
+ token, and the install waits for the registration that start makes. On macOS, launchd also loads a
95
+ changed property list only after a stop. A definition that counts as different, or a changed bootstrap
96
+ file, stops the service, so it does not keep running on the old ones. A `worker` then starts again at
97
+ once.
98
+
99
+ The stop keeps each service's definition, and the install prints `the worker service is stopped while
100
+ this install runs`. The service starts again only after the whole install succeeds, and then at the
101
+ time its role sets, below. When the stop fails, the install changes nothing. When a later step fails,
102
+ or a signal interrupts the install after the stop, the service stays stopped and the error says so. For
103
+ a `worker`, run `worker install` again to start it. A signal during the stop itself gives an error that
104
+ says the service may still be stopping. A signal before the stop ends the install quietly, with nothing
105
+ stopped and nothing changed.
106
+
107
+ **An install that would change nothing does not stop the worker service.** A running service keeps
108
+ its open turns. The install prints `this install changes nothing under <root> and does not stop the
109
+ worker service; an upgraded worker runs after the service restarts`. A worker upgraded at the same path
110
+ leaves the definition as it is, so the running service keeps the program it started with.
96
111
 
97
112
  **`--service` says which session the worker is registered in, and neither of its two values needs any
98
113
  privilege.** `user` registers it in the invoking account's own session: a launch agent under
@@ -381,8 +396,7 @@ service, which answers the evidence that call presents. Nothing is uid-wide, so
381
396
  stays intercepted and this worker's own content pulls meet the platform's rule at the edge.
382
397
 
383
398
  The redirect takes its Windows form on Windows and its nftables form everywhere else, whatever the
384
- substrate. A pod with an egress sidecar runs only the certificate step: the sidecar installs that
385
- lane's redirect and runs its own shim, which reads the token from the loopback feed below. A Launcher
399
+ substrate. A launch that names no intercept set runs only the certificate step. A Launcher
386
400
  machine, a Launcher pod included, names an intercept set: where `install-machine --egress-redirect`
387
401
  wrote the file `egress-redirect` under the worker root this worker installs the redirect itself, and
388
402
  where it did not, as on an image built before that file existed, the worker binds the local egress port
@@ -407,24 +421,15 @@ because the metadata service is never reached through a proxy. Where a redirect
407
421
  names are left out of the environment each harness and the setup script are handed, so the agent's
408
422
  calls reach the redirect, which carries them to the edge.
409
423
 
410
- ## The egress shim's token feed
424
+ ## The one-worker lock
411
425
 
412
- The shim that intercepts this machine's traffic stamps the machine token on it, and the worker is
413
- what holds that token. On Kubernetes the two are in different containers of one pod, so the only
414
- channel between them is the network: the worker listens on `127.0.0.1:7788` — a constant both halves
415
- carry, not a placed value — and the shim connects with retry.
426
+ On every machine the worker listens on `127.0.0.1:7788`, so that a second worker started on the same
427
+ machine finds the port held and stops. The port is a constant, not a placed value, and
428
+ `orchestra outpost up` checks the same port to refuse a second outpost on one machine.
416
429
 
417
- Each frame is one JSON line, newline-terminated:
418
-
419
- ```
420
- {"generation": 7, "token": "<the machine token>", "expiresAt": "2026-09-12T10:15:00.123456Z"}
421
- ```
422
-
423
- On connect the worker writes the generation this machine holds now, and one line per rotation after
424
- that. It writes nothing else on that socket and never reads from it, and it listens on loopback and
425
- nowhere else. A worker restart drops the connection; the shim reconnects and is fed the current
426
- generation again. The broker credential co-issued beside the token never crosses this channel, and
427
- neither does the holder key.
430
+ The worker writes nothing on that port: it closes each connection as soon as it accepts it, and a
431
+ completed connection is the whole answer. It listens on loopback and nowhere else. No credential
432
+ crosses this port: not the machine token, the broker credential or the holder key.
428
433
 
429
434
  ## Building and testing
430
435
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@orchestraworks/worker",
3
- "version": "0.0.152",
3
+ "version": "0.0.153",
4
4
  "type": "module",
5
5
  "description": "The Orchestra worker.",
6
6
  "license": "Apache-2.0",
@@ -18,10 +18,10 @@
18
18
  "docs/REFERENCE.md"
19
19
  ],
20
20
  "optionalDependencies": {
21
- "@orchestraworks/worker-linux-x64": "0.0.152",
22
- "@orchestraworks/worker-linux-arm64": "0.0.152",
23
- "@orchestraworks/worker-darwin-x64": "0.0.152",
24
- "@orchestraworks/worker-darwin-arm64": "0.0.152",
25
- "@orchestraworks/worker-win32-x64": "0.0.152"
21
+ "@orchestraworks/worker-linux-x64": "0.0.153",
22
+ "@orchestraworks/worker-linux-arm64": "0.0.153",
23
+ "@orchestraworks/worker-darwin-x64": "0.0.153",
24
+ "@orchestraworks/worker-darwin-arm64": "0.0.153",
25
+ "@orchestraworks/worker-win32-x64": "0.0.153"
26
26
  }
27
27
  }