@cowliss/cli 0.9.0 → 0.10.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.
- package/dist/index.js +30 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3170,8 +3170,15 @@ const insertAppSchema = createInsertSchema(apps$1);
|
|
|
3170
3170
|
const bytea = customType({ dataType: () => "bytea" });
|
|
3171
3171
|
/**
|
|
3172
3172
|
* What an artifact is: a journey or template bundle as `cow build` emitted
|
|
3173
|
-
* it, the
|
|
3174
|
-
*
|
|
3173
|
+
* it, or the gzipped source tarball of the repo the push was built from.
|
|
3174
|
+
*
|
|
3175
|
+
* `module` is still a value of the Postgres enum and no longer a value here
|
|
3176
|
+
* (ticket 22/05). Compiled modules are not stored: a module is a
|
|
3177
|
+
* deterministic function of its bundle, so the rows were Postgres caching
|
|
3178
|
+
* what the sandbox's own disk cache already holds, at about 2MB each of
|
|
3179
|
+
* which 1.34MB is the QuickJS engine Javy links into every one. Dropping
|
|
3180
|
+
* the enum value itself would mean recreating the type and rewriting the
|
|
3181
|
+
* column, for a label nothing writes.
|
|
3175
3182
|
*/
|
|
3176
3183
|
const artifactKindEnum = pgEnum("artifact_kind", [
|
|
3177
3184
|
"bundle",
|
|
@@ -4395,10 +4402,16 @@ const versionStatusEnum = pgEnum("version_status", [
|
|
|
4395
4402
|
* use; an execution pins the journey version it started on for its whole
|
|
4396
4403
|
* life (ADR 0004).
|
|
4397
4404
|
*
|
|
4398
|
-
*
|
|
4399
|
-
*
|
|
4400
|
-
*
|
|
4401
|
-
*
|
|
4405
|
+
* The content address is the manifest's `bundle`, which is what the
|
|
4406
|
+
* developer actually pushed. `moduleDigest` is a derived compile result,
|
|
4407
|
+
* null until the compile settles and rewritable afterwards: the toolchain
|
|
4408
|
+
* that produced it is ours, not the tenant's, so bumping Javy is a
|
|
4409
|
+
* background recompile rather than a new version in a customer's history
|
|
4410
|
+
* (ADR 0011, amended 2026-09-19).
|
|
4411
|
+
*
|
|
4412
|
+
* The uniqueness that follows is "one ready version per key per bundle": a
|
|
4413
|
+
* key whose bundle does not compile records every attempt, and the next
|
|
4414
|
+
* push of that bundle is a retry rather than a duplicate.
|
|
4402
4415
|
*
|
|
4403
4416
|
* `pushedAt` is the ordering key rather than a creation stamp, because an
|
|
4404
4417
|
* unchanged key gets no new version: a push that re-sends bytes a version
|
|
@@ -4430,7 +4443,7 @@ const versions$1 = pgTable("versions", {
|
|
|
4430
4443
|
}),
|
|
4431
4444
|
error: text("error")
|
|
4432
4445
|
}, (table) => [
|
|
4433
|
-
uniqueIndex("
|
|
4446
|
+
uniqueIndex("versions_org_id_kind_key_bundle_unique").on(table.orgId, table.kind, table.key, sql`(${table.manifest}->>'bundle')`).where(sql`${table.status} = 'ready'`),
|
|
4434
4447
|
index("versions_org_id_kind_key_pushed_at_idx").on(table.orgId, table.kind, table.key, table.pushedAt),
|
|
4435
4448
|
index("versions_org_id_push_id_idx").on(table.orgId, table.pushId),
|
|
4436
4449
|
foreignKey({
|
|
@@ -6343,15 +6356,23 @@ const versionSchema = selectVersionSchema.extend({
|
|
|
6343
6356
|
* version" column shows (the short digest, when it was pushed, whether it
|
|
6344
6357
|
* compiled) and the push its source archive lives on. The manifest entry is
|
|
6345
6358
|
* left out, because a journey row already carries what its own entry says.
|
|
6359
|
+
*
|
|
6360
|
+
* `bundle` is lifted out of that entry because it is the version's address:
|
|
6361
|
+
* it is there from the moment the push lands, and it does not move when a
|
|
6362
|
+
* recompile rewrites `moduleDigest` (ADR 0011, amended 2026-09-19). The
|
|
6363
|
+
* compiled module's digest is not on the wire at all; nothing outside the
|
|
6364
|
+
* sandbox has a use for it.
|
|
6346
6365
|
*/
|
|
6347
6366
|
const versionSummarySchema = selectVersionSchema.pick({
|
|
6348
6367
|
id: true,
|
|
6349
6368
|
status: true,
|
|
6350
|
-
moduleDigest: true,
|
|
6351
6369
|
pushId: true,
|
|
6352
6370
|
appId: true,
|
|
6353
6371
|
error: true
|
|
6354
|
-
}).extend({
|
|
6372
|
+
}).extend({
|
|
6373
|
+
pushedAt: z.iso.datetime(),
|
|
6374
|
+
bundle: digestSchema
|
|
6375
|
+
});
|
|
6355
6376
|
/**
|
|
6356
6377
|
* A push as the API reports it, with the versions it created: `cow push`
|
|
6357
6378
|
* returns as soon as the upload is stored, so what is compiling, what is
|