@bastani/atomic-storage-postgres 0.9.88-alpha.1 → 0.9.88

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 (2) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,31 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.9.88] - 2026-11-16
6
+
7
+ ### Added
8
+
9
+ - `@bastani/atomic-storage-postgres`, a PostgreSQL storage adapter for Atomic sessions, workflow journals, and Intercom, installed with `atomic install npm:@bastani/atomic-storage-postgres`. It keeps a pool of up to 8 connections per process, bounds every statement with a 30-second statement timeout, and works through transaction-mode poolers such as PgBouncer. The password comes from the selection's `secrets` and is read again for each new connection, so a rotated password file is picked up without a restart; a URL that carries a password is refused. Lock conflicts, cancelled statements, and refused or lost connections are reported as `StorageTransientError`, and a call that wrote nothing runs again. PostgreSQL 14 or newer is required ([#4793](https://github.com/bastani-inc/atomic/issues/4793))
10
+ - Cloud IAM authentication for the PostgreSQL adapter: set `auth` to `"azure-entra"`, `"aws-iam"` or `"gcp-iam"` and each new connection signs in with a short-lived token from the cloud's own SDK (`@azure/identity`, `@aws-sdk/rds-signer` or `google-auth-library`, installed beside the adapter as an optional peer dependency) instead of a stored password. Tokens stay in memory, each token request is time-limited, and a failure names the package to install or the SDK's reason without showing a token. The README lists the least-privilege role for each cloud ([#4793](https://github.com/bastani-inc/atomic/issues/4793))
11
+ - Wake-ups through `LISTEN`/`NOTIFY`: the adapter keeps one listening connection per process and exposes it as `notifications` on the opened database, so worker hosts and Intercom brokers learn about new work at once instead of at their next poll. Their polls stay, so a dropped listening connection or a transaction pooler only makes them slower, never loses work. Through a transaction pooler, set the new `listenUrl` option to the server's direct endpoint; otherwise the adapter detects that notifications do not arrive, unlistens, and uses polling alone for the rest of the process, so it leaves no `LISTEN` on the pooler's server connections. A listening connection that stops delivering, such as a half-open one, is found by a probe every 30 seconds and a short TCP keepalive, and replaced. `atomic storage status` says which applies ([#5103](https://github.com/bastani-inc/atomic/issues/5103))
12
+
13
+ ### Changed
14
+
15
+ - A transaction's statements now go to the server without waiting for the answer to the one before, and a transaction that sends several before it commits takes one round trip for all of them and its commit ([#5102](https://github.com/bastani-inc/atomic/issues/5102))
16
+
17
+ ### Fixed
18
+
19
+ - Atomic's tables now live in a schema of their own, `atomic` (the new `schema` option), set per transaction with `SET LOCAL search_path` so a transaction-mode pooler can serve it. The owner role creates it, so `CREATE DATABASE … OWNER <role>` is enough on Azure, Amazon RDS, Cloud SQL and PostgreSQL 15 and later, where `public` gives no one `CREATE`. A database whose `public` schema holds an earlier release's tables keeps using it until `atomic storage migrate` moves them. Advisory locks and `LISTEN` channels are scoped to the schema, unchanged in `public` ([#5218](https://github.com/bastani-inc/atomic/issues/5218))
20
+ - A statement refused for a missing privilege (`42501`) now fails with `StorageConfigError` reason `missing-privilege`, which names the privilege and the fix (the runtime role's grant, or `atomic storage migrate` as the owner role), instead of the server's bare message ([#5218](https://github.com/bastani-inc/atomic/issues/5218))
21
+ - A server certificate that TLS verification refuses (`ERR_TLS_CERT_ALTNAME_INVALID`, `UNABLE_TO_VERIFY_LEAF_SIGNATURE` and the like) is no longer retried five times as an unreachable server: the open fails at once with the reason and the fix, a host name the certificate names or `sslrootcert` ([#5218](https://github.com/bastani-inc/atomic/issues/5218))
22
+ - A cloud token the server refuses (`28P01`, or Azure's `28000` for a malformed one) is dropped and a fresh one tried once, so a clock that runs behind no longer reuses an expired Entra token for every new connection ([#5218](https://github.com/bastani-inc/atomic/issues/5218))
23
+ - `@azure/identity`, `@aws-sdk/rds-signer` and `google-auth-library` installed with `atomic install npm:<package>` are now found by an adapter installed from a local path, from the user packages in `~/.atomic/agent/npm`, not only beside the adapter ([#5218](https://github.com/bastani-inc/atomic/issues/5218))
24
+ - A value over PostgreSQL's limit (`54000`, program limit exceeded) now fails with `StoragePayloadTooLargeError`, which names the 1 GB field limit, instead of being reported as the store being unavailable ([#4954](https://github.com/bastani-inc/atomic/issues/4954))
25
+ - A `?` inside a dollar-quoted string whose tag contains a non-ASCII character that is not a letter, such as `$·$` or an emoji, is no longer treated as a parameter, so the parameters after it are numbered correctly. Identifiers containing such characters are recognised the same way, matching PostgreSQL. A `?` written directly after an identifier or keyword, as in `LIMIT?`, now becomes a separate parameter instead of being read as part of that name ([#4834](https://github.com/bastani-inc/atomic/issues/4834))
26
+ - `statementTimeoutMs` now applies to statements run outside a transaction too. Before, only the client gave up on such a statement, 5 seconds after the timeout, while the server kept running it, so a write reported as failed with an unknown outcome could still be saved afterwards. The server now cancels it at the timeout and the call fails as `transaction-timeout` with nothing written, also through a transaction-mode pooler. When the client does give up on a server or network that stopped answering, it also asks the server to cancel the statement ([#4901](https://github.com/bastani-inc/atomic/issues/4901))
27
+ - An identifier longer than PostgreSQL's 63 bytes, in any statement, now reaches the server as the storage dialect's name for it (its head and a hash of the whole name) instead of being truncated, so a store whose prefix makes its names long finds again every table, index and trigger it created ([#4793](https://github.com/bastani-inc/atomic/issues/4793))
28
+ - `sslmode` now follows libpq without extra parameters: `verify-ca` checks the server certificate's CA (`sslrootcert`, or the CAs Node.js trusts) but not its host name, so a server reached by an address its certificate does not name, such as Cloud SQL by private IP, connects instead of failing with "Hostname/IP does not match certificate's altnames". `require` with `sslrootcert` does the same. `prefer` and `allow` encrypt without checking the certificate. `require` without `sslrootcert` still checks the certificate and its host name, stricter than libpq, and a URL with `uselibpqcompat` keeps pg's own reading of `sslmode`. A TLS parameter whose name is not lowercase, such as `SSLMODE=verify-full`, is now refused instead of being ignored by pg, which connected to a remote host without TLS; an `sslmode` libpq does not know is refused too ([#5113](https://github.com/bastani-inc/atomic/issues/5113))
29
+
5
30
  ## [0.9.88-alpha.1] - 2026-11-16
6
31
 
7
32
  ### Added
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/atomic-storage-postgres",
3
- "version": "0.9.88-alpha.1",
3
+ "version": "0.9.88",
4
4
  "description": "PostgreSQL storage adapter for Atomic sessions, workflow journals, and Intercom.",
5
5
  "contributors": [
6
6
  "Norin Lavaee",