Fusion Agent
b956a7c8eb
fix(core): repair a renumbered migration whose ledger row outlived its column
...
Reported from a dev instance: `column "memory_focus" does not exist` on every chat-session
read, so the task planner chat 500s and never opens — with a startup that reports success.
A ledger row asserts "a migration with this NUMBER ran". That is not the same claim as "this
COLUMN exists" once a migration has been renumbered, and this one was renumbered four times
— 0059 -> 0060 -> 0061 -> 0065 -> 0066 — each time because an upstream batch claimed the
sequence first. A database can therefore carry a row from one numbering while a different
migration owned that number on the boot that recorded it. The applier trusts the ledger
absolutely, skips the migration, and leaves a schema that does not match it. Nothing fails at
startup; everything fails afterwards, because Drizzle's `select()` emits the binary's full
column list and one missing column breaks every read of the table.
The defence already existed one table over: `0047` task recommendations verifies its
materialized column in addition to the marker and replays its idempotent SQL. The lesson had
been learned and not generalized. Both migrations renumbered on this branch — 0066 memory
focus and 0067 session contention wait state — now carry it, and both SQL files are
`ADD COLUMN IF NOT EXISTS`, so a replay over a healthy schema costs nothing.
Two PostgreSQL regression tests reproduce the drifted state exactly (marker present, column
dropped) and prove the replay materializes the column and stays idempotent on a second pass.
pnpm lint 0 errors, test:gate green, core typecheck clean, schema-applier 80/80 against a
real PostgreSQL.
2026-08-26 09:03:59 +00:00
..
2026-08-03 00:20:53 -07:00
2026-08-20 03:36:07 -07:00
2026-08-10 11:50:56 -07:00
2026-08-26 09:03:59 +00:00
2026-08-03 00:20:53 -07:00
2026-08-09 14:39:17 -07:00
2026-08-09 14:39:17 -07:00
2026-08-14 12:41:03 -07:00
2026-08-03 00:20:53 -07:00
2026-08-07 00:25:10 -07:00
2026-08-03 00:20:53 -07:00
2026-07-30 08:09:36 -07:00
2026-08-10 02:25:03 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-07 00:25:10 -07:00
2026-08-07 01:36:34 -07:00
2026-08-23 19:46:11 -07:00
2026-08-03 00:20:53 -07:00
2026-08-07 01:36:34 -07:00
2026-08-07 01:36:34 -07:00
2026-08-07 23:55:08 -07:00
2026-08-07 17:33:56 -07:00
2026-08-07 17:33:56 -07:00
2026-08-03 00:20:53 -07:00
2026-08-20 03:57:23 +00:00
2026-08-21 04:33:56 +00:00
2026-08-07 00:25:10 -07:00
2026-08-15 14:19:23 -07:00
2026-08-03 00:20:53 -07:00
2026-08-16 17:07:40 -07:00
2026-08-03 00:20:53 -07:00
2026-08-07 00:25:10 -07:00
2026-07-30 13:55:10 -07:00
2026-08-03 00:20:53 -07:00
2026-08-15 00:35:12 -07:00
2026-07-16 17:05:29 -07:00
2026-08-03 00:20:53 -07:00
2026-08-14 22:32:00 -07:00
2026-07-30 12:02:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-13 17:22:46 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-19 21:42:29 -07:00
2026-08-03 00:20:53 -07:00
2026-08-07 00:25:10 -07:00
2026-08-03 00:20:53 -07:00
2026-08-23 16:31:25 -07:00
2026-08-26 07:31:40 +00:00
2026-08-03 00:20:53 -07:00
2026-08-23 01:36:12 +00:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-23 16:31:25 -07:00
2026-08-26 07:31:40 +00:00
2026-08-03 00:20:53 -07:00
2026-08-07 00:25:10 -07:00
2026-08-03 00:20:53 -07:00
2026-07-30 02:38:58 -07:00
2026-08-03 00:20:53 -07:00
2026-07-30 03:01:36 -07:00
2026-07-16 21:39:49 -07:00
2026-08-21 17:22:17 -07:00
2026-08-08 23:16:01 -07:00
2026-08-23 09:22:26 +00:00
2026-08-20 03:36:07 -07:00
2026-08-20 03:36:07 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-23 01:36:32 +00:00
2026-07-29 19:03:03 -07:00
2026-08-03 16:15:12 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-04 10:52:12 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-08 23:05:29 -07:00
2026-08-03 00:20:53 -07:00
2026-08-20 00:36:50 -07:00
2026-08-26 08:57:31 +00:00
2026-08-07 00:25:10 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-23 16:31:25 -07:00
2026-08-20 00:28:59 -07:00
2026-07-19 12:16:51 -07:00
2026-08-03 00:20:53 -07:00
2026-08-08 19:58:43 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-08 18:56:43 -07:00
2026-08-03 00:20:53 -07:00
2026-08-24 01:20:23 +00:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-07-13 19:07:58 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-20 03:55:38 +00:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-12 13:29:34 -07:00
2026-08-03 00:20:53 -07:00
2026-07-26 08:56:58 -07:00
2026-07-30 21:11:42 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-09 09:14:56 -07:00
2026-08-13 17:13:56 -07:00
2026-08-24 01:20:23 +00:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-19 22:44:46 -07:00
2026-08-23 01:37:58 +00:00
2026-07-30 12:02:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-23 16:31:25 -07:00
2026-08-09 13:33:16 -10:00
2026-08-07 00:25:10 -07:00
2026-08-03 00:20:53 -07:00
2026-08-07 00:25:10 -07:00
2026-08-03 00:20:53 -07:00
2026-08-10 17:50:27 -07:00
2026-08-10 17:50:27 -07:00
2026-08-03 00:20:53 -07:00
2026-08-23 16:46:14 -07:00
2026-08-23 16:46:14 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-11 04:57:14 -07:00
2026-08-10 04:46:10 -07:00
2026-08-10 04:46:10 -07:00
2026-08-11 03:53:11 -07:00
2026-07-31 03:40:11 -07:00
2026-08-07 00:25:10 -07:00
2026-07-30 07:08:16 -07:00
2026-08-23 03:29:32 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-08 19:58:43 -07:00
2026-07-21 23:09:30 -07:00
2026-08-09 00:41:18 -07:00
2026-08-09 10:28:24 -07:00
2026-08-23 01:36:33 +00:00
2026-08-11 01:30:04 -07:00
2026-08-11 01:30:04 -07:00
2026-08-13 16:01:57 -07:00
2026-08-10 19:36:31 -07:00
2026-08-13 16:01:57 -07:00
2026-08-05 17:39:15 -07:00
2026-08-11 10:57:36 -10:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-07-29 19:03:03 -07:00
2026-07-30 02:38:58 -07:00
2026-08-03 00:20:53 -07:00
2026-08-23 05:37:27 +00:00
2026-08-25 12:31:43 +00:00
2026-08-07 00:25:10 -07:00
2026-08-03 00:20:53 -07:00
2026-08-15 20:50:38 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-04 19:15:20 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-20 03:55:38 +00:00
2026-07-30 02:38:58 -07:00
2026-08-03 00:20:53 -07:00
2026-07-26 20:33:25 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-16 15:57:36 -07:00
2026-08-16 22:06:38 -07:00
2026-08-16 22:06:38 -07:00
2026-08-23 01:36:12 +00:00
2026-08-16 21:09:58 -07:00
2026-08-16 12:59:23 -07:00
2026-08-19 08:41:14 -07:00
2026-08-19 10:10:39 -07:00
2026-08-20 00:36:50 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-19 19:46:35 -07:00
2026-08-23 01:36:32 +00:00
2026-08-10 19:43:13 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-11 03:40:21 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-07 00:25:10 -07:00
2026-08-03 00:20:53 -07:00
2026-07-30 21:50:37 -07:00
2026-07-29 21:07:28 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-23 09:22:26 +00:00
2026-08-24 10:07:22 +00:00
2026-08-23 09:22:26 +00:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-07-30 20:17:18 -07:00
2026-08-23 16:46:14 -07:00
2026-08-23 16:31:25 -07:00
2026-08-21 04:32:53 +00:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-07-30 08:35:24 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-23 05:37:27 +00:00
2026-08-03 00:20:53 -07:00
2026-08-23 01:36:32 +00:00
2026-08-09 01:33:06 -07:00
2026-08-23 03:29:32 -07:00
2026-08-11 05:45:36 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-07-18 13:09:38 -07:00
2026-08-03 00:20:53 -07:00
2026-08-23 01:36:32 +00:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-07-13 19:07:58 -07:00
2026-08-13 17:13:56 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-23 01:36:12 +00:00
2026-08-03 00:20:53 -07:00
2026-08-23 01:36:12 +00:00
2026-08-08 21:10:13 -07:00
2026-08-23 04:21:28 +00:00
2026-08-23 16:46:14 -07:00
2026-08-21 19:30:08 -07:00
2026-08-16 13:47:12 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-14 23:33:36 -07:00
2026-08-03 00:20:53 -07:00
2026-08-15 21:57:22 -07:00
2026-07-16 20:37:05 -07:00
2026-07-16 20:37:05 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-07-31 12:14:40 -07:00
2026-08-23 01:37:58 +00:00
2026-08-20 03:57:23 +00:00
2026-07-16 05:52:17 -07:00
2026-07-29 00:04:28 -07:00
2026-07-30 09:28:27 -07:00
2026-07-14 22:13:30 -07:00
2026-07-29 21:39:57 -07:00
2026-08-07 00:26:15 -07:00
2026-08-03 00:20:53 -07:00
2026-07-14 00:11:06 -07:00
2026-08-11 12:34:47 -07:00
2026-08-03 00:20:53 -07:00
2026-08-10 03:50:58 -07:00
2026-08-03 00:20:53 -07:00
2026-07-30 12:03:07 -07:00
2026-08-03 00:20:53 -07:00
2026-08-01 01:15:10 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-15 00:35:12 -07:00
2026-08-21 04:32:53 +00:00
2026-08-20 00:54:56 -07:00
2026-08-21 04:32:53 +00:00
2026-08-01 03:24:36 -07:00
2026-07-13 19:07:58 -07:00
2026-08-03 00:20:53 -07:00
2026-08-10 19:31:21 -07:00
2026-08-23 16:31:25 -07:00
2026-08-01 01:15:10 -07:00
2026-08-01 06:09:04 -07:00
2026-08-20 00:54:56 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-07 00:26:15 -07:00
2026-08-03 00:20:53 -07:00
2026-08-24 03:55:34 +00:00
2026-08-23 01:36:32 +00:00
2026-08-03 00:20:53 -07:00
2026-07-26 13:15:36 -07:00
2026-08-20 03:55:38 +00:00
2026-08-15 17:36:32 -07:00
2026-08-12 22:18:18 -07:00
2026-07-31 10:27:18 -07:00
2026-08-23 16:46:14 -07:00
2026-08-23 16:31:25 -07:00
2026-08-03 00:20:53 -07:00
2026-07-26 09:06:41 -07:00
2026-08-19 21:42:29 -07:00
2026-08-08 23:05:29 -07:00
2026-08-04 00:20:08 -07:00
2026-08-23 16:31:25 -07:00
2026-08-03 03:01:24 -07:00
2026-08-10 16:53:51 -07:00
2026-08-20 03:55:38 +00:00
2026-07-26 16:16:27 -07:00
2026-08-03 00:20:53 -07:00
2026-07-30 07:53:28 -07:00
2026-08-03 00:20:53 -07:00
2026-08-21 10:18:45 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-16 21:09:58 -07:00
2026-08-03 00:20:53 -07:00
2026-07-20 18:16:58 -07:00
2026-08-07 01:36:34 -07:00
2026-08-03 00:20:53 -07:00
2026-07-21 20:05:39 -07:00
2026-08-03 00:20:53 -07:00
2026-07-28 17:35:07 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-04 23:36:32 -07:00
2026-08-03 00:20:53 -07:00
2026-08-09 04:37:47 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-20 03:55:38 +00:00
2026-08-03 00:20:53 -07:00
2026-08-19 18:16:49 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-23 01:36:32 +00:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-07 01:36:34 -07:00
2026-08-12 21:24:53 -07:00
2026-08-19 19:59:04 -07:00
2026-08-14 23:33:36 -07:00
2026-08-21 10:57:44 -07:00
2026-08-23 01:37:58 +00:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00
2026-08-03 00:20:53 -07:00