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
5 changes: 3 additions & 2 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 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).
- 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). The Agents app also passes 6/6 through `sobjects deploy`/`up` (`test:product`, not in CI).
- 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 All @@ -24,6 +24,7 @@ Run from the repository root unless a command says otherwise. Node.js 22+ is req
| Benchmark | `npm run bench --workspace=sobjects-conformance -- --target native` (or `celld`, `wrangler`, `--url URL`) | Runs `bench-app/` and prints latency/throughput; not run in CI. Results and durability caveats in `docs/benchmarks.md`. |
| Conformance (Cloudflare) | `npm run test:cloudflare --workspace=sobjects-conformance` | Deploys both apps with `wrangler deploy` to the account Wrangler is logged in to, runs every check, then deletes the Workers (`--keep-deployment` keeps them). Outward-facing: needs the account owner's OK; not run in CI. |
| Conformance (native) | `npm run test:native --workspace=sobjects-conformance` (add `-- --native-threads 3` for threads) | Runs them against the native engine from this checkout; CI runs both. |
| Product path (Agents app) | `npm run test:product --workspace=sobjects-conformance -- --local-s3` | Deploys `agents-app` with `sobjects deploy` and serves it with `sobjects up --detach` behind TLS ingress, then runs the Agents SDK checks against the ingress. `--local-s3` starts a disposable SeaweedFS bucket; needs Docker and celld, not run in CI. |
| Native engine | `npm exec --workspace=serverless-objects -- sobjects dev [project] --engine native` | Runs a project in Node with no celld; state under `<project>/.sobjects/native`. |
| Portability check | `npm exec --workspace=serverless-objects -- sobjects build [project] --strict` | Fails if the app imports Node.js built-ins that don't work on Cloudflare Workers. |
| CLI help | `npm exec --workspace=serverless-objects -- sobjects --help` | Uses the workspace CLI entry point. |
Expand Down Expand Up @@ -54,7 +55,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, `party-app/` PartyServer), 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), runners (`src/run.js` for Wrangler, celld and native; `src/product.js` for `sobjects deploy`/`up`), 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 Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,11 @@ State survives `down` and `up` because it lives in the bucket. The [install guid
- **A loopback dashboard and admin API.** Node load, the objects in each namespace, a key-value browser and read-only SQL console per object, eviction, logical JSON export, and Prometheus `/metrics`.
- **A Hotcell `Sandbox` binding** ([`serverless-objects/hotcell`](docs/hotcell-binding.md)). It has the Cloudflare Sandbox SDK 0.x call shape and reattaches to its sandbox after the object is evicted. With egress enabled, sandboxes get gateway tokens, never real provider keys.
- **Autopilot runs as objects** ([`serverless-objects/autopilot`](docs/autopilot.md)). One Durable Object per run holds its state machine, budgets, hash-only tool records, durable wake timers and a Camouflage session log that streams from a cursor. A registry per workspace lists and reconciles runs. `AutopilotCellRun` executes the task with Autopilot in a Hotcell cell. Stop the node mid-run, and after restart the object resumes from its saved cursor while the cell keeps working.
- **A conformance suite** ([`packages/conformance`](packages/conformance)) that runs the same apps under `wrangler dev` and celld, so engine differences show up as failing checks.
- **A conformance suite** ([`packages/conformance`](packages/conformance)) that runs the same apps under `wrangler dev` and celld, so engine differences show up as failing checks, and runs the Agents app through `sobjects deploy`/`up` behind TLS ingress.

## 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 (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.
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. The Agents app also passes 6/6 through `sobjects deploy` and `sobjects up` behind TLS ingress (`test:product`).

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.

Expand All @@ -104,7 +104,7 @@ Not covered yet: sockets across a cell move between nodes, PartyServer on Cloudf
|---|---|
| [`packages/cli`](packages/cli) | The `serverless-objects` npm package: the `sobjects` CLI (`src/`), the Hotcell Sandbox binding (`hotcell/`, imported as `serverless-objects/hotcell`) and Autopilot run objects (`autopilot/`, imported as `serverless-objects/autopilot`). Its README is the CLI reference. |
| [`examples/autopilot-runs`](examples/autopilot-runs) | An HTTP demo of run objects: wake after restart, event streams, reconcile. |
| [`packages/conformance`](packages/conformance) | Conformance apps and the Wrangler and celld runners. |
| [`packages/conformance`](packages/conformance) | Conformance apps and the Wrangler, celld, native and product-path runners. |
| [`deploy/compose`](deploy/compose) | Dockerfile and Compose bundle for a single node, with an optional local SeaweedFS bucket. |
| [`docs/`](docs) | Install, porting and compatibility guides, and recorded conformance results. |

Expand Down
2 changes: 1 addition & 1 deletion docs/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ 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 | 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. |
| 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), the WebSocket identity/state protocol, and `@callable()` RPC over WebSocket matched `wrangler dev`. `npm run test:product` repeats the state, SQL, schedules, addressing, callable RPC and schedule checks against that deployment (6/6). 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. |

