@ai-ecoverse/slicc-kernel 1.182.0 → 1.184.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.
Files changed (78) hide show
  1. package/README.md +150 -5
  2. package/dist/async-process.js +14060 -0
  3. package/dist/async-process.js.map +7 -0
  4. package/dist/cloudflare-sources.js +2 -0
  5. package/dist/cloudflare.js +42562 -0
  6. package/dist/cloudflare.js.map +7 -0
  7. package/dist/driver-worker.js +290 -90
  8. package/dist/driver-worker.js.map +4 -4
  9. package/dist/index.js +328 -102
  10. package/dist/index.js.map +4 -4
  11. package/dist/kernel-worker.js +1837 -732
  12. package/dist/kernel-worker.js.map +4 -4
  13. package/dist/node-driver-worker.js +298 -98
  14. package/dist/node-driver-worker.js.map +4 -4
  15. package/dist/node-process-worker.cjs +4719 -652
  16. package/dist/node-process-worker.cjs.map +4 -4
  17. package/dist/node-process-worker.js +4719 -652
  18. package/dist/node-process-worker.js.map +4 -4
  19. package/dist/node.js +3341 -924
  20. package/dist/node.js.map +4 -4
  21. package/dist/process-worker.js +4625 -558
  22. package/dist/process-worker.js.map +4 -4
  23. package/dist/types/async/header-hook.d.ts +3 -0
  24. package/dist/types/async/link.d.ts +14 -0
  25. package/dist/types/async/message-link.d.ts +15 -0
  26. package/dist/types/async/node-host.d.ts +16 -0
  27. package/dist/types/async/remote-worker.d.ts +12 -0
  28. package/dist/types/async/snapshots.d.ts +13 -0
  29. package/dist/types/async/transport.d.ts +28 -0
  30. package/dist/types/async/wire.d.ts +113 -0
  31. package/dist/types/cdp/port.d.ts +2 -1
  32. package/dist/types/client/attach.d.ts +2 -0
  33. package/dist/types/client/protocol.d.ts +1 -0
  34. package/dist/types/client/serve-client.d.ts +1 -0
  35. package/dist/types/cloudflare/clock-skew.d.ts +2 -0
  36. package/dist/types/cloudflare/computer-driver.d.ts +65 -0
  37. package/dist/types/cloudflare/computer.d.ts +105 -0
  38. package/dist/types/cloudflare/fork-tokens.d.ts +17 -0
  39. package/dist/types/cloudflare/images.d.ts +20 -0
  40. package/dist/types/cloudflare/isolates.d.ts +17 -0
  41. package/dist/types/cloudflare/kernel-end.d.ts +45 -0
  42. package/dist/types/cloudflare/loader.d.ts +54 -0
  43. package/dist/types/cloudflare/options.d.ts +81 -0
  44. package/dist/types/cloudflare/placement.d.ts +61 -0
  45. package/dist/types/cloudflare/rpc-link.d.ts +49 -0
  46. package/dist/types/cloudflare/rpc-pack.d.ts +7 -0
  47. package/dist/types/cloudflare/sqlite-meta.d.ts +4 -0
  48. package/dist/types/cloudflare/sqlite-root.d.ts +5 -0
  49. package/dist/types/cloudflare/sqlite-store.d.ts +73 -0
  50. package/dist/types/cloudflare.d.ts +16 -0
  51. package/dist/types/devices-relay.d.ts +74 -0
  52. package/dist/types/facade/port.d.ts +2 -1
  53. package/dist/types/index.d.ts +14 -0
  54. package/dist/types/kernel/devices.d.ts +155 -0
  55. package/dist/types/kernel/embedder.d.ts +2 -0
  56. package/dist/types/kernel/fd-table.d.ts +3 -1
  57. package/dist/types/kernel/host.d.ts +3 -0
  58. package/dist/types/kernel/process.d.ts +22 -0
  59. package/dist/types/kernel/protocol.d.ts +1 -0
  60. package/dist/types/kernel/serial-ioctl.d.ts +73 -0
  61. package/dist/types/launcher.d.ts +20 -0
  62. package/dist/types/mount/hostfs.d.ts +2 -1
  63. package/dist/types/mount/in-process.d.ts +15 -0
  64. package/dist/types/node.d.ts +20 -2
  65. package/dist/types/ports.d.ts +7 -0
  66. package/dist/types/process/js/js-dev.d.ts +24 -0
  67. package/dist/types/process/kernel-streams.d.ts +11 -1
  68. package/dist/types/process/process-pty.d.ts +1 -0
  69. package/dist/types/process/wasi/wasi-fds.d.ts +1 -0
  70. package/dist/types/process/wasi/wasi-files.d.ts +1 -0
  71. package/dist/types/process/wasi/wasi-host.d.ts +3 -2
  72. package/dist/types/process/wasi/wasi-module.d.ts +2 -0
  73. package/dist/types/process/wasi/wasi-sigmask.d.ts +2 -1
  74. package/dist/types/process/wasi/wasi-termios.d.ts +1 -0
  75. package/dist/types/process/wasi/wasm-reentry.d.ts +1 -0
  76. package/dist/types/realm/sync-sab-bridge.d.ts +1 -0
  77. package/dist/types/serve.d.ts +14 -1
  78. package/package.json +11 -5
package/README.md CHANGED
@@ -45,6 +45,7 @@ TypeScript declarations ship in `dist/types/`, and each entry (`.`, `./node`, `.
45
45
  | `sealed` | none | `(req, { signal }) => Promise<object>`, or `{ request, fetch? }` with that function as `request`: `request` answers requests written to [`/dev/sealed`](#devsealed), and `fetch` fills requests that carry a sealed placeholder (see **The fetch hook** under [`/dev/sealed`](#devsealed)). `createNodeKernel` takes it too. An exported `SEALED_FETCH_VERSION`, the number `1`, says that this kernel takes the object |
46
46
  | `clipboard` | none | `{ read(stamp) => Promise<string>, write(text, stamp) => Promise<void> }`: the clipboard behind [`/dev/clipboard`](#devclipboard). `createNodeKernel` takes it too |
47
47
  | `requests` | none | `{ kinds, handle(request) }`: the page's answers to [`/dev/embedder`](#devembedder) for the processes it starts. `createNodeKernel` takes it too |
48
+ | `devices` | none | `{ open(request) }`: the page's answers for the serial device nodes it adds with [`kernel.devices`](#kerneldevices) (see [Embedder devices](#embedder-devices)). `createNodeKernel` takes it too |
48
49
  | `approve` | none | `(req, { signal }) => 'once' \| 'always' \| 'deny'` (or a promise of one), or `{ answer: 'once' \| 'always', timestamp: true }` when a person approved: decides a `sudo` request that needs approval (see [Sudo](#sudo) and [Sudo timestamps](#sudo-timestamps)); without it, such a request is denied. `createNodeKernel` takes it too |
49
50
  | `cdp` | none | `({ runtime, stamp }) => Promise<CdpConnection>`: a browser-level DevTools connection for programs that drive a browser (see [Browser automation](#browser-automation-cdp)) |
50
51
  | `facades` | none | `{ link: { port, hook? } }`: kernel-only loopback ports whose connections a hook on the page serves, with the connecting program's identity (see [Page facades](#page-facades)) |
@@ -95,6 +96,8 @@ Makes a port for another client of the same kernel. Hand it to a dedicated worke
95
96
 
96
97
  **`requests`** binds the port's [`/dev/embedder`](#devembedder) requests when the port is made: a hook (`{ kinds, handle }`, as `createKernel`'s) answers for every process the port's client starts, in the embedder's own realm, so a worker client (an agent) never answers or registers requests itself. `'attach'` lets the client that attaches to the port bring its own hook (`attachKernel(port, { requests })`, protocol 1.13); without it, an attach with `requests` fails with `EPERM`. A port with neither answers nothing: its processes' requests are `ENOTSUP`.
97
98
 
99
+ **`devices`** binds a [devices hook](#embedder-devices) the same way (protocol 1.18): a hook (`{ open }`) answers the opens of the nodes the page adds for the port (`kernel.devices.add({ client: port, … })`), in the embedder's own realm, and `'attach'` lets the client that attaches to the port bring its own (`attachKernel(port, { devices })`); without it, an attach with `devices` fails with `EPERM`, and a node added for a port with no hook is `ENOTSUP`.
100
+
98
101
  **`user`** (a name or uid) binds the client to that user; without it the client is root. The binding is a capability: the client's `spawn`, `run` and `openTerminal` run as that user, its `ps` lists only that user's processes, and its `kill` follows POSIX permission. A bound client can't run anything as another user (`code: 'EPERM'`). A root client may pass `user` to `spawn`, `run` or `openTerminal` to run one command as any user. An unknown user rejects with `code: 'ENOENT'`. **`tag`** is the tag (see `kernel.run`) of every process the client starts; its own `spawn`, `run` and `openTerminal` cannot name another. They may add one with their own `tag` option (protocol 1.12; an older kernel answers `ENOSYS`): the process then has both tags, the connection's first, and so does everything it starts. The option may also be a list of at most 8 tags, added in order (protocol 1.15; against an older kernel the client rejects with `code: 'ENOSYS'` before sending anything), so a caller can mark one call's tree with a tag of its own for [`trace`](#clienttracetag-onevents--limit---promise-close-) beside a tag that means something else. A per-spawn tag only adds; no client, program or child can remove or replace a tag ([#1380](https://github.com/ai-ecoverse/slicc-kernel/issues/1380)).
99
102
 
100
103
  ### `kernel.sudoRun(request, { stdout, stderr, tag }?) → Promise<{ pid, pgid, ended }>`
@@ -132,6 +135,23 @@ await kernel.users.add({ name: 'scoop-site', groups: ['cone'], homeGroup: 'cone'
132
135
 
133
136
  The cone's home lets its group in only to pass through (`0710`), and the cone opens what it shares with `chmod g+r`. A scoop's home belongs to the cone's group, so the cone reads it, and new files there take that group. Change `/etc/passwd` and `/etc/group` through `kernel.users` and `kernel.groups`, which keep the two consistent and serialize their writes.
134
137
 
138
+ ### `kernel.devices`
139
+
140
+ Serial device nodes the embedder backs, on the page and the Node entry (not on attached clients); see [Embedder devices](#embedder-devices):
141
+
142
+ | | |
143
+ | --- | --- |
144
+ | `add({ path, owner?, group?, mode?, links?, client? })` | adds a character device directly under `/dev` and resolves with `{ remove() }`. `path` is `ttyUSB<n>` or `ttyACM<n>` (with or without `/dev/`, `n` from 0 to 255); `owner` and `group` are names or ids (default `0`), `mode` the permission bits (default `0o600`), `links` names of symlinks the kernel makes to the node in `/dev/serial/by-id/` (a bare name or the full path), and `client` the port from `kernel.connect({ devices })` whose hook answers the node's opens (default: the page's own `devices` hook). A name, a link or a client that doesn't fit, or an unknown owner or group, rejects with `EINVAL`; a name or a link that exists with `EEXIST`; a client without a devices hook with `ENOTSUP` |
145
+ | `remove()` | deletes the node and its links. Descriptors still open on it fail every call with `EIO` from then on, and `poll` reports `POLLHUP` and `POLLERR`, as on Linux when a USB serial adapter is unplugged. A second `remove()` does nothing |
146
+
147
+ When the client whose hook answers a node goes away (its port closes), its nodes are removed the same way.
148
+
149
+ ```js
150
+ const kernel = await createKernel({ devices: { open: ({ path, flags, stamp, signal }) => port(path) } });
151
+ await kernel.groups.add('dialout', { gid: 20 });
152
+ const node = await kernel.devices.add({ path: 'ttyUSB0', owner: 0, group: 'dialout', mode: 0o640, links: ['usb-0403_6001-if00'] });
153
+ ```
154
+
135
155
  ### `kernel.chmod(path, mode) → Promise<void>`
136
156
 
137
157
  Sets a file's permission bits (`0` to `0o7777`, `EINVAL` otherwise) as root, through the mounts, as the processes see them, for a file the page wrote some other way. For files the page writes straight to OPFS before any kernel runs, see `writeMetadata` under [Metadata](#metadata).
@@ -177,7 +197,7 @@ Neither is on an attached client (`attachKernel`, `connect()`), so no process or
177
197
 
178
198
  ### `attachKernel(port, options?) → Promise<KernelClient>`
179
199
 
180
- Attaches to a kernel over a port from `kernel.connect()`, in any realm: a worker, another tab, or Node. `options.timeoutMs` (10 s by default) bounds the handshake: a port with no kernel behind it rejects with `KernelGoneError`. `options.requests` (`{ kinds, handle }`) answers the [`/dev/embedder`](#devembedder) requests of the client's processes, when the port was made with `connect({ requests: 'attach' })`.
200
+ Attaches to a kernel over a port from `kernel.connect()`, in any realm: a worker, another tab, or Node. `options.timeoutMs` (10 s by default) bounds the handshake: a port with no kernel behind it rejects with `KernelGoneError`. `options.requests` (`{ kinds, handle }`) answers the [`/dev/embedder`](#devembedder) requests of the client's processes, when the port was made with `connect({ requests: 'attach' })`. `options.devices` (`{ open }`) answers the opens of the [embedder devices](#embedder-devices) the page added for this client (`kernel.devices.add({ client: port })`), when the port was made with `connect({ devices: 'attach' })` (protocol 1.18; an older kernel ignores it).
181
201
 
182
202
  | Client | |
183
203
  |---|---|
@@ -242,6 +262,101 @@ By default `nodeTransport()` refuses destinations on the host itself, because No
242
262
  - **The opt-in:** `nodeTransport({ hostLoopback: true })` allows the host's loopback except ports 9222–9229. `nodeTransport({ hostLoopback: [8080, 9222] })` allows exactly the listed ports, so DevTools ports are reachable only when named. Link-local stays refused either way.
243
263
  - **Connect-time enforcement:** the kernel also checks the address each connection actually reaches, before anything is sent, so a name whose DNS answer changes after the check is still refused. A keep-alive connection opened outside this kernel's policy (by the host application, or by another kernel in the same process whose `hostLoopback` allows it) to the same origin could be reused without a new check. When a proxy is in use (`HTTP_PROXY`/`HTTPS_PROXY` with `--use-env-proxy` or `NODE_USE_ENV_PROXY=1`), a connection opened to the proxy's own host and port is allowed even on the host's loopback, and so is any request later tunnelled over that same live TCP connection (matched by its local and remote address and port, and forgotten when it closes), so only the pre-check applies to the target; a direct connection, a `NO_PROXY` host's included, is checked as usual, and a proxy that resolves names itself closes the rebinding window on its side.
244
264
 
265
+ ### In a Cloudflare Durable Object
266
+
267
+ `@ai-ecoverse/slicc-kernel/cloudflare` runs the kernel inside a Durable Object, with its processes in Dynamic Workers. It is experimental: the API can change, and the limits below are real.
268
+
269
+ ```js
270
+ import { DurableObject } from 'cloudflare:workers';
271
+ import { createCloudflareKernel } from '@ai-ecoverse/slicc-kernel/cloudflare';
272
+
273
+ export class Kernel extends DurableObject {
274
+ now() {
275
+ return Date.now();
276
+ }
277
+
278
+ kernel() {
279
+ const { storage } = this.ctx;
280
+ this.booting ??= createCloudflareKernel({
281
+ loader: this.env.LOADER,
282
+ sql: storage.sql,
283
+ sqlite: { transaction: (fn) => storage.transactionSync(fn) },
284
+ clock: () => this.env.KERNEL.get(this.ctx.id).now(),
285
+ });
286
+ return this.booting;
287
+ }
288
+
289
+ async fetch() {
290
+ const kernel = await this.kernel();
291
+ return Response.json(await kernel.run(['bash', '-c', 'ls / | head -3'], { cwd: '/root' }));
292
+ }
293
+ }
294
+ ```
295
+
296
+ The Worker needs a Worker Loader binding (`worker_loaders`) and a SQLite-backed Durable Object class. Packages are installed as on Node, with `kernel.writeFile` under `/node_modules`; [`examples/cloudflare`](examples/cloudflare) bundles bash and coreutils with the Worker and installs them on first boot, and [`examples/cloudflare-computer`](examples/cloudflare-computer) adds a [Cloudflare Computer](https://github.com/cloudflare/computer) Workspace.
297
+
298
+ `createCloudflareKernel(options)` returns a kernel with `run`, `openTerminal`, `writeFile`, `readFile`, `chmod`, `connect`, `users`, `groups`, `setRoutes`, `mount`, `umount`, `mounts` and `terminate`, as `createNodeKernel` does. Its own options:
299
+
300
+ | option | default | |
301
+ | --- | --- | --- |
302
+ | `loader` | required | the Worker Loader binding |
303
+ | `sql`, `sqlite` | none | the Durable Object's `ctx.storage.sql`, and `{ transaction, writeBehind }`: the root file system and its POSIX metadata live in tables prefixed `slicc_` |
304
+ | `root`, `meta`, `ranged` | `memoryRoot()` | a root of your own in place of `sql` |
305
+ | `clock` | none | called before every timed wait; pass a call into the Durable Object's own namespace, as above. Without it, `sleep` and timeouts can end early |
306
+ | `isolates` | `{ max: 8, waitMs: 10000, memory: 64 MiB, perInstance: 8 MiB }` | how many Dynamic Workers run at once, how long a spawn waits for one, and the memory budget per Dynamic Worker |
307
+
308
+ **How it works.** Workers has no `Worker`, refuses `Atomics.wait`, and does not share memory between isolates, so a process cannot block the way it does in a page. Here a process is a wasm instance in a Dynamic Worker, parked with JSPI (`WebAssembly.Suspending`) while its system call is answered by the Durable Object over Workers RPC.
309
+ - **The kernel side is the same code as in the page.** A proxy in the Durable Object speaks the kernel's shared-memory protocol on behalf of each remote process (`src/async/remote-worker.ts`).
310
+ - **The process side is derived at build time.** `tools/derive-async` turns the synchronous process runtime (`src/process/wasi`, `src/process/emscripten`) into an async one, `dist/async-process.js`: functions that can reach a kernel call become `async`, and wasm is entered through `WebAssembly.promising`. The build fails where it cannot (a kernel call in a constructor, a getter, or a callback passed to a synchronous built-in).
311
+ - **Emscripten programs run without their glue.** Workers refuses `eval`, and Emscripten's JavaScript file system layer cannot be suspended by JSPI. So the kernel implements the Emscripten import ABI itself (`src/process/emscripten`). `createNodeKernel({ emscripten: 'kernel' })` selects the same on Node; the default there and in the page stays the package's glue.
312
+ - **Programs are Worker modules.** Workers also refuses `WebAssembly.compile` at run time, so each program's wasm is handed to the Worker Loader, one Dynamic Worker per program, with many processes in it. A fork's memory snapshot stays inside that Dynamic Worker.
313
+
314
+ `createNodeKernel({ blocking: 'async', emscripten: 'kernel' })` runs the same async runtime on Node, for tests.
315
+
316
+ **Limits.**
317
+ - **Not supported:** threads (`pthread_create` fails with `EAGAIN`), `dlopen` and anything else that compiles wasm at run time, JS programs (`"abi": "js"`), and packages with an `imports` module. Each fails with an errno or a message, never a hang.
318
+ - **Memory:** a Dynamic Worker has 128 MB. A program whose wasm memory starts above that cannot run (`python.wasm` declares 160 MiB). Processes of one program share a Dynamic Worker up to the budget and then spill into another; at most 8 Dynamic Workers run at once, and a spawn beyond that waits, then fails with `EAGAIN`, which bash retries. A Dynamic Worker that outgrows its limit is ended by Cloudflare: its processes exit with status 70 and the kernel carries on.
319
+ - **CPU and signals:** a process that computes for 30 s without a system call is ended by Cloudflare. Nothing can interrupt it sooner: a signal, `SIGKILL` included, is seen at the process's next system call.
320
+ - **Clocks:** inside a Workers request the clock stands still while code computes. `time` and CPU accounting are wrong, and a timed wait that follows a long computation in the same process can end early by that computation's length.
321
+ - **Durability:** the SQLite root writes behind. Every `run()`, `writeFile()`, `chmod()`, terminal exit and client reply, and every `fsync` or `fdatasync`, makes all earlier writes durable. A program that never syncs can lose, on an unclean stop of the Durable Object, what it wrote since the last of those points: at most the last second, or 50 ms after its last write if it then went quiet. What survives is always a consistent tree. `sync` without a file does nothing, because Emscripten's libc compiles it away. `sqlite: { writeBehind: false }` commits every change at once, at about 25 ms per change.
322
+ - **Hard links** are refused on the root, as on every root.
323
+ - **Speed:** a system call costs about 0.3 ms and starting a process about 50–90 ms.
324
+
325
+ Measured on a deployed Worker, from a client about 40 ms away, next to local `wrangler dev`:
326
+
327
+ | | `wrangler dev` | deployed |
328
+ | --- | --- | --- |
329
+ | cold boot (SQLite root; bash, coreutils and ripgrep installed) | 67 ms | 736 ms |
330
+ | first `bash -c 'echo hi'` | 16 ms | 305 ms |
331
+ | warm `echo hi` | 9 ms | 100 ms |
332
+ | `echo a \| cat; x=$(uname); ls / \| head -3; for i in 1 2 3; do echo $i; done \| wc -l` | 100 ms | 865 ms |
333
+ | 1,000 `echo` lines | 87 ms | 506 ms |
334
+ | 20 × `$(echo x)` | 100 ms | 1,036 ms |
335
+ | 16-stage `cat` pipeline | 243 ms | 3,677 ms |
336
+ | 100 redirections into new files | 244 ms | 1,226 ms |
337
+ | `rg -l` over 200 files | 203 ms | 1,255 ms |
338
+
339
+ #### As a Cloudflare Computer backend
340
+
341
+ `sliccBackend` makes the kernel a `WorkspaceBackend` of `@cloudflare/computer`: `workspace.runtime.exec(source, { backend: 'slicc' })` runs `bash -c` with GNU bash and the installed packages, on the Workspace's own files, mounted at `/workspace`.
342
+
343
+ ```js
344
+ import { Workspace } from '@cloudflare/computer';
345
+ import { createCloudflareKernel, sliccBackend } from '@ai-ecoverse/slicc-kernel/cloudflare';
346
+
347
+ const workspace = new Workspace({
348
+ storage: ctx.storage,
349
+ sessionId: ctx.id.toString(),
350
+ backends: [sliccBackend({ kernel: () => kernel })],
351
+ });
352
+ const run = await workspace.runtime.exec('ls -la /workspace | wc -l', { backend: 'slicc' });
353
+ ```
354
+
355
+ Output is streamed, `killExec` signals the whole process group, and a timeout sends `SIGTERM` and then `SIGKILL`. The kernel's own root (`/root`, `/etc`, `/tmp`, `/node_modules`) lives in the same SQLite database as the Workspace, in its own tables.
356
+ - **What the Workspace store does not have:** owners (files show as uid 0 and `chown` fails), `utimes` (`touch -d` does nothing), hard links, and ranged writes (a write that seeks backwards rewrites the file).
357
+ - **Write-behind:** a file is committed to the Workspace up to 1 s after it is closed, and always before the run's exit event. `workspace.fs` can see a file that late during a run, and an error in a deferred commit is not reported to the program that wrote the file. `sliccBackend({ writeBehind: false })` commits at close.
358
+ - **Deletes are slow:** each removed file is one durable commit, about 30 ms on a deployed Worker.
359
+
245
360
  ## Commands
246
361
 
247
362
  Commands come from installed packages in npm's `node_modules` layout: every `<modules>/<name>/package.json` and `<modules>/@scope/<name>/package.json` with a `slicc.commands` block. An Emscripten program names its glue and module, for example bash's:
@@ -416,7 +531,7 @@ The module's default export (or its `main` export) is called with a context and
416
531
  - **Another tab:** a kernel sharing the OPFS root reports its changes too ([#1391](https://github.com/ai-ecoverse/slicc-kernel/issues/1391)): a structural change (create, remove, rename, mkdir) as `'rename'`, a content or metadata change as `'change'`. Their order across a name isn't guaranteed, and a new directory may also come with a `'change'`, so a watcher should treat either as "look again". Another tab's change never ends or renames a watch, and a directory watch doesn't hear one at the directory itself; a file watch hears another tab's write as `'change'`.
417
532
  - **Lifetime:** a watch ends with its process and doesn't keep the program alive.
418
533
  - **The older watches:** `kernel.watch` is unchanged, and a client's `fs.watch` with `{ paths }` hears another tab's changes too (see [`attachKernel`](#attachkernelport-options--promisekernelclient)).
419
- - `/dev`, in `open`, `fs` and their `sync` forms, as a WASI or Emscripten program sees it, with the same modes and owners as under `users`: `null`, `zero`, `full`, `random`, `urandom` and `tty` (character devices, `0666`, root's), `stdin`, `stdout` and `stderr` (links to `/proc/self/fd/0`, `1`, `2`), `fd` (a link to `/proc/self/fd`, so `/dev/fd/N` is descriptor N) and the kernel's terminals `/dev/ttyN` and `/dev/pts/N` (with users on, owned by the session's user or the master's opener, `0620`). `/dev/shm` is the kernel's shared tmpfs (see [Mounts](#mounts)), read and written like any other mount; `/dev/ptmx` isn't there. `stat` through `/dev/stdin`, `/dev/stdout` or `/dev/fd/N` describes the program's own descriptor (the file it is redirected to, a pipe, a terminal), `readlink` of `/dev/fd/N` names it (`pipe:[N]` and `socket:[N]` for a pipe or a socket), and a closed descriptor is `ENOENT`. Opening a device gives a kernel descriptor on it; opening `/dev/std*` or `/dev/fd/N` opens the file again with the flags asked for when the descriptor is on a file (as Linux reopens `/proc/self/fd/N`, so `append` appends and `truncate` truncates), and otherwise duplicates the descriptor; `/dev/tty` is the program's controlling terminal (`ENXIO` without one); and `/dev/ttyN` and `/dev/pts/N` are opened by name through the kernel, so a terminal that isn't the user's is `EACCES` under `enforce`. A file on anything but a regular file reads and writes as a stream (the position is ignored) and only in the directions it was opened for (`EBADF` otherwise), its `size()` is 0 and `truncate` is `EINVAL`. `readFile` reads a device or a descriptor to its end, up to 64 MiB, and fails with `EFBIG` past that (where Node's `readFile` throws `ERR_FS_FILE_TOO_LARGE`), so `readFile('/dev/zero')` fails instead of hanging, while a bounded `read` of it works. Other paths pay only a prefix check: they make the same kernel calls as before. Removing a `/dev` entry fails (see [`/dev`](#dev-entries)), and so does a new name directly in `/dev` or `/proc`;
534
+ - `/dev`, in `open`, `fs` and their `sync` forms, as a WASI or Emscripten program sees it, with the same modes and owners as under `users`: `null`, `zero`, `full`, `random`, `urandom` and `tty` (character devices, `0666`, root's), `stdin`, `stdout` and `stderr` (links to `/proc/self/fd/0`, `1`, `2`), `fd` (a link to `/proc/self/fd`, so `/dev/fd/N` is descriptor N) and the kernel's terminals `/dev/ttyN` and `/dev/pts/N` (with users on, owned by the session's user or the master's opener, `0620`), and the embedder's serial nodes and their `/dev/serial/by-id` links (see [Embedder devices](#embedder-devices), whose handles have the terminal controls as methods). `/dev/shm` is the kernel's shared tmpfs (see [Mounts](#mounts)), read and written like any other mount; `/dev/ptmx` isn't there. `stat` through `/dev/stdin`, `/dev/stdout` or `/dev/fd/N` describes the program's own descriptor (the file it is redirected to, a pipe, a terminal), `readlink` of `/dev/fd/N` names it (`pipe:[N]` and `socket:[N]` for a pipe or a socket), and a closed descriptor is `ENOENT`. Opening a device gives a kernel descriptor on it; opening `/dev/std*` or `/dev/fd/N` opens the file again with the flags asked for when the descriptor is on a file (as Linux reopens `/proc/self/fd/N`, so `append` appends and `truncate` truncates), and otherwise duplicates the descriptor; `/dev/tty` is the program's controlling terminal (`ENXIO` without one); and `/dev/ttyN` and `/dev/pts/N` are opened by name through the kernel, so a terminal that isn't the user's is `EACCES` under `enforce`. A file on anything but a regular file reads and writes as a stream (the position is ignored) and only in the directions it was opened for (`EBADF` otherwise), its `size()` is 0 and `truncate` is `EINVAL`. `readFile` reads a device or a descriptor to its end, up to 64 MiB, and fails with `EFBIG` past that (where Node's `readFile` throws `ERR_FS_FILE_TOO_LARGE`), so `readFile('/dev/zero')` fails instead of hanging, while a bounded `read` of it works. Other paths pay only a prefix check: they make the same kernel calls as before. Removing a `/dev` entry fails (see [`/dev`](#dev-entries)), and so does a new name directly in `/dev` or `/proc`;
420
535
  - `/proc`, in `fs`, `open` and their `sync` forms, the same as a WASI program's (see [`/proc`](#proc)): `stat`, `lstat`, `exists`, `readdir`, `readlink` and `readFile` answer it, and `/proc/self` is the program's own pid. It's read-only, so every change in it is `EROFS`: `writeFile`, `mkdir`, `rm`, `unlink`, `chmod`, a `rename`, `link` or `symlink` into or out of it, and an `open` for writing, creating or truncating. A file opened in it is a snapshot read at the open, with no descriptor (`fd` is `-1`): its `read` and `size` answer from the snapshot until it's closed, and `write` and `truncate` are `EBADF`. Other paths pay only a prefix check;
421
536
  - `signals`: `on(signal, handler)` catches a signal (by number or as `'SIGINT'`), `ignore(signal)` ignores it and `reset(signal)` restores its default action. A call blocked in a read or write is restarted after a handler runs; signals without a handler keep their default actions, so an uncaught `SIGINT` ends the program with 130 and `SIGKILL` always does;
422
537
  - `sync`: `read`, `write`, `close`, `open` (whose files' methods are synchronous too) and `fs`, made synchronously, for code that cannot `await`, such as a compiled program's file system or a `readFileSync`. A synchronous call holds the worker until the kernel answers, so nothing else of the program runs meanwhile, timers and callbacks included; a signal that arrives during a blocked read or write runs its handler, and the call is then restarted. Descriptors are shared with the rest of the context, so a file opened with `sync.open` can be closed with `close`, and the other way around; `sync.run` and `sync.exit` are described next;
@@ -1046,19 +1161,21 @@ The kernel's device nodes answer the mode and owner an Emscripten program sees f
1046
1161
  - A pty's `/dev/pts/N` is its owner's, with `0620`.
1047
1162
  - `/dev/pts` is a directory listing the open ptys, for Emscripten and WASIX programs as for JS ones, and `/dev` lists it ([#1040](https://github.com/ai-ecoverse/slicc-kernel/issues/1040)); an Emscripten program also stats a pty through a symlink to it.
1048
1163
  - `/dev/stdin`, `/dev/stdout`, `/dev/stderr` and `/dev/fd/N` answer for the descriptor they name.
1164
+ - The embedder's serial nodes, `/dev/ttyUSB<n>` and `/dev/ttyACM<n>`, are character devices with the owner, group, mode and major and minor they were added with, and `/dev/serial/by-id` lists their links (see [Embedder devices](#embedder-devices)).
1049
1165
  - A symlink elsewhere that leads to one of them, such as `/tmp/console -> /dev/tty`, answers the same when followed ([#1042](https://github.com/ai-ecoverse/slicc-kernel/issues/1042)).
1050
1166
 
1051
1167
  An Emscripten program sees those six character devices at `0666` with `users: 'off'` too.
1052
1168
 
1053
1169
  The owner calls follow [File owners](#file-owners): with `users: 'off'`, `fd_chown` and `path_chown` succeed and change nothing, and the four owner calls answer `ENOTSUP`, "owners not tracked", before looking at anything, so a libc can remember that once and take its own `getuid()` and `getgid()` as every file's owner, which is what an Emscripten program built against the credential calls sees. Devices are root's. A pipe's owner is the caller.
1054
1170
 
1055
- WASIX's own terminal calls carry only echo and line buffering (`tty_set`) and answer for "the" terminal whatever the descriptor (`tty_get`), so a WASIX program's `cfmakeraw` would leave `^C` a signal and its output post-processed. The kernel adds the import module `slicc_tty`, with the full Linux `struct termios` (musl's 60-byte layout: four `u32` flag words, `c_line`, `c_cc[32]`, then input and output speed; speeds read as `B38400` and are ignored when set) and answers per descriptor, again as a preview1 errno (`ENOTTY` for a descriptor that is no terminal, `EBADF` for one that isn't open, `ENOSYS` from kernels without them):
1171
+ WASIX's own terminal calls carry only echo and line buffering (`tty_set`) and answer for "the" terminal whatever the descriptor (`tty_get`), so a WASIX program's `cfmakeraw` would leave `^C` a signal and its output post-processed. The kernel adds the import module `slicc_tty`, with the full Linux `struct termios` (musl's 60-byte layout: four `u32` flag words, `c_line`, `c_cc[32]`, then input and output speed; speeds read as the speed bits of `c_cflag`, `B38400` on a terminal, which ignores them when set, while a [serial node](#embedder-devices) uses them) and answers per descriptor, again as a preview1 errno (`ENOTTY` for a descriptor that is no terminal, `EBADF` for one that isn't open, `ENOSYS` from kernels without them):
1056
1172
 
1057
1173
  | Import | Does |
1058
1174
  | --- | --- |
1059
1175
  | `tcgetattr(fd, termios_out)` | writes the terminal's termios |
1060
- | `tcsetattr(fd, actions, termios)` | sets every flag and `c_cc` as given (unknown bits are kept and read back), at once for `TCSANOW`, `TCSADRAIN` and `TCSAFLUSH` (0 to 2; anything else is `EINVAL`); `TCSAFLUSH` also drops the input typed but not yet read, the pending line too, as an Emscripten program's `TCSETSF` does |
1176
+ | `tcsetattr(fd, actions, termios)` | sets every flag and `c_cc` as given (unknown bits are kept and read back), at once for `TCSANOW`, `TCSADRAIN` and `TCSAFLUSH` (0 to 2; anything else is `EINVAL`); `TCSAFLUSH` also drops the input typed but not yet read, the pending line too, as an Emscripten program's `TCSETSF` does; on a [serial node](#embedder-devices), `TCSADRAIN` and `TCSAFLUSH` drain the output first |
1061
1177
  | `winsize(fd, winsize_out)` | writes `struct winsize` (`u16` rows, columns, then zero pixels) |
1178
+ | `ioctl(fd, request, arg)` | a Linux tty ioctl on a [serial node](#embedder-devices), with `arg` the value or the address Linux takes: `TCGETS`, `TCSETS*` (musl's 60-byte termios), `TCGETS2`, `TCSETS2*` (Linux's 44-byte `struct termios2`), `TIOCMGET`, `TIOCMSET`, `TIOCMBIS`, `TIOCMBIC`, `TIOCSBRK`, `TIOCCBRK`, `TCSBRK`, `TCSBRKP`, `TCFLSH`, `FIONREAD`, `TIOCOUTQ`, `TIOCGWINSZ`, `TIOCSWINSZ`, `TIOCEXCL` and `TIOCNXCL`; `TIOCSCTTY` is `EPERM` and any other request `ENOTTY`. On another descriptor it answers `FIONREAD` (the bytes ready to read) and `ENOTTY` for the rest. A wasix-sysroot routes its `ioctl` there for the requests above |
1062
1179
 
1063
1180
  A wasix-sysroot that builds `tcgetattr`, `tcsetattr`, `isatty` and `ioctl(TCGETS, TCSETS*, TIOCGWINSZ)` on them gives WASIX programs (python's `tty.setraw`, curses, ruby's `IO#raw`) a really raw terminal. Stock `tty_get` answers `ENOTTY` when none of the process's descriptors is a terminal, instead of an 80×24 terminal that isn't there, so stdio on pipes and files isn't taken for a terminal.
1064
1181
 
@@ -1304,6 +1421,33 @@ printf '{"kind":"open.url","url":"%s"}\n' "$url" | cat > /dev/embedder
1304
1421
  - **Limits:** at most 16 open requests per process (`EMFILE`) and 256 MiB of request windows per kernel, 128 requests at 2 MiB each (`EAGAIN` at `open()` beyond); a closed request frees its share.
1305
1422
  - `/dev/clipboard` stays as it is, text only. Image clipboards are kinds on this channel (`clipboard.read`, `clipboard.write`), answered by the embedder.
1306
1423
 
1424
+ ### Embedder devices
1425
+
1426
+ Serial ports the page can reach (Web Serial, in seven) appear as Linux character devices, `/dev/ttyUSB<n>` and `/dev/ttyACM<n>`, so `cat`, `stty`, `screen`, `picocom` and pyserial use them unchanged. The page adds them with [`kernel.devices.add`](#kerneldevices); a program can't create or remove them (see [`/dev` entries](#dev-entries)).
1427
+
1428
+ - **The node:** a character device with the owner, group and mode it was added with, major 188 for `ttyUSB` and 166 for `ttyACM` and minor `n`, as on Linux, so `ls -l /dev/ttyUSB0` shows `crw-r----- 1 root dialout 188, 0`. Its links are symlinks `/dev/serial/by-id/<name> -> ../../ttyUSB0`. Every process of the kernel sees them, in every runtime (Emscripten, WASI and WASIX, JS), in `stat`, `readdir` and `readlink`, whatever its session.
1429
+ - **Opening:** the normal permission check applies: reading needs `r` and `O_WRONLY` or `O_RDWR` need `w`, so with `root:dialout 0640` a `dialout` member reads and only root writes (an agent writes with `sudo`); a refusal is `EACCES` and goes to `onDenial`. Then the kernel calls the hook that answers the node, `open({ path, flags, stamp, signal })`, with `flags` the access mode (0, 1 or 2) and `stamp` the opener's `{ pid, uid, gid, groups, users, tag?, tags? }`, as for [`/dev/embedder`](#devembedder). It resolves with `{ readable, writable, control(op, args) }`: a byte `ReadableStream`, a byte `WritableStream` and a function that may return a promise. Its error fails the open, mapped as for `/dev/embedder` (`NotAllowedError` `EACCES`, `NotSupportedError` `ENOTSUP`, `NotFoundError` `ENOENT`, anything else `EIO`); a signal while it waits fails the open with `EINTR` and aborts `signal`. A node has one open file description at a time: a second open is `EBUSY` until the first is closed everywhere (dups, forks and inherited descriptors share the first), as Web Serial ports behave and as `TIOCEXCL`, which pyserial sets, asks. Closing the last descriptor waits up to 30 s for the output to drain (Linux's `closing_wait`), then cancels both streams and releases their locks, and only then calls `control('close')`, so the hook can close a Web Serial port, whose `close()` rejects while its streams are locked.
1430
+ - **Read and write:** the kernel reads `readable` into its own buffer, at most 64 KiB ahead of the program, and reads block, return what is there, honour `O_NONBLOCK` (`EAGAIN`) and wake `poll`, `select`, epoll and `FIONREAD` (`TIOCINQ`), as for a terminal. A write waits while `writable` applies backpressure (`EAGAIN` with `O_NONBLOCK`) and returns once its bytes are queued there. The end of `readable` is a hangup: reads return 0, writes fail with `EIO` and `poll` reports `POLLHUP`; an error of either stream is `EIO`. A signal interrupts a blocked call with `EINTR`, as for pipes.
1431
+ - **Terminal settings:** the node is a terminal (`isatty` is true, `ttyname` names it) with its own termios, which starts as Linux's for a USB serial port made raw (`cfmakeraw`): `B9600`, `CS8`, no parity, one stop bit, no flow control (`CREAD`, `HUPCL` and `CLOCAL` set), `VMIN` 1. The settings stay with the node across opens, so `stty -F /dev/ttyUSB0 115200` holds for the next program, as on Linux, and an open whose saved settings differ from that start configures the port before it returns. `TCGETS`, `TCSETS`, `TCSETSW` (drains output first) and `TCSETSF` (also discards input), and `TCGETS2`/`TCSETS2`/`TCSETSW2`/`TCSETSF2` with `BOTHER` and `c_ispeed`/`c_ospeed` for a custom speed, take every flag and `c_cc` as given and keep them. A change to the speed (`B50` to `B4000000`, from `cfsetispeed`/`cfsetospeed` or `BOTHER`), `CSIZE`, `PARENB`/`PARODD`, `CSTOPB` or `CRTSCTS` calls `control('configure', { baudRate, dataBits, parity, stopBits, flowControl })` once and waits for it (`parity` `'none'`, `'even'` or `'odd'`, `stopBits` 1 or 2, `flowControl` `'none'` or `'hardware'`); its error fails the call and leaves the old settings. `B0` drops DTR and RTS instead, as on Linux, and the line stays hung up: an open whose saved speed is `B0` calls `control('setSignals', { dataTerminalReady: false, requestToSend: false })` rather than `configure`, and the first setting with a real speed configures the port and raises DTR and RTS again. The rest of the line discipline is the kernel's pseudo-terminal one: with `ICANON`, `ECHO`, `ICRNL` or `OPOST`/`ONLCR` set, the node edits lines, echoes to the port and translates as a pty does. A node is never a controlling terminal: `O_NOCTTY` is implied, `TIOCSCTTY` is `EPERM`, `TIOCGPGRP` and `TIOCSPGRP` are `ENOTTY`, and a `VINTR` byte with `ISIG` set signals nobody. `TIOCGWINSZ` answers 0 × 0 until a `TIOCSWINSZ`.
1432
+ - **Owner, mode and times:** an Emscripten program's `chmod`, `chown` and `utimensat` of a node (by its name or through its link), and `fchmod`, `fchown` and `futimens` on an open one, change the node itself under the rules for any file: the mode is the owner's or root's to change, the owner only root's, the group the owner's to change to one of its own groups, and the times the owner's or root's (setting them to now also any user who may write it); anyone else gets `EPERM` (`EACCES` for now without write permission), reported to `onDenial`. The change shows in `stat` in every runtime and lasts until the node is removed. With `users: 'off'` nothing is checked.
1433
+ - **Modem lines:** `TIOCMGET` asks `control('signals')`, which resolves with `{ clearToSend, dataCarrierDetect, dataSetReady, ringIndicator }` (`TIOCM_CTS`, `TIOCM_CD`, `TIOCM_DSR`, `TIOCM_RI`), and adds the DTR and RTS the kernel last set (both on at the first open, as Linux raises them). `TIOCMSET`, `TIOCMBIS` and `TIOCMBIC` call `control('setSignals', { dataTerminalReady, requestToSend })`.
1434
+ - **Break, flush and drain:** `TIOCSBRK` and `TIOCCBRK` call `control('setSignals', { break: true })` and `{ break: false }`; `TCSBRK` with 0 (`tcsendbreak`) drains, then sends a 250 ms break, and `TCSBRKP` one of `arg` × 100 ms. `TCSBRK` with any other value (`tcdrain`) waits until `writable` has taken everything written. `TCFLSH` (`tcflush`) with `TCIFLUSH`, `TCOFLUSH` or `TCIOFLUSH` discards the kernel's own input buffer for the first and third and calls `control('flush', { input, output })`. `TIOCOUTQ` answers the bytes `writable` hasn't taken yet.
1435
+ - **Other ioctls:** `TIOCEXCL` and `TIOCNXCL` are accepted (the node is exclusive anyway); `FIONBIO`, `FIONCLEX`, `FIOCLEX` and `FIOASYNC` go to the runtime's own handling, as for any file. Any other ioctl is `ENOTTY`, as Linux answers for an unknown tty ioctl.
1436
+ - **Runtimes:** an Emscripten program makes these calls with `ioctl`, `tcgetattr`/`tcsetattr`, `tcdrain`, `tcflush` and `tcsendbreak` as on Linux. A WASIX program has them through `slicc_tty` (see [WASI programs](#wasi-programs)): `tcgetattr` and `tcsetattr` (`TCSADRAIN` and `TCSAFLUSH` drain first) and `ioctl(fd, request, arg)` for the rest. A JS program's `ctx.open` of a node (and `ctx.sync.open`) returns a handle with the controls as methods:
1437
+
1438
+ | method | does |
1439
+ | --- | --- |
1440
+ | `termios()` | the node's settings, `{ c_iflag, c_oflag, c_cflag, c_lflag, c_cc, ispeed, ospeed }` (Linux values, speeds in baud) |
1441
+ | `setTermios(termios, when?)` | sets them, speeds from `ispeed` and `ospeed` (any value, as `BOTHER` would), `when` `'now'` (the default), `'drain'` or `'flush'`, as `TCSETS2`, `TCSETSW2` and `TCSETSF2` |
1442
+ | `modem()` | `{ dtr, rts, cts, dsr, cd, ri }`, as `TIOCMGET` |
1443
+ | `setModem({ dtr?, rts? })` | sets the lines given, as `TIOCMBIS` and `TIOCMBIC` |
1444
+ | `setBreak(on)`, `sendBreak()` | `TIOCSBRK`/`TIOCCBRK`, and a 250 ms break after draining |
1445
+ | `drain()` | waits until the port has taken everything written |
1446
+ | `flush(queue?)` | discards `'input'`, `'output'` or `'both'` (the default), as `tcflush` |
1447
+
1448
+ `ctx.sync.open` has the same methods, synchronous. A closed handle's methods fail with `EBADF`.
1449
+ - **Not there yet:** `/sys/class/tty`, through which pyserial's `list_ports` and Node `serialport`'s list find ports, and `TIOCGSERIAL`.
1450
+
1307
1451
  ### Protected paths
1308
1452
 
1309
1453
  `createKernel({ protect: { paths: ['/node_modules', '/os'] } })` makes those directories read-only for every process, root included, in every `users` mode. They hold code every later process runs, which only the embedder writes, straight to OPFS.
@@ -1339,7 +1483,7 @@ printf '{"kind":"open.url","url":"%s"}\n' "$url" | cat > /dev/embedder
1339
1483
 
1340
1484
  ### `/dev` entries
1341
1485
 
1342
- `/dev` and `/proc` hold the kernel's own entries, and a program can't add or remove names there. Only `/dev/shm`, a tmpfs, takes new files.
1486
+ `/dev` and `/proc` hold the kernel's own entries, and a program can't add or remove names there. Only `/dev/shm`, a tmpfs, takes new files, and only the embedder adds names: its serial nodes and their `/dev/serial/by-id` links (see [Embedder devices](#embedder-devices)), which a program can't remove either.
1343
1487
  - **Removing** an entry fails and leaves it: `EACCES` for a user, `EPERM` for root on a device, `EBUSY` for `/dev` itself.
1344
1488
  - **Creating** a name that doesn't exist fails in every runtime, whether it's a file, a directory, a symlink, a device node, or the new name of a link or a rename: `EACCES` for a user, `EPERM` for root in `/dev`, and `EROFS` in `/proc`.
1345
1489
  - **Why:** an Emscripten program's `/dev` and `/proc` live in its glue's own memory, so such a file used to look written and then vanish when the process exited. On the root file system no other runtime would see it either.
@@ -1450,6 +1594,7 @@ The kernel is ported from SLICC's `packages/webapp/src/kernel/` with the browser
1450
1594
  - `src/cdp/`: the CDP facade on `127.0.0.1:9222`, its WebSocket framing, the registry of hosts and the `MessagePort` bridge to them.
1451
1595
  - `src/sudo.ts`, `src/sudoers.ts`, `src/sudo-command.ts`: the kernel side of `sudo` and `visudo -c`, the policy parser (both line forms and their diagnostics), and the two commands.
1452
1596
  - `src/time-zone.ts`: the system time zone (`timeZone`, or the browser's) and UTC offsets of a zone, which cron's schedules and `TZ` both come from.
1597
+ - `src/async/`, `src/process/emscripten/`, `src/cloudflare.ts`, `src/cloudflare/` and `tools/derive-async/`: the kernel [in a Cloudflare Durable Object](#in-a-cloudflare-durable-object). `src/async/` is the link between the kernel and a process that shares no memory with it; `src/process/emscripten/` the kernel's own Emscripten imports; `src/cloudflare/` the Durable Object host, the SQLite root and the Cloudflare Computer backend; `tools/derive-async/` the build step that derives the async process runtime. Their tests are in `test/integration/cf/` and run in Node, with `node --test --test-concurrency=2 'test/integration/cf/*.test.mjs'`; those named `cloudflare-*` and `computer-cloudflare-*` start `wrangler dev`, and run against a deployed Worker when given its URL and key. `npm test` and CI run them with the rest. On a pull request, CI's `deploy` job runs `tools/cf-staging.mjs`, which deploys `examples/cloudflare-computer` as the Worker `slicc-kernel-do-pr-<number>` with a fresh random key, and hands its address to the test shards and the reviewers as `STAGING_URL` (`https://…workers.dev/?key=…`); `computer-cloudflare-staging.test.mjs` then runs the Computer example's tests against it. That address, key included, shows in the run's log and on the pull request, so the Worker stops answering 24 hours after its deploy, and its programs have no network. The job needs the secret `SLICC_KERNEL_CLOUDFLARE_API_TOKEN` (a Cloudflare API token that may edit Workers scripts; `SLICC_KERNEL_CLOUDFLARE_ACCOUNT_ID` too when the token sees several accounts). Without it, on a fork, in the merge queue, or when the deploy fails, there is no staging Worker and that test file skips. Each deploy deletes the staging Workers of other pull requests that no deploy has touched for a week.
1453
1598
  - `src/cron/`: the cron service (`service.ts`), the schedule and table parsers, the clock, and the `crontab` command with the kernel side of `ctx.crontab`. An embedder that uses `Launcher` directly passes `cron: { lock }` to share the firing lock among the kernels on one root; the default, `slicc-kernel-cron`, is one lock for the whole origin.
1454
1599
 
1455
1600