Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Guidance for agents working in this repository. Prefer the checked-in code and t
## 1. Project

- Published on npm as one package, `serverless-objects` (0.13.x, pre-alpha). It contains the `sobjects` CLI, the native engine, and the `serverless-objects/hotcell` and `serverless-objects/autopilot` modules. There is no `@serverless-objects` npm scope; ship new modules as subpath exports of this package.
- Two engines: celld (external, pinned 0.6.2) and the native engine (`sobjects dev --engine native`: in-process, trusted code, node:sqlite per object). Conformance: Cloudflare 17/17 (`test:cloudflare`, deploys to the logged-in account and deletes afterwards), Wrangler 4.150.0 17/17, celld 0.6.2 19/19, native 18/18 (hibernation runs everywhere but Wrangler; facets pass on Wrangler and celld but not the native engine; a schedule across restart runs on celld and native).
- Two engines: celld (external, pinned 0.6.2) and the native engine (`sobjects dev --engine native`: in-process, trusted code, node:sqlite per object). Conformance: Cloudflare 17/17 (`test:cloudflare`, deploys to the logged-in account and deletes afterwards), Wrangler 4.150.0 21/21, celld 0.6.2 24/24, native 23/23 (hibernation runs everywhere but Wrangler; facets pass on Wrangler and celld but not the native engine; a schedule across restart runs on celld and native; the PartyServer suite runs on Wrangler, celld and native but not Cloudflare).
- ACME HTTP-01 is verified only against a local Pebble server. Point-in-time restore is not available on celld 0.6. The native engine has bucket backups (`--backup-bucket`; `--backup-mode durable` holds each result until its writes are in the bucket and adds Cloudflare's point-in-time recovery API, back `--backup-retention-days`), several nodes per bucket (`--node-name`, `--peer-listen`), and optional worker threads (`--threads`; fault and CPU isolation, not a security boundary). A `[native]` table in `sobjects.toml` (instead of `[celld]`) makes `sobjects up` run it as `sobjects dev --engine native` in a child process; `[admin]` isn't supported with it yet. Roadmap targets are not guarantees.

Serverless Objects is a self-hostable operating layer for Cloudflare Workers and Durable Objects applications, aimed at coding-agent infrastructure. It is JavaScript (ES modules) on Node.js >=22, managed with npm workspaces; the product is the `sobjects` CLI (workspace package `serverless-objects`). The CLI supervises the external celld runtime (pinned v0.6.2) for production nodes and also ships a Node-native engine for trusted code. Cloudflare Workers/Wrangler APIs are the compatibility contract. The dashboard is plain HTML/CSS/JS; there is no application framework or TypeScript codebase. Status: pre-alpha.
Expand Down Expand Up @@ -54,7 +54,7 @@ CI: `.github/workflows/ci.yml` runs `npm ci`, `npm test`, and the Wrangler and n
| `packages/cli/autopilot/` | `serverless-objects/autopilot` (and `/autopilot/cell`): `RunObject`/`RunRegistry`/`AutopilotCellRun`. Runtime-independent logic in `run-store.js`, `run-host.js`, `registry-store.js` and `cell-executor.js` over an `{exec, transaction}` SQL adapter; tests (`test/autopilot-*.test.js`) use `node:sqlite`. |
| `deploy/compose/` | Dockerfile and Compose bundle for a single node; pins the npm CLI version via `SOBJECTS_VERSION`. |
| `examples/` | Runnable Wrangler projects (not workspaces) that import the packages through the root `node_modules`. |
| `packages/conformance/` | Private workspace: conformance apps (`app/` core, `agents-app/` Agents SDK), runner (`src/run.js`) for Wrangler, celld and native, and runner tests. |
| `packages/conformance/` | Private workspace: conformance apps (`app/` core, `agents-app/` Agents SDK, `party-app/` PartyServer), runner (`src/run.js`) for Wrangler, celld and native, and runner tests. |
| `sobjects.example.toml` | Safe starter configuration; copy to the ignored, machine-specific `sobjects.toml`. |
| `docs/conformance/` | Recorded Workers/celld compatibility findings (`m0-celld.md`) and conformance results (`results.md`); consult before changing runtime assumptions. |
| `docs/install.md`, `docs/porting-from-cloudflare.md`, `docs/compatibility.md` | User guides and the supported/unsupported table; keep them in step with conformance results. |
Expand All @@ -77,7 +77,7 @@ CI: `.github/workflows/ci.yml` runs `npm ci`, `npm test`, and the Wrangler and n
## 5. Dependencies

- Use npm workspaces and commit the matching `package-lock.json` update. Add CLI runtime dependencies with `npm install --workspace=serverless-objects <package>`; use `--save-dev` for tools used only in development/tests. Keep root tooling out of runtime dependencies.
- CLI runtime dependencies: `jsonc-parser`, `smol-toml`, `esbuild` (celld deploy, the native engine and `build`), `@hotcell/sdk` (Hotcell binding and cell executor), and for ACME `jose`, `@root/csr`, `@root/keypairs`, `@root/encoding`; tests use Node built-ins and `node:sqlite`. The conformance workspace pins `wrangler` and `agents` exactly as dev dependencies. Avoid adding dependencies for functionality available in supported Node versions.
- CLI runtime dependencies: `jsonc-parser`, `smol-toml`, `esbuild` (celld deploy, the native engine and `build`), `@hotcell/sdk` (Hotcell binding and cell executor), and for ACME `jose`, `@root/csr`, `@root/keypairs`, `@root/encoding`; tests use Node built-ins and `node:sqlite`. The conformance workspace pins `wrangler`, `agents` and `partyserver` exactly as dev dependencies. Avoid adding dependencies for functionality available in supported Node versions.
- Examples: runtime package `npm install --workspace=serverless-objects <package>`; test/build-only tool `npm install --workspace=serverless-objects --save-dev <package>`. Keep the root lockfile synchronized.
- No bundler/native dependency pipeline exists. Keep celld as an external executable: `engine.js` pins its version and SHA-256 asset checksums, installs/verifies it at runtime, and supports `SOBJECTS_CELLD_BIN` for an existing binary. Do not bundle or bypass verification of it.
- Package dependency ranges currently use npm semver ranges (for example `^`) with the lockfile providing reproducibility; the engine version is exact and checksum-pinned. Preserve that distinction and update checksums when intentionally changing celld.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ State survives `down` and `up` because it lives in the bucket. The [install guid

## Compatibility

Cloudflare's APIs are the contract. The current [conformance results](docs/conformance/results.md) pass every check on real Cloudflare (17/17), Wrangler 4.150.0 (17/17), celld 0.6.2 (19/19) and the native engine (18/18): the same apps, unchanged. They cover Durable Object IDs, KV and SQL storage, transactions, input gates, RPC, alarms (including across a restart), WebSockets with hibernation on celld, facets on Wrangler and celld, and an Agents SDK suite: state, SQL, schedules (including one across a restart), addressing and `@callable()` RPC.
Cloudflare's APIs are the contract. The current [conformance results](docs/conformance/results.md) pass every check on real Cloudflare (17/17), Wrangler 4.150.0 (21/21), celld 0.6.2 (24/24) and the native engine (23/23): the same apps, unchanged. They cover Durable Object IDs, KV and SQL storage, transactions, input gates, RPC, alarms (including across a restart), WebSockets with hibernation on celld, facets on Wrangler and celld, an Agents SDK suite (state, SQL, schedules including one across a restart, addressing and `@callable()` RPC), and a PartyServer suite (storage, alarms, room routing, broadcast and hibernation). The Cloudflare run predates the PartyServer suite.

Not covered yet: sockets across a cell move between nodes, PartyServer, Agents SDK chat, MCP and Workflows, and Cloudflare-hosted production behavior. Facets pass on Wrangler and celld but are not implemented by the native engine. Point-in-time restore isn't available on celld 0.6; the native engine has Cloudflare's point-in-time recovery API in durable mode. The [compatibility table](docs/compatibility.md) has the details, including Containers and `@cloudflare/sandbox` 1.0 on celld. The [porting guide](docs/porting-from-cloudflare.md) covers moving an existing project.
Not covered yet: sockets across a cell move between nodes, PartyServer on Cloudflare or through `sobjects deploy`, Agents SDK chat, MCP and Workflows, and Cloudflare-hosted production behavior. Facets pass on Wrangler and celld but are not implemented by the native engine. Point-in-time restore isn't available on celld 0.6; the native engine has Cloudflare's point-in-time recovery API in durable mode. The [compatibility table](docs/compatibility.md) has the details, including Containers and `@cloudflare/sandbox` 1.0 on celld. The [porting guide](docs/porting-from-cloudflare.md) covers moving an existing project.

## Repository layout

Expand All @@ -115,7 +115,7 @@ celld is driven through a small contract: the Wrangler bundle, the Wrangler conf
| Engine | Status | Notes |
|---|---|---|
| [celld](https://github.com/denoland/celld) | Supported (0.6.2, pinned) | Runs Wrangler bundles with Durable Objects, KV, D1, R2, Queues, Workflows and Containers. |
| native | In progress: `sobjects dev --engine native` | Runs the Worker and Durable Objects in Node, with each object in its own SQLite file and full Node APIs inside objects. It passes the full conformance suite (18/18, hibernation and the Agents SDK included, with facets skipped), with idle eviction. `sobjects build --strict` checks that an app stays portable to Cloudflare. `--backup-bucket` backs objects up to S3-compatible storage (with `--backup-mode durable`, every acknowledged write is in the bucket), `--threads N` spreads objects over worker threads, and `--node-name` lets several nodes share one bucket, taking over each other's objects and forwarding calls. A `[native]` table in `sobjects.toml` runs it under `sobjects up`. For trusted code. See [the native engine](docs/native-engine.md). |
| native | In progress: `sobjects dev --engine native` | Runs the Worker and Durable Objects in Node, with each object in its own SQLite file and full Node APIs inside objects. It passes the full conformance suite (23/23, hibernation, the Agents SDK and PartyServer included, with facets skipped), with idle eviction. `sobjects build --strict` checks that an app stays portable to Cloudflare. `--backup-bucket` backs objects up to S3-compatible storage (with `--backup-mode durable`, every acknowledged write is in the bucket), `--threads N` spreads objects over worker threads, and `--node-name` lets several nodes share one bucket, taking over each other's objects and forwarding calls. A `[native]` table in `sobjects.toml` runs it under `sobjects up`. For trusted code. See [the native engine](docs/native-engine.md). |

## Why

Expand Down
3 changes: 2 additions & 1 deletion docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ This table distinguishes behavior exercised by the project from functionality de
| WebSocket hibernation/eviction | Tested on celld | Same-node hibernation passed on celld 0.6.2: the object was evicted with a socket open, and the next message reached a new instance with tags and attachment intact. Not run on Wrangler (no eviction control). celld documents that sockets may close when a cell moves between nodes; that is not tested. |
| Facets | Tested on Wrangler and celld | `ctx.facets.get` with a class taken from `ctx.exports` passed on Wrangler 4.150.0 and celld 0.6.2: state by name, isolation between facets, storage separate from the parent, and alarms refused. The native engine does not implement `ctx.facets`, so the check is skipped there. |
| Durable Object migrations | Limited upstream support | celld 0.6.2 accepts `tag` and `new_sqlite_classes`; rename/delete/transfer migrations are rejected. |
| Agents SDK / PartyServer | Partial | A minimal `agents` 0.28.1 app was deployed through `sobjects deploy` and served by `sobjects up` behind TLS ingress (celld 0.6.2, SeaweedFS): routing, `setState`, `this.sql`, `schedule()` (including one pending across a node restart), and the WebSocket identity/state protocol matched `wrangler dev`. Callable RPC passes in the conformance suite on celld and the native engine (Agents SDK client protocol), and a delayed schedule now survives a process restart there, but neither has been exercised through `sobjects deploy`/`up`; chat agents, MCP, Workflows and the official samples have not been run through the CLI. PartyServer chat was tested only directly on celld in M0. See [M0 findings](conformance/m0-celld.md). |
| Agents SDK | Partial | A minimal `agents` 0.28.1 app was deployed through `sobjects deploy` and served by `sobjects up` behind TLS ingress (celld 0.6.2, SeaweedFS): routing, `setState`, `this.sql`, `schedule()` (including one pending across a node restart), and the WebSocket identity/state protocol matched `wrangler dev`. Callable RPC passes in the conformance suite on celld and the native engine (Agents SDK client protocol), and a delayed schedule now survives a process restart there, but neither has been exercised through `sobjects deploy`/`up`; chat agents, MCP, Workflows and the official samples have not been run through the CLI. |
| PartyServer | Tested on Wrangler, celld and the native engine | `partyserver` 0.5.10 in its own conformance app: `getServerByName` and `this.name` from `ctx.id.name`, `onStart`, `this.sql`, alarms, `/parties/<namespace>/<room>` routing, `broadcast()` to two connections, connection attachments, and hibernation across idle eviction (celld and native only; Wrangler's local runtime gives the runner no eviction control). Not run on Cloudflare, and not through `sobjects deploy`/`up`. The native engine needed workerd's `READY_STATE_*` ready-state constants on the global `WebSocket` for PartyServer's connection manager. See [results](conformance/results.md). |
| Cloudflare-hosted production behavior | Not tested | Local Wrangler and celld results do not certify production Cloudflare behavior. |

## Bindings and topology
Expand Down
17 changes: 12 additions & 5 deletions docs/conformance/results.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

Recorded 19–29 Oct 2026 on macOS arm64 with Node.js 24.12.0, using the local
Wrangler runner as the reference and celld's local development server. Each
runner completed all of its checks in one run: 17 on Wrangler (11 core, 6 Agents SDK), 19 on celld (adding hibernation and facets) and 18 on the native engine (adding hibernation and a schedule across restart, without facets).
runner completed all of its checks in one run: 21 on Wrangler (11 core, 6 Agents SDK, 4 PartyServer), 24 on celld (adding hibernation and facets, plus a PartyServer hibernation check) and 23 on the native engine (adding hibernation and a schedule across restart, without facets).

- Wrangler: 4.150.0 (`wrangler dev --local`)
- celld: 0.6.2 (`celld dev`)
- Agents SDK: `agents` 0.28.1 (separate app with `nodejs_compat`)
- PartyServer: `partyserver` 0.5.10 (separate app with `nodejs_compat`)
- Worker compatibility date: `2026-02-24`
- Command: `npm run test:wrangler --workspace=sobjects-conformance` and
`npm run test:celld --workspace=sobjects-conformance`
Expand All @@ -29,10 +30,14 @@ runner completed all of its checks in one run: 17 on Wrangler (11 core, 6 Agents
| Agents SDK schedule across restart | Not run | Not run | Pass | Pass | A delayed schedule armed before a process restart was still pending afterwards and fired |
| Agents SDK addressing | Pass | Pass | Pass | Pass | `getAgentByName`, `this.name`, class name, `/agents/<class>/<name>` routing |
| Agents SDK client protocol | Pass | Pass | Pass | Pass | Identity and state frames, `@callable()` RPC over WebSocket, state broadcast, non-callable methods refused |
| PartyServer storage and addressing | Not run | Pass | Pass | Pass | `getServerByName`, `this.name` from `ctx.id.name`, `onStart`, and `this.sql` create/insert/ordered select |
| PartyServer alarm | Not run | Pass | Pass | Pass | `setAlarm`, `onAlarm` and `getAlarm` through PartyServer's `alarm()` |
| PartyServer WebSocket broadcast | Not run | Pass | Pass | Pass | `/parties/chat/<room>` routing, welcome frames, `broadcast()` to both connections, connection count, attachment, and `this.sql` from a socket message |
| PartyServer WebSocket hibernation | Not run | Not run | Pass | Pass | Evicted with the socket open; the next message reached a new instance with the connection attachment rehydrated from the socket |

The Cloudflare column is from `npm run test:cloudflare` (20 Oct 2026): 17/17. The runner deployed both apps unchanged with `wrangler deploy` to a workers.dev subdomain on the free plan, ran every check against the deployment, and deleted the Workers. Cloudflare hibernated the object on its own during a 30-second idle period. There is no process to restart, so the alarm-across-restart check runs as plain alarm delivery there. The facets and schedule-across-restart checks were added after that run and have not been run on Cloudflare.
The Cloudflare column is from `npm run test:cloudflare` (20 Oct 2026): 17/17. The runner deployed both apps unchanged with `wrangler deploy` to a workers.dev subdomain on the free plan, ran every check against the deployment, and deleted the Workers. Cloudflare hibernated the object on its own during a 30-second idle period. There is no process to restart, so the alarm-across-restart check runs as plain alarm delivery there. The facets, schedule-across-restart and PartyServer checks were added after that run and have not been run on Cloudflare.

The native engine column is from `npm run test:native` on the same host (29 Oct 2026): 18/18, with `--idle-evict-seconds 2` for the hibernation check; see [the native engine](../native-engine.md).
The native engine column is from `npm run test:native` on the same host (29 Oct 2026): 23/23, with `--idle-evict-seconds 2` for the hibernation checks; see [the native engine](../native-engine.md). The PartyServer suite needed one engine fix: the global `WebSocket` now exposes workerd's `READY_STATE_*` ready-state constants, which PartyServer reads when it filters hibernatable sockets.

## Platforms

Expand All @@ -41,7 +46,9 @@ Every column above is one local run on macOS arm64. CI runs the Wrangler and nat
## Not covered

This v0 run does not test hibernation on Wrangler, the alarm-across-restart check on Cloudflare or Wrangler, sockets across a cell move between nodes, all
compatibility flags, PartyServer, or
Agents SDK chat agents, MCP, Workflows and streaming RPC. These runners use `wrangler dev` and `celld dev` directly; they do not
compatibility flags, or
Agents SDK chat agents, MCP, Workflows and streaming RPC. PartyServer is covered
by its own suite on Wrangler, celld and the native engine, but not on Cloudflare,
and not through `sobjects deploy`. These runners use `wrangler dev` and `celld dev` directly; they do not
go through `sobjects deploy`. Those remain separate
conformance and product-level gates.
Loading
Loading