+
    jHàjþ	  ã                  óª   € R t ^ RIHt ^ RIt^ RIHt ^ RIHtHtH	t	 ]P                  ! R4      tR R ltR R	 ltR
 R ltR R ltR R ltR R ltR# )a:  Idle gates for the gateway's per-profile pollers (heartbeat restore, handoff watcher, loop wakeup).

Entering ``_profile_runtime_scope`` costs a config.yaml load, a ``.env`` parse, secret hydration and a
terminal-policy build; on a multiplex gateway the pollers paid that per profile per tick with nothing
to do. Each gate answers "does this profile's store hold work?" from the goals-cached SessionDB with
ONLY the HERMES_HOME contextvar installed. Every gate fails OPEN: an unavailable store, a failing
read or a corrupt row is "cannot prove emptiness", never "idle".
)ÚannotationsN)ÚPath)ÚAnyÚCallableÚOptionalzgateway.runc               ó    € V ^8„  d   QhRRRR/# )é   Úprofile_homer   ÚreturnzOptional[Any]© )Úformats   "Ú;/home/ubuntu/.hermes/hermes-agent/gateway/run_idle_gates.pyÚ__annotate__r      s   € ÷ *ñ *¨Dð *°]ñ *ó    c                óÞ   € ^ RI Hp ^ RIHpHp V! \        V 4      4      p V! 4       V! V4       #   \         d%    \        P                  RT RR7        T! T4       R# i ; i  T! T4       i ; i)zEThe goals-cached SessionDB for *profile_home*; None when unavailable.)Ú_get_session_db)Úreset_hermes_home_overrideÚset_hermes_home_overridezsession-db probe failed for %sT©Úexc_infoN)	Úhermes_cli.goalsr   Úhermes_constantsr   r   ÚstrÚ	ExceptionÚloggerÚdebug)r	   r   r   r   Útokens   &    r   Ú_profile_session_db_prober      sf   € å0ßUá$¤S¨Ó%6Ó7€Eð*ÙÓ ñ
 	# 5Õ)øô	 ô Ü�‰Ð5°|ÈdˆÔSØá" 5Ö)ð	ûñ 	# 5Õ)ús!   ¡0 °#AÁA" ÁAÁA" Á"
A,c               ó$   € V ^8„  d   QhRRRRRR/# )r   r	   r   Ústore_has_workzCallable[[Any], bool]r
   Úboolr   )r   s   "r   r   r   !   s"   € ÷ ñ ˜ð Ð.Cð Èñ r   c                óŠ   € \        V 4      pVf   R#  V! V4      #   \         d    \        P                  RT RR7        R# i ; i)NTz0idle probe failed for %s; keeping the full sweepr   )r   r   r   r   )r	   r   Údbs   && r   Ú_gater#   !   sJ   € Ü	" <Ó	0€BØ	‚zÙðÙ˜bÓ!Ð!øÜô Ü�‰ÐGÈÐ`dˆÔeÚðús   “ ›#AÁAc               ó    € V ^8„  d   QhRRRR/# ©r   r	   r   r
   r    r   )r   s   "r   r   r   ,   s   € ÷ ;ñ ;¨tð ;¸ñ ;r   c                ó$   € ^ RI Hp \        W4      # )é    )Ústore_has_active_heartbeat)Úhermes_cli.heartbeatr(   r#   )r	   r(   s   & r   Úprofile_has_active_heartbeatr*   ,   s   € Ý?ä�Ó:Ð:r   c               ó    € V ^8„  d   QhRRRR/# r%   r   )r   s   "r   r   r   2   s   € ÷ 6ñ 6¨$ð 6°4ñ 6r   c                ó$   € ^ RI Hp \        W4      # )r'   )Ústore_has_active_loop)Úhermes_cli.loopsr-   r#   )r	   r-   s   & r   Úprofile_has_active_loopr/   2   s   € Ý6ä�Ó5Ð5r   c               ó    € V ^8„  d   QhRRRR/# r%   r   )r   s   "r   r   r   8   s   € ÷ Eñ E¨dð E°tñ Er   c                ó   € \        V R  4      # )c                ó"   € V P                  4       # )N)Úhas_pending_handoffs)r"   s   &r   Ú<lambda>Ú-profile_has_pending_handoff.<locals>.<lambda>9   s   € ¨"×*AÑ*AÔ*Cr   )r#   )r	   s   &r   Úprofile_has_pending_handoffr6   8   s   € Ü�ÑCÓDÐDr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   ÚrunnerÚobjectÚprobezCallable[[], bool]r
   r    r   )r   s   "r   r   r   <   s"   € ÷ &ñ & ð &Ð/Að &Àdñ &r   c              ƒ  ó€   "  € \        V RR4      p\        V4      '       g   R# \        V! V4      G Rj  x€L
 4      #  L5i)z Run a sync gate through the runner's executor hop. Runners without one (bare test stand-ins
for the handoff watcher) keep the historical always-enter behaviour.Ú_run_in_executor_with_contextNT)ÚgetattrÚcallabler    )r8   r:   Úoffloads   && r   Úoff_loop_gater@   <   s9   é € ô �fÐ=¸tÓD€GÜ�G×ÒÙÜ‘g˜e“n×$Ó%Ð%Ñ$ùs   ‚1>³<´	>)Ú__doc__Ú
__future__r   ÚloggingÚpathlibr   Útypingr   r   r   Ú	getLoggerr   r   r#   r*   r/   r6   r@   r   r   r   Ú<module>rG      sJ   ðñõ #ã Ý ß *Ñ *à	×	Ò	˜=Ó	)€õ*õõ;õ6õE÷&r   