From d815db4a860c09ff929c3c797e85f1e9e5cdad6a Mon Sep 17 00:00:00 2001 From: Guangyu Date: Sat, 12 Sep 2026 02:09:06 +0000 Subject: [PATCH] refactor(playbook): drop the provisional confirmation seam The lifecycle termination triple is a pair. `restore` and `displace` remain; `confirm_user_playbook_provisional_publication` is deleted from both the shared `UserPlaybookLifecycleTerminationStore` Protocol and the storage base's default-raising stub. It was never callable. The transition required a confirmation analyst that is a Protocol with no implementation, and `QualificationCase` refuses `role="confirmation"` at parse time, so the support tally the boundary compared against its two-session floor was permanently zero. Every publication therefore reverted at its deadline regardless of quality. The enterprise adapter's implementation and its only caller are already gone. A published revision is now KEPT until the tuner's own next evidence pass revises it, so nothing can ask for the transition -- and a declared-but-uncallable Protocol member obliges every backend to implement one anyway. The SQL routine is untouched: dropping it is a contract migration that needs its own rollout sequencing. --- .../server/services/playbook/publication.py | 31 +++++-------------- .../storage/storage_base/playbook/_user.py | 30 +++--------------- 2 files changed, 12 insertions(+), 49 deletions(-) diff --git a/reflexio/server/services/playbook/publication.py b/reflexio/server/services/playbook/publication.py index 39ad4d61..1442f085 100644 --- a/reflexio/server/services/playbook/publication.py +++ b/reflexio/server/services/playbook/publication.py @@ -669,29 +669,14 @@ def restore_user_playbook_provisional_publication( """Reselect the retained predecessor and terminalize, under a fence.""" ... - def confirm_user_playbook_provisional_publication( - self, - *, - lifecycle_id: int, - expected_fence: int, - expected_successor_fingerprint: str, - support_session_count: int, - refute_session_count: int, - global_coverage_numerator: int, - global_coverage_denominator: int, - target_coverage_numerator: int, - target_coverage_denominator: int, - ) -> LifecycleTerminalResult: - """Keep the successor and terminalize as confirmed, under a fence. - - No ``reason`` parameter: ``confirmed_online_support`` is the only reason - this transition can record, so passing it would create a second place - the pairing could drift. The six counts are the evidence the boundary - decided on; the RPC re-checks the arithmetic itself and refuses an - inadmissible set rather than obeying it. - """ - ... - + # There is no ``confirm_...`` member. It was the third of a termination + # TRIPLE -- restore, confirm, displace -- and it is deleted rather than left + # declared: its only caller was a confirmation boundary that could never + # fire (no confirmation analyst was ever implementable, so the support tally + # was permanently zero), and a published successor is now KEPT until the + # tuner's own next evidence pass revises it. A declared-but-uncallable + # member of a Protocol obliges every backend to implement a transition + # nothing can ask for. def displace_user_playbook_provisional_publication( self, *, lifecycle_id: int ) -> LifecycleTerminalResult: diff --git a/reflexio/server/services/storage/storage_base/playbook/_user.py b/reflexio/server/services/storage/storage_base/playbook/_user.py index 0a7fadfe..34385104 100644 --- a/reflexio/server/services/storage/storage_base/playbook/_user.py +++ b/reflexio/server/services/storage/storage_base/playbook/_user.py @@ -121,32 +121,10 @@ def restore_user_playbook_provisional_publication( "Storage backend does not support provisional user-playbook restoration" ) - def confirm_user_playbook_provisional_publication( - self, - *, - lifecycle_id: int, - expected_fence: int, - expected_successor_fingerprint: str, - support_session_count: int, - refute_session_count: int, - global_coverage_numerator: int, - global_coverage_denominator: int, - target_coverage_numerator: int, - target_coverage_denominator: int, - ) -> "LifecycleTerminalResult": - """Atomically keep the successor and terminalize as confirmed. - - Declared here, alongside restore and displace, rather than as an - enterprise-only extra: the three are one termination triple over the - same lifecycle row, and their shared Protocol - (``UserPlaybookLifecycleTerminationStore``) lives in the OSS package. A - backend that satisfied two thirds of it would be a surface every reader - has to special-case. - """ - raise NotImplementedError( - "Storage backend does not support provisional user-playbook confirmation" - ) - + # No ``confirm_...`` stub: the termination triple is a PAIR now. Restore and + # displace remain; confirmation is deleted, because a published successor is + # kept until the tuner's next evidence pass revises it and no caller can ask + # for the transition. See ``UserPlaybookLifecycleTerminationStore``. def displace_user_playbook_provisional_publication( self, *, lifecycle_id: int ) -> "LifecycleTerminalResult":