From db63afb9d72dad04f4c2a87a34d99bdc5f6c15d1 Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Thu, 27 Aug 2026 13:28:09 -0700 Subject: [PATCH] fix(state): journal-mode probe/restore go through _connect_repair_durable The write-durability contract test (test_repair_path_has_no_bare_connects) enforces that every repair-path connection carries the macOS write barriers; the restore rewrites the file header, so it belongs under the same rule. --- hermes_state.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hermes_state.py b/hermes_state.py index 064502e5b5..8fed65b943 100644 --- a/hermes_state.py +++ b/hermes_state.py @@ -3324,7 +3324,7 @@ def _probe_journal_mode_for_repair(db_path: Path) -> Optional[str]: configured ``database.journal_mode`` for ``None``. """ try: - conn = sqlite3.connect(str(db_path)) + conn = _connect_repair_durable(db_path) try: return _on_disk_journal_mode(conn) finally: @@ -3359,7 +3359,7 @@ def _restore_journal_mode_after_repair(db_path: Path, before_mode: Optional[str] to re-apply are logged at WARNING, never raised. """ try: - conn = sqlite3.connect(str(db_path)) + conn = _connect_repair_durable(db_path) try: after = apply_wal_with_fallback(conn, db_label=db_path.name) finally: