+
    iHàjµ  ã                  ór   € R t ^ RIHt ^ RIt^ RIHt ]P                  ! ]4      tR R lt	R R lt
R R	 ltR# )
a  Best-effort accessors for the single-writer stream fence.

The fence lives on ``AIAgent`` (``_claim_stream_writer`` / ``_stream_writer_is_current``) but is
used from other streaming modules. Calling it directly would turn an *additive* safety net into a
fatal AttributeError on a partially-updated checkout, hot-reloaded gateway, duck-typed agent, or
test double (a cron job died this way). The fence may only drop a *provably* superseded stream,
never the sole writer, so when it is unavailable or raises the degradation is "no fence".
)ÚannotationsN)ÚAnyc               ó    € V ^8„  d   QhRRRR/# )é   Úagentr   ÚreturnÚint© )Úformats   "Ú?/home/ubuntu/.hermes/hermes-agent/agent/stream_single_writer.pyÚ__annotate__r      s   € ÷ cñ c˜sð c sñ có    c                ó(   € \        V R\        ^ R4      # )zvClaim the delta sink for this stream attempt; ``0`` (never fenced) when the agent lacks the fence or the claim raised.Ú_claim_stream_writerz!claim failed; proceeding unfenced)Ú_fence_callr   )r   s   &r   Úclaim_stream_writerr      s   € ä�uÐ4´c¸1Ð>aÓbÐbr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r   r   Útokenr   r   Úboolr	   )r
   s   "r   r   r      s&   € ÷ ~ñ ~ Cð ~°ð ~¸ñ ~r   c                ó>   € V'       g   R# \        V R\        RRV4      # )zwTrue when ``token`` is still the active writer; a falsy token or a fence-less agent cannot prove supersession, so True.TÚ_stream_writer_is_currentz,is_current check failed; treating as current)r   r   )r   r   s   &&r   Ústream_writer_is_currentr      s    € çÙÜ�uÐ9¼4ÀÐGuÐw|Ó}Ð}r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r   r   ÚnameÚstrÚfailure_noter	   )r
   s   "r   r   r      s!   € ÷ ñ �sð  #ð ÀSñ r   c                ó®   € \        WR4      p\        V4      '       d    V! V! V!  4      # V#   \         d    \        P	                  RTRR7        T# i ; i)zdCall ``agent.<name>(*args)`` when it exists; ``fallback`` when missing or raising (logged at debug).Nzstream single-writer: %sT)Úexc_info)ÚgetattrÚcallableÚ	ExceptionÚloggerÚdebug)r   r   ÚcastÚfallbackr   ÚargsÚfns   &&&&&* r   r   r      s]   € ä	�˜dÓ	#€BÜ�‡|‚|ð	RÙ™˜D™	“?Ð"ð €Oøô ô 	RÜ�L‰LÐ3°\ÈDˆLÕQØ€Oð	Rús   Ÿ- ­#AÁA)Ú__doc__Ú
__future__r   ÚloggingÚtypingr   Ú	getLoggerÚ__name__r!   r   r   r   r	   r   r   Ú<module>r-      s6   ðñõ #ã Ý à	×	Ò	˜8Ó	$€õcõ
~÷r   