The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
docs(state): trim derived-id recognizer comments to the contract
kshitijk4poor406cf7787b94
diff --git a/hermes_cli/session_lost_and_found.py b/hermes_cli/session_lost_and_found.pyindex dd333a66b41..3951bb88e07 100644--- a/hermes_cli/session_lost_and_found.py+++ b/hermes_cli/session_lost_and_found.py@@ -297,13 +297,7 @@ def _parse_sql_default(text: str) -> Any:def _is_session_id(value: Any) -> bool:- """A cell that can be a session id: any shape this repo's surfaces really mint.-- Not just ``SESSION_ID_PATTERN``. Cron fires, ``/bg`` tasks and hosted rooms derive their ids- instead of minting through ``new_session_id``, and those rows are first-class sessions. Missing- them here both drops them from salvage and — since one bad value at the id position vetoes a- candidate layout — collapses layout inference for the whole table to the positional fallback.- """+ """A cell that can be a session id: any shape in ``SESSION_ID_RECOGNIZERS``."""return isinstance(value, str) and is_known_session_id(value)diff --git a/hermes_state_ids.py b/hermes_state_ids.pyindex e3633d2423b..bcbfd767328 100644--- a/hermes_state_ids.py+++ b/hermes_state_ids.py@@ -16,17 +16,8 @@ from typing import OptionalSESSION_ID_PATTERN = re.compile(r"^\d{8}_\d{6}_")-# Not every session id is minted by ``new_session_id``. Several first-class surfaces derive an id-# from something they already have (a job id, a clock, a room hash) so the id itself carries the-# provenance. Salvage classifies schema-less rows by these shapes, so a surface missing here (a)-# has its sessions DROPPED by ``hermes sessions recover`` (classify returns None) and (b) poisons-# layout inference for the WHOLE table via ``parent_session_id``: an ordinary child session of a-# cron job classifies fine but carries the unrecognised parent id, and one bad sampled value vetoes-# every candidate layout, which drops recovery onto the positional-guessing fallback. Measured on a-# real 3,373-session store: 379 rows (11.2%) -- 375 cron + 1 bg + junk -- were silently discarded.-#-# Keep each entry anchored on the parts the minting site actually fixes; these are layout sentinels,-# so a loose pattern costs real wrong-column-mapping safety.+# Ids that surfaces derive instead of minting via new_session_id; salvage uses them as layout+# sentinels, so anchor each on what its mint site fixes.SESSION_ID_RECOGNIZERS = (SESSION_ID_PATTERN,# cron/scheduler.py: f"cron_{job_id}_{now:%Y%m%d_%H%M%S}". job_id is uuid4().hex[:12] for jobs