effect-jobs 0.1.0-alpha.1 → 0.1.0-alpha.3

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 (260) hide show
  1. package/CHANGELOG.md +87 -0
  2. package/README.md +342 -323
  3. package/dist/FailureCode.d.ts +2 -2
  4. package/dist/FailureCode.d.ts.map +1 -1
  5. package/dist/FailureCode.js.map +1 -1
  6. package/dist/Job.d.ts +21 -68
  7. package/dist/Job.d.ts.map +1 -1
  8. package/dist/Job.js +25 -80
  9. package/dist/Job.js.map +1 -1
  10. package/dist/JobApi.d.ts +35 -0
  11. package/dist/JobApi.d.ts.map +1 -0
  12. package/dist/JobApi.js +62 -0
  13. package/dist/JobApi.js.map +1 -0
  14. package/dist/JobApiBuilder.d.ts +29 -0
  15. package/dist/JobApiBuilder.d.ts.map +1 -0
  16. package/dist/JobApiBuilder.js +53 -0
  17. package/dist/JobApiBuilder.js.map +1 -0
  18. package/dist/JobContract.d.ts +22 -59
  19. package/dist/JobContract.d.ts.map +1 -1
  20. package/dist/JobContract.js +8 -2
  21. package/dist/JobContract.js.map +1 -1
  22. package/dist/JobEnqueue.d.ts +12 -11
  23. package/dist/JobEnqueue.d.ts.map +1 -1
  24. package/dist/JobEnqueue.js +4 -4
  25. package/dist/JobEnqueue.js.map +1 -1
  26. package/dist/JobFailure.d.ts +12 -11
  27. package/dist/JobFailure.d.ts.map +1 -1
  28. package/dist/JobFailure.js +6 -5
  29. package/dist/JobFailure.js.map +1 -1
  30. package/dist/JobGroup.d.ts +64 -0
  31. package/dist/JobGroup.d.ts.map +1 -0
  32. package/dist/JobGroup.js +52 -0
  33. package/dist/JobGroup.js.map +1 -0
  34. package/dist/JobId.d.ts +7 -7
  35. package/dist/JobId.d.ts.map +1 -1
  36. package/dist/JobId.js +1 -1
  37. package/dist/JobId.js.map +1 -1
  38. package/dist/JobIdentity.d.ts +19 -35
  39. package/dist/JobIdentity.d.ts.map +1 -1
  40. package/dist/JobIdentity.js +30 -67
  41. package/dist/JobIdentity.js.map +1 -1
  42. package/dist/JobLifecycle.d.ts +148 -123
  43. package/dist/JobLifecycle.d.ts.map +1 -1
  44. package/dist/JobLifecycle.js +93 -38
  45. package/dist/JobLifecycle.js.map +1 -1
  46. package/dist/JobOperators.d.ts +131 -0
  47. package/dist/JobOperators.d.ts.map +1 -0
  48. package/dist/JobOperators.js +48 -0
  49. package/dist/JobOperators.js.map +1 -0
  50. package/dist/JobPayload.d.ts +4 -2
  51. package/dist/JobPayload.d.ts.map +1 -1
  52. package/dist/JobPayload.js +86 -61
  53. package/dist/JobPayload.js.map +1 -1
  54. package/dist/JobPayloadCodec.d.ts.map +1 -1
  55. package/dist/JobPayloadCodec.js +41 -22
  56. package/dist/JobPayloadCodec.js.map +1 -1
  57. package/dist/JobPolicy.d.ts +109 -28
  58. package/dist/JobPolicy.d.ts.map +1 -1
  59. package/dist/JobPolicy.js +124 -51
  60. package/dist/JobPolicy.js.map +1 -1
  61. package/dist/JobPolling.d.ts +34 -0
  62. package/dist/JobPolling.d.ts.map +1 -0
  63. package/dist/JobPolling.js +103 -0
  64. package/dist/JobPolling.js.map +1 -0
  65. package/dist/JobProducer.d.ts +93 -25
  66. package/dist/JobProducer.d.ts.map +1 -1
  67. package/dist/JobProducer.js +174 -29
  68. package/dist/JobProducer.js.map +1 -1
  69. package/dist/JobRetryPolicy.d.ts +24 -0
  70. package/dist/JobRetryPolicy.d.ts.map +1 -0
  71. package/dist/JobRetryPolicy.js +39 -0
  72. package/dist/JobRetryPolicy.js.map +1 -0
  73. package/dist/JobSchedule.d.ts +74 -0
  74. package/dist/JobSchedule.d.ts.map +1 -0
  75. package/dist/JobSchedule.js +55 -0
  76. package/dist/JobSchedule.js.map +1 -0
  77. package/dist/JobStorage.d.ts +43 -0
  78. package/dist/JobStorage.d.ts.map +1 -0
  79. package/dist/JobStorage.js +46 -0
  80. package/dist/JobStorage.js.map +1 -0
  81. package/dist/JobStore.d.ts +38 -261
  82. package/dist/JobStore.d.ts.map +1 -1
  83. package/dist/JobStore.js +4 -4
  84. package/dist/JobStore.js.map +1 -1
  85. package/dist/JobTelemetry.d.ts +15 -5
  86. package/dist/JobTelemetry.d.ts.map +1 -1
  87. package/dist/JobTelemetry.js +119 -26
  88. package/dist/JobTelemetry.js.map +1 -1
  89. package/dist/JobTransaction.d.ts +9 -7
  90. package/dist/JobTransaction.d.ts.map +1 -1
  91. package/dist/JobTransaction.js +3 -3
  92. package/dist/JobTransaction.js.map +1 -1
  93. package/dist/JobWorker.d.ts +58 -49
  94. package/dist/JobWorker.d.ts.map +1 -1
  95. package/dist/JobWorker.js +42 -175
  96. package/dist/JobWorker.js.map +1 -1
  97. package/dist/index.d.ts +1 -1
  98. package/dist/index.js +1 -1
  99. package/dist/internal/JobTransaction.d.ts +11 -3
  100. package/dist/internal/JobTransaction.d.ts.map +1 -1
  101. package/dist/internal/JobTransaction.js +7 -2
  102. package/dist/internal/JobTransaction.js.map +1 -1
  103. package/dist/internal/ProducerDeclaration.d.ts +27 -0
  104. package/dist/internal/ProducerDeclaration.d.ts.map +1 -0
  105. package/dist/internal/ProducerDeclaration.js +38 -0
  106. package/dist/internal/ProducerDeclaration.js.map +1 -0
  107. package/dist/internal/codec/CanonicalJson.d.ts +2 -2
  108. package/dist/internal/codec/CanonicalJson.d.ts.map +1 -1
  109. package/dist/internal/codec/CanonicalJson.js +177 -134
  110. package/dist/internal/codec/CanonicalJson.js.map +1 -1
  111. package/dist/internal/codec/ProtectedProjection.d.ts.map +1 -1
  112. package/dist/internal/codec/ProtectedProjection.js +164 -112
  113. package/dist/internal/codec/ProtectedProjection.js.map +1 -1
  114. package/dist/internal/lifecycle/Artifacts.d.ts +39 -1
  115. package/dist/internal/lifecycle/Artifacts.d.ts.map +1 -1
  116. package/dist/internal/lifecycle/Artifacts.js +5 -5
  117. package/dist/internal/lifecycle/Artifacts.js.map +1 -1
  118. package/dist/internal/lifecycle/Reconciliation.d.ts +10 -63
  119. package/dist/internal/lifecycle/Reconciliation.d.ts.map +1 -1
  120. package/dist/internal/lifecycle/Reconciliation.js +20 -38
  121. package/dist/internal/lifecycle/Reconciliation.js.map +1 -1
  122. package/dist/internal/policy/Retry.d.ts +65 -0
  123. package/dist/internal/policy/Retry.d.ts.map +1 -0
  124. package/dist/internal/policy/Retry.js +69 -0
  125. package/dist/internal/policy/Retry.js.map +1 -0
  126. package/dist/internal/worker/Capability.d.ts +14 -72
  127. package/dist/internal/worker/Capability.d.ts.map +1 -1
  128. package/dist/internal/worker/Capability.js +1 -1
  129. package/dist/internal/worker/Capability.js.map +1 -1
  130. package/dist/internal/worker/Drain.d.ts +5 -3
  131. package/dist/internal/worker/Drain.d.ts.map +1 -1
  132. package/dist/internal/worker/Drain.js +13 -10
  133. package/dist/internal/worker/Drain.js.map +1 -1
  134. package/dist/internal/worker/Execution.d.ts +1 -1
  135. package/dist/internal/worker/Execution.d.ts.map +1 -1
  136. package/dist/internal/worker/Execution.js +37 -21
  137. package/dist/internal/worker/Execution.js.map +1 -1
  138. package/dist/internal/worker/GroupWorker.d.ts +59 -0
  139. package/dist/internal/worker/GroupWorker.d.ts.map +1 -0
  140. package/dist/internal/worker/GroupWorker.js +91 -0
  141. package/dist/internal/worker/GroupWorker.js.map +1 -0
  142. package/dist/internal/worker/Handler.d.ts +14 -0
  143. package/dist/internal/worker/Handler.d.ts.map +1 -0
  144. package/dist/internal/worker/Handler.js +2 -0
  145. package/dist/internal/worker/Handler.js.map +1 -0
  146. package/dist/internal/worker/InstallHandlers.d.ts +9 -0
  147. package/dist/internal/worker/InstallHandlers.d.ts.map +1 -0
  148. package/dist/internal/worker/InstallHandlers.js +35 -0
  149. package/dist/internal/worker/InstallHandlers.js.map +1 -0
  150. package/dist/internal/worker/QueueRun.d.ts +9 -0
  151. package/dist/internal/worker/QueueRun.d.ts.map +1 -0
  152. package/dist/internal/worker/QueueRun.js +2 -0
  153. package/dist/internal/worker/QueueRun.js.map +1 -0
  154. package/dist/internal/worker/Results.d.ts +13 -92
  155. package/dist/internal/worker/Results.d.ts.map +1 -1
  156. package/dist/internal/worker/Results.js +1 -1
  157. package/dist/internal/worker/Results.js.map +1 -1
  158. package/dist/internal/worker/Runtime.d.ts +26 -0
  159. package/dist/internal/worker/Runtime.d.ts.map +1 -0
  160. package/dist/internal/worker/Runtime.js +158 -0
  161. package/dist/internal/worker/Runtime.js.map +1 -0
  162. package/dist/{PostgreSqlDrizzleSchema.d.ts → postgresql/PostgreSqlDrizzleSchema.d.ts} +93 -9
  163. package/dist/postgresql/PostgreSqlDrizzleSchema.d.ts.map +1 -0
  164. package/dist/{PostgreSqlDrizzleSchema.js → postgresql/PostgreSqlDrizzleSchema.js} +27 -10
  165. package/dist/postgresql/PostgreSqlDrizzleSchema.js.map +1 -0
  166. package/dist/{PostgreSqlJobs.d.ts → postgresql/PostgreSqlJobs.d.ts} +45 -19
  167. package/dist/postgresql/PostgreSqlJobs.d.ts.map +1 -0
  168. package/dist/postgresql/PostgreSqlJobs.js +147 -0
  169. package/dist/postgresql/PostgreSqlJobs.js.map +1 -0
  170. package/dist/{PostgreSqlNative.d.ts → postgresql/PostgreSqlNative.d.ts} +2 -2
  171. package/dist/postgresql/PostgreSqlNative.d.ts.map +1 -0
  172. package/dist/postgresql/PostgreSqlNative.js +151 -0
  173. package/dist/postgresql/PostgreSqlNative.js.map +1 -0
  174. package/dist/{PostgreSqlSchema.d.ts → postgresql/PostgreSqlSchema.d.ts} +20 -3
  175. package/dist/postgresql/PostgreSqlSchema.d.ts.map +1 -0
  176. package/dist/postgresql/PostgreSqlSchema.js +168 -0
  177. package/dist/postgresql/PostgreSqlSchema.js.map +1 -0
  178. package/dist/postgresql/PostgreSqlTransaction.d.ts.map +1 -0
  179. package/dist/postgresql/PostgreSqlTransaction.js.map +1 -0
  180. package/dist/postgresql/internal/Health.d.ts +27 -0
  181. package/dist/postgresql/internal/Health.d.ts.map +1 -0
  182. package/dist/postgresql/internal/Health.js +58 -0
  183. package/dist/postgresql/internal/Health.js.map +1 -0
  184. package/dist/postgresql/internal/Operators.d.ts +5 -0
  185. package/dist/postgresql/internal/Operators.d.ts.map +1 -0
  186. package/dist/postgresql/internal/Operators.js +144 -0
  187. package/dist/postgresql/internal/Operators.js.map +1 -0
  188. package/dist/postgresql/internal/Producer.d.ts +23 -0
  189. package/dist/postgresql/internal/Producer.d.ts.map +1 -0
  190. package/dist/postgresql/internal/Producer.js +86 -0
  191. package/dist/postgresql/internal/Producer.js.map +1 -0
  192. package/dist/{internal/postgresql → postgresql/internal}/Readiness.d.ts +2 -2
  193. package/dist/postgresql/internal/Readiness.d.ts.map +1 -0
  194. package/dist/{internal/postgresql → postgresql/internal}/Readiness.js +41 -6
  195. package/dist/postgresql/internal/Readiness.js.map +1 -0
  196. package/dist/{internal/postgresql → postgresql/internal}/Rows.d.ts +23 -7
  197. package/dist/postgresql/internal/Rows.d.ts.map +1 -0
  198. package/dist/postgresql/internal/Rows.js +119 -0
  199. package/dist/postgresql/internal/Rows.js.map +1 -0
  200. package/dist/postgresql/internal/Schedule.d.ts +6 -0
  201. package/dist/postgresql/internal/Schedule.d.ts.map +1 -0
  202. package/dist/postgresql/internal/Schedule.js +74 -0
  203. package/dist/postgresql/internal/Schedule.js.map +1 -0
  204. package/dist/{internal/postgresql → postgresql/internal}/Store.d.ts +1 -1
  205. package/dist/postgresql/internal/Store.d.ts.map +1 -0
  206. package/dist/{internal/postgresql → postgresql/internal}/Store.js +68 -26
  207. package/dist/postgresql/internal/Store.js.map +1 -0
  208. package/docs/observability-checklist.md +33 -0
  209. package/docs/observability.md +204 -0
  210. package/package.json +121 -36
  211. package/specs/api-refinements.md +91 -16
  212. package/specs/architecture-decisions.md +133 -57
  213. package/specs/core-contract.md +129 -69
  214. package/specs/drizzle-compatibility.md +75 -21
  215. package/specs/operator-contract.md +107 -0
  216. package/specs/{postgresql-backend.md → postgresql-jobs.md} +60 -8
  217. package/specs/release-qualification.md +149 -139
  218. package/specs/retry-policy.md +120 -0
  219. package/dist/JobConsumer.d.ts +0 -87
  220. package/dist/JobConsumer.d.ts.map +0 -1
  221. package/dist/JobConsumer.js +0 -71
  222. package/dist/JobConsumer.js.map +0 -1
  223. package/dist/JobRegistry.d.ts +0 -82
  224. package/dist/JobRegistry.d.ts.map +0 -1
  225. package/dist/JobRegistry.js +0 -75
  226. package/dist/JobRegistry.js.map +0 -1
  227. package/dist/JobWorkerRuntime.d.ts +0 -59
  228. package/dist/JobWorkerRuntime.d.ts.map +0 -1
  229. package/dist/JobWorkerRuntime.js +0 -48
  230. package/dist/JobWorkerRuntime.js.map +0 -1
  231. package/dist/PollingJobWorker.d.ts +0 -24
  232. package/dist/PollingJobWorker.d.ts.map +0 -1
  233. package/dist/PollingJobWorker.js +0 -63
  234. package/dist/PollingJobWorker.js.map +0 -1
  235. package/dist/PostgreSqlDrizzleSchema.d.ts.map +0 -1
  236. package/dist/PostgreSqlDrizzleSchema.js.map +0 -1
  237. package/dist/PostgreSqlJobs.d.ts.map +0 -1
  238. package/dist/PostgreSqlJobs.js +0 -97
  239. package/dist/PostgreSqlJobs.js.map +0 -1
  240. package/dist/PostgreSqlNative.d.ts.map +0 -1
  241. package/dist/PostgreSqlNative.js +0 -78
  242. package/dist/PostgreSqlNative.js.map +0 -1
  243. package/dist/PostgreSqlSchema.d.ts.map +0 -1
  244. package/dist/PostgreSqlSchema.js +0 -99
  245. package/dist/PostgreSqlSchema.js.map +0 -1
  246. package/dist/PostgreSqlTransaction.d.ts.map +0 -1
  247. package/dist/PostgreSqlTransaction.js.map +0 -1
  248. package/dist/internal/postgresql/Producer.d.ts +0 -14
  249. package/dist/internal/postgresql/Producer.d.ts.map +0 -1
  250. package/dist/internal/postgresql/Producer.js +0 -55
  251. package/dist/internal/postgresql/Producer.js.map +0 -1
  252. package/dist/internal/postgresql/Readiness.d.ts.map +0 -1
  253. package/dist/internal/postgresql/Readiness.js.map +0 -1
  254. package/dist/internal/postgresql/Rows.d.ts.map +0 -1
  255. package/dist/internal/postgresql/Rows.js +0 -75
  256. package/dist/internal/postgresql/Rows.js.map +0 -1
  257. package/dist/internal/postgresql/Store.d.ts.map +0 -1
  258. package/dist/internal/postgresql/Store.js.map +0 -1
  259. /package/dist/{PostgreSqlTransaction.d.ts → postgresql/PostgreSqlTransaction.d.ts} +0 -0
  260. /package/dist/{PostgreSqlTransaction.js → postgresql/PostgreSqlTransaction.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,92 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-alpha.3 (unpublished candidate)
4
+
5
+ Breaking prerelease changes since the published alpha.2 package:
6
+
7
+ - Require exact Effect/sql-pg `4.1.0` and optional Drizzle `1.0.0-rc.5`, replacing
8
+ Effect/sql-pg `4.0.5` and the two hash-suffixed Drizzle snapshots. Node `24.15.0`
9
+ and Bun `1.4.2` remain pinned; the local Alchemy example uses `2.0.0-beta.85`.
10
+ - Evaluate lazy `Job.make`, `JobProducer.make`, `JobPolicy.make` and
11
+ `JobPayload.encrypted` setup in their typed Effect channels. Reuse one
12
+ application-owned definitions Layer; do not hide setup in synchronous runners.
13
+ - Move routing and default policy from jobs into immutable producer slot bindings:
14
+ `JobProducer.make(operation).pipe(JobProducer.withSlot(slot, job, { queue }))`.
15
+ Enqueue now takes one object containing `slot`, `operationId` and `payload`.
16
+ Fixed bindings forbid an enqueue queue; selectable `{ queues: [...] }` bindings
17
+ require a declared queue-name string. Job-level enqueue and producer `identity`
18
+ are removed. See [the API migration contract](./specs/api-refinements.md).
19
+ - Replace `JobRegistry`, `JobConsumer`, `JobWorkerRuntime` and `PollingJobWorker`
20
+ public entrypoints with `JobGroup`, `JobApi`, `JobApiBuilder`, `JobStorage`,
21
+ `JobSchedule` and `JobPolling`. Declare complete catalog handlers and compose
22
+ the shared worker/storage graph explicitly; old imports are not aliases.
23
+ - Configure retries through `JobRetryPolicy` and `yield* JobPolicy.make({ retry })`.
24
+ Replace `retryDelay`/`maxAttempts` options with `fixed`/`exponential`, optional
25
+ cap/jitter, and `maxFinalizedAttempts`. Public counters use `finalizedAttempts`;
26
+ stored `maxAttempts`/`attempts_made` keys are retained. Upgrade every reader
27
+ before producing `BackoffV1`/`ProportionalV1` jobs; old readers cannot process
28
+ them safely. Existing `FixedDelayV1` policies keep their semantics.
29
+ - Adapt encrypted codecs to the lazy Schema-native transformation, with explicit
30
+ independent seal/open services. Already-protected envelopes remain supported.
31
+ The application still owns encryption, keys and stable keyed fingerprints.
32
+
33
+ Also included: read-only bounded scheduling, nullable creation metadata and its
34
+ application-owned `creationTimeMigration`, focused PostgreSQL implementation
35
+ subpaths behind the unchanged public PostgreSQL export names, and bounded
36
+ observability with application-owned exporters. Review schema readiness and
37
+ apply required migrations before starting readers; runtime never migrates or
38
+ resets an installation. See [retry rollout](./specs/retry-policy.md) and the
39
+ [PostgreSQL contract](./specs/postgresql-jobs.md).
40
+
41
+ This entry describes prepared source, not publication or a fresh qualification
42
+ PASS. The release handoff binds actual commands, exceptions and cleanup to one
43
+ immutable archive. Completed retention remains 90 days. Website/playground source
44
+ is excluded from npm; no deployment or production guarantee is implied.
45
+
46
+ ## 0.1.0-alpha.2 (published)
47
+
48
+ Breaking prerelease changes since alpha.1:
49
+
50
+ - Rename public `Job.make({ kind })` to `{ name }`, definition/catalog and handler
51
+ context access from `.kind` to `.name`, and `JobIdentity.JobKind` to
52
+ `JobIdentity.JobName`. The public Drizzle jobs-column property also becomes
53
+ `.name`, including `extraIndexes` callbacks. Keep existing name values and
54
+ catalog versions: the physical PostgreSQL column is still `kind`, so this
55
+ rename alone needs no column rename, data rewrite/reset or migration. See
56
+ [the API migration contract](./specs/api-refinements.md).
57
+ - Require exact Effect `4.0.5`; the qualified native PostgreSQL companion is
58
+ `@effect/sql-pg@4.0.5`. Optional Drizzle peers are the exact snapshots
59
+ `1.0.0-rc.5-ab785fc` and `1.0.0-rc.5-169397b`.
60
+ - Bind producer slots to definitions with inferred enqueue inputs and explicit
61
+ application-owned transaction/service composition.
62
+ - Extend the PostgreSQL schema/readiness contract for Cancelled jobs, guarded
63
+ operators, corrected redrive and durable repair lineage. Applications own
64
+ migration review and execution; runtime does not migrate old installations.
65
+
66
+ Also included:
67
+
68
+ - Focused `JobOperators` support for guarded retry acceleration, cancellation and
69
+ redrive; corrected redrive creates a new job and preserves source evidence.
70
+ - Current Astro documentation, runnable application examples and the local
71
+ playground. The npm package excludes the website/playground implementation.
72
+ - PostgreSQL Node/Bun CI, real-process crash/recovery tests, and a bounded manual
73
+ soak harness. These are scoped synthetic qualification, not production or
74
+ exactly-once guarantees.
75
+
76
+ Completed retention remains 90 days by default. Upstream Drizzle full-declaration
77
+ checks retain their documented known-failure exceptions; successful own-code
78
+ checks do not mean upstream full strict PASS. The registry contains this release
79
+ with Effect `4.0.5` and the two Drizzle snapshots; current source is not identical
80
+ to those published bytes. Deployment is not established by registry publication.
81
+
82
+ ## 0.1.0-alpha.1-effect.4.0.5.local.2 (local only)
83
+
84
+ - Qualify exact Drizzle snapshots `1.0.0-rc.5-ab785fc` and `1.0.0-rc.5-169397b`
85
+ with Effect/sql-pg 4.0.5; use `ab785fc` for the Alchemy beta.83 peer graph.
86
+ - Preserve native PgClient transaction ownership and production runtime bytes.
87
+ - Keep the narrowly approved seven upstream declaration diagnostics as separate
88
+ C FAIL; require independent A+B source and negative controls for both snapshots.
89
+
3
90
  ## 0.1.0-alpha.1
4
91
 
5
92
  Breaking prerelease API changes since alpha.0: