refactor(state): drop the SESSION_ID_PATTERN re-export from lost-and-found
session_lost_and_found now classifies through is_known_session_id, so the noqa re-export only existed to satisfy an identity assertion in test_hermes_state_ids. Import the predicate it uses and drop the pin.
This commit is contained in:
@@ -16,10 +16,7 @@ from typing import Any, Callable, Optional, Sequence
|
||||
|
||||
from hermes_cli.session_schema_history import SCHEMA_HISTORY, reachable_physical_layouts
|
||||
|
||||
from hermes_state_ids import ( # timestamp prefix + derived shapes: sentinel for schema-less rows
|
||||
SESSION_ID_PATTERN, # noqa: F401 -- re-export; test_hermes_state_ids pins the identity
|
||||
is_known_session_id,
|
||||
)
|
||||
from hermes_state_ids import is_known_session_id # every minted id shape: sentinel for schema-less rows
|
||||
from hermes_cli.session_recovery import (
|
||||
_AUXILIARY_TABLE_SCHEMAS, _AUXILIARY_TABLES, _CANONICAL_TABLES, _DANGLING_TOOL_PIN, _count_rows,
|
||||
_immediate_transaction, _placeholder_titles, _quoted_columns, _table_columns,
|
||||
|
||||
@@ -5,13 +5,12 @@ as a session id (the shape is the recovery sentinel for schema-less rows).
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib
|
||||
import re
|
||||
from datetime import datetime
|
||||
|
||||
import pytest
|
||||
|
||||
from hermes_state_ids import SESSION_ID_PATTERN, new_session_id
|
||||
from hermes_state_ids import new_session_id
|
||||
|
||||
@pytest.mark.parametrize("hex_len,expected_re", [(6, r"^\d{8}_\d{6}_[0-9a-f]{6}$"), (8, r"^\d{8}_\d{6}_[0-9a-f]{8}$"),
|
||||
(12, r"^\d{8}_\d{6}_[0-9a-f]{12}$")])
|
||||
@@ -20,4 +19,3 @@ def test_minted_ids_are_what_salvage_classifies_as_session_ids(hex_len, expected
|
||||
sid = new_session_id(datetime(2026, 1, 2, 3, 4, 5), hex_len=hex_len)
|
||||
assert re.fullmatch(expected_re, sid) and sid.startswith("20260102_030405_")
|
||||
assert _is_session_id(sid)
|
||||
assert SESSION_ID_PATTERN is importlib.import_module("hermes_cli.session_lost_and_found").SESSION_ID_PATTERN
|
||||
|
||||
Reference in New Issue
Block a user