Sulthan Zahran
38adfe90a4
fix(state): classify FTS-scoped corruption as fts_index, never whole-file damage
...
classify_persistence_error bucketed every _DB_CORRUPTION_MARKERS hit as "corrupt",
so an error SQLite itself scoped to the FTS5 index layer (SQLITE_CORRUPT_VTAB, or an
`fts5: corrupt structure record for table "messages_fts"` report) that escaped the
write path — the detach in _enter_fts_fail_open refused (generation/lock check),
or a read/search path with no fail-open at all — reached the turn boundary and the
gateway startup notice as structural corruption: the turn ended with `.recover` /
restore-backup advice on a file whose canonical tables were provably healthy.
One provenance rule, hermes_state_errors.is_fts_scoped_corruption_error, now feeds
both the write-repair gate (SessionDB._is_fts_write_corruption_error delegates to it,
so the gateway transcript retry inherits it) and the classifier: a known result code
outranks prose (only SQLITE_CORRUPT_VTAB is FTS-scoped; bare SQLITE_CORRUPT/NOTADB
and any contradictory code fail closed), and without a code the text must both carry
a corruption marker and name a messages_fts* object. The new "fts_index" cause
renders index-scoped guidance (doctor --fix / restart, do not run recovery) in the
turn explainer and the home-channel notice. The structural fail-close is untouched:
bare malformed / not-a-database still quarantine and still classify "corrupt".
Salvaged from PR #97843 (SulthanZahran1), trimmed: the quick_check-backed
"corrupt_unconfirmed" tier is dropped — on a live handle that just observed an
unscoped SQLITE_CORRUPT, PRAGMA quick_check on a damaged shadow b-tree raises rather
than reports on 3.53.1, so the probe could never downgrade the exact shape it was
built for, and a verdict that softens quarantine guidance on prose alone weakens the
fail-close. #97841 (Finn763) reached the same fts_index cause via text markers
only; its LIKE-degradation intent already lives in _search_messages_impl (_fts_stale).
Fixes #97794
Co-authored-by: finn763 <165816600+finn763@users.noreply.github.com >
2026-09-11 06:37:27 -07:00
..
2026-09-07 07:10:28 -07:00
2026-09-07 16:48:29 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 17:13:22 -07:00
2026-09-04 00:15:16 -07:00
2026-09-11 01:37:22 -07:00
2026-09-10 11:48:01 -07:00
2026-09-06 20:50:02 +05:30
2026-09-02 13:29:48 -07:00
2026-09-03 13:16:47 -07:00
2026-09-02 18:56:06 -07:00
2026-09-03 09:44:26 -07:00
2026-09-10 18:08:16 -07:00
2026-09-10 18:08:16 -07:00
2026-09-09 12:21:28 +05:30
2026-09-11 01:37:22 -07:00
2026-09-07 08:07:26 -07:00
2026-09-06 05:37:03 -07:00
2026-09-06 05:37:03 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 20:10:26 -07:00
2026-09-02 21:38:20 -07:00
2026-09-03 17:13:22 -07:00
2026-09-10 18:11:25 -07:00
2026-09-07 07:06:58 -07:00
2026-09-07 06:02:22 -07:00
2026-09-03 13:29:35 -07:00
2026-09-07 07:06:58 -07:00
2026-09-09 12:19:13 +05:30
2026-09-02 18:18:18 -07:00
2026-09-11 01:37:22 -07:00
2026-09-02 18:49:57 -07:00
2026-09-02 18:49:57 -07:00
2026-09-02 18:49:57 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 17:13:22 -07:00
2026-09-04 00:15:16 -07:00
2026-09-05 10:54:19 +05:30
2026-09-11 03:45:33 +05:30
2026-09-07 05:24:15 -07:00
2026-09-07 05:24:15 -07:00
2026-09-10 18:08:16 -07:00
2026-09-02 18:47:54 -07:00
2026-09-07 21:43:54 +05:30
2026-09-10 15:13:02 -04:00
2026-09-06 22:45:31 +05:30
2026-09-07 21:22:49 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-07 08:13:01 -07:00
2026-09-07 05:59:08 -07:00
2026-09-11 02:07:48 -07:00
2026-09-11 02:07:48 -07:00
2026-09-05 16:44:23 +05:30
2026-09-10 03:04:51 -07:00
2026-09-11 03:45:33 +05:30
2026-09-03 09:44:26 -07:00
2026-09-02 18:57:14 -07:00
2026-09-07 08:06:48 -07:00
2026-09-11 03:45:31 +05:30
2026-09-03 22:00:01 -07:00
2026-09-11 03:45:33 +05:30
2026-09-03 09:44:26 -07:00
2026-09-07 06:15:43 -07:00
2026-09-07 08:19:32 -07:00
2026-09-07 07:10:28 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 04:31:46 -07:00
2026-09-11 03:45:33 +05:30
2026-09-09 16:30:24 -07:00
2026-09-02 13:29:48 -07:00
2026-09-03 17:13:22 -07:00
2026-09-09 11:29:56 -07:00
2026-09-02 18:22:13 -07:00
2026-09-10 10:35:07 -07:00
2026-09-03 09:44:26 -07:00
2026-09-07 21:10:50 -07:00
2026-09-02 19:32:53 -07:00
2026-09-03 17:13:22 -07:00
2026-09-04 00:15:16 -07:00
2026-09-07 08:08:04 -07:00
2026-09-06 14:19:42 -07:00
2026-09-07 06:05:13 -07:00
2026-09-11 06:24:54 -07:00
2026-09-02 18:53:53 -07:00
2026-09-09 13:08:25 +05:30
2026-09-09 10:58:16 -07:00
2026-09-07 08:28:43 -07:00
2026-09-02 18:22:13 -07:00
2026-09-02 18:58:42 -07:00
2026-09-02 18:22:13 -07:00
2026-09-11 19:04:06 +10:00
2026-09-03 22:00:01 -07:00
2026-09-02 19:22:42 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 18:22:13 -07:00
2026-09-02 18:29:05 -07:00
2026-09-02 22:21:06 -07:00
2026-09-10 10:27:07 -07:00
2026-09-10 10:27:07 -07:00
2026-09-02 18:28:38 -07:00
2026-09-02 18:28:38 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-10 18:11:25 -07:00
2026-09-02 19:10:21 -07:00
2026-09-10 09:22:31 -07:00
2026-09-07 21:43:54 +05:30
2026-09-02 18:33:06 -07:00
2026-09-06 09:09:00 -07:00
2026-09-04 00:15:16 -07:00
2026-09-06 09:11:04 -07:00
2026-09-02 22:21:06 -07:00
2026-09-02 19:05:15 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 17:13:22 -07:00
2026-09-09 12:17:57 +05:30
2026-09-03 09:44:26 -07:00
2026-09-03 15:07:39 -07:00
2026-09-02 19:10:21 -07:00
2026-09-02 18:22:01 -07:00
2026-09-03 13:28:22 -07:00
2026-09-09 12:21:28 +05:30
2026-09-03 17:13:22 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 18:33:06 -07:00
2026-09-02 19:10:21 -07:00
2026-09-02 18:44:36 -07:00
2026-09-02 19:10:21 -07:00
2026-09-11 03:45:33 +05:30
2026-09-02 19:18:18 -07:00
2026-09-02 18:51:24 -07:00
2026-09-07 21:43:54 +05:30
2026-09-03 13:48:49 -07:00
2026-09-07 08:24:54 -07:00
2026-09-10 09:22:31 -07:00
2026-09-10 10:35:07 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 19:16:38 -07:00
2026-09-08 04:38:47 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 19:18:18 -07:00
2026-09-03 04:56:59 +05:30
2026-09-07 06:15:43 -07:00
2026-09-06 05:35:12 -07:00
2026-09-09 10:32:01 +05:30
2026-09-07 07:10:28 -07:00
2026-09-02 19:19:44 -07:00
2026-09-03 17:13:22 -07:00
2026-09-03 09:44:26 -07:00
2026-09-07 07:10:28 -07:00
2026-09-11 19:04:06 +10:00
2026-09-03 17:13:22 -07:00
2026-09-03 03:31:03 -07:00
2026-09-03 10:40:25 -07:00
2026-09-03 12:29:52 -07:00
2026-09-03 13:29:35 -07:00
2026-09-02 19:42:28 -07:00
2026-09-03 03:31:03 -07:00
2026-09-04 02:03:08 -07:00
2026-09-02 19:36:47 -07:00
2026-09-09 10:31:26 +05:30
2026-09-09 10:31:26 +05:30
2026-09-03 13:24:04 -07:00
2026-09-04 00:15:16 -07:00
2026-09-02 19:45:03 -07:00
2026-09-02 19:19:44 -07:00
2026-09-02 19:42:28 -07:00
2026-09-03 10:40:25 -07:00
2026-09-10 02:21:16 +05:30
2026-09-10 02:21:16 +05:30
2026-09-03 10:40:25 -07:00
2026-09-06 22:56:51 +05:30
2026-09-02 22:23:45 -07:00
2026-09-03 17:13:22 -07:00
2026-09-04 00:15:16 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 09:44:26 -07:00
2026-09-04 00:15:16 -07:00
2026-09-11 03:45:33 +05:30
2026-09-09 11:29:56 -07:00
2026-09-03 09:44:26 -07:00
2026-09-10 10:45:57 -07:00
2026-09-06 13:21:17 -07:00
2026-09-10 10:27:07 -07:00
2026-09-03 13:12:23 -07:00
2026-09-11 06:37:27 -07:00
2026-09-09 12:17:57 +05:30
2026-09-10 10:27:07 -07:00
2026-09-03 09:44:26 -07:00
2026-09-11 06:24:11 -07:00
2026-09-09 09:51:31 -07:00
2026-09-09 12:17:57 +05:30
2026-09-03 09:44:26 -07:00
2026-09-03 13:12:23 -07:00
2026-09-06 13:21:17 -07:00
2026-09-06 13:21:17 -07:00
2026-09-11 03:45:33 +05:30
2026-09-07 06:15:43 -07:00
2026-09-11 01:37:22 -07:00
2026-09-02 18:40:01 -07:00
2026-09-03 17:13:22 -07:00
2026-09-02 19:30:27 -07:00
2026-09-02 19:26:50 -07:00
2026-09-03 09:44:26 -07:00
2026-09-02 18:45:32 -07:00
2026-09-09 11:42:43 -07:00
2026-09-06 14:19:42 -07:00
2026-09-06 13:21:17 -07:00
2026-09-10 02:44:26 -07:00
2026-09-10 11:48:01 -07:00
2026-09-10 11:48:01 -07:00
2026-09-09 02:35:41 -07:00
2026-09-02 19:19:54 -07:00
2026-09-02 18:29:10 -07:00
2026-09-02 19:07:07 -07:00
2026-09-03 17:13:22 -07:00
2026-09-04 00:15:16 -07:00
2026-09-03 09:44:26 -07:00
2026-09-03 17:13:22 -07:00
2026-09-04 07:17:00 -07:00