effect-jobs 0.1.0-alpha.0

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 (157) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/LICENSE +22 -0
  3. package/README.md +142 -0
  4. package/dist/Job.d.ts +33 -0
  5. package/dist/Job.d.ts.map +1 -0
  6. package/dist/Job.js +66 -0
  7. package/dist/Job.js.map +1 -0
  8. package/dist/JobConsumer.d.ts +34 -0
  9. package/dist/JobConsumer.d.ts.map +1 -0
  10. package/dist/JobConsumer.js +28 -0
  11. package/dist/JobConsumer.js.map +1 -0
  12. package/dist/JobContract.d.ts +128 -0
  13. package/dist/JobContract.d.ts.map +1 -0
  14. package/dist/JobContract.js +15 -0
  15. package/dist/JobContract.js.map +1 -0
  16. package/dist/JobFailure.d.ts +51 -0
  17. package/dist/JobFailure.d.ts.map +1 -0
  18. package/dist/JobFailure.js +34 -0
  19. package/dist/JobFailure.js.map +1 -0
  20. package/dist/JobId.d.ts +5 -0
  21. package/dist/JobId.d.ts.map +1 -0
  22. package/dist/JobId.js +4 -0
  23. package/dist/JobId.js.map +1 -0
  24. package/dist/JobIdentity.d.ts +54 -0
  25. package/dist/JobIdentity.d.ts.map +1 -0
  26. package/dist/JobIdentity.js +82 -0
  27. package/dist/JobIdentity.js.map +1 -0
  28. package/dist/JobLifecycle.d.ts +173 -0
  29. package/dist/JobLifecycle.d.ts.map +1 -0
  30. package/dist/JobLifecycle.js +234 -0
  31. package/dist/JobLifecycle.js.map +1 -0
  32. package/dist/JobPayload.d.ts +18 -0
  33. package/dist/JobPayload.d.ts.map +1 -0
  34. package/dist/JobPayload.js +10 -0
  35. package/dist/JobPayload.js.map +1 -0
  36. package/dist/JobPayloadCodec.d.ts +14 -0
  37. package/dist/JobPayloadCodec.d.ts.map +1 -0
  38. package/dist/JobPayloadCodec.js +78 -0
  39. package/dist/JobPayloadCodec.js.map +1 -0
  40. package/dist/JobPolicy.d.ts +50 -0
  41. package/dist/JobPolicy.d.ts.map +1 -0
  42. package/dist/JobPolicy.js +85 -0
  43. package/dist/JobPolicy.js.map +1 -0
  44. package/dist/JobProducer.d.ts +14 -0
  45. package/dist/JobProducer.d.ts.map +1 -0
  46. package/dist/JobProducer.js +23 -0
  47. package/dist/JobProducer.js.map +1 -0
  48. package/dist/JobQueue.d.ts +16 -0
  49. package/dist/JobQueue.d.ts.map +1 -0
  50. package/dist/JobQueue.js +16 -0
  51. package/dist/JobQueue.js.map +1 -0
  52. package/dist/JobRegistry.d.ts +37 -0
  53. package/dist/JobRegistry.d.ts.map +1 -0
  54. package/dist/JobRegistry.js +47 -0
  55. package/dist/JobRegistry.js.map +1 -0
  56. package/dist/JobStore.d.ts +348 -0
  57. package/dist/JobStore.d.ts.map +1 -0
  58. package/dist/JobStore.js +19 -0
  59. package/dist/JobStore.js.map +1 -0
  60. package/dist/JobTelemetry.d.ts +7 -0
  61. package/dist/JobTelemetry.d.ts.map +1 -0
  62. package/dist/JobTelemetry.js +61 -0
  63. package/dist/JobTelemetry.js.map +1 -0
  64. package/dist/JobTransaction.d.ts +24 -0
  65. package/dist/JobTransaction.d.ts.map +1 -0
  66. package/dist/JobTransaction.js +7 -0
  67. package/dist/JobTransaction.js.map +1 -0
  68. package/dist/JobWorker.d.ts +24 -0
  69. package/dist/JobWorker.d.ts.map +1 -0
  70. package/dist/JobWorker.js +155 -0
  71. package/dist/JobWorker.js.map +1 -0
  72. package/dist/JobWorkerRuntime.d.ts +18 -0
  73. package/dist/JobWorkerRuntime.d.ts.map +1 -0
  74. package/dist/JobWorkerRuntime.js +5 -0
  75. package/dist/JobWorkerRuntime.js.map +1 -0
  76. package/dist/PollingJobWorker.d.ts +9 -0
  77. package/dist/PollingJobWorker.d.ts.map +1 -0
  78. package/dist/PollingJobWorker.js +54 -0
  79. package/dist/PollingJobWorker.js.map +1 -0
  80. package/dist/PostgreSqlDrizzleSchema.d.ts +432 -0
  81. package/dist/PostgreSqlDrizzleSchema.d.ts.map +1 -0
  82. package/dist/PostgreSqlDrizzleSchema.js +72 -0
  83. package/dist/PostgreSqlDrizzleSchema.js.map +1 -0
  84. package/dist/PostgreSqlJobs.d.ts +25 -0
  85. package/dist/PostgreSqlJobs.d.ts.map +1 -0
  86. package/dist/PostgreSqlJobs.js +38 -0
  87. package/dist/PostgreSqlJobs.js.map +1 -0
  88. package/dist/PostgreSqlSchema.d.ts +30 -0
  89. package/dist/PostgreSqlSchema.d.ts.map +1 -0
  90. package/dist/PostgreSqlSchema.js +63 -0
  91. package/dist/PostgreSqlSchema.js.map +1 -0
  92. package/dist/PostgreSqlTransaction.d.ts +42 -0
  93. package/dist/PostgreSqlTransaction.d.ts.map +1 -0
  94. package/dist/PostgreSqlTransaction.js +9 -0
  95. package/dist/PostgreSqlTransaction.js.map +1 -0
  96. package/dist/index.d.ts +7 -0
  97. package/dist/index.d.ts.map +1 -0
  98. package/dist/index.js +7 -0
  99. package/dist/index.js.map +1 -0
  100. package/dist/internal/JobTransaction.d.ts +16 -0
  101. package/dist/internal/JobTransaction.d.ts.map +1 -0
  102. package/dist/internal/JobTransaction.js +21 -0
  103. package/dist/internal/JobTransaction.js.map +1 -0
  104. package/dist/internal/codec/CanonicalJson.d.ts +9 -0
  105. package/dist/internal/codec/CanonicalJson.d.ts.map +1 -0
  106. package/dist/internal/codec/CanonicalJson.js +184 -0
  107. package/dist/internal/codec/CanonicalJson.js.map +1 -0
  108. package/dist/internal/codec/ProtectedProjection.d.ts +12 -0
  109. package/dist/internal/codec/ProtectedProjection.d.ts.map +1 -0
  110. package/dist/internal/codec/ProtectedProjection.js +121 -0
  111. package/dist/internal/codec/ProtectedProjection.js.map +1 -0
  112. package/dist/internal/lifecycle/Artifacts.d.ts +6 -0
  113. package/dist/internal/lifecycle/Artifacts.d.ts.map +1 -0
  114. package/dist/internal/lifecycle/Artifacts.js +49 -0
  115. package/dist/internal/lifecycle/Artifacts.js.map +1 -0
  116. package/dist/internal/lifecycle/Reconciliation.d.ts +82 -0
  117. package/dist/internal/lifecycle/Reconciliation.d.ts.map +1 -0
  118. package/dist/internal/lifecycle/Reconciliation.js +98 -0
  119. package/dist/internal/lifecycle/Reconciliation.js.map +1 -0
  120. package/dist/internal/postgresql/Producer.d.ts +14 -0
  121. package/dist/internal/postgresql/Producer.d.ts.map +1 -0
  122. package/dist/internal/postgresql/Producer.js +55 -0
  123. package/dist/internal/postgresql/Producer.js.map +1 -0
  124. package/dist/internal/postgresql/Readiness.d.ts +5 -0
  125. package/dist/internal/postgresql/Readiness.d.ts.map +1 -0
  126. package/dist/internal/postgresql/Readiness.js +53 -0
  127. package/dist/internal/postgresql/Readiness.js.map +1 -0
  128. package/dist/internal/postgresql/Rows.d.ts +45 -0
  129. package/dist/internal/postgresql/Rows.d.ts.map +1 -0
  130. package/dist/internal/postgresql/Rows.js +75 -0
  131. package/dist/internal/postgresql/Rows.js.map +1 -0
  132. package/dist/internal/postgresql/Store.d.ts +5 -0
  133. package/dist/internal/postgresql/Store.d.ts.map +1 -0
  134. package/dist/internal/postgresql/Store.js +211 -0
  135. package/dist/internal/postgresql/Store.js.map +1 -0
  136. package/dist/internal/worker/Capability.d.ts +106 -0
  137. package/dist/internal/worker/Capability.d.ts.map +1 -0
  138. package/dist/internal/worker/Capability.js +11 -0
  139. package/dist/internal/worker/Capability.js.map +1 -0
  140. package/dist/internal/worker/Drain.d.ts +22 -0
  141. package/dist/internal/worker/Drain.d.ts.map +1 -0
  142. package/dist/internal/worker/Drain.js +59 -0
  143. package/dist/internal/worker/Drain.js.map +1 -0
  144. package/dist/internal/worker/Execution.d.ts +7 -0
  145. package/dist/internal/worker/Execution.d.ts.map +1 -0
  146. package/dist/internal/worker/Execution.js +125 -0
  147. package/dist/internal/worker/Execution.js.map +1 -0
  148. package/dist/internal/worker/Results.d.ts +108 -0
  149. package/dist/internal/worker/Results.d.ts.map +1 -0
  150. package/dist/internal/worker/Results.js +3 -0
  151. package/dist/internal/worker/Results.js.map +1 -0
  152. package/package.json +169 -0
  153. package/specs/architecture-decisions.md +841 -0
  154. package/specs/core-contract.md +323 -0
  155. package/specs/drizzle-compatibility.md +167 -0
  156. package/specs/postgresql-backend.md +291 -0
  157. package/specs/release-qualification.md +107 -0
