+
    …WÝjY  ã                  ó¢   € R t ^ RIHt ^ RIt^ RIHtHt ^ RIHt ^ RI	H
t
Ht ^ RIHt R R lt]
 ! R	 R
4      4       t ! R R4      t]! 4       tR# )zëOwnership leases for replaceable runtime registrations.

The coordinator models registration *generations*, not just value identity: the same provider
singleton may be registered again after an older ownership generation was unloaded.
)ÚannotationsN)ÚCallableÚHashable)Úcontextmanager)Ú	dataclassÚfield)ÚAnyc               ó$   € V ^8„  d   QhRRRRRR/# )é   Úleftr   ÚrightÚreturnÚbool© )Úformats   "ÚJC:\Users\johnn\AppData\Local\hermes\hermes-agent\registration_lifecycle.pyÚ__annotate__r      s!   € ÷ ñ ˜Cð ¨ð °ñ ó    c                ó*  € \        V \        4      '       d|   \        V\        4      '       df   \        V 4      \        V4      8H  ;'       dG    \        ;QJ d%    R \	        W4       4       F  '       d   K   R# 	  R# ! R \	        W4       4       4      # WJ # )zPCompare opaque registry snapshots using identity only (element-wise for tuples).c              3  ó<   "  € T F  w  r\        W4      x € K  	  R # 5i©N)Úsame_registration)Ú.0ÚaÚbs   &  r   Ú	<genexpr>Ú$same_registration.<locals>.<genexpr>   s   é € Ð.dÑScÉ4È1Ô/@À×/FÐ/FÓScùs   ‚FT)Ú
isinstanceÚtupleÚlenÚallÚzip)r   r   s   &&r   r   r      so   € ä�$œ×Ò¤:¨e´U×#;Ò#;Ü�4‹yœC ›JÑ&×dÐd¯3«3Ñ.dÔSVÐW[ÔScÓ.d¯3¬3Ðdª3Ðd¨3Ñ.dÔSVÐW[ÔScÓ.dÓ+dÐdØˆ=Ðr   c                  ó”   € ] tR t^t$ RtR]R&   R]R&   R]R&   R]R&   R	]R
&   RtR]R&   RtR]R&   ]! RRR7      t	R]R&   R R lt
RtR# )ÚReplacementLeasez8One ownership generation in a replaceable registry slot.ÚReplacementCoordinatorÚcoordinatorr   Úslotr   ÚcurrentÚpreviousúCallable[[Any], bool]ÚrestoreNúCallable[[], None] | NoneÚfinalizezReplacementLease | NoneÚpredecessorTF)ÚdefaultÚinitr   Úactivec               ó   € V ^8„  d   QhRR/# ©r
   r   ÚNoner   )r   s   "r   r   ÚReplacementLease.__annotate__$   s   € ÷ 'ñ '˜ñ 'r   c                	ó<   € V P                   P                  V 4       R # r   )r%   Údispose©Úselfs   &r   r6   ÚReplacementLease.dispose$   s   € Ø×Ñ× Ñ  Ö&r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__r,   r-   r   r0   r6   Ú__static_attributes__r   r   r   r#   r#      sQ   ‡ áBà'Ó'Ø
ƒNØƒLØƒMØ"Ó"Ø*.€HÐ'Ó.Ø+/€KÐ(Ó/Ù ¨EÔ2€FˆDÓ2÷'ñ 'r   r#   c                  óV   € ] tR t^(tRtR R lt]R 4       tRR/R R lltR	 R
 lt	Rt
R# )r$   zCLink and remove registration generations in arbitrary unload order.c               ó   € V ^8„  d   QhRR/# r2   r   )r   s   "r   r   Ú#ReplacementCoordinator.__annotate__+   s   € ÷ 'ñ '˜$ñ 'r   c                	óH   € / V n         \        P                  ! 4       V n        R # r   )Ú_activeÚ	threadingÚRLockÚ_lockr7   s   &r   Ú__init__ÚReplacementCoordinator.__init__+   s   € Ø?AˆŒÜ—_’_Ó&ˆŽ
r   c              #  óx   "  € V P                   ;_uu_ 4        Rx € RRR4       R#   + '       g   i     R# ; i5i)z@Serialize a registry snapshot/write/acquire with lease disposal.N)rH   r7   s   &r   ÚtransactionÚ"ReplacementCoordinator.transaction/   s   é € ð �Z�Z‹ZÛ÷ �Z�ZŠZüs   ‚:—&œ
:¦7	±	:r,   Nc               ó0   € V ^8„  d   QhRRRRRRRRRR	R
R/# )r
   r&   r   r'   r   r(   r*   r)   r,   r+   r   r#   r   )r   s   "r   r   rC   5   s9   € ÷ ñ ˜Hð °#ð Àð ÐOdð Ø3ðØ?Oñr   c               ó$  a€ V P                   ;_uu_ 4        V P                  P                  V. 4      p\        V3R l\	        V4       4       R4      p\        WVSWEV4      pVP                  V4       VuuRRR4       #   + '       g   i     R# ; i)z@Attach a new live generation to the matching active predecessor.c              3  óŠ   <"  € T F8  qP                   '       g   K  \        VP                  S4      '       g   K4  Vx € K:  	  R # 5ir   )r0   r   r'   )r   Úcr(   s   & €r   r   Ú1ReplacementCoordinator.acquire.<locals>.<genexpr>:   s-   øé € ÐsÑ+; a¿x½x¤ÔL]Ð^_×^gÑ^gÐiq×Lr§¢Ó+;ùs   ƒA›A¹
AN)rH   rE   Ú
setdefaultÚnextÚreversedr#   Úappend)	r8   r&   r'   r(   r*   r,   Úleasesr-   Úleases	   &&$d$$   r   ÚacquireÚReplacementCoordinator.acquire5   sj   ø€ ð �Z�Z‹ZØ—\‘\×,Ñ,¨T°2Ó6ˆFÜÔs¬8°FÔ+;ÓsÐuyÓzˆKÜ$ T°¸(ÀGÐWbÓcˆEØ�M‰M˜%Ô Ø÷ �Z�Z‹Zús   –AA>Á>B	c               ó    € V ^8„  d   QhRRRR/# )r
   rX   r#   r   r3   r   )r   s   "r   r   rC   ?   s   € ÷ 7ñ 7Ð-ð 7°$ñ 7r   c                ó‚  € V P                   ;_uu_ 4        VP                  '       g    RRR4       R# V P                  P                  VP                  . 4      p\        R \        V4       4       R4      pRVn          W1J dh   VP                  VP                  rTVe,   VP                  '       g   VP                  VP                  rTK/  TP                  Ve   VP                  MT4       VP                  e   VP                  4        T Uu. uF  qfP                  '       g   K  TNK  	  ppT'       d   YpP                  TP                  &   M.T'       d'   T P                  P                  TP                  R4       RRR4       R#   TP                  e   TP                  4        i i ; iu upi   T Uu. uF  qfP                  '       g   K  TNK  	  Mu upi ppT'       d   YpP                  TP                  &   i T'       d(   T P                  P                  TP                  R4       i i ; i  + '       g   i     R# ; i)z–Remove *lease*, restoring the nearest still-live predecessor.

``restore`` -> ``finalize`` -> slot pruning each run even when an earlier step raises.
Nc              3  óL   "  € T F  qP                   '       g   K  Vx € K  	  R # 5ir   )r0   )r   rQ   s   & r   r   Ú1ReplacementCoordinator.dispose.<locals>.<genexpr>H   s   é € ÐCÑ&6 ¿(½(Ÿ1š1Ó&6ùs   ‚$š
$F)rH   r0   rE   Úgetr&   rT   rU   r(   r-   r*   r'   r,   Úpop)r8   rX   rW   ÚlatestÚreplacementr-   ÚitemÚlives   &&      r   r6   ÚReplacementCoordinator.dispose?   s˜  € ð
 �Z�Z‹ZØ—<—<�<Ø÷ ‰Zð —\‘\×%Ñ% e§j¡j°"Ó5ˆFÜÑC¤h¨vÔ&6ÓCÀTÓJˆFØ ˆEŒLð7ð	)Ø“à38·>±>À5×CTÑCT [Ø)Ò5¸k×>P×>PÐ>PØ7B×7KÑ7KÈ[×MdÑMdªØŸ™¸[Ò=T k×&9Ò&9ÐZeÔfà—~‘~Ò1ØŸ™Ô(á)/Ó?© ·;µ;Ÿ˜©�Ð?ßØ/3—L‘L §¡Ò,ßØ—L‘L×$Ñ$ U§Z¡Z°Ô6÷1 ‰Zøð" —~‘~Ò1ØŸ™Õ(ð 2üò @ø©Ó?© ·;µ;Ÿ˜ªùÒ?�Ð?ßØ/3—L‘L §¡Ò,ßØ—L‘L×$Ñ$ U§Z¡Z°Õ6ð ú÷/ �ZˆZúsw   •H-³A	H-Á>1FÂ0:FÃ*F.ÄH-ÄF)Ä$F)Ä**H-Å&H-Æ!F&Æ&F.Æ)H-Æ.H*Æ3GÇGÇ0H*È(H*È*H-È-H>	)rE   rH   )r:   r;   r<   r=   r>   rI   r   rL   rY   r6   r@   r   r   r   r$   r$   (   s5   † ÙMõ'ð ñó ðð
Ø6:÷÷7ñ 7r   r$   )r>   Ú
__future__r   rF   Úcollections.abcr   r   Ú
contextlibr   Údataclassesr   r   Útypingr   r   r#   r$   Úreplacement_coordinatorr   r   r   Ú<module>rl      sR   ðñõ #ã ß .Ý %ß (Ý õð ÷'ð 'ó ð'÷ 47ñ 47ñn 1Ó2Ò r   