diff --git a/hermes_state.py b/hermes_state.py index 297ea27698..f71ec87cfa 100644 --- a/hermes_state.py +++ b/hermes_state.py @@ -33,12 +33,11 @@ from typing import Any, Callable, Dict, Iterator, List, Optional, Tuple, TypeVar from hermes_state_common import ( # noqa: F401 (re-exported; tests import from hermes_state) AUTO_VACUUM_MIN_FREELIST_RATIO, _FTS_CJK_TRIGGERS, _FTS_TRIGGERS, _LISTABLE_CHILD_SQL, - _PREVIEW_ELIGIBLE_SQL, _PREVIEW_RAW_SELECT, _RECOVERABLE_END_REASONS, - _RECOVERABLE_END_REASONS_SQL, _RESET_END_REASONS, _legacy_reset_child_sql, _shape_preview, - _sql_session_last_active, _sql_session_last_active_by_id, escape_like as _escape_like, - FTS_CJK_STALE_KEY, FTS_REBUILD_DEFERRAL_KEY, FTS_SQL, FTS_STALE_KEY, FTS_STORAGE_VERSION, - FTS_TRIGRAM_SQL, LEGACY_FTS_SQL, LEGACY_FTS_TRIGRAM_SQL, SCHEMA_SQL, SCHEMA_VERSION, - stat_db_file_identity as _stat_db_file_identity, + _PREVIEW_ELIGIBLE_SQL, _PREVIEW_RAW_SELECT, _RECOVERABLE_END_REASONS, _RECOVERABLE_END_REASONS_SQL, + _RESET_END_REASONS, _legacy_reset_child_sql, _shape_preview, _sql_session_last_active, + _sql_session_last_active_by_id, escape_like as _escape_like, FTS_CJK_STALE_KEY, + FTS_REBUILD_DEFERRAL_KEY, FTS_SQL, FTS_STALE_KEY, FTS_STORAGE_VERSION, FTS_TRIGRAM_SQL, LEGACY_FTS_SQL, + LEGACY_FTS_TRIGRAM_SQL, SCHEMA_SQL, SCHEMA_VERSION, stat_db_file_identity as _stat_db_file_identity, ) from hermes_state_errors import ( # noqa: F401 (re-exported; the historical import path) _DELETED_WAL_GENERATION_MSG, _DISK_IO_ERROR_MARKER, _STATE_DB_APPLICATION_ID_OFFSET, @@ -49,9 +48,8 @@ from hermes_state_errors import ( # noqa: F401 (re-exported; the historical im is_malformed_db_error, is_malformed_schema_error, is_transient_sqlite_error, ) from hermes_state_guard import ( # noqa: F401 (re-exported; tests patch hermes_state.) - _STATE_DB_GUARD_BYPASS_ENV, _in_test_context, _is_production_state_db, - _process_looks_like_pytest, _real_platform_state_root, _running_under_pytest, - _set_last_init_error, get_last_init_error, + _STATE_DB_GUARD_BYPASS_ENV, _in_test_context, _is_production_state_db, _process_looks_like_pytest, + _real_platform_state_root, _running_under_pytest, _set_last_init_error, get_last_init_error, ) from hermes_state_readpool import ( # noqa: F401 (re-exported; tests import from hermes_state) _READ_POOL_MAX, _proc_fd_targets, _process_read_permits, _read_budget_for, @@ -67,30 +65,28 @@ from hermes_state_dbfile import ( # noqa: F401 (re-exported; tests patch herme _canonical_sqlite_path, _concrete_state_db_holder_pids, _connect_tracked_db, _is_inactive_orphan_desktop_holder, _looks_like_hermes, _read_proc_cmdline, _read_sqlite_application_id, _stat_sqlite_sidecar_identity, _watched_sqlite_sidecar_paths, - collect_state_db_stats, count_db_holders, is_zeroed_state_db, - iter_deleted_sqlite_sidecar_holders, quarantine_cross_process_lock, quarantine_zeroed_state_db, - refuse_deleted_wal_generation, + collect_state_db_stats, count_db_holders, is_zeroed_state_db, iter_deleted_sqlite_sidecar_holders, + quarantine_cross_process_lock, quarantine_zeroed_state_db, refuse_deleted_wal_generation, ) from hermes_state_messages import SessionMessagesMixin from hermes_state_wal import ( # noqa: F401 (re-exported; tests patch hermes_state.) - WalUnsupportedError, _WAL_INCOMPAT_MARKERS, _apply_macos_checkpoint_barrier, - _apply_synchronous_pragma, _database_has_content, _delete_overridden_warned_paths, - _enforce_macos_synchronous_full, _journal_upgrade_warned_paths, _on_disk_journal_mode, - _wal_fallback_warned_paths, _wal_reset_bug_warned_paths, _wal_reset_repair_hint, - apply_database_pragmas, apply_wal_with_fallback, is_sqlite_wal_reset_vulnerable, - resolve_journal_mode, resolve_synchronous_level, sqlite_source_id, + WalUnsupportedError, _WAL_INCOMPAT_MARKERS, _apply_macos_checkpoint_barrier, _apply_synchronous_pragma, + _database_has_content, _delete_overridden_warned_paths, _enforce_macos_synchronous_full, + _journal_upgrade_warned_paths, _on_disk_journal_mode, _wal_fallback_warned_paths, + _wal_reset_bug_warned_paths, _wal_reset_repair_hint, apply_database_pragmas, apply_wal_with_fallback, + is_sqlite_wal_reset_vulnerable, resolve_journal_mode, resolve_synchronous_level, sqlite_source_id, ) from hermes_state_repair import ( # noqa: F401 (re-exported; tests patch hermes_state.) _MAX_MALFORMED_BACKUPS, _MAX_PERSISTENT_REPAIR_ATTEMPTS, _REPAIR_BACKUP_MIN_FREE_BYTES, _REPAIR_SNAPSHOT_MIN_THROUGHPUT_BYTES_PER_SECOND, _backup_content_identity, _backup_db_file, - _claim_repair_attempt, _connect_repair_durable, _copy_database_snapshot, - _cross_process_repair_lock, _db_fingerprint, _db_opens_cleanly, _existing_malformed_backups, - _live_writer_holds_db, _persistent_repair_attempts_exhausted, _probe_journal_mode_for_repair, - _prune_malformed_backups, _read_repair_ledger, _record_repair_outcome, - _release_auto_maintenance_lock, _repair_backup_headroom_bytes, _repair_ledger_path, - _repair_scratch_space_error, _repair_snapshot_timeout_seconds, _repair_state_db_schema_locked, - _run_repair_strategies, _try_acquire_auto_maintenance_lock, _unlink_db_triple, - apply_durability_barriers, preflight_db_writability, repair_state_db_schema, + _claim_repair_attempt, _connect_repair_durable, _copy_database_snapshot, _cross_process_repair_lock, + _db_fingerprint, _db_opens_cleanly, _existing_malformed_backups, _live_writer_holds_db, + _persistent_repair_attempts_exhausted, _probe_journal_mode_for_repair, _prune_malformed_backups, + _read_repair_ledger, _record_repair_outcome, _release_auto_maintenance_lock, + _repair_backup_headroom_bytes, _repair_ledger_path, _repair_scratch_space_error, + _repair_snapshot_timeout_seconds, _repair_state_db_schema_locked, _run_repair_strategies, + _try_acquire_auto_maintenance_lock, _unlink_db_triple, apply_durability_barriers, + preflight_db_writability, repair_state_db_schema, ) from hermes_state_titles import SessionTitlesMixin from hermes_state_usage import SessionUsageMixin