@@ -0,0 +1,291 @@
1
+ # PostgreSQL backend — qualification and integration
2
+
3
+ PR #6 was integrated at `0525adda1384788124b273ea5ee8eac17c40413a` after its
4
+ completed original review set. The phase-B integration-blocked statements and
5
+ receipts below describe their historical snapshots. Current Drizzle dependency
6
+ compatibility qualification is recorded separately in
7
+ [drizzle-compatibility.md](./drizzle-compatibility.md); it preserves those receipts
8
+ and does not restart their review or qualify arbitrary transaction adapters.
9
+
10
+ ## Public module boundaries
11
+
12
+ - `PostgreSqlJobs`: `make(options)` / `layerNoDeps(options)` produce
13
+ `PostgreSqlJobs` and require `PostgreSqlApplication`. The value exposes an
14
+ explicit `ready` Effect, the generic `store`, optional separately selected
15
+ `cleanup`, `joinTransaction(handle, callback)` and `withTransaction(callback)`.
16
+ - `PostgreSqlTransaction`: the trusted application-adapter extension contract,
17
+ exact-connection `TransactionQuery`, and sanitized backend errors. This is **not**
18
+ a structural query-only transaction constructor or a supplied transaction engine.
19
+ - `PostgreSqlSchema`: validated storage mapping and explicit application migration
20
+ DDL. Runtime never invokes that DDL or creates a schema.
21
+ - `PostgreSqlDrizzleSchema`: optional, migration-only Drizzle declarations.
22
+ Neither core nor the PostgreSQL runtime imports Drizzle. These declarations do
23
+ **not** qualify a Drizzle transaction adapter.
24
+
25
+ Construction performs no SQL, readiness, DDL, pool allocation/closing, worker
26
+ startup or maintenance. Applications invoke readiness/maintenance and explicitly
27
+ compose workers. Ordinary caller Effect value/error/environment/interruption
28
+ channels pass through the callback bridge. Enqueue results are provisional until
29
+ the application owner commits.
30
+
31
+ The root package now registers these four exports and the optional exact Drizzle
32
+ peer. Shared registrars remain coordinator-owned. Their earlier missing state
33
+ in the historical receipts below is not the current package configuration.
34
+
35
+ ## Explicit application adapter contract
36
+
37
+ `PostgreSqlApplication` contains `validate`, `withTransaction` and
38
+ `ownedTransaction`. An implementation must prove source identity, private handle
39
+ registration, exact active connection and invocation lifetime before returning a
40
+ query capability. DSN equality and the presence of a query method prove nothing.
41
+ Queries sharing a transaction are sequenced. Revalidate lifetime before each
42
+ query; never silently borrow another connection for a joined handle.
43
+
44
+ `withTransaction` delegates join-or-establish to the application manager. A joined
45
+ producer does no BEGIN/savepoint/COMMIT/ROLLBACK, business replay or independent
46
+ reconciliation. The internal capability factory invalidates jobs capabilities on
47
+ all callback exit channels; it is not publicly exported.
48
+
49
+ Worker/cleanup operations use `ownedTransaction`, whose success must mean its
50
+ durable commit was acknowledged. It must reject any ambient transaction rather
51
+ than report provisional joined mutations as committed. The application owns
52
+ acquisition, rollback, connection destruction/release and finite control/query
53
+ timeouts. Uncertain COMMIT or response delivery is `PostgreSqlFailure` with
54
+ `commitKnowledge: "Unknown"`; never automatically replay the callback. Adapter
55
+ failures must not contain SQL, parameters, DSNs or provider Causes.
56
+
57
+ The phase-B fixture adapts the retained concrete `pg@8.23.0` application manager.
58
+ It reads that manager's actual ambient handle for the owned-operation guard.
59
+ The phase-A receipt remains evidence for its historical snapshot only; phase A
60
+ was not rerun for confirmation. Phase B qualified the new guard and the final
61
+ fixture-manager delta rejecting a COMMIT command tag of ROLLBACK on real PG.
62
+ No auth, Effect SQL or Drizzle transaction adapter is claimed.
63
+
64
+ READ COMMITTED is required for producer conflict comparison: the statement after
65
+ `INSERT ... ON CONFLICT DO NOTHING` must see the committed winner. A concurrent
66
+ cleanup may remove old evidence; that is conservatively an integrity conflict,
67
+ not permission to recreate a missing row within the same business operation.
68
+
69
+ ## Storage and producer semantics
70
+
71
+ Names are bounded, validated lowercase PostgreSQL identifiers. Defaults are
72
+ `public.jobs` and `public.job_payloads`; namespace and relation names are
73
+ configurable, arbitrary column remapping is not. Applications create their
74
+ namespace, generate/run migrations, own privileges, and own pool lifetime.
75
+
76
+ `jobs` persists generated ID, producer tuple, queue/kind/version, complete first
77
+ policy, optional initial availability, mutable lifecycle and lease/fencing fields.
78
+ `job_payloads` persists immutable format version, payload and canonical semantic
79
+ projection with a primary-key foreign key and ON DELETE CASCADE. Backend lifecycle
80
+ writes never rewrite payload, catalog, producer or first policy/initial envelope.
81
+ PK, global producer tuple UNIQUE and unique live lease tokens are structural
82
+ requirements. Due, expiry and terminal-cleanup partial indexes are provided.
83
+ Index names retain a bounded hash of the full configured table name to avoid
84
+ PostgreSQL truncating away its distinguishing suffix.
85
+
86
+ IDs are generated only by the library. A semantic duplicate compares catalog,
87
+ payload format and canonical projection bytes, including protected fingerprints;
88
+ it returns the first ID without changing policy, availability or randomized
89
+ ciphertext. Changed content is `JobIntegrityConflict`. A genuine same-connection
90
+ PostgreSQL error additionally aborts the producer transaction, so catching that
91
+ typed error cannot commit preceding domain writes. An application manager must
92
+ also classify a COMMIT command tag of ROLLBACK as a NotCommitted failure rather
93
+ than advertise successful business commit. The final fixture regression passed
94
+ both durable rollback and that response classification on Node and Bun.
95
+
96
+ Omitted availability uses a genuine server-time sample. Supplied availability
97
+ is persisted separately as the immutable initial envelope field. Due eligibility
98
+ uses `available_at <= dbNow`; rescheduled availability is lifecycle state.
99
+
100
+ ## Lifecycle, unknown outcomes and cleanup
101
+
102
+ The store delegates plans to the existing validated `JobLifecycle` functions;
103
+ SQL locks the parent before owned transitions and commits the complete plan.
104
+ Claims filter the caller's registered queue/kind/version tuples and use
105
+ `FOR UPDATE OF j SKIP LOCKED`. Claims and recovery have finite row bounds and no
106
+ handler invocation. Fixed leases are never renewed; attempts and stalls preserve
107
+ the accepted existing protocol. Finalization compares the exact frozen pre-write
108
+ snapshot as well as token/version/expiry. Inputs are copied before async work.
109
+
110
+ One DB-time snapshot governs each transition; owned writes sample after locking
111
+ the row. Claims sample before non-waiting SKIP LOCKED selection and perform one
112
+ post-commit DB-time check before exposing a usable lease. A response consuming its
113
+ reserve returns Unknown for original-token reconciliation, not a second claim.
114
+ Configured response budget is positive and must agree with the worker's budget.
115
+
116
+ Claim/release/finalization uncertain commits return tagged Unknown. Reconciliation
117
+ reads the original token or exact finalization evidence once; it neither invokes
118
+ handlers nor replays writes. The existing worker owns its bounded reconciliation
119
+ policy. The number-only recovery/cleanup core ports cannot express an Unknown
120
+ count: they fail with explicit Unknown commit knowledge, never fabricate zero or
121
+ retry internally. Applications must not blindly replay these maintenance calls.
122
+
123
+ Malformed snapshot rows are isolated in a bounded locked operation, never repaired
124
+ into an executable payload. Encoded artifacts remain untrusted until the worker's
125
+ existing structure/codec checks; malformed payloads can be fenced to Isolated.
126
+ An incompatible stored lease/budget is not dispatched. Both cases remove a poison
127
+ head row from scheduling without claiming to have handled its payload.
128
+
129
+ `cleanup_at` is a derived scheduling index, not a generic retention hold. Confirmed
130
+ Completed/Dead transitions derive it from their persisted policy; Forever or
131
+ unrepresentable expiry has no automatic cleanup timestamp. Cleanup selects a
132
+ bounded due terminal batch, validates policy/snapshot again under the parent lock,
133
+ and deletes only eligible parents (payloads cascade). Pending/Active/Isolated are
134
+ never candidates. Domain references still require an application-selected cleanup
135
+ adapter; this generic port is neither installed nor executed automatically.
136
+
137
+ Readiness is explicit, bounded introspection of only the configured relations:
138
+ required columns, PK/UNIQUE/FK/cascade and valid partial indexes. It does not run
139
+ DDL or claim to audit every application migration/data constraint. The readiness
140
+ correction passed the recovered-resource phase-B runs on both runtimes.
141
+
142
+ ## Historical phase-B qualification and integration blockers
143
+
144
+ On `2026-10-05T15:56Z`, the current production source and final COMMIT-tag manager
145
+ passed **27/27 on Node 24.15.0 and 27/27 on Bun 1.4.2**, against PostgreSQL 16.15,
146
+ pg 8.23.0 and Effect 4.0.0. Each run includes 25 production-backend real-PG tests
147
+ and 2 optional Drizzle declaration tests; no PG tests skipped. Existing tests
148
+ already covered retry-notAfter and lease-reserve equality and +/-1 ms neighbors;
149
+ they were not reimplemented. The only test-code continuation change pins the
150
+ new coordinator-authorized exact container ID. Phase A was not rerun.
151
+
152
+ Both sanitized receipts confirm zero remaining fixture schemas/roles, restored
153
+ TEMP, zero runtime DDL and zero savepoints. Runtime fixture objects remain limited
154
+ to `effect_jobs_d6.backend_fixture` and `backend_fixture_runtime`. The coordinator
155
+ owns container `6afbcddb555e2b546b0b6783a2196e9d8efae6f23950800b2ad1738117217526`,
156
+ loopback port 59465, deadline `2026-10-05T19:28:03.993972Z`. Author PG use ended
157
+ after the two synchronous test runs; no container lifecycle action was performed.
158
+
159
+ Fixture types and root lint passed. Current root check/build **FAIL** because
160
+ root Drizzle resolution is missing and build `types: []` excludes Node types.
161
+ No shared files were edited, and failed build output is not a qualified installed
162
+ artifact. Root exports/optional peer/lock/Node build types and fixture/installed
163
+ gate registration remain coordinator prerequisites. No push or PR is permitted
164
+ until these shared changes and the final integrated local gates pass.
165
+
166
+ Current logs, sanitized runtime/time-boundary evidence and a byte-bound receipt
167
+ are retained in `tests/postgresql/artifacts/`. Historical matrices below remain
168
+ historical only; current evidence does not rewrite phase A.
169
+
170
+ ### Preserved earlier qualification history
171
+
172
+ The exploratory Node run at approximately `2026-10-05T10:51Z` exercised production
173
+ source modules against real PostgreSQL 16.15: **22 passed, 2 failed, overall FAIL**.
174
+ Failures were a mistaken Drizzle check-count assertion and readiness receiving
175
+ `name[]` rather than `text[]`. Those were corrected; the pending runtime rerun
176
+ could not connect because the coordinator container was stopped at `11:03:11Z`.
177
+ Do not attribute those 22 intermediate passes to final checkpoint bytes. Earlier
178
+ exploratory runs also exposed and fixed duplicate pg module identity and the
179
+ server-version packaging suffix assertion. No intermediate failed run is a gate
180
+ PASS.
181
+
182
+ The coordinator recovered the exact same label/image-verified resource at
183
+ `11:28Z`, recorded readiness and updated its private loopback port mapping. The
184
+ expanded phase-B suite then passed **27/27 on Node and 27/27 on Bun** at about
185
+ `11:30Z`: 25 production-backend real-PG tests plus 2 Drizzle declaration tests.
186
+ Receipts include exact actual DB-time equality and +/-1 ms neighbors for due,
187
+ owned expiry, recovery expiry, lease reserve and retry-notAfter. Both runs
188
+ confirmed zero remaining fixture schemas/roles, restored TEMP, zero runtime DDL
189
+ and zero savepoints. This did not repeat phase A.
190
+
191
+ Those historical results precede the last fixture-manager COMMIT-tag correction. Its affected
192
+ rerun at `11:37Z` failed before setup with ECONNREFUSED; Docker/WSL integration was
193
+ also unavailable. No final PASS is claimed for that delta. Historical phase-B
194
+ receipts are explicitly named `*-before-commit-tag-*`; the failed final attempt
195
+ has its own log. Root check/build still fail on coordinator-owned peer/Node-type
196
+ registration, and installed-artifact gates remain unqualified.
197
+
198
+ The expanded tests cover atomic invoice/job/payload/receipt writes and real CHECK
199
+ failures, concurrent duplicate/conflict producers, protected equality, actual held
200
+ row SKIP LOCKED, due equality/neighbors, genuine expiry equality/neighbors,
201
+ attempt/stall limits, durable delays, artifact isolation, bounded pool exhaustion,
202
+ owned-operation rejection, interruption and before/after COMMIT response faults.
203
+ Due boundary fixture DML occurs after a genuine production server-time read;
204
+ expiry tests observe actual clock results in a finite 90-operation budget without
205
+ replacing SQL/time. No timing neighbor is skipped or passed if unobserved.
206
+ COMMIT faults are bounded application-manager injection around actual transactions,
207
+ **not** network proxy/server-crash qualification. The pure core protocol is
208
+ unchanged. Installed backend exports and Drizzle-generated migration execution
209
+ are not yet qualified.
210
+
211
+ The exact container is coordinator-owned; it was only inspected, not started,
212
+ stopped, removed or replaced by this author. Author fixtures use only
213
+ `effect_jobs_d6`, schema `backend_fixture`, role `backend_fixture_runtime` and
214
+ four owned relations. Runtime has CONNECT/USAGE/DML, no admin/CREATE/TRUNCATE/TEMP.
215
+ Setup tracks objects and PUBLIC TEMP changes, closes application pools, removes
216
+ only owned fixtures, and restores TEMP in cleanup. Prior completed exploratory
217
+ PG runs reached cleanup, including both recovered-resource 27/27 runs. Failed
218
+ connection attempts created no new fixture objects; they cannot certify server
219
+ state while the container is offline.
220
+
221
+ Remaining coordinator prerequisites:
222
+
223
+ 1. Register exports for the four public PostgreSql modules, preserving core's
224
+ backend-peer-free graph. Add optional `drizzle-orm@0.45.1` peer metadata and
225
+ pinned development dependency/lock needed for root type/build/test resolution.
226
+ The current build config excludes Node types: enable its already-pinned Node
227
+ declarations for backend `node:crypto`/`node:buffer` imports, or agree a separate
228
+ backend build project. Production runtime has no direct `pg` import;
229
+ applications own that driver.
230
+ 2. Integrate fixture qualification commands/installed-artifact checks through the
231
+ coordinator-owned registrars. Fixture-local aliases are not a replacement for
232
+ root/package integration. Complete final local gates before any authorized push.
233
+ 3. Preserve the final source/fixture receipts and historical matrices. The final
234
+ COMMIT-tag regression is now qualified; do not dispatch confirmation-only work.
235
+ Run affected integrated gates on exact shared configuration/artifact bytes,
236
+ then the coordinator chooses the single frozen review set. No author dispatch.
237
+
238
+ ## Finite reproduction
239
+
240
+ Use the pinned Node 24.15.0 and Bun 1.4.2 runtimes; fixture pins pg 8.23.0,
241
+ @types/pg 8.20.0 and Drizzle 0.45.1. Root retains Effect 4.0.0 and its existing
242
+ toolchain pins. No global/system installation is needed.
243
+
244
+ ```sh
245
+ # Fixture directory: tests/postgresql
246
+ timeout 60s bun install --frozen-lockfile
247
+ # Repository directory; fixture-local paths are for isolated type qualification.
248
+ timeout 180s node_modules/.bin/tsc --project tests/postgresql/tsconfig.json --noEmit
249
+ timeout 180s node node_modules/vitest/vitest.mjs run --config tests/postgresql/vitest.config.ts --reporter=verbose
250
+ timeout 180s bun --bun node_modules/vitest/vitest.mjs run --config tests/postgresql/vitest.config.ts --reporter=verbose
251
+ ```
252
+
253
+ Real PG requires `D6_RESOURCE_DIRECTORY` naming the coordinator's private directory,
254
+ `PG_EXPECT_RUNTIME=node|bun` and optionally `PG_EVIDENCE_FILE` for a sanitized
255
+ receipt. Never print credentials, pass them in argv, or attach their file.
256
+ Without PG configuration the backend suite is skipped: **NotTested, not PASS**.
257
+ Run runtimes serially because fixture object names are exclusive. Root check,
258
+ lint, format:check, build, required script guards and installed checks remain
259
+ separate mandatory gates after shared integration.
260
+
261
+ ## Documentation read manifest
262
+
263
+ All 16 files were read recursively before phase-B implementation, including
264
+ documents, examples and configuration:
265
+
266
+ - `ai-docs/README.md`
267
+ - `ai-docs/tsconfig.json`
268
+ - `ai-docs/src/index.md`
269
+ - `ai-docs/src/01_services/10_services-and-layers.ts`
270
+ - `ai-docs/src/01_services/20_module-consumption.ts`
271
+ - `ai-docs/src/01_services/30_layer-composition.ts`
272
+ - `ai-docs/src/02_modeling/10_schema-tagged-match.ts`
273
+ - `ai-docs/src/03_errors/10_errors-and-causes.ts`
274
+ - `ai-docs/src/04_observability/10_operation-observability.ts`
275
+ - `ai-docs/src/05_resources/10_resources-interruption-secrets.ts`
276
+ - `ai-docs/src/06_persistence/10_mutation-boundaries.ts`
277
+ - `ai-docs/src/07_transport/10_wire-errors.ts`
278
+ - `ai-docs/src/08_style/10_visible-code-and-modules.ts`
279
+ - `ai-docs/src/09_testing/10_testing-and-review.ts`
280
+ - `ai-docs/src/10_boundaries/10_external-time-regex.ts`
281
+ - `ai-docs/src/fixtures/Auth.ts`
282
+
283
+ Also read current UPVE-860, its required thread scan and phase-A report thread,
284
+ canonical UPVE-1020, `specs/multica-workflow.md`, all accepted
285
+ `specs/architecture-decisions.md`, `specs/d6-qualification.md`, retained phase-A
286
+ receipt, package/TypeScript configuration, core definition/transaction/store/
287
+ lifecycle/worker/reconciliation/codec seams and resource ownership metadata.
288
+ There is no repository AGENTS.md in this retained worktree; global Conventional
289
+ Commits instructions apply. No auth source or another project's resources were
290
+ written. The stopped-resource blocker was read after the runtime restart without
291
+ repeating completed phase-A work.
@@ -0,0 +1,107 @@
1
+ # Alpha release qualification
2
+
3
+ This release preserves accepted D1–D8 and all production source bytes of main
4
+ `427e9f96db19808b89671c733f8c84edca165ff5` (tree
5
+ `8ea09baa94089ed66c13964af00a9adf93497b76`). New work covers packaging, documentation
6
+ and finite qualification tooling. No auth dependency, migration of legacy data,
7
+ new backend, worker protocol or cryptographic mechanism is introduced.
8
+
9
+ ## Immutable artifact and reproduction
10
+
11
+ Version `0.1.0-alpha.0` is the first prerelease for the existing `effect-jobs` name.
12
+ The public registry returned E404 on 2026-10-06; availability and ownership must
13
+ be checked again by the coordinator immediately before publication. Dist-tag is
14
+ explicitly `alpha`, never `latest`. The MIT license is retained with both jobs and original auth copyright notices; the
15
+ mechanism was extracted from the owner's MIT effect-auth repository. No invented
16
+ npm ownership or cryptographic provenance is asserted.
17
+
18
+ Use Node 24.15.0, Bun 1.4.2 and exact locked tools. There are no tracked GitHub CI
19
+ workflows. Local gates are the actual package verify pipeline plus PostgreSQL
20
+ types, source and installed matrices and native optional-peer checks.
21
+
22
+ ```sh
23
+ bun install --frozen-lockfile
24
+ (cd tests/postgresql && bun install --frozen-lockfile)
25
+ (cd tests/qualification/d6-pg && bun install --frozen-lockfile)
26
+ bun run build
27
+ bun run release:pack
28
+ # Set EFFECT_JOBS_ARCHIVE to that immutable versioned archive.
29
+ # Set D6_RESOURCE_DIRECTORY to private, task-owned loopback PG resource records.
30
+ bun run qualify:drizzle:native
31
+ bun run qualify:release
32
+ bun run verify
33
+ bun run check:postgresql
34
+ bun run test:postgresql:node
35
+ bun run test:postgresql:bun
36
+ bun run qualify:postgresql:installed
37
+ bun run release:check
38
+ ```
39
+
40
+ All child operations are foreground and finite. Tests sharing schemas run
41
+ serially. Resource records contain exact container/image/labels/deadline/loopback
42
+ ports; validation compares actual Docker state before fixture SQL. Credentials
43
+ are kept outside Git and reports. The application creates/drops fixture schemas,
44
+ restores temporary privileges and closes pools in finally. The author removes
45
+ only its exact verified disposable container before handoff.
46
+
47
+ `release:pack` refuses to overwrite an existing archive and records SHA256,
48
+ SHA512, npm integrity and included files. Installed and native runners consume
49
+ `EFFECT_JOBS_ARCHIVE` without rebuilding/repacking. `release:check` validates
50
+ exports/files, lifecycle absence and explicit-alpha npm dry-run. It never
51
+ publishes. Coordinator publishes those same bytes only after review, integration,
52
+ local/hosted gates and owner authentication. Any integration byte change requires
53
+ rebuilding and qualifying its affected inputs, not relabeling old receipts.
54
+
55
+ ## Required evidence inventory
56
+
57
+ The issue attachments contain final exact Git identifiers, archive hashes,
58
+ runtime versions, command exits, read manifest and sanitized detailed logs. This
59
+ file defines evidence scope; it does not assert a future gate succeeded.
60
+
61
+ | Accepted requirement | Qualification oracle |
62
+ | -------------------------------------------------------------- | ------------------------------------------------------------------------------------------ |
63
+ | Typed declarations, operation/slot validation, library job IDs | Core definitions/identity/type gates; PG production inserts and duplicate readback |
64
+ | Catalog/payload/fingerprint equality; first config retained | Installed real-PG protected duplicates, changed-content conflict and rollback |
65
+ | Exact source/connection/lifetime, outer ownership | Installed neutral pg application and native Effect Drizzle registrars; auth final receipts |
66
+ | Two generic tables, app migrations/pools | Installed migration/readiness, least privilege, cascade; import/construction controls |
67
+ | DB-time due/lease edges and ownership fencing | Source and installed real-PG equality and neighboring millisecond boundaries |
68
+ | Persisted retries, bounded stalls/recovery and completion | Installed neutral real-PG lifecycle oracle |
69
+ | Unknown response reconciliation without blind replay | Deterministic before-send/after-durable-COMMIT injection; core worker protocol |
70
+ | Finite fractions, Union protected projection and bounds | Core codec and portable installed public-codec probe on Node/Bun |
71
+ | Malformed payload isolation | Installed public codec rejection and fenced Isolated transition |
72
+ | Bounded cleanup, cleanup-vs-retry, payload cascade | Installed generic PG fixture and auth coordinated receipt/OTP receipts |
73
+ | Registration, OTP, receipt retain-until | Auth UPVE-1129/1130 final corrected receipts and UPVE-1355 final-head qualification |
74
+ | Explicit workers/shutdown and metrics privacy | Core worker/polling/telemetry gates; installed import controls |
75
+ | Optional peers absent/present, public export/type graph | Installed absent-peer imports, native normal npm resolver and exports/types |
76
+ | Runnable setup/documentation | Installed typed quickstart plus real-PG public migration/application fixture |
77
+ | License, private-auth exclusion, lifecycle/package metadata | Archive inspection, source/artifact hashes and release check |
78
+
79
+ ## Limits and preserved evidence
80
+
81
+ Prior jobs receipt UPVE-1165 binds its archive SHA256
82
+ `1fb5a2ae426d80e5725b3412a8147d43b6df98bb4666786aea7b6a5d7cd6171c` to main's
83
+ production bytes. Reuse requires per-file byte comparison and unchanged tools and
84
+ config; new archive checks cannot be replaced by that old archive receipt.
85
+ PR7 Security is OWNER WAIVED for PR7 only, never Security PASS.
86
+
87
+ Auth PR163 corrected T1–T3 before merge, including source-bound transaction
88
+ execution and receipt log privacy. PR164 follow-up qualified final head
89
+ `48b0587a7fca673ffcee14b9827d943ef60605c9`, tree
90
+ `9879c8bd6ca2215a84feeca79350a9187630416e`, merged as
91
+ `4f78f51349f646502842717ad18458c26c23550f` with unchanged tree. Its exact receipts
92
+ cover 372 PG tests, installed consumers and Node/Bun packed graphs on Node24.15.0
93
+ and Bun1.4.1. Those are consumed auth evidence, not new auth tests or evidence for
94
+ the new jobs archive until dependency/artifact byte comparison is recorded.
95
+
96
+ Full upstream Drizzle declaration checking with `skipLibCheck:false` FAIL is
97
+ preserved. Strict non-Drizzle declarations and Drizzle consumers with
98
+ `skipLibCheck:true` have distinct scope. Native qualification is a concrete
99
+ application adapter; no universal Drizzle/Effect SQL transaction adapter ships.
100
+ Optional PG skips in root verify are NotTested in that invocation. Real-PG gates
101
+ supply their separate evidence. Actual server crashes, arbitrary network faults,
102
+ other runtime/driver versions and Cloudflare deployment are NotTested.
103
+
104
+ No production application deployment is part of this release. Publication and
105
+ registry-install verification belong to the coordinator; auth's dependency switch
106
+ waits for actual npm publication. Registry authentication/ownership/MFA remains
107
+ owner-only and is not bypassed by local qualification.