@rikalabs/akter 0.1.0-alpha.3 → 0.1.0-alpha.5

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
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-alpha.5 (2026-10-09)
4
+
5
+ The framework and CLI release together on the `alpha` and `latest` npm dist-tags. Stored formats and the default Postgres pool sizes are unchanged from alpha.4.
6
+
7
+ - Adds the supported opt-in `Database.postgres({ url, preset: "low-connection" })` preset: one turn, two off-turn and one query session, for four primary Postgres sessions per runner without read replicas. Explicit pool options override the preset. This uses direct Postgres connections; it does not establish transaction-pooler support.
8
+ - Real-Postgres evidence covers a held single turn session, progressing off-turn work, migration serialization, command deduplication and process recovery. See the [low-connection verification](https://docs.akter.dev/verification/low-connection-postgres) and [deployment guidance](https://docs.akter.dev/guides/deploy).
9
+ - Includes the compute-only Akter Cloud guides and deterministic offline/content conformance timing fixes; the CLI and bundled cloud API contract are unchanged from alpha.4.
10
+
11
+ ## 0.1.0-alpha.4 (2026-10-09)
12
+
13
+ The framework and CLI release together on the `alpha` and `latest` npm dist-tags. The framework runtime and stored formats are unchanged from alpha.3; the hosted quota and cloud API contracts change during alpha.
14
+
15
+ - **Breaking:** `QuotaExceeded.cap` is now `compute`, `connections` or `spend`; `storage` is removed because Akter Cloud no longer supplies or bills managed databases. Only the connections cap remains retryable. HTTP 429 and WebSocket 1008 mappings are unchanged.
16
+ - **Breaking cloud API:** every environment uses customer Postgres through `DATABASE_URL`. The optional `Environment.database` report has source `customer`, state `missing`, `reachable` or `unreachable`, nullable p50 `latency` in milliseconds, boolean `latencyWarning`, and nullable integer `runnerCap`. A deploy probes from the runner region: p50 above 5 ms warns without refusing, and runner cap is `floor((max_connections - in_use - 10) / 9)`.
17
+ - **Breaking billing API:** base subscription plus compute unit-hours only. Removes every storage allowance, hard cap, price, meter, sample and per-project storage figure, plus storage and dedicated managed database plan features. The contract continues to ship at `@rikalabs/akter-cli/cloud-api`, not as a separate package.
18
+ - `akter env list` no longer marks variables `managed`. `akter deploy` confirms a live rollout and prints its matching database probe's latency warning and non-null runner cap, preserving zero and unknown measurements. Failed or superseded diagnostic reads warn without changing the successful exit status.
19
+ - Includes [#711](https://github.com/Rika-Labs/akter/pull/711): deploy following retries transient transport failures, typed `Unavailable` outages and unreadable 5xx responses with bounded exponential delays; refusals are never retried. Authentication declares `Unavailable`, so `whoami` reports a session-store outage without asking for another login.
20
+
3
21
  ## 0.1.0-alpha.3 (2026-10-08)
4
22
 
5
23
  The framework and CLI release together on the `alpha` and `latest` npm dist-tags; verified-main canaries use only `next`. This launch release includes the unpublished alpha.2 draft and subsequent changes. Alpha APIs and stored formats can change. Read the [upgrade notes](https://docs.akter.dev/operations/alpha-upgrades), back up the database, and stop every earlier alpha runner before starting alpha.3; mixed-alpha rolling upgrades are not established as safe.
@@ -107,7 +107,7 @@ export declare class RunnerAtCapacity extends RunnerAtCapacity_base {
107
107
  declare const QuotaExceeded_base: Schema.Class<QuotaExceeded, Schema.TaggedStruct<"QuotaExceeded", {
108
108
  readonly organizationId: Schema.String;
109
109
  readonly period: Schema.String;
110
- readonly cap: Schema.Literals<readonly ["compute", "storage", "connections", "spend"]>;
110
+ readonly cap: Schema.Literals<readonly ["compute", "connections", "spend"]>;
111
111
  readonly limit: Schema.Finite;
112
112
  readonly used: Schema.Finite;
113
113
  readonly retryAfterMs: Schema.Finite;
@@ -116,8 +116,7 @@ declare const QuotaExceeded_base: Schema.Class<QuotaExceeded, Schema.TaggedStruc
116
116
  * The hosted organization reached one of its plan's hard caps. `cap` names it,
117
117
  * and `limit` and `used` are in that cap's units: cents for `spend`, open
118
118
  * connections for `connections`, compute unit-hours this period for
119
- * `compute`, and decimal gigabytes of pooled managed database storage for
120
- * `storage`. A `connections` refusal clears as connections close, so it is
119
+ * `compute`. A `connections` refusal clears as connections close, so it is
121
120
  * retryable with the same command id after `retryAfterMs`; the others hold
122
121
  * until usage drops, the period resets or the plan changes.
123
122
  */
@@ -123,15 +123,14 @@ export class RunnerAtCapacity extends Schema.TaggedError()("RunnerAtCapacity", {
123
123
  * The hosted organization reached one of its plan's hard caps. `cap` names it,
124
124
  * and `limit` and `used` are in that cap's units: cents for `spend`, open
125
125
  * connections for `connections`, compute unit-hours this period for
126
- * `compute`, and decimal gigabytes of pooled managed database storage for
127
- * `storage`. A `connections` refusal clears as connections close, so it is
126
+ * `compute`. A `connections` refusal clears as connections close, so it is
128
127
  * retryable with the same command id after `retryAfterMs`; the others hold
129
128
  * until usage drops, the period resets or the plan changes.
130
129
  */
131
130
  export class QuotaExceeded extends Schema.TaggedError()("QuotaExceeded", {
132
131
  organizationId: Schema.String,
133
132
  period: Schema.String,
134
- cap: Schema.Literals(["compute", "storage", "connections", "spend"]),
133
+ cap: Schema.Literals(["compute", "connections", "spend"]),
135
134
  limit: Schema.Finite,
136
135
  used: Schema.Finite,
137
136
  retryAfterMs: Schema.Finite,
@@ -31,7 +31,7 @@ declare const reasonSchemas: {
31
31
  readonly _tag: Schema.tag<"QuotaExceeded">;
32
32
  readonly organizationId: Schema.String;
33
33
  readonly period: Schema.String;
34
- readonly cap: Schema.Literals<readonly ["compute", "storage", "connections", "spend"]>;
34
+ readonly cap: Schema.Literals<readonly ["compute", "connections", "spend"]>;
35
35
  readonly limit: Schema.Finite;
36
36
  readonly used: Schema.Finite;
37
37
  readonly retryAfterMs: Schema.Finite;
@@ -83,7 +83,7 @@ export declare const envelope: (route: {
83
83
  readonly _tag: Schema.tag<"QuotaExceeded">;
84
84
  readonly organizationId: Schema.String;
85
85
  readonly period: Schema.String;
86
- readonly cap: Schema.Literals<readonly ["compute", "storage", "connections", "spend"]>;
86
+ readonly cap: Schema.Literals<readonly ["compute", "connections", "spend"]>;
87
87
  readonly limit: Schema.Finite;
88
88
  readonly used: Schema.Finite;
89
89
  readonly retryAfterMs: Schema.Finite;
@@ -223,6 +223,8 @@ export interface Options {
223
223
  */
224
224
  export declare const layer: (options?: Options) => Layer.Layer<Actors | ContentStore | DefectLog | InternalActors | OperatorRuntime | RuntimeControl | TelemetrySampler, import("effect/sql/Migrator").MigrationError | SqlError.SqlError, Crypto.Crypto | SqlClient.SqlClient>;
225
225
  type PostgresOptions = Omit<PgClient.PgPoolConfig, "types"> & {
226
+ /** Four primary sessions: one turn, two off-turn (one reserved by Cluster), and one query. Explicit pool sizes take precedence. */
227
+ readonly preset?: "low-connection";
226
228
  readonly offTurnConnections?: number;
227
229
  readonly queryConnections?: number;
228
230
  readonly replica?: Omit<PgClient.PgPoolConfig, "types"> | undefined;
@@ -245,6 +247,13 @@ type PostgresOptions = Omit<PgClient.PgPoolConfig, "types"> & {
245
247
  * first come, first served. Keep the sum across runners below the server's
246
248
  * `max_connections`.
247
249
  *
250
+ * `preset: "low-connection"` defaults these pools to 1/2/1 instead of
251
+ * 50/10/10. Cluster reserves one off-turn session for its entire lifetime,
252
+ * including with table leases, so the other must remain available for
253
+ * startup and ordinary work. Fleet maintenance and application reservations
254
+ * need additional off-turn capacity; optional pools add to the budget.
255
+ * Explicit pool sizes override the preset.
256
+ *
248
257
  * `replica` is this runner's nearest streaming replica of the same primary.
249
258
  * Queries read there once it has replayed the commit version their caller
250
259
  * last saw, and read the primary when it is behind or fails. Its pool
@@ -913,6 +913,13 @@ export const layer = (options = {}) => {
913
913
  * first come, first served. Keep the sum across runners below the server's
914
914
  * `max_connections`.
915
915
  *
916
+ * `preset: "low-connection"` defaults these pools to 1/2/1 instead of
917
+ * 50/10/10. Cluster reserves one off-turn session for its entire lifetime,
918
+ * including with table leases, so the other must remain available for
919
+ * startup and ordinary work. Fleet maintenance and application reservations
920
+ * need additional off-turn capacity; optional pools add to the budget.
921
+ * Explicit pool sizes override the preset.
922
+ *
916
923
  * `replica` is this runner's nearest streaming replica of the same primary.
917
924
  * Queries read there once it has replayed the commit version their caller
918
925
  * last saw, and read the primary when it is behind or fails. Its pool
@@ -932,9 +939,22 @@ function postgres(options) {
932
939
  ? Result.succeed(new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength).getUint32(0))
933
940
  : Result.fail(new PgTypes.CodecError({ message: "Invalid regclass value" })),
934
941
  });
935
- const { offTurnConnections, queryConnections, replica, coordination, ...configured } = options;
942
+ const { preset, offTurnConnections, queryConnections, replica, coordination, ...configured } = options;
936
943
  const pool = withKeepalives(configured);
937
- return Layer.mergeAll(boundedLayer({ ...pool, maxConnections: offTurnConnections ?? 10, types }), turnGroups.pipe(Layer.provideMerge(turnConnections({ ...pool, maxConnections: pool.maxConnections ?? 50, types }))), queryPoolLayer({ ...pool, maxConnections: queryConnections ?? 10, types }), replicaLayer(replica === undefined ? undefined : { ...withKeepalives(replica), types }), coordinationLayer(coordination === undefined ? undefined : { ...withKeepalives(coordination), types }));
944
+ const lowConnection = preset === "low-connection";
945
+ return Layer.mergeAll(boundedLayer({
946
+ ...pool,
947
+ maxConnections: offTurnConnections ?? (lowConnection ? 2 : 10),
948
+ types,
949
+ }), turnGroups.pipe(Layer.provideMerge(turnConnections({
950
+ ...pool,
951
+ maxConnections: pool.maxConnections ?? (lowConnection ? 1 : 50),
952
+ types,
953
+ }))), queryPoolLayer({
954
+ ...pool,
955
+ maxConnections: queryConnections ?? (lowConnection ? 1 : 10),
956
+ types,
957
+ }), replicaLayer(replica === undefined ? undefined : { ...withKeepalives(replica), types }), coordinationLayer(coordination === undefined ? undefined : { ...withKeepalives(coordination), types }));
938
958
  }
939
959
  /** Database layers for `Actors.layer`: `postgres` for real deployments, `pglite` for embedded and test use. */
940
960
  export const Database = {
package/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@rikalabs/akter","version":"0.1.0-alpha.3","files":["dist","CHANGELOG.md","README.md","LICENSE","NOTICE"],"dependencies":{"@effect/platform-node-shared":"4.0.2","@electric-sql/pglite":"0.5.8","@noble/hashes":"2.4.0","@node-rs/xxhash":"1.7.8","koffi":"3.3.2"},"peerDependencies":{"@effect/platform-bun":"^4.0.2","@effect/platform-node":"^4.0.2","@effect/sql-pg":"^4.0.2","@effect/sql-pglite":"^4.0.2","drizzle-orm":"^1.0.0-rc.5-5935859","effect":"^4.0.2"},"publishConfig":{"access":"public"},"description":"The framework for durable, stateful backends that power realtime apps, background work, and agents.","keywords":["actor-model","actors","agents","background-jobs","bun","durable","effect","effect-ts","pglite","postgres","realtime","stateful","transactions","workflows"],"homepage":"https://github.com/Rika-Labs/akter#readme","bugs":"https://github.com/Rika-Labs/akter/issues","license":"Apache-2.0","author":"Rika Labs","repository":{"type":"git","url":"git+https://github.com/Rika-Labs/akter.git","directory":"packages/akter"},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./runtime":{"types":"./dist/runtime/index.d.ts","default":"./dist/runtime/index.js"},"./client":{"types":"./dist/client/index.d.ts","default":"./dist/client/index.js"},"./testing":{"types":"./dist/testing/index.d.ts","default":"./dist/testing/index.js"},"./package.json":"./package.json"},"peerDependenciesMeta":{"@effect/platform-bun":{"optional":true},"@effect/platform-node":{"optional":true}},"engines":{"bun":">=1.4.2","node":">=24.0.0"}}
1
+ {"name":"@rikalabs/akter","version":"0.1.0-alpha.5","files":["dist","CHANGELOG.md","README.md","LICENSE","NOTICE"],"dependencies":{"@effect/platform-node-shared":"4.0.2","@electric-sql/pglite":"0.5.8","@noble/hashes":"2.4.0","@node-rs/xxhash":"1.7.8","koffi":"3.3.2"},"peerDependencies":{"@effect/platform-bun":"^4.0.2","@effect/platform-node":"^4.0.2","@effect/sql-pg":"^4.0.2","@effect/sql-pglite":"^4.0.2","drizzle-orm":"^1.0.0-rc.5-5935859","effect":"^4.0.2"},"publishConfig":{"access":"public"},"description":"The framework for durable, stateful backends that power realtime apps, background work, and agents.","keywords":["actor-model","actors","agents","background-jobs","bun","durable","effect","effect-ts","pglite","postgres","realtime","stateful","transactions","workflows"],"homepage":"https://github.com/Rika-Labs/akter#readme","bugs":"https://github.com/Rika-Labs/akter/issues","license":"Apache-2.0","author":"Rika Labs","repository":{"type":"git","url":"git+https://github.com/Rika-Labs/akter.git","directory":"packages/akter"},"type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./runtime":{"types":"./dist/runtime/index.d.ts","default":"./dist/runtime/index.js"},"./client":{"types":"./dist/client/index.d.ts","default":"./dist/client/index.js"},"./testing":{"types":"./dist/testing/index.d.ts","default":"./dist/testing/index.js"},"./package.json":"./package.json"},"peerDependenciesMeta":{"@effect/platform-bun":{"optional":true},"@effect/platform-node":{"optional":true}},"engines":{"bun":">=1.4.2","node":">=24.0.0"}}