Adam Durham
0788e759dd
fix(state): session recovery must recognize cron_/bg_/room_ ids
...
session recovery's salvage classifier decided "is this cell a session id?"
with SESSION_ID_PATTERN alone (^\d{8}_\d{6}_), which only covers ids minted
by new_session_id. Several first-class surfaces DERIVE an id instead:
cron/scheduler.py f"cron_{job_id}_{now:%Y%m%d_%H%M%S}"
hermes_cli/cli_commands_mixin.py f"bg_{now:%H%M%S}_{uuid4().hex[:6]}" (/bg)
gateway/.../api_server_room_dispatch.py f"room_{sha256(seed)[:32]}"
Measured against a copy of a real 3,373-session store: 379 ids (11.2%)
failed the pattern -- 375 cron, 1 bg, plus 3 non-session test artifacts.
job_id is normally uuid4().hex[:12] (cron/jobs.py) but legacy/user ids like
"job-1" are real and still present in live stores, so the cron recognizer
accepts a general job-id token.
Two distinct consequences, both fixed:
1. DROPPED SESSIONS. classify_lost_and_found_row() returned None for those
rows, so recovery silently discarded every cron/bg/room session. On the
real store: 2994 of 3373 rows kept before, 3370 after (the 3 still
dropped are 's'/'session-key'/'pre-compress-key' -- not sessions,
correctly rejected).
2. POISONED LAYOUT INFERENCE. parent_session_id is a _TEXT_SHAPE_RULES
column checked with the same predicate. A cron job's CHILD session has an
ordinary timestamp id, so it classifies fine and becomes layout evidence
-- while carrying the unrecognised cron id in parent_session_id. Since one
bad sampled value vetoes a candidate layout, a single such row collapsed
inference for the whole sessions table, i.e. the positional-guessing path
#101409 's fix exists to prevent. Proven on a synthetic store: 20 clean +
cron parent + child-of-cron -> EMPTY before, 59/59 columns named and 0
wrong after.
Fix: hermes_state_ids gains SESSION_ID_RECOGNIZERS + is_known_session_id(),
the recognition side of the minting contract; _is_session_id() consults it.
Each pattern is anchored on exactly what its minting site fixes -- these are
layout sentinels, so a loose pattern would buy recall at the cost of
wrong-column mappings.
Tests: tests/hermes_state/test_session_id_recognition_recovery.py (new, 43
cases) covers recognition, non-dropping, the parent_session_id poisoning
path, and adversarial wrong-layout rejection (rotated layouts still vetoed;
near-miss and arbitrary text still rejected). Mutation-checked: with the
added recognizers removed, 12 of 43 fail -- including the end-to-end
poisoning test.
(cherry picked from commit f82b7182f03e1eee55c832a3f90fffbe580d1f5c)
2026-10-04 12:05:37 +05:30
..
2026-10-02 01:05:58 +05:30
2026-10-03 23:06:58 -04:00
2026-10-03 13:38:29 -07:00
2026-10-03 16:29:17 +05:30
2026-10-03 23:05:48 -07:00
2026-10-04 11:57:03 +05:30
2026-09-24 14:47:06 -04:00
2026-09-29 20:57:17 -05:00
2026-10-03 22:46:14 -04:00
2026-09-29 16:47:48 +05:30
2026-10-02 04:39:28 -07:00
2026-09-23 11:41:01 -04:00
2026-10-02 02:31:03 +05:30
2026-09-27 02:55:39 -07:00
2026-09-21 00:58:39 -04:00
2026-09-28 10:21:41 -07:00
2026-09-22 09:55:47 -04:00
2026-09-29 20:24:19 -04:00
2026-09-29 07:44:13 +00:00
2026-09-19 12:11:58 -07:00
2026-09-28 03:37:09 -07:00
2026-09-21 19:08:19 -04:00
2026-09-23 11:41:01 -04:00
2026-09-24 18:06:48 +05:30
2026-09-28 12:43:03 -07:00
2026-09-28 12:43:03 -07:00
2026-09-29 18:47:44 -05:00
2026-10-03 16:30:59 +05:30
2026-09-20 18:21:34 -07:00
2026-09-20 18:29:22 -07:00
2026-09-21 09:55:40 -07:00
2026-09-29 20:24:19 -04:00
2026-09-19 09:23:22 -07:00
2026-10-03 16:30:59 +05:30
2026-10-03 16:30:59 +05:30
2026-09-20 18:20:44 -07:00
2026-09-29 07:44:13 +00:00
2026-09-25 14:22:12 -04:00
2026-10-01 01:50:16 -05:00
2026-09-24 01:40:31 -04:00
2026-09-28 10:21:41 -07:00
2026-09-25 12:07:32 -05:00
2026-09-28 10:21:41 -07:00
2026-09-27 18:19:17 +05:30
2026-09-29 23:54:34 +05:30
2026-09-24 01:55:51 -04:00
2026-09-28 14:16:18 -07:00
2026-09-28 14:16:18 -07:00
2026-10-02 18:35:45 -05:00
2026-10-03 16:30:59 +05:30
2026-09-29 23:54:34 +05:30
2026-09-20 13:35:09 -07:00
2026-09-28 14:16:18 -07:00
2026-09-28 14:16:18 -07:00
2026-10-02 22:47:50 -04:00
2026-10-01 13:23:12 -07:00
2026-09-28 14:16:18 -07:00
2026-09-28 14:16:18 -07:00
2026-09-28 14:16:18 -07:00
2026-09-26 22:19:53 -05:00
2026-09-28 14:16:18 -07:00
2026-09-23 10:05:40 -07:00
2026-10-03 23:28:02 +05:30
2026-09-30 14:23:52 -05:00
2026-09-30 22:30:35 -04:00
2026-09-28 14:16:18 -07:00
2026-09-28 14:16:18 -07:00
2026-09-28 14:16:18 -07:00
2026-09-28 14:16:18 -07:00
2026-09-28 14:16:18 -07:00
2026-10-01 13:23:12 -07:00
2026-10-03 23:05:48 -07:00
2026-09-28 14:16:18 -07:00
2026-09-28 14:16:18 -07:00
2026-09-20 10:52:54 -07:00
2026-10-02 13:34:54 +05:30
2026-09-19 22:57:07 -04:00
2026-09-19 09:30:56 -07:00
2026-09-28 14:16:18 -07:00
2026-10-03 20:44:07 +05:30
2026-09-29 20:34:45 +05:30
2026-10-03 10:15:11 -07:00
2026-09-23 19:51:34 -04:00
2026-09-28 02:00:41 -07:00
2026-09-28 14:16:18 -07:00
2026-09-28 13:08:49 -07:00
2026-10-03 16:31:09 +05:30
2026-09-23 15:05:44 -07:00
2026-10-02 01:02:00 +05:30
2026-10-03 19:21:54 +05:30
2026-09-28 04:04:23 -07:00
2026-09-19 16:28:57 +05:30
2026-09-22 09:55:47 -04:00
2026-09-29 20:24:19 -04:00
2026-10-02 20:29:53 -05:00
2026-09-30 23:10:24 -05:00
2026-09-28 10:21:41 -07:00
2026-10-03 19:51:54 +05:30
2026-10-03 21:15:17 +05:30
2026-10-03 21:15:17 +05:30
2026-09-29 19:49:52 -05:00
2026-09-26 21:43:07 -05:00
2026-10-03 21:15:17 +05:30
2026-09-28 10:21:41 -07:00
2026-09-29 20:24:19 -04:00
2026-09-21 19:08:19 -04:00
2026-09-28 10:21:41 -07:00
2026-09-28 06:42:00 -07:00
2026-10-02 04:39:28 -07:00
2026-10-02 04:39:28 -07:00
2026-09-29 12:16:43 -04:00
2026-10-03 21:15:17 +05:30
2026-10-02 01:02:00 +05:30
2026-09-23 10:42:18 -04:00
2026-09-28 10:21:41 -07:00
2026-09-28 10:21:41 -07:00
2026-09-29 07:44:13 +00:00
2026-09-27 01:04:39 +05:30
2026-09-21 10:11:19 -07:00
2026-09-28 04:04:23 -07:00
2026-09-28 13:30:57 -07:00
2026-09-23 10:58:15 -07:00
2026-10-03 21:57:13 -04:00
2026-09-28 13:30:57 -07:00
2026-09-23 07:48:32 -07:00
2026-09-21 00:58:39 -04:00
2026-09-27 02:57:28 -07:00
2026-10-03 21:44:47 -04:00
2026-09-20 10:44:52 -07:00
2026-09-21 18:56:56 -04:00
2026-10-02 14:17:41 -07:00
2026-10-03 20:44:07 +05:30
2026-09-29 18:09:20 -05:00
2026-10-02 20:51:34 +00:00
2026-09-28 10:21:41 -07:00
2026-09-28 12:43:03 -07:00
2026-10-01 04:50:26 -05:00
2026-10-04 02:12:57 +05:30
2026-09-28 10:21:41 -07:00
2026-09-28 14:16:18 -07:00
2026-10-03 16:31:23 +05:30
2026-10-02 22:21:27 -05:00
2026-09-28 10:21:41 -07:00
2026-09-28 10:21:41 -07:00
2026-10-03 16:31:23 +05:30
2026-09-20 18:43:59 -07:00
2026-09-22 13:41:11 +05:30
2026-09-28 03:37:09 -07:00
2026-09-28 03:37:09 -07:00
2026-09-23 08:09:47 -07:00
2026-09-23 11:41:01 -04:00
2026-09-28 10:21:41 -07:00
2026-09-21 23:47:51 -07:00
2026-09-28 12:24:52 -05:00
2026-09-29 21:48:25 -05:00
2026-09-25 14:22:12 -04:00
2026-09-25 14:22:12 -04:00
2026-09-21 19:08:19 -04:00
2026-09-28 04:44:29 -07:00
2026-09-25 16:28:14 -05:00
2026-10-02 23:30:18 +05:30
2026-09-28 06:42:00 -07:00
2026-10-03 23:05:48 -07:00
2026-09-29 15:45:52 +05:30
2026-10-03 22:32:13 -04:00
2026-09-28 14:16:18 -07:00
2026-09-20 16:41:21 +05:30
2026-10-03 23:05:48 -07:00
2026-09-23 15:26:34 -04:00
2026-09-19 02:44:02 -07:00
2026-09-28 12:43:03 -07:00
2026-09-28 12:43:03 -07:00
2026-09-28 10:21:41 -07:00
2026-09-28 10:21:41 -07:00
2026-09-26 17:04:25 -05:00
2026-09-24 11:50:30 -04:00
2026-09-23 07:49:35 -07:00
2026-10-02 04:39:28 -07:00
2026-10-02 04:39:28 -07:00
2026-09-28 10:21:41 -07:00
2026-09-28 10:21:41 -07:00
2026-09-28 05:37:55 -07:00
2026-09-19 09:34:40 -07:00
2026-09-21 19:08:19 -04:00
2026-09-28 12:43:03 -07:00
2026-09-28 12:43:03 -07:00
2026-09-19 10:26:08 -07:00
2026-10-03 22:32:13 -04:00
2026-10-02 21:43:17 -05:00
2026-09-29 12:55:46 -07:00
2026-10-02 22:40:31 -05:00
2026-10-02 20:24:37 -05:00
2026-09-19 10:26:08 -07:00
2026-10-02 22:58:26 -05:00
2026-09-24 09:40:41 -04:00
2026-10-04 02:12:57 +05:30
2026-10-04 00:10:54 +05:30
2026-09-23 06:46:02 -07:00
2026-09-28 10:21:41 -07:00
2026-10-01 16:22:28 +05:30
2026-09-28 10:21:41 -07:00
2026-10-03 19:01:42 -07:00
2026-09-28 10:21:41 -07:00
2026-10-03 10:26:12 -07:00
2026-10-01 10:46:45 -07:00
2026-09-28 10:21:41 -07:00
2026-09-22 05:16:50 -04:00
2026-09-24 02:03:03 -07:00
2026-10-03 10:15:11 -07:00
2026-10-03 10:15:11 -07:00
2026-10-03 10:15:11 -07:00
2026-10-03 10:15:11 -07:00
2026-10-03 10:15:11 -07:00
2026-10-03 10:15:11 -07:00
2026-09-28 12:43:03 -07:00
2026-10-03 13:34:08 -07:00
2026-10-01 12:41:57 -07:00
2026-09-28 14:16:18 -07:00
2026-10-03 10:15:11 -07:00
2026-09-23 12:45:32 +05:30
2026-09-28 14:16:18 -07:00
2026-09-24 14:08:21 -04:00
2026-09-24 11:50:29 -04:00
2026-10-03 10:15:11 -07:00
2026-09-24 11:50:29 -04:00
2026-10-03 21:40:42 -04:00
2026-10-03 10:15:11 -07:00
2026-09-24 11:50:29 -04:00
2026-09-25 21:19:04 +05:30
2026-09-27 01:42:52 +05:30
2026-10-02 03:40:17 -07:00
2026-09-28 09:22:11 -07:00
2026-09-22 01:19:12 -07:00
2026-09-22 17:16:00 +05:30
2026-10-03 10:15:11 -07:00
2026-09-28 14:16:18 -07:00
2026-09-25 14:22:12 -04:00
2026-09-22 05:16:50 -04:00
2026-09-22 05:16:50 -04:00
2026-10-02 04:09:57 -07:00
2026-09-25 14:22:12 -04:00
2026-09-29 22:57:48 -04:00
2026-10-01 16:22:28 +05:30
2026-10-01 22:35:29 -07:00
2026-09-27 21:29:39 -07:00
2026-09-29 20:24:19 -04:00
2026-10-02 01:29:41 -07:00
2026-09-28 10:21:41 -07:00
2026-10-03 16:29:29 +05:30
2026-09-23 05:37:40 -07:00
2026-09-28 04:04:23 -07:00
2026-10-03 19:02:12 +05:30
2026-09-29 20:57:57 -05:00
2026-10-02 14:37:54 +05:30
2026-10-02 14:37:54 +05:30
2026-09-21 00:58:39 -04:00
2026-09-28 12:43:03 -07:00
2026-09-21 14:02:05 -07:00
2026-09-27 03:41:42 -07:00
2026-10-03 16:30:27 +05:30
2026-09-20 11:19:50 -07:00
2026-09-28 10:21:41 -07:00
2026-09-28 04:44:29 -07:00
2026-09-28 03:34:07 -07:00
2026-09-28 10:21:41 -07:00
2026-09-24 11:50:30 -04:00
2026-09-19 22:57:07 -04:00
2026-09-24 12:30:00 -04:00
2026-10-03 23:28:02 +05:30
2026-09-26 20:40:40 -05:00
2026-10-04 12:05:37 +05:30
2026-09-25 10:46:54 -05:00
2026-09-28 15:54:01 +05:30
2026-09-28 21:03:09 -04:00
2026-09-27 20:49:04 +05:30
2026-09-24 18:08:24 +05:30
2026-10-03 19:21:54 +05:30
2026-09-23 10:43:45 -04:00
2026-09-28 08:33:43 +00:00
2026-09-28 12:43:03 -07:00
2026-09-28 12:33:01 -07:00
2026-10-02 02:58:18 +05:30
2026-09-30 21:15:08 -07:00
2026-10-04 02:54:56 +05:30
2026-09-25 20:00:57 -05:00
2026-09-28 10:21:41 -07:00
2026-09-28 14:16:18 -07:00
2026-10-02 23:30:18 +05:30
2026-09-28 21:02:35 -04:00
2026-10-01 00:15:05 -05:00
2026-09-24 14:23:48 -04:00
2026-10-01 22:35:29 -07:00
2026-09-25 14:22:12 -04:00
2026-09-28 10:21:41 -07:00
2026-09-29 15:28:19 -05:00
2026-10-01 22:03:11 -07:00
2026-09-27 07:43:23 -05:00
2026-10-01 22:27:03 -07:00
2026-09-28 19:02:20 +05:30
2026-09-24 11:12:27 -04:00
2026-09-19 09:54:20 -07:00
2026-09-28 10:21:41 -07:00
2026-09-28 14:16:18 -07:00
2026-09-26 17:09:16 -05:00
2026-09-22 22:24:31 +00:00
2026-09-27 23:53:40 -07:00
2026-09-24 16:17:16 -04:00
2026-10-02 21:23:30 -05:00
2026-10-03 16:29:54 +05:30
2026-10-02 18:06:40 +00:00
2026-09-27 14:09:15 -05:00
2026-09-21 22:02:46 -04:00
2026-10-02 11:41:19 -07:00
2026-09-29 20:58:24 -05:00
2026-09-26 20:07:47 +05:30
2026-09-25 14:22:12 -04:00
2026-09-23 18:48:33 -05:00
2026-09-29 21:50:16 -05:00
2026-09-29 18:49:58 -05:00
2026-09-28 10:21:41 -07:00
2026-09-21 01:57:31 -07:00
2026-09-28 05:33:25 -07:00
2026-09-28 04:44:29 -07:00
2026-09-28 12:43:03 -07:00
2026-10-02 11:41:19 -07:00
2026-09-28 12:43:03 -07:00
2026-09-24 14:08:22 -04:00
2026-09-23 11:41:01 -04:00
2026-09-27 02:57:28 -07:00
2026-09-23 06:51:47 -07:00
2026-09-28 04:44:29 -07:00
2026-09-29 21:50:16 -05:00
2026-09-29 20:58:59 -05:00
2026-09-28 05:33:25 -07:00
2026-09-28 21:02:29 -04:00
2026-09-27 14:09:15 -05:00
2026-09-20 10:07:50 -04:00
2026-09-21 19:32:37 -04:00
2026-09-22 15:55:23 +05:30
2026-09-20 10:21:52 -07:00
2026-10-03 22:46:14 -04:00
2026-09-28 12:43:03 -07:00
2026-09-28 10:21:41 -07:00
2026-09-28 16:23:22 +05:30
2026-09-29 11:40:36 -05:00
2026-10-03 16:54:59 +05:30
2026-10-02 04:39:28 -07:00
2026-10-04 11:57:03 +05:30
2026-10-03 10:15:11 -07:00
2026-10-03 12:08:23 -04:00
2026-09-28 12:18:58 -07:00
2026-09-19 15:04:44 +05:30
2026-09-19 15:04:44 +05:30
2026-09-29 19:06:35 -05:00
2026-09-23 06:46:02 -07:00
2026-10-01 23:27:08 -07:00
2026-09-23 11:41:01 -04:00
2026-09-28 12:18:58 -07:00
2026-10-03 19:51:54 +05:30
2026-09-28 12:18:58 -07:00
2026-10-03 23:05:48 -07:00
2026-10-03 19:51:54 +05:30
2026-10-03 17:03:54 -04:00
2026-10-02 02:54:18 +05:30
2026-09-28 10:21:41 -07:00
2026-10-02 10:42:07 -04:00
2026-09-21 14:13:07 -04:00
2026-10-02 10:42:07 -04:00
2026-10-03 22:03:44 +05:30
2026-10-03 22:03:44 +05:30
2026-09-24 15:38:22 +05:30
2026-09-23 19:51:34 -04:00