@everystack/server 0.4.33 → 0.4.34
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 +10 -0
- package/package.json +3 -3
- package/src/plugin.ts +12 -4
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,16 @@ All notable changes to `@everystack/server` are documented here.
|
|
|
4
4
|
|
|
5
5
|
Format based on [Keep a Changelog](https://keepachangelog.com/).
|
|
6
6
|
|
|
7
|
+
## [0.4.34] - 2026-09-27
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- apply state prerequisites atomically
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- govern state prerequisites
|
|
16
|
+
|
|
7
17
|
## [0.4.33] - 2026-09-24
|
|
8
18
|
|
|
9
19
|
### BREAKING CHANGES
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@everystack/server",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.34",
|
|
4
4
|
"description": "Server runtime primitives for Lambda — event adapters, routing, SSR, image processing",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"author": "Scalable Technology, Inc. <licensing@scalable.technology>",
|
|
@@ -187,8 +187,8 @@
|
|
|
187
187
|
"sst": "4.13.1",
|
|
188
188
|
"ts-jest": "29.4.9",
|
|
189
189
|
"typescript": "5.9.3",
|
|
190
|
-
"@everystack/
|
|
191
|
-
"@everystack/
|
|
190
|
+
"@everystack/cli": "0.4.98",
|
|
191
|
+
"@everystack/auth": "0.4.8"
|
|
192
192
|
},
|
|
193
193
|
"scripts": {
|
|
194
194
|
"test": "jest",
|
package/src/plugin.ts
CHANGED
|
@@ -1242,7 +1242,7 @@ export function dbPlugin(options: DbPluginOptions): Plugin {
|
|
|
1242
1242
|
// direct --database-url path runs, only here the connection never leaves the
|
|
1243
1243
|
// Lambda. A destructive plan snapshots first (db:backup), in order.
|
|
1244
1244
|
actions['db:apply'] = async (payload, ctx) => {
|
|
1245
|
-
const { plan, contractVersion, actor, gitRef, dirty, descentVerdict, descentAttested, authorityVerdict, stage, snapshotRef } =
|
|
1245
|
+
const { plan, contractVersion, actor, gitRef, dirty, stateOnly, descentVerdict, descentAttested, authorityVerdict, stage, snapshotRef } =
|
|
1246
1246
|
(payload ?? {}) as {
|
|
1247
1247
|
plan?: any;
|
|
1248
1248
|
/** The CLI's db:apply wire-contract version. Checked for EXACT equality against this
|
|
@@ -1253,11 +1253,12 @@ export function dbPlugin(options: DbPluginOptions): Plugin {
|
|
|
1253
1253
|
/** The CLI applied from a dirty worktree — recorded on the schema_log witness so a
|
|
1254
1254
|
* later descent ignores this row's git_ref. */
|
|
1255
1255
|
dirty?: boolean;
|
|
1256
|
+
stateOnly?: boolean;
|
|
1256
1257
|
descentVerdict?: { ok: boolean; reason?: string };
|
|
1257
1258
|
/** What the CLI's descent step decided, to record in the schema_log outcome
|
|
1258
|
-
* (`applied — <note>`): a honoured --attest-lineage-lost waiver, or a
|
|
1259
|
-
* origin (`descent: drift-origin
|
|
1260
|
-
* from a DIRTY worktree at
|
|
1259
|
+
* (`applied — <note>`): a honoured --attest-lineage-lost waiver, or a DRIFT
|
|
1260
|
+
* origin (`descent: drift-origin never-declared (…) | hand-edited since … | applied
|
|
1261
|
+
* from a DIRTY worktree at …`) — the
|
|
1261
1262
|
* record that makes this row the origin every later apply descends from. */
|
|
1262
1263
|
descentAttested?: string;
|
|
1263
1264
|
authorityVerdict?: { ok: boolean; reason?: string };
|
|
@@ -1297,6 +1298,11 @@ export function dbPlugin(options: DbPluginOptions): Plugin {
|
|
|
1297
1298
|
const result: any = await opsDb.execute(sql.raw(query));
|
|
1298
1299
|
return Array.isArray(result) ? result : result?.rows ?? [];
|
|
1299
1300
|
};
|
|
1301
|
+
const transaction = async <T>(work: (transactionRunner: (query: string) => Promise<any[]>) => Promise<T>): Promise<T> =>
|
|
1302
|
+
opsDb.transaction(async (tx: any) => work(async (query: string) => {
|
|
1303
|
+
const result: any = await tx.execute(sql.raw(query));
|
|
1304
|
+
return Array.isArray(result) ? result : result?.rows ?? [];
|
|
1305
|
+
}));
|
|
1300
1306
|
// The fingerprint endpoints this apply gates on are multi-statement reads, so they
|
|
1301
1307
|
// run as ONE session on this container's operator connection. Server-side that was
|
|
1302
1308
|
// always one connection; saying so in the type is what stops a future caller from
|
|
@@ -1315,9 +1321,11 @@ export function dbPlugin(options: DbPluginOptions): Plugin {
|
|
|
1315
1321
|
// in order, atomic with the lock. Authority/snapshot stay conditional (destructive-only, and
|
|
1316
1322
|
// the stage lane refuses destructive outright, so they never light up on this lane).
|
|
1317
1323
|
const applyOptions: StageApplyOptions = {
|
|
1324
|
+
transaction,
|
|
1318
1325
|
actor: actor ?? null,
|
|
1319
1326
|
gitRef: gitRef ?? null,
|
|
1320
1327
|
dirty: dirty === true,
|
|
1328
|
+
stateOnly: stateOnly === true,
|
|
1321
1329
|
checkDescent: async () => (descentVerdict.ok ? { ok: true as const } : { ok: false as const, reason: descentVerdict.reason ?? 'descent refused' }),
|
|
1322
1330
|
// The CLI's descent record (a honoured waiver, or a proven-drift origin) lands in the
|
|
1323
1331
|
// schema_log outcome; the witness query matches `applied%`, so the row stays a witness.
|