Regenerate lifecycle migration after rebasing master

Master now owns migration numbers 0301 and 0302. Generate the lifecycle delivery schema as 0303, retain the atomic baseline and restore repair, and update migration references. The migration snapshot, lifecycle, and legacy restore tests pass.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Nicky LeachandPaperclip committed 2026-10-06 10:26:12 -07:00
1 parent 26d59f9da7
commit 0e39d1304b
5 files changed
+1489 -6

No files matched your search

+1 -1
View File
@@ -523,7 +523,7 @@ retains events, so consumers must revalidate existence and eligibility and load
current authorized repository data. A termination hook does not authorize
provider cleanup without the plugin's own authorization and retention policy.
Migration `0301_whole_venom.sql` seeds a one-time current-state baseline before
Migration `0303_modern_mathemanic.sql` seeds a one-time current-state baseline before
plugin delivery is available. It records creation for existing hired agents and
all projects, including archived projects. Pending hires stay behind approval.
Paused and terminated agents receive missing final status intents. A partial
+7
View File
@@ -2108,6 +2108,13 @@
"when": 1791298148518,
"tag": "0302_colossal_otto_octavius",
"breakpoints": true
},
{
"idx": 303,
"version": "7",
"when": 1791307521076,
"tag": "0303_modern_mathemanic",
"breakpoints": true
}
]
}
@@ -271,7 +271,7 @@ describePostgres("Resource lifecycle events", () => {
});
const backfillBaseline = () => db.transaction(async tx => {
const migration = readFileSync(new URL("../../../packages/db/src/migrations/0301_whole_venom.sql", import.meta.url), "utf8");
const migration = readFileSync(new URL("../../../packages/db/src/migrations/0303_modern_mathemanic.sql", import.meta.url), "utf8");
const lock = migration.split("--> statement-breakpoint")[0];
const baseline = migration.slice(migration.indexOf("-- Seed a one-time current-state baseline"));
for (const statement of [lock, ...baseline.split("--> statement-breakpoint")]) {
@@ -326,7 +326,7 @@ describePostgres("Resource lifecycle events", () => {
await db.execute(sql`DROP TABLE plugin_lifecycle_acknowledgments`);
await db.execute(sql`DROP INDEX resource_lifecycle_events_resource_order_idx`);
const applyDeliveryMigration = () => db.transaction(async tx => {
const migration = readFileSync(new URL("../../../packages/db/src/migrations/0301_whole_venom.sql", import.meta.url), "utf8");
const migration = readFileSync(new URL("../../../packages/db/src/migrations/0303_modern_mathemanic.sql", import.meta.url), "utf8");
for (const statement of migration.split("--> statement-breakpoint")) {
if (statement.trim()) await tx.execute(sql.raw(statement));
}