Commit Graph

4 Commits

Author SHA1 Message Date
yoniebans
2a13ffc490 F7: an unknown worker refuses a settled handoff with unknown_execution
Main's require_idle counts a worker execution whose outcome is unknown with the unknown admissions (hermes_state_mutation_guards.py at the pin), so it refuses unknown_execution, and the user is told a turn did not finish when Hermes restarted. The reference does the same, but check_handoff_settled's docstring, HandoffUnsettled's and the contract module's said session_busy for any live worker, and no case covered the state, so a backend written to the docstring passed. The docstrings now say an admission or worker execution whose outcome is unknown, and the per-owner cases gain an unknown worker.

Reported-by: BearHuddleston
2026-11-17 13:22:49 +01:00
yoniebans
c0b71f2b0e feat(persistence): begin_epoch refuses a bump while another process owns the profile
SessionRuntimeRepository.begin_epoch now states the owner guard instead of leaving it to the caller: while another process holds the profile's gateway ownership the bump raises AuthorityRefusal('ownership_conflict', field='runtime_epoch') and the epoch is unchanged, a reservation this process holds is granted, and a store with no profile directory never refuses. AuthorityRefusal lists ownership_conflict among the codes store code raises.

Contract cases pin the documented code and field, and that the reference backend, which has no profile home, grants every bump across handles of one scope.
2026-11-17 13:01:56 +01:00
yoniebans
c256ebd9c5 feat(persistence): settled-handoff refusal on request_handoff and a watcher re-check
request_handoff takes require_settled (default False, so the CLI and TUI paths keep today's behaviour). With it the verb refuses in its own write, before the in-flight check, while durable work owns the session's runtime lineage: a queued, started or unknown admission, a live worker, or a live turn lease or compression lock. The refusal is HandoffUnsettled, an AuthorityRefusal whose reason is unknown_execution for an admission with an unknown outcome and session_busy for every other owner, and nothing is written.

check_handoff_settled runs the same condition in a write transaction for the handoff watcher's re-check before it repoints the route. The reference backend evaluates both over its runtime lineage and idle guard.
2026-11-17 13:01:55 +01:00
yoniebans
4a66e4b1cd feat(persistence): the storage interface: core records, errors, profile scope and awaitable view 2026-11-17 13:01:54 +01:00