Skip to content

Commit 2be57ab

Browse files
committed
fix(hooks): remove stale hooks-state.db fallback from ralph-stop
Server's state.db is the SSOT for chain state (PID-scoped rows, WAL mode). The hooks-state.db fallback was a legacy path that could read stale data.
1 parent 47a2c9e commit 2be57ab

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

hooks/ralph-stop.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
sys.path.insert(0, str(Path(__file__).parent / "lib"))
2828

2929
from db_reader import load_active_chain_state
30-
from session_state import load_session_state
3130
from verify_active_store import (
3231
clear_verify_active_state,
3332
load_verify_active_state,
@@ -375,11 +374,8 @@ def main():
375374

376375
if not verify_state:
377376
# No active verification — check for active chain before allowing stop
378-
# SSOT: read from server's state.db (works without PostToolUse hook)
377+
# SSOT: server's state.db (PID-scoped rows, WAL mode for concurrent reads)
379378
chain_state = load_active_chain_state()
380-
# Fallback: hooks-state.db (if PostToolUse populated it)
381-
if not chain_state and hook_session_id:
382-
chain_state = load_session_state(hook_session_id)
383379
if chain_state:
384380
chain_id = chain_state.get("chain_id", "")
385381
step = chain_state.get("current_step", 0)

0 commit comments

Comments
 (0)