refactor(state): stdlib-only home for read_only_db_uri; reuse the doctor/repair helpers

hermes_state_common pulls in agent.* at import, so the URI builder moves to
hermes_state_holders (errno/os/sqlite3/pathlib only) where the gateway
readiness probe and backup can adopt it in a follow-up sweep. The doctor
structural-damage branch is one helper instead of two copies, the holder
scan goes through hermes_state_repair._live_writer_holds_db, the migration
hint uses _schema_not_built (the startswith("no such ") check also matched
"no such module: fts5"), and the hermes_state import is hoisted so an import
failure cannot mask itself as UnboundLocalError.
This commit is contained in:
kshitijk4poor
2026-09-15 12:41:00 +05:30
committed by kshitij
parent ddbd7a9437
commit 30a299180c
7 changed files with 33 additions and 29 deletions
+1 -2
View File
@@ -24,9 +24,8 @@ import time
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Tuple
from hermes_state_holders import canonical_sqlite_path
from hermes_state_holders import canonical_sqlite_path, read_only_db_uri
from hermes_state_common import (
read_only_db_uri,
FTS_REBUILD_DEFERRAL_KEY, stat_db_file_identity as _stat_db_file_identity
)