Expand Down
9 changes: 7 additions & 2 deletions docs/conformance/results.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,17 @@ The native engine column is from `npm run test:native` on the same host (29 Oct

Every column above is one local run on macOS arm64. CI runs the Wrangler and native suites on Ubuntu x64 (Node 22) on every change, and builds the linux/amd64 Docker image and checks that `sobjects` and `celld` start in it; it does not run `test:celld` or `test:cloudflare`, and it records no results. Linux arm64 has no conformance evidence beyond the Compose stack on Docker Desktop. Treat the table as macOS arm64 evidence plus unrecorded Ubuntu x64 CI coverage, not as a cross-platform claim.

## Product path

`npm run test:product --workspace=sobjects-conformance` deploys `agents-app` with `sobjects deploy` and serves it with `sobjects up --detach` behind TLS ingress, then runs the Agents SDK checks against the ingress rather than a runner's local server. One run on 2 Nov 2026 (macOS arm64, celld 0.6.2, SeaweedFS started with `--local-s3`) passed 6/6: state, SQL, schedules, addressing, the WebSocket client protocol with `@callable()` RPC, and a delayed schedule. It is not in CI because it needs Docker, a bucket and celld.

## 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, 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
and not through `sobjects deploy`. The Wrangler, celld and native runners use
`wrangler dev` and `celld dev` directly; only `test:product` goes through
`sobjects deploy`/`up`, and only for the Agents app. Those remain separate
conformance and product-level gates.
2 changes: 1 addition & 1 deletion docs/porting-from-cloudflare.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ Before switching traffic, check for:
- Assumptions about production networking, service bindings, outbound connections, Cache, or global coordination.
- Durable Object migration operations beyond adding SQLite classes.
- WebSocket hibernation, facets, cross-isolate RPC, or behavior across a cell move. Hibernation and the Agents SDK client protocol (including `@callable()` RPC over WebSocket) pass in conformance on celld and the native engine; facets pass on Wrangler and celld but not on the native engine; cell moves are not covered.
- Whether the app has been run through the actual `sobjects` CLI. A minimal Agents SDK app (state, SQL, schedules, WebSocket protocol) has run through `sobjects deploy` and `sobjects up`; the official samples, chat agents, MCP and Workflows have not. Callable RPC passes in the conformance suite but has not been exercised through `sobjects deploy`/`up`.
- Whether the app has been run through the actual `sobjects` CLI. A minimal Agents SDK app (state, SQL, schedules, addressing, WebSocket protocol and `@callable()` RPC) has run through `sobjects deploy` and `sobjects up`, and `npm run test:product` repeats those checks against that deployment; the official samples, chat agents, MCP and Workflows have not.

Do not infer production Cloudflare behavior from local Wrangler results, or infer full celld compatibility from one passing sample. Record any mismatch as a conformance case and keep unsupported behavior visible.
20 changes: 20 additions & 0 deletions packages/conformance/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,23 @@ with the documented Workers contract.
See [the recorded results](../../docs/conformance/results.md) for tested
versions and coverage boundaries. A green result is evidence for these cases
and versions only; it is not a claim of complete Workers compatibility.

## Product path

The runners above start `wrangler dev` or `celld dev` directly. `src/product.js`
instead exercises the product path for the Agents app: it copies `agents-app/`,
writes an `sobjects.toml` with a self-signed TLS certificate, deploys with
`sobjects deploy`, starts the node with `sobjects up --detach`, and runs the
state, SQL, schedules, addressing, callable RPC and schedule checks against the
TLS ingress.

```sh
npm run test:product --workspace=sobjects-conformance -- --local-s3
```

`--local-s3` starts a disposable SeaweedFS container and creates the bucket;
without it, pass `--bucket`, `--endpoint` and credentials in the environment.
The ingress listens on `--port` (default 18443), with celld, its operator
listener and the admin API on the next three ports. `--keep` leaves the node,
bucket and scratch directory running. It is not in CI because it needs Docker,
a bucket and celld.
1 change: 1 addition & 0 deletions packages/conformance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"test:wrangler": "node src/run.js --target wrangler",
"test:celld": "node src/run.js --target celld",
"test:native": "node src/run.js --target native",
"test:product": "node src/product.js",
"bench": "node src/bench.js",
"test:cloudflare": "node src/run.js --target cloudflare"
},
Expand Down
Loading
Loading