@ewhauser/world-celld 0.4.0 → 0.4.1

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.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,20 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## 0.4.1 (2026-08-24)
6
+
7
+ ## What's Changed
8
+ * fix: harden remote transport failure handling by @ewhauser in https://github.com/ewhauser/world-celld/pull/34
9
+ * test: enforce real celld restart recovery by @ewhauser in https://github.com/ewhauser/world-celld/pull/36
10
+ * test: cover index compaction alarm recovery by @ewhauser in https://github.com/ewhauser/world-celld/pull/37
11
+ * test: harden index compaction rollback coverage by @ewhauser in https://github.com/ewhauser/world-celld/pull/38
12
+ * test: harden StreamDO corruption handling by @ewhauser in https://github.com/ewhauser/world-celld/pull/39
13
+ * test: harden configuration and malformed input handling by @ewhauser in https://github.com/ewhauser/world-celld/pull/40
14
+ * fix: enforce negative apply-event contracts by @ewhauser in https://github.com/ewhauser/world-celld/pull/41
15
+
16
+
17
+ **Full Changelog**: https://github.com/ewhauser/world-celld/compare/v0.4.0...v0.4.1
18
+
5
19
  ## 0.4.0 (2026-08-22)
6
20
 
7
21
  ## What's Changed
package/README.md CHANGED
@@ -180,19 +180,30 @@ variable is shown below.
180
180
 
181
181
  The deployed worker also accepts these celld variables:
182
182
 
183
- | Variable | Default | Purpose |
184
- | --------------------------------- | -------- | -------------------------------------------------------- |
185
- | `WORLD_SECRET` | none | Required bearer secret for RPC routes |
186
- | `WORKFLOW_CALLBACK_SECRET` | none | Sent with deliveries as `x-workflow-callback-secret` |
187
- | `QUEUE_MAX_ATTEMPTS` | `5` | Attempts before a message is dead-lettered |
188
- | `QUEUE_MAX_INFLIGHT` | `5` | Concurrent deliveries per queue cell (maximum `128`) |
189
- | `QUEUE_DELIVERY_TIMEOUT_MS` | `300000` | Callback timeout (maximum `300000`) |
190
- | `WORKFLOW_RETENTION_MS` | `0` | Maximum run age from creation; includes active runs |
191
- | `WORKFLOW_RETENTION_BATCH_SIZE` | `128` | Runs admitted by each cron sweep (maximum `1000`) |
192
- | `WORKFLOW_RETENTION_QUEUE_SHARDS` | `1` | Queue-shard fallback for runs created before this policy |
183
+ | Variable | Default | Purpose |
184
+ | --------------------------------- | -------- | ---------------------------------------------------- |
185
+ | `WORLD_SECRET` | none | Required bearer secret for RPC routes |
186
+ | `WORKFLOW_CALLBACK_SECRET` | none | Sent with deliveries as `x-workflow-callback-secret` |
187
+ | `QUEUE_MAX_ATTEMPTS` | `5` | Attempts before a message is dead-lettered |
188
+ | `QUEUE_MAX_INFLIGHT` | `5` | Concurrent deliveries per queue cell (maximum `128`) |
189
+ | `QUEUE_DELIVERY_TIMEOUT_MS` | `300000` | Callback timeout (maximum `300000`) |
190
+ | `WORKFLOW_RETENTION_MS` | `0` | Maximum run age from creation; includes active runs |
191
+ | `WORKFLOW_RETENTION_BATCH_SIZE` | `128` | Runs admitted by each cron sweep (maximum `1000`) |
192
+ | `WORKFLOW_RETENTION_QUEUE_SHARDS` | `1` | Queue-shard fallback for older runs |
193
193
 
194
194
  `queueShards` is part of queue placement and is pinned when a queue cell is
195
- first used. Drain pending work before changing it.
195
+ first used. It may be any positive safe integer; the `128` storage-operation
196
+ batch limit does not cap the fleet's total shard count. Drain pending work
197
+ before changing it.
198
+
199
+ Queue deadlines use fixed-width 13-digit epoch-millisecond keys. A requested
200
+ `delaySeconds` or handler redelivery timeout is accepted only when its deadline
201
+ is at most `9999999669998`, leaving 330,001 ms for a fresh alarm edge and the
202
+ maximum delivery lease. Every derived due, retry, inflight, and GC deadline is
203
+ checked against the absolute `9999999999999` limit. A production retry which
204
+ cannot preserve that headroom is dead-lettered instead of clamped or rescheduled;
205
+ the test pump terminates the equivalent in-memory message. Long test-mode waits
206
+ are chunked at the host timer limit without changing this deadline contract.
196
207
 
197
208
  ## Workflow retention
198
209
 
@@ -219,6 +230,7 @@ does not provide the desired expiration resolution or catch-up rate.
219
230
  New runs persist the application's `queueShards` value for complete queue
220
231
  cleanup. `WORKFLOW_RETENTION_QUEUE_SHARDS` is the fallback for runs created
221
232
  before that metadata existed and must match the placement used by those runs.
233
+ Both values may be any positive safe integer.
222
234
 
223
235
  ### Terminal payload retention
224
236
 
@@ -293,6 +305,33 @@ CELLD_WORLD_SECRET=replace-with-a-secret \
293
305
  pnpm test:integration
294
306
  ```
295
307
 
308
+ ### Real celld restart smoke
309
+
310
+ The required CI smoke owns native celld v0.3.0 and MinIO processes on loopback,
311
+ uses fresh temporary bucket and runtime state, and kills celld with `SIGKILL`
312
+ before deleting its local working state and starting a new process against the
313
+ bucket-backed state. It checks that:
314
+
315
+ - acknowledged run and stream state survives the process restart;
316
+ - an accepted delayed queue message that becomes due while celld is down is
317
+ delivered once after the alarm is restored;
318
+ - multi-page retention cleanup continues from a persisted nonterminal phase;
319
+ - cancelling an in-flight HTTP long poll leaves the stream writable and
320
+ readable.
321
+
322
+ Run the same bounded smoke locally on Linux x86-64 or macOS arm64:
323
+
324
+ ```sh
325
+ pnpm test:integration:celld-smoke
326
+ ```
327
+
328
+ The runner downloads celld and MinIO artifacts at pinned versions and verifies
329
+ their SHA-256 digests before use. MinIO does not implement the conditional-write
330
+ contract celld requires for production ownership fencing, so the smoke disables
331
+ the storage probe and runs exactly one celld process at a time. It proves the
332
+ single-process restart boundaries above, not multi-node ownership, handoff, or
333
+ failover correctness.
334
+
296
335
  ### Local MinIO performance and loss test
297
336
 
298
337
  The opt-in performance harness starts a fresh MinIO bucket and a single celld
@@ -42,9 +42,11 @@ well as terminal ones. Each cron occurrence admits at most
42
42
  state machine finishes bounded index, stream, queue, and payload cleanup.
43
43
 
44
44
  New runs persist the application's `queueShards` placement. Set
45
- `WORKFLOW_RETENTION_QUEUE_SHARDS` to the historical queue-shard count when
46
- cleaning runs created before this worker version. Edit `triggers.crons` in the
47
- copied config if hourly discovery is not the desired resolution.
45
+ `WORKFLOW_RETENTION_QUEUE_SHARDS` to the historical positive-safe-integer
46
+ queue-shard count when cleaning runs created before this worker version. The
47
+ `128` multikey storage-operation limit is not a total-shard ceiling. Edit
48
+ `triggers.crons` in the copied config if hourly discovery is not the desired
49
+ resolution.
48
50
 
49
51
  Point the app at any node's public listener:
50
52
 
package/dist/index.d.ts CHANGED
@@ -61,7 +61,6 @@ interface ReleaseHookIndexesResult {
61
61
  }
62
62
  interface ExpireRunIndexesRequest {
63
63
  runId: string;
64
- keys: string[];
65
64
  hooks: HookIndexReference[];
66
65
  expiredAt: number;
67
66
  }
@@ -370,9 +369,11 @@ interface IndexListOptions {
370
369
  reverse?: boolean;
371
370
  }
372
371
  interface IndexListPage {
372
+ /** sourceShard is populated by the merged fleet index for exact follow-up mutation. */
373
373
  keys: Array<{
374
374
  name: string;
375
375
  value: string;
376
+ sourceShard?: string;
376
377
  }>;
377
378
  list_complete: boolean;
378
379
  cursor?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/retention.ts","../src/apply-event.ts","../src/storage.ts","../src/stream-protocol.ts","../src/streamer.ts","../src/queue.ts","../src/indexes.ts","../src/config.ts","../src/index.ts"],"mappings":";;KAOY;UAEK;EACf;EACA;EACA;EACA,WAAW;;EAEX,SAAS;;EAET,cAAc;;EAEd,iBAAiB;EACjB;EACA,OAAO;EACP;EACA,OAAO;;EAEP;EACA;EACA;EACA,gBAAgB;EAChB,eAAe;EACf;EACA;EACA;;UAGe;EACf;EACA;;EAEA,SAAS;EACT,cAAc;EACd,iBAAiB;EACjB,WAAW;EACX,cAAc;;EAEd,SAAS;;KAGC;KAEA,eAAe;EACrB;EAAU,OAAO;;EACjB;EAAW;EAAqB;EAAiB,WAAW;;UAEjD;EACf;EACA;;UAae;EACf;EACA,OAAO;;UAGQ;EACf;;UAGe;EACf;EACA;EACA,OAAO;EACP;;UAGe;EACf;;UAGe;EACf;;UAGe;;EAEf;EACA;;UAGe;;EAEf;;EAEA;;EAEA;EACA;;UAGe;EACf;EACA;;KAGU;;EAEV;;EA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SAAS,UAAU,mBAAmB,QAAQ;EAC9C,eAAe,gBAAgB;EAC/B,YAAY,iBAAiB;EAC7B,YAAY,eAAe,OAAO,iBAAiB,QAAQ;EAC3D,oBACE,eACA,gBACA,wBACA,OAAO,gBACP,cAAc,kBACb;EACH,uBACE,eACA,OAAO,gBACP,aAAa,kBACZ;EACH,mBAAmB,SAAS,4BAA4B,QAAQ;EAChE,UAAU,SAAS,0BAA0B,QAAQ;;;;;KC1H3C,iBAAiB;UAEZ;EACf;EACA;;UAGe;EACf,aAAa;EACb,gBAAgB;EAChB,gBAAgB;EAChB,kBAAkB;;UAGH;;;;;;;EAOf;;;;;EAKA;;;;;EAKA,MAAM;;EAEN;;;;;;EAMA;;EAEA;;;;;;EAMA;;EAEA;;EAEA;;EAEA;;;;UCpBe;EACf,UAAU,gBAAgB,QAAQ;EAClC,SAAS,gBAAgB,QAAQ;EACjC,WAAW,gBAAgB,QAAQ;EACnC,MAAM,gBAAgB,QAAQ;;KAGpB,aAAa,QAAQ;EAAkB,WAAW;;iBAE9C,iBAAiB,SAAS,mBAAmB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/retention.ts","../src/apply-event.ts","../src/storage.ts","../src/stream-protocol.ts","../src/streamer.ts","../src/queue.ts","../src/indexes.ts","../src/config.ts","../src/index.ts"],"mappings":";;KAOY;UAEK;EACf;EACA;EACA;EACA,WAAW;;EAEX,SAAS;;EAET,cAAc;;EAEd,iBAAiB;EACjB;EACA,OAAO;EACP;EACA,OAAO;;EAEP;EACA;EACA;EACA,gBAAgB;EAChB,eAAe;EACf;EACA;EACA;;UAGe;EACf;EACA;;EAEA,SAAS;EACT,cAAc;EACd,iBAAiB;EACjB,WAAW;EACX,cAAc;;EAEd,SAAS;;KAGC;KAEA,eAAe;EACrB;EAAU,OAAO;;EACjB;EAAW;EAAqB;EAAiB,WAAW;;UAEjD;EACf;EACA;;UAae;EACf;EACA,OAAO;;UAGQ;EACf;;UAGe;EACf;EACA,OAAO;EACP;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