Jakob Wennberg and Claude Opus 5
77becf3d65
fix(documents): record archive integrity checks in their own ledger so the nightly control advances again ( #2108 )
...
The 03:00 WORM verification cron stamped last_integrity_check_at on
document_attachments. enforce_period_lock_documents() fires on any UPDATE of a
row whose journal entry sits in a closed or locked period, without checking
whether the entry link actually changed, so a read-only integrity stamp was
rejected. The queue orders last_integrity_check_at ASC NULLS FIRST, so the
rejected rows re-sorted to the head every night and the batch became
permanently 200/200 blocked. Both call sites discarded the update error, so
nothing logged and nothing alerted.
Prod state: 34 557 current-version documents, 24 083 never checked, last
successful stamp 2026-08-31 03:00, nightly successes already decayed to
single digits.
Migration 017's enforcement triggers are legally required and never-touch, so
this does not narrow the trigger. The verification outcome moves to its own
document_integrity_checks table and the cron stops writing document_attachments
altogether, which takes the trigger off the write path. The legacy column stays
in place. Failures are now counted, logged and reported in the route's summary:
the silence is why this went unnoticed for weeks.
Claude-Session: https://claude.ai/code/session_016ifKg6Ec67A39oxfGPU1yc
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com >
2026-09-01 14:23:05 +02:00
..
2026-08-03 16:30:14 +02:00
2026-07-24 16:36:35 +02:00
2026-07-03 16:50:28 +02:00
2026-08-25 09:34:05 +02:00
2026-08-24 14:07:58 +02:00
2026-08-06 23:00:05 +02:00
2026-07-04 15:58:06 +02:00
2026-07-04 15:58:06 +02:00
2026-07-26 17:48:18 +02:00
2026-08-03 15:41:01 +02:00
2026-07-21 23:00:15 +02:00
2026-08-31 15:53:53 +01:00
2026-07-04 15:58:06 +02:00
2026-08-26 09:58:25 +02:00
2026-07-04 15:58:06 +02:00
2026-07-16 16:00:05 +02:00
2026-08-06 23:00:05 +02:00
2026-08-15 23:07:29 +02:00
2026-08-03 15:41:01 +02:00
2026-08-25 09:34:05 +02:00
2026-08-28 12:12:47 +02:00
2026-08-03 18:55:59 +02:00
2026-04-24 11:24:45 +02:00
2026-08-27 18:32:52 +02:00
2026-08-26 16:56:39 +02:00
2026-07-04 15:58:06 +02:00
2026-07-27 03:34:56 +02:00
2026-08-25 10:32:12 +02:00
2026-08-06 23:00:05 +02:00
2026-08-26 16:56:39 +02:00
2026-07-11 23:13:50 +02:00
2026-08-21 15:55:26 +02:00
2026-08-04 19:34:54 +02:00
2026-08-06 23:00:05 +02:00
2026-07-04 15:58:06 +02:00
2026-08-10 14:11:09 +02:00
2026-07-04 15:58:06 +02:00
2026-08-27 14:35:19 +02:00
2026-08-31 20:51:17 +02:00
2026-08-31 21:46:50 +02:00
2026-08-25 12:41:02 +02:00
2026-07-27 03:34:56 +02:00
2026-07-27 03:34:56 +02:00
2026-07-28 19:50:16 +02:00
2026-08-26 15:14:49 +02:00
2026-07-10 11:05:40 +02:00
2026-09-01 14:00:36 +02:00
2026-07-04 15:58:06 +02:00
2026-08-24 17:05:00 +02:00
2026-07-04 15:58:06 +02:00
2026-07-04 15:58:06 +02:00
2026-07-04 15:58:06 +02:00
2026-09-01 14:23:05 +02:00
2026-08-25 15:15:33 +02:00
2026-07-27 03:34:56 +02:00
2026-07-28 18:34:55 +02:00
2026-07-13 22:54:33 +02:00
2026-07-13 22:54:33 +02:00
2026-07-04 15:58:06 +02:00
2026-07-21 23:00:15 +02:00
2026-08-20 21:25:18 +02:00
2026-07-27 03:34:56 +02:00
2026-08-28 23:51:27 +02:00
2026-08-06 23:00:05 +02:00
2026-08-06 23:00:05 +02:00
2026-08-30 11:56:15 +02:00
2026-05-12 13:12:17 +02:00
2026-08-28 17:45:10 +02:00
2026-08-31 16:01:11 +02:00
2026-08-19 20:09:23 +02:00
2026-08-25 17:03:57 +02:00
2026-08-03 17:56:37 +02:00
2026-08-13 23:57:53 +02:00
2026-07-04 15:58:06 +02:00
2026-08-17 21:36:16 +02:00
2026-07-04 15:58:06 +02:00
2026-08-13 16:53:19 +02:00
2026-08-06 23:00:05 +02:00
2026-08-06 23:00:05 +02:00
2026-08-06 23:00:05 +02:00
2026-08-30 16:54:35 +02:00
2026-08-06 23:00:05 +02:00
2026-08-10 12:23:42 +02:00
2026-07-23 16:16:55 +02:00
2026-08-17 22:20:52 +02:00
2026-08-24 13:19:32 +02:00
2026-07-04 15:58:06 +02:00
2026-07-29 18:15:06 +02:00
2026-09-01 11:29:12 +02:00
2026-08-20 10:27:52 +02:00
2026-07-04 15:58:06 +02:00
2026-06-08 09:47:33 +02:00
2026-07-04 15:58:06 +02:00
2026-08-13 23:12:27 +02:00
2026-07-22 18:30:33 +02:00
2026-07-22 18:33:49 +02:00
2026-08-31 08:39:04 +01:00
2026-08-13 15:55:01 +02:00
2026-07-27 03:34:56 +02:00
2026-07-27 03:34:56 +02:00
2026-08-21 17:27:45 +02:00
2026-08-13 19:44:32 +02:00
2026-08-21 16:56:32 +02:00
2026-09-01 14:14:09 +02:00
2026-08-29 00:29:11 +02:00
2026-08-28 22:12:20 +02:00
2026-07-04 15:58:06 +02:00
2026-08-25 14:36:18 +02:00
2026-07-23 16:16:55 +02:00
2026-07-03 13:57:59 +02:00
2026-07-12 19:14:12 +02:00
2026-05-26 22:29:41 +02:00
2026-07-03 13:57:59 +02:00
2026-07-05 03:05:09 +02:00
2026-07-05 03:05:09 +02:00
2026-09-01 14:14:45 +02:00
2026-07-04 15:58:06 +02:00
2026-06-04 13:14:57 +02:00
2026-07-27 03:34:56 +02:00
2026-08-09 12:44:08 +02:00
2026-07-21 16:54:14 +02:00
2026-07-12 19:14:12 +02:00
2026-08-14 08:21:57 +02:00
2026-07-12 19:14:12 +02:00
2026-07-09 12:19:57 +02:00
2026-07-27 14:49:22 +02:00
2026-08-03 18:49:46 +02:00
2026-08-27 22:24:36 +02:00
2026-07-21 23:00:15 +02:00
2026-08-04 11:43:58 +02:00
2026-08-26 16:56:39 +02:00
2026-07-04 15:58:06 +02:00
2026-07-04 15:58:06 +02:00
2026-05-06 10:24:57 +02:00
2026-08-13 23:12:27 +02:00
2026-08-08 11:58:51 +02:00
2026-09-01 11:29:12 +02:00
2026-08-15 19:50:32 +02:00
2026-08-13 16:53:19 +02:00
2026-08-30 11:51:27 +02:00
2026-08-06 23:00:05 +02:00
2026-08-06 23:00:05 +02:00
2026-08-25 14:23:56 +02:00
2026-08-05 15:47:23 +02:00
2026-08-05 15:27:00 +02:00
2026-08-12 15:08:13 +02:00