Commit Graph
11439 Commits
Author SHA1 Message Date
Tim Smart a80d28d5df test(platform-cloudflare): restore restart recovery regressions 2026-10-08 10:25:55 +00:00
Tim Smart 223b605d86 feat(platform-cloudflare): recover entities after a Durable Object restart
An entity holding Entity.keepAlive, or running a persisted request, keeps
an alarm armed one heartbeat ahead. Cloudflare never re-creates an evicted
object by itself, so that alarm is what brings it back after a deploy,
runtime update, or eviction: it rebuilds a kept-alive entity and restores
its hold, and replays every unprocessed row instead of only due DeliverAt
rows.

- cluster_entity_state stores the keep-alive flag and the encoded name, so
  an alarm wake without id.name still resolves the entity.
- The holder count stays in memory, per handler build, and resets when the
  build is invalidated. The flag is written in a forked fiber (inline would
  deadlock inside withTransaction), and a release writes 0 before the hold
  opens.
- One nextAlarmAt covers due rows, unrun unprocessed rows, and the
  heartbeat; the alarm arms it before awaiting replayed handlers.
- keepAliveHeartbeat on CloudflareCluster.layer and
  AlchemyCloudflareCluster.make, 30 seconds by default.
2026-10-08 10:18:40 +00:00
Tim Smart 85a2bee87a Revert restart recovery tests
This reverts commits 8ed3dc6f62 and 7753e290cd.
2026-10-08 08:53:04 +00:00
Tim Smart 8ed3dc6f62 test(platform-cloudflare): split keep-alive recovery into its own test file
Recovery.test.ts now covers only unprocessed persisted-message replay
after a restart. The keep-alive restart test moves unchanged to
KeepAliveRecovery.test.ts, which is tracked separately.
2026-10-08 08:45:11 +00:00
Tim Smart 7753e290cd test(platform-cloudflare): cover keep-alive and unprocessed-message recovery after a restart
Both tests fail until the entity Durable Object wakes itself after a
restart: a keep-alive entity is not rebuilt, and an unprocessed persisted
tell replays only on the next contact.
2026-10-08 08:42:44 +00:00
Tim Smart 59c1888474 test(platform-cloudflare): reduce the suite to focused contract tests
Remove coverage repeated across seams, keeping one focused test per
contract plus the regression tests for fixed bugs. The end-to-end Miniflare
suite is the primary coverage; unit tests stay only where a contract is not
observable end to end.

- Delete the second Miniflare harness (CloudflareDurableObjects.test.ts and
  its fixture worker). Its distinct contracts move to EntityManager unit
  tests on the shared node:sqlite storage: unacknowledged stream chunks do
  not block other requests, undecodable replay rows are skipped, an ask
  deduplicated onto a tell is rejected, and interrupting a deduplicated
  delayed waiter leaves the original. The DO-to-DO delayed reply moves to
  the integration fixture's Relay entity.
- Delete ClusterCron and EntityKeepAlive unit tests, which repeat the
  integration tests.
- Drop unit tests repeated by integration or by the shared PersistedQueue
  contract suite, and implementation-coupled program tests that asserted
  SQL strings and bindings.
- Move EntityMailbox onto the shared node:sqlite storage and drop its
  hand-written SQL fake.
- Drop type tests that only checked core Entity or alchemy types.
2026-10-08 06:14:24 +00:00
Tim Smart c1e2d5b792 refactor(platform-cloudflare): simplify the entity DurableObjectSqlClient plumbing
The entity client builds with its own `Reactivity` instead of looking one up
in the registration context, so `EntitySql.make` is a plain scoped effect and
the handler build adds it to the context in one line. `toLayer` registers
through `flatMap` instead of a generator, and the docs drop the per-build
client lifetime, an implementation detail.

The node:sqlite Durable Object storage fake is shared between the entity
manager and entity SQL tests from `test/fixtures/sqliteStorage.ts`.
2026-10-08 05:22:52 +00:00
Tim Smart 6af8e04489 Annotate Cloudflare cluster APIs as unstable 2026-10-08 04:36:25 +00:00
Tim Smart adc5eb257b Merge main into Cloudflare cluster branch 2026-10-08 04:29:42 +00:00
Tim Smart a0a376267a test(platform-cloudflare): cover DurableObjectSqlClient in entity handlers
Fake-storage unit tests and Miniflare integration tests for the entity
Durable Object's own SQL client: per-entity rows, atomic handler
transactions, `reset` leaving user tables alone, rows surviving an isolate
restart, and the Worker layer's `SqlClient` staying reachable in handlers.

A Miniflare regression test interleaves two handlers through a user
transaction that rolls back, and checks the other handler's stored reply
survives. Type tests cover `CloudflareCluster.toLayer` erasing only
`DurableObjectSqlClient`, requiring `CloudflareSharding`, and being satisfied
by `CloudflareCluster.layer` and `AlchemyCloudflareCluster.make`.
2026-10-08 04:24:44 +00:00
effect-botandTim Smart ca068cef44 Allow cluster SQL storage to run without runtime DDL (#8897)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-08 04:12:51 +00:00
Tim Smart 1122ee2af8 feat(platform-cloudflare): give entity handlers a Durable Object SqlClient
Each entity Durable Object provides `CloudflareCluster.DurableObjectSqlClient`,
an `@effect/sql-sqlite-do` client on its own SQLite storage, to its handler
build and handlers. It is a separate tag, so an app-wide `SqlClient` stays in
place. `CloudflareCluster.toLayer` registers handlers that use it, removing
the service from the layer requirements and requiring `CloudflareSharding`,
which only `CloudflareCluster.layer` provides.

User transactions and mailbox writes share a gate: workerd runs every write
on the object's one SQLite connection inside an open `storage.transaction()`,
so a handler resumed from inside a user transaction could otherwise save its
reply there and lose it to the rollback.

Closes EFF-1842
2026-10-08 04:05:39 +00:00
Tim 9753be9ecf Deliver cluster WithTransaction replies after the transaction outcome is known (#8891) 2026-10-08 15:20:39 +13:00
Tim f686000760 Add compact SchemaError JSON and inspect output (#8895) 2026-10-08 15:11:28 +13:00
effect-botandTim Smart ea52c245f6 Fix typed SQL transaction COMMIT error recovery (#8892)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-07 22:42:33 +00:00
Tim d6082a25a3 Send MCP cancellation notifications for interrupted reverse requests (#8890) 2026-10-07 21:22:51 +00:00
effect-botandTim Smart 977096bcea Persist cluster WithTransaction failure replies after rollback (#8886)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-07 21:03:58 +00:00
133ceb2b77 Answer cancelled MCP HTTP request POSTs with an empty event stream (#8888)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-07 20:59:32 +00:00
Žan MlakarandEffect Bot d418ce011a test(encoding): cover Base64 binary and padding contracts (#8889)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
2026-10-08 09:37:51 +13:00
effect-botandTim Smart a46592aed9 Preserve query URLs during HTTP router slash normalization (#8885)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-07 18:55:43 +00:00
devangpratapandEffect Bot cf58cb0362 Fix Zsh completions for flag descriptions containing ] (#8882)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
2026-10-08 07:51:03 +13:00
effect-bot 269a7c8643 Version Packages (#8744) @effect/doctest@4.0.2 @effect/vitest@4.0.2 @effect/sql-sqlite-wasm@4.0.2 @effect/ai-anthropic@4.0.2 @effect/sql-sqlite-react-native@4.0.2 @effect/ai-cloudflare@4.0.2 @effect/sql-sqlite-node@4.0.2 @effect/sql-sqlite-do@4.0.2 @effect/ai-openai-compat@4.0.2 @effect/sql-sqlite-bun@4.0.2 @effect/sql-pglite@4.0.2 @effect/ai-openai@4.0.2 @effect/sql-pg@4.0.2 @effect/sql-mysql2@4.0.2 @effect/ai-openrouter@4.0.2 @effect/sql-mssql@4.0.2 @effect/sql-libsql@4.0.2 @effect/ai-typesafe@4.0.2 @effect/sql-d1@4.0.2 @effect/sql-clickhouse@4.0.2 @effect/atom-react@4.0.2 @effect/platform-node@4.0.2 @effect/platform-node-shared@4.0.2 @effect/atom-solid@4.0.2 @effect/platform-deno@4.0.2 effect@4.0.2 @effect/atom-vue@4.0.2 @effect/platform-bun@4.0.2 @effect/platform-browser@4.0.2 @effect/docgen@4.0.2 @effect/opentelemetry@4.0.2 @effect/openapi-generator@4.0.2 2026-10-07 19:23:49 +02:00
Tim 757821fe99 Fix PostgreSQL cancellation test readiness and cleanup (#8879) 2026-10-07 23:02:38 +13:00
540ecd1a94 Require explicit @stability on every module and importable export (#8770)
Co-authored-by: Giulio Canti <giulio.canti@gmail.com>
Co-authored-by: Tim Smart <hello@timsmart.co>
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Mattia Manzati <mattia.manzati@gmail.com>
2026-10-07 23:01:54 +13:00
1b35732952 Fix Stream.slidingSize dropping elements from the final partial window (#8878)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-07 19:51:36 +13:00
Jay HemnaniandEffect Bot 7a721cee6b Keep = inside values when decoding key-value config strings (#8877)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
2026-10-07 19:47:46 +13:00
Jungin YuandClaude Opus 5 78994c5e0d docs(http-api): fix stale HttpApiBuilder.middlewareSecurity references (#8876)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-10-07 18:46:24 +13:00
Ibrahim ElkamaliandTim Smart 0aeb7fd6f5 Preserve active OpenTelemetry parents for Effect spans (#8586)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-07 02:14:34 +00:00
Jay HemnaniandTim Smart d350f8e7ba Fix HttpApi form and GET payloads rejecting single-value arrays (#8858)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-07 15:05:46 +13:00
Tim f6af4b6d24 expose more of the atom registry apis (#8875) 2026-10-07 00:30:03 +00:00
00f1cc783f fix(sql): follow OpenTelemetry database semantic conventions in SQL spans (#8866)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-07 12:51:02 +13:00
Tim 146e86a689 fix(http): align HTTP tracing with OpenTelemetry semantic conventions (#8873) 2026-10-06 23:49:03 +00:00
f5716ad55d fix(observability): align OTLP exporter, resource and logger with the OpenTelemetry spec (#8868)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-06 23:26:00 +00:00
a0e1b871b4 fix(tracing): leave interrupted spans Unset and drop synthetic stack frames (#8864)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-07 11:53:36 +13:00
26c108919f fix(ai): follow the OpenTelemetry GenAI semantic conventions (#8870)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 11:43:23 +13:00
c6086ee5a2 fix(rpc): set span kind and rpc.* attributes per OpenTelemetry RPC conventions (#8867)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-07 11:41:12 +13:00
26931d0fee fix(observability): export OTLP Summary metrics and UCUM units (#8869)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 11:38:26 +13:00
Tim 763b445f55 Fix SQL event-log notifications before transaction commit (#8855) 2026-10-07 11:13:15 +13:00
WolfieLeaderandTim Smart 7ccfeb3569 fix(sql-pg): report a stale plan inside a transaction instead of retrying it (#8861)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-06 21:07:55 +00:00
d4f4bc8b83 Fix Stream.groupBy and partition hanging when a substream stops early (#8857)
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-07 08:11:43 +13:00
Matej ČernýandTim Smart 2131d44bd1 fix(sql-pg): release connection listeners and retirement hooks on scope closure (#8854)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-06 12:10:53 +00:00
Tim ec540703a5 Update repository dependencies (#8740) 2026-10-07 01:08:17 +13:00
effect-botandTim Smart 7d8d4979c6 Fix logged status after successful WebSocket upgrades (#8852)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-07 00:45:56 +13:00
Tim 48a373b2b4 Fix NodeHttpServer keep-alive requests during graceful shutdown (#8846) 2026-10-07 00:25:42 +13:00
effect-botandTim Smart bc4d76e44a Add trusted /effect-bot maintainer comment relay (#8853)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-07 00:13:11 +13:00
Giulio Canti 6c59de782b Preserve defects and interruption in Arbitrary mixed causes (#8849) 2026-10-06 11:43:27 +02:00
Sebastian LorenzandTim Smart eee0eeb1e4 Fix suspended compiled Struct parser output reuse (#8810)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-06 10:00:08 +02:00
Brandon Julio ThenaroandTim Smart 5630677ff5 fix(ai): preserve MCP toolkit service requirements (#8842)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-06 07:26:21 +00:00
digicoderandTim Smart 972c80fb02 Fix SqlEventJournal on PostgreSQL (#8756)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-06 20:17:59 +13:00
Tim 053e3ead5a Keep atom-react server snapshots stable for delayed Suspense hydration (#8841) 2026-10-06 19:28:15 +13:00