+
    „WÝje  ã                   ó  € R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIH	t	 ]P                  ! R4      tRtR R ltR R	 ltR
 R ltR R ltR R ltR R R lltR R ltR R ltR R ltR R ltRtRtRtR R ltR tR# )!uá  Post-restart fleet verification for ``hermes update`` (``update_cmd_fleet`` sibling).

After the restart phase: compare every live gateway's stamped code against the checkout, reconcile
the pre-update plan against what the restart did, keep the restart owed (a ``gateway_restart``
follow-up, never a failed update â€” contract C3) or clear the obligation, and finalize the receipt.
Restart-phase helpers stay in ``update_cmd_fleet`` and are read through it so their patches apply.
N)Úsuppress)Ú_best_effortzhermes_cli.update_cmdg      ^@c                ó   € V ^8„  d   QhRR/# ©é   ÚreturnN© )Úformats   "ÚVC:\Users\johnn\AppData\Local\hermes\hermes-agent\hermes_cli\update_cmd_fleet_verify.pyÚ__annotate__r      s   € ÷ 7ñ 7 Tñ 7ó    c                 ó„  € ^ RI Hp HpHp V! 4       '       d   V ! 4       '       g   R# \	        4        \	        R4       V! 4        F$  w  r4pV'       d   RMRp\	        RV RV R24       K&  	  \	        4        \	        R	4       \	        R
4       \	        R4       \	        4        \	        R4       \	        4        \	        R4       R# )zlLegacy hermes.service fights hermes-gateway.service over the bot token; warn on
every update until migrated.)Úhas_legacy_hermes_unitsÚ_find_legacy_hermes_unitsÚsupports_systemd_servicesNu+   âš  Legacy Hermes gateway unit(s) detected:ÚsystemÚuserz    z  (z scope)z;  These pre-rename units (hermes.service) fight the currentz<  hermes-gateway.service for the bot token and cause SIGTERMz  flap loops. Remove them with:z!    hermes gateway migrate-legacyz)  (add `sudo` if any are in system scope))Úhermes_cli.gatewayr   r   r   Úprint)r   r   r   ÚnameÚpathÚis_sysÚscopes          r
   Ú_print_legacy_units_warningr      sž   € ÷ sÑrÙ%×'Ò'Ñ,C×,EÒ,EÙÜ	„GÜ	Ð
7Ô8Ù7Ö9Ñˆ�Fß"‘¨ˆÜ��T�F˜#˜e˜W GÐ,Ö-ñ :ô 
„GÜ	Ð
GÔHÜ	Ð
HÔIÜ	Ð
+Ô,Ü	„GÜ	Ð
-Ô.Ü	„GÜ	Ð
5Ö6r   c                ó0   € V ^8„  d   QhR\         R\        /# )r   Úrows_expectedr   )ÚboolÚlist)r	   s   "r
   r   r   /   s   € ÷ ñ ´Dð ¼Tñ r   c                ó†  € ^ RI Hp \        V RR4      ;'       g    RpV'       g   V! V P                  VR7      # V P                  p\        P
                  ! 4       \        ,           p \        P                  ! R4       V! WCR7      pV Uu. uF  p\        Wt4      '       g   K  VNK  	  ppV'       dE   V'       g=   \        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       g   V# \        P
                  ! 4       V8¼  g   \        \        V R	R4      4      '       g   KÈ  V F  pRVR
&   K
  	  V# u upi )u  Fleet version rows, polled over a bounded settle window when runtimes are expected.

Gateways need time to rewrite gateway_state.json; Windows resumes DETACHED (~10s boot),
so a single 2s sleep reported "no rows" on healthy resumes. A "down" row may be a
detached replacement still booting: poll until none remain or the deadline passes.
Pre-restart PIDs make a gateway stopped WITHOUT verified replacement a DOWN row (owed restart)
instead of no row at all. An ``unknown`` row whose pid is NOT a pre-restart pid is a successor
that has not published its code identity yet (a relaunched gateway can sit ~10s between process
start and its first runtime-status write, #112634) â€” keep polling; at the deadline it is flagged
``identity_pending`` so the matrix does not call it a pre-stamping gateway.
)Úcollect_fleet_versionsÚself_restart_pending_pidsN)Úpre_restart_pidsÚself_restart_pendingTg       @c              3   óH   "  € T F  qP                  R 4      R8H  x € K  	  R# 5i)ÚstateÚdownN©Úget)Ú.0Úrows   & r
   Ú	<genexpr>Ú*_collect_fleet_snapshot.<locals>.<genexpr>F   s   é € Ð1aÑX`ÐQT·'±'¸'Ó2BÀfÖ2LÓX`ùs   ‚ "FÚrestarted_scoped_unitsÚidentity_pendingr   )Úhermes_cli.update_receiptr   ÚgetattrÚpre_restart_gateway_pidsÚ_timeÚ	monotonicÚ#_FLEET_PROBE_SETTLE_TIMEOUT_SECONDSÚsleepÚ_fleet_row_identity_pendingÚanyÚ_restarted_units_gone)	Úrestartr   r   ÚpendingÚpre_pidsÚ_fleet_deadlineÚsnapshotr)   Ú	unstampeds	   &&       r
   Ú_collect_fleet_snapshotr>   /   s  € õ AÜ�gÐ:¸DÓA×IÐIÀT€GßÙ%Ø$×=Ñ=ÐT[ô]ð 	]à×/Ñ/€HÜ—o’oÓ'Ô*MÕM€OØ
Ü�Š�CÔÙ)¸8ÔbˆÙ$,Ó[¡H˜SÔ0KÈC×0Z—S�S¡Hˆ	Ð[ßŸI¯c«cÑ1aÑX`Ó1a¯c¯cªcÑ1aÑX`Ó1a×.aÒ.aØˆOÜ�?Š?Ó Ô/Ô3HÜ˜Ð!9¸2Ó>÷4@ô 4@ã �Ø*.�Ð&Ó'ñ !àˆOùò \s   Â
D>Â"D>c                ó0   € V ^8„  d   QhR\         R\        /# )r   r)   r   )Údictr   )r	   s   "r
   r   r   O   s   € ÷ Zñ Z¤Tð ZÄñ Zr   c                ó   € V P                  R4      R8w  g   V P                  R4      '       d   R# Vf   R# V P                  R4      V Uu0 uF&  p\        V\        4      '       g   K  \        V4      kK(  	  up9  # u upi )u  An ``unknown`` row with no sha from a pid that did not exist at update start: a relaunched
gateway still booting, not a gateway that predates version stamping. A surviving pre-restart pid
(or no pid snapshot at all) is settled as-is â€” waiting cannot change what it publishes.r$   ÚunknownÚcode_shaFÚpid)r'   Ú
isinstanceÚint)r)   r!   Úps   && r
   r5   r5   O   sh   € ð ‡w�wˆwÓ˜9Ô$¨¯©°
×(;Ò(;ÙØÒÙØ�7‰7�5‹>Ñ2BÓ!YÑ2B¨QÄjÐQRÔTW×FX¤&¤# a¦&Ñ2BÑ!YÑYÐYùÒ!Ys   Á
A;Á'A;c                ó$   € V ^8„  d   QhR\         /# ©r   r   ©r   )r	   s   "r
   r   r   Z   s   € ÷ ñ ¬4ñ r   c                óÜ  € ^ RI Hp V '       g   R# \        VP                  4      pV  F˜  pVP	                  R4      w  rEp VP                  W$,          RRRV.,           ^R7      P                  p\        R TP                  4        4       4      pTP                  R	4      R
8w  d    R# TP                  R4      R9   g   K—   R# 	  R#   \        \        \        P                  3 d      R# i ; i)uÖ  True when every restarted systemd unit is LOADED in its scope and neither active nor
activating: the successor died, nothing will publish a state stamp, so the settle poll should fail
closed now instead of at the deadline. Anything inconclusive keeps waiting: no units, systemctl
missing/slow, or ``LoadState=not-found`` â€” a unit name asked in a scope that does not own it
answers ``inactive`` exactly like a dead unit (#112466), so only a loaded unit can prove death.©Úupdate_cmd_fleetFÚ/Úshowz-pzLoadState,ActiveState)Útimeoutc              3   óX   "  € T F   pR V9   g   K  VP                  R ^4      x € K"  	  R# 5i)Ú=N)Úsplit)r(   Úlines   & r
   r*   Ú(_restarted_units_gone.<locals>.<genexpr>j   s*   é € ÐWÑ4G¨DÈ3ÐRVÉ;Ô'�T—Z‘Z  Q×'Ð'Ó4Gùs   ‚	*�*Ú	LoadStateÚloadedÚActiveStateT)ÚactiveÚ
activatingÚ	reloading)Ú
hermes_clirM   r@   Ú_SYSTEMD_SCOPESÚ	partitionÚ
_systemctlÚstdoutÚKeyErrorÚFileNotFoundErrorÚ
subprocessÚTimeoutExpiredÚ
splitlinesr'   )	Úscoped_unitsÚfleetÚ
scope_cmdsÚscopedr   Ú_r   r`   Úpropss	   &        r
   r7   r7   Z   sÚ   € õ 5ßÙÜ�e×+Ñ+Ó,€JÛˆØ×)Ñ)¨#Ó.‰ˆ�$ð	Ø×%Ñ% jÕ&7¸6À4ÐI`ÐbfÐ:gÕ&gÐqrÐ%Ós×zÑzˆFô ÑW°F×4EÑ4EÔ4GÓWÓWˆØ�9‰9�[Ó! XÔ-ÚØ�9‰9�]Ó#Ð'LÖLÚñ ñ øô Ô+¬Z×-FÑ-FÐGô 	Ûð	ús   Á .CÃ C+Ã*C+c                ó0   € V ^8„  d   QhR\         R\        /# )r   Ú
fleet_rowsr   )r   r@   )r	   s   "r
   r   r   r   s   € ÷ ñ ¬dð ´tñ r   c                ó6  € / pV  F�  pVP                  R4      VP                  R4      rCV'       g   K.  \        V\        4      '       g   KF  VP                  R4      R8w  g   K^  VP                  \	        V4      \        4       4      P                  V4       K’  	  V# )u3  Profile -> gateway PIDs alive after the restart phase, from the fleet snapshot.

Incarnation evidence for gateway reconciliation (``match_runtime_outcomes``'s
``live_gateway_pids``): the plan identifies a gateway by the profile it SERVES while the restart
bookkeeping names the SERVICE, and a service can serve a profile its name does not encode â€” the
profile-scoped name matcher then never credits the planned runtime. A ``down`` row reports the
PRE-restart PID (nothing replaced it), so it is never a successor; rows without a usable
profile/PID are skipped.
rD   Úprofiler$   r%   )r'   rE   rF   Ú
setdefaultÚstrÚsetÚadd)rm   Úliver)   rD   ro   s   &    r
   Ú_live_gateway_pids_from_fleetru   r   sr   € ð €DÛˆØ—w‘w˜u“~ s§w¡w¨yÓ'9ˆWß‰7”z #¤s×+Ô+°·±¸Ó0@ÀFÖ0JØ�O‰OœC ›L¬#«%Ó0×4Ñ4°SÖ9ñ ð €Kr   c                ó   € V ^8„  d   QhRR/# r   r   )r	   s   "r
   r   r   „   s   € ÷ &^ñ &^Àdñ &^r   c                óÂ  € ^ RI Hp VP                  4       pV'       d   VP                  4       M/ pVf   R# . pVP	                  R4      R9  d9    \
        P                  ! VR,          4      pVP                  V4       TR,          p^ RI	H
p \        V RR4      ;'       g    R Uu. uFw  p\        VRR4      R8X  g   K  \        \        VR	R4      \        4      '       g   K:  VP                  P                  4       '       g   K\  VP                  R
8w  g   Ko  V! V4      NKy  	  up\!        V4       U	u. uF  p	RRR	RRV	RR/NK  	  up	,           p
V
 Uu. uF  q»V9  g   K  VNK  	  p
pV
'       dP   V'       d   VP	                  RR4      MVP#                  4       ;'       g    RpVP%                  WÅV
,           R7       R# R#   \         d     R# i ; iu upi u up	i u upi )a1  Name the pre-update gateways on the obligation once their restart is owed.

The pull arms the obligation before the restart phase knows what it owes. An inventory-less
record on a host whose gateway then died at boot is settled by the gateway-less discharge
(nothing live, nothing named), which would silence the owed-restart warning that replaces a
failed update under contract C3. A named inventory keeps it until those gateways run HEAD.
A gateway stopped with no known profile is recorded as an unmapped row for the same reason: it
has no ``gateway_state.json`` the gateway-less probe could see, so absence would settle it.
A readable inventory (a same-SHA catch-up keeps the standing record) only GROWS: rows this run
newly owes are appended, so a mapped successor cannot discharge a newly stopped unmapped one.
rL   NÚ	inventoryÚ Úruntimes©ÚasdictÚkindÚgatewayro   rB   rD   Ústopped_unmappedTÚexpected_sha)r€   rz   ©Nry   Únullr   )r\   rM   Ú_fleet_restart_obligation_armedÚ_obligation_fieldsr'   ÚjsonÚloadsÚ_marker_owed_gatewaysÚ
ValueErrorÚdataclassesr|   r/   rE   rq   ro   ÚstripÚsortedÚ_current_checkout_shaÚ#_write_fleet_restart_pending_marker)ÚplanÚstopped_unmapped_pidsrg   ÚarmedÚfieldsÚrecordedrx   r|   ÚruntimerD   Úrowsr)   Úshas   &&           r
   Ú_record_owed_gateway_inventoryr–   „   sÂ  € õ 5Ø×1Ñ1Ó3€Eß+0ˆU×%Ñ%Ô'°b€FØ‚~ÙØ€HØ‡z�z�+ÓÐ&8Ô8ð	ÜŸ
š
 6¨+Õ#6Ó7ˆIØ×'Ñ'¨	Ô2ð ˜ZÕ(ˆÝ"ä'.¨t°ZÀÓ'D×'JÐ'JÈÐ'JóÙ'J˜GÜ�7˜F DÓ)¨YÑ6ô 	ä”w˜w¨	°4Ó8¼#×>ô 	ð �O‰O×!Ñ!×#ô 	ð )0¯©¸9Ñ(Dô 	‰ˆwŽÑ'Jñô Ð0Ô1ó	3Ù1ˆSð �)˜Y¨¨e°SÐ:LÈdÓ	SÙ1ñ	3õ3€Dñ  Ó7™4�C¨hÑ#6�CˆC™4€DÐ7ß÷ 16ˆf�j‰j˜¨Ô,¸E×<WÑ<WÓ<Y×<_Ð<_Ð]_ˆØ×1Ñ1¸sÐX\Í_Ð1Ö]ñ	 øô ô 	Úð	üòùò
	3ùâ7sB   Á.G  Â&GÂ?GÃ"GÄGÄGÄ2GÅGÅGÇ GÇGc                ó$   € V ^8„  d   QhR\         /# rI   rJ   )r	   s   "r
   r   r   ­   s   € ÷ 	5ñ 	5¤Dñ 	5r   c                 óÀ   € ^ RI Hp  V P                  4       '       g   R# V P                  4       pVe   VP	                  R4      R9   d   R# V P                  4       '       * # )z·True when the armed obligation NAMES gateways (recorded by an earlier owed restart) and the
live fleet still does not prove them current. An inventory-less record keeps its old rules.rL   Frx   r�   )r\   rM   rƒ   r„   r'   Ú_marker_only_restart_obsolete)rg   r‘   s     r
   Ú_named_gateways_still_owedrš   ­   sR   € õ 5Ø×0Ñ0×2Ò2ÙØ×%Ñ%Ó'€FØ‚~˜Ÿ™ KÓ0Ð4FÔFÙØ×2Ñ2Ó4Ô4Ð4r   c                ó0   € V ^8„  d   QhR\         R\        /# )r   r   r   )Úobjectr   )r	   s   "r
   r   r   ¹   s   € ÷ Xñ Xœð X¤Dñ Xr   c                óT   € ^ RI Hp V! \        V 4      P                  R4       R24      # )zêA serve/dashboard unit by the fleet loop's own name gate (``hermes-serve*``/``hermes-dashboard*``,
bare or ``.service``). Anything else it records as failed (gateway units, launchd labels,
listing-failure markers) is gateway evidence.)Ú_is_serve_or_dashboard_unitú.service)Úhermes_cli.update_cmd_fleetrž   rq   Úremovesuffix)r   rž   s   & r
   Ú_is_serve_unitr¢   ¹   s*   € õ Há&¬#¨d«)×*@Ñ*@ÀÓ*LÐ)MÈXÐ'VÓWÐWr   c                ó$   € V ^8„  d   QhR\         /# rI   rJ   )r	   s   "r
   r   r   Â   s   € ÷ \ñ \¬Dñ \r   c                óè   € V P                   '       g   R# \        V P                  4      p\        V P                  4      ;'       g.    V'       * ;'       g    \        \        \        V4      4      '       * # )z§Did the restart phase itself leave a gateway owed? Its incompleteness counts against the
gateways unless every failure it recorded is a serve/dashboard unit (#141021).F)Ú
incompleter   Úfailed_or_stale_unitsr   Úphase_errorsÚallÚmapr¢   )r8   Úfaileds   & r
   Ú_restart_phase_owes_gatewayr«   Â   sV   € ð ××ÐÙÜ�'×/Ñ/Ó0€FÜ�×$Ñ$Ó%×[Ð[¨V¬×[Ð[¼3¼sÄ>ÐSYÓ?ZÓ;[Ô7[Ð[r   c                óF   € V ^8„  d   QhR\         \        \        3,          /# rI   )Útupler   rr   )r	   s   "r
   r   r   Ë   s   € ÷ Nñ N¤E¬$´¨)Õ$4ñ Nr   c                ó   a€ ^ RI Ho V  Uu. uF  qP                  R4      R8X  g   K  VNK  	  ppV Uu0 uFJ  qP                  R4      S9   g   K  \        VP                  R4      \        4      '       g   KA  VR,          kKL  	  pp\
        ;QJ d#    V3R lV 4       F  '       g   K   RV3# 	  RV3# ! V3R lV 4       4      V3# u upi u upi )	zY``(gateway missed, serve/dashboard PIDs missed)`` among the unaccounted runtime outcomes.)Ú_SERVE_KINDSÚoutcomeÚunaccountedr}   rD   c              3   óJ   <"  € T F  qP                  R 4      S9  x € K  	  R# 5i)r}   Nr&   )r(   Úor¯   s   & €r
   r*   Ú%_split_unaccounted.<locals>.<genexpr>Ñ   s   øé € ÐA¹&°Q�u‰u�V‹} LÖ0»&ùs   ƒ #TF)Úhermes_cli.update_inventoryr¯   r'   rE   rF   r6   )Úoutcomesr³   ÚmissedÚ
serve_pidsr¯   s   &   @r
   Ú_split_unaccountedr¹   Ë   s®   ø€ å8á!ÓG™�A§U¡U¨9Ó%5¸Ñ%F�aˆa™€FÐGÙ$*Ón¡F˜q¯e©e°F«m¸|Ñ.K”(ÔPZÐ[\×[`Ñ[`ÐafÓ[gÔil×Pm”(�!�E—(�(¡F€JÐnß‹3ÔA¹&ÓA�3Œ3À:ÐMÐMŠ3À:ÐMÐMˆ3ÔA¹&ÓAÓAÀ:ÐMÐMùò HùÚns   ŒC¨C´CÁ"CÁ7Czserve/dashboard zJgateways may still run pre-update code or were stopped without a successorz'; recover with `hermes gateway restart`c                óH   € V ^8„  d   QhR\         R\        R\        R\        /# )r   Úgateway_owedÚstale_servesÚdown_servesr   )r   rr   rq   )r	   s   "r
   r   r   Ü   s1   € ÷ Jñ J¼Dð JÔPSð JÔbeð JÔjmñ Jr   c               óX  € . pV'       dS   TP                  \        V'       d$   RRP                  \        \        V4      4       R2MR,           \
        ,           4       \        V P                   Uu0 uF0  p\        V4      '       g   K  \	        V4      P                  R4      kK2  	  up4      pV'       d+   VP                  \         RRP                  V4       R24       V'       dB   VP                  \         RRP                  \        \        \        V4      4      4       R	24       W4,
          '       dH   VP                  \         RRP                  \        \        \        W4,
          4      4      4       R
24       RP                  V4      ;'       g    \        \
        ,           # u upi )a`  The ``gateway_restart`` follow-up's reason, naming what is actually owed (#141021).

The step id stays ``gateway_restart`` (Desktop hand-offs parse it); only the text changes. A run
whose gateways all verified current but whose dashboard unit could not be restarted must not tell
the user to run `hermes gateway restart`, which never touches that unit.z (stopped PIDs z, Ú)ry   rŸ   zunit(s) zE were not restarted onto the new code; see the systemctl advice abovezprocess(es) zb were stopped during the update and not brought back; relaunch `hermes serve` / `hermes dashboard`z9 still run pre-update code; restart them as advised abovez; )ÚappendÚ_GATEWAY_OWED_REASONÚjoinr©   rq   Ú_GATEWAY_RECOVERYr‹   r¦   r¢   r¡   ÚSERVE_ONLY_REASON_PREFIX)r8   Ústoppedr»   r¼   r½   ÚpartsÚuÚunitss   &&$$$   r
   Ú_owed_restart_reasonrÉ   Ü   sg  € ð €EßØ�‰Ü ßDK� §¡¬3¬s°GÓ+<Ó!=Ð >¸aÑ@ÐQSõUäõ ô	!ô ¸W×=ZÒ=ZÓpÑ=Z¸Ô^lÐmn×^oÔ3”C˜“F×'Ñ'¨
Ö3Ñ=ZÑpÓq€EßØ�‰Ü'Ð(¨°·±¸5Ó1AÐ0Bð C.ð .ô	/÷ Ø�‰Ü'Ð(¨°T·Y±Y¼sÄ3ÌÈ{ÓH[Ó?\Ó5]Ð4^ð _Yð Yô	Zð ×!Ô!Ø�‰Ü'Ð(¨°T·Y±Y¼sÄ3ÌÈ|ÕOiÓHjÓ?kÓ5lÐ4mð n>ð >ô	?ð �9‰9�UÓ×IÐIÔ 4Ô7HÕ HÐIùò qs   Á0F'ÂF'c               ó²  € ^ RI Hp ^ RIHpHpHp ^ RIHp \        R4      ;_uu_ 4        \        4        RRR4       \        V 4      p	V! \        V P                  4      \        V P                  4      ,          R7      p
V
'       d   RV n        \        4       pRp\        R4      ;_uu_ 4        V! V4      pV'       d	   V! V4       RRR4       \        4        \        R	4       \        R
4       . p\        R4      ;_uu_ 4        ^ RIHp V P%                  4       w  ppV! 4       P'                  WW P                  V4      p\)        V V4      pV! V4      '       d(   R;V n        p	^ RIHp V! WÐVP/                  4       4       M$V'       g   V'       d   \        R4       R;V n        p	RRR4       \        R4      ;_uu_ 4        VEe¦   VP0                  '       Ed“   ^ RIHpHp ^ RIHp \;        V4      pT! TV P                  V P<                  V P>                  V P@                  V P                  Ve"   V Uu0 uF  pVPC                  R4      kK  	  upMRT
V Uu0 uF$  pV! V4      '       g   K  VPC                  R4      kK&  	  upVR7
      p^ RI"H#p ^ RI$H%p \M        VP0                  V4       F3  w  ppVR,          R8X  g   K  V! V! V4      RR7      '       g   K.  RVR&   K5  	  V! V4      '       d(   RV n        \O        V4      w  ppV	V,          p	VV,          p\Q        \R        4      ;_uu_ 4        ^ RIH*p VPV                  PC                  4       p V e   VV PX                  R&   RRR4       RRR4       V P                  '       gA   \        R4      ;_uu_ 4        \[        4       '       d   \        R4       R;V n        p	RRR4       \]        V RR4      '       d
   R;V n        p	V P                  '       dx   ^ RIH/p! \a        \]        V RR4      ;'       g    R+4      p"T!! R\c        T T"Y›\        T
;'       g    R+4      R 7      4       \        R!4      ;_uu_ 4        \e        VV"4       RRR4       \        R"4      ;_uu_ 4        ^ R#IH3p# V#! R$VR%7      p$V$e   \h        Pk                  R&V$4       RRR4       V P                  '       d   R# VPm                  4        V'       g   R#  ^ R'I7H8p% V%! 4        R#   + '       g   i     ELÀ; i  + '       g   i     ELD; i  + '       g   i     ELz; iu upi u upi   + '       g   i     ELÚ; i  + '       g   i     ELæ; i  + '       g   i     EL¨; i  + '       g   i     EL; i  + '       g   i     Lä; i  \R        \r        3 d1   p&\h        Pu                  R(T&4       \        R)T& R*24        Rp&?&R# Rp&?&ii ; i),a—  Post-restart verification: legacy-unit warning, dashboard cleanup, stale serve
probe, fleet version matrix, plan-vs-execution reconciliation, receipt finalize.

Never fails the committed update (contract C3): when any gateway may still be stale it
records a ``gateway_restart`` follow-up and leaves ``fleet_restart_pending`` armed for the
next catch-up and the startup warning; otherwise clears the marker.
rL   )Ú_mÚ$_surviving_pre_update_serve_runtimesÚ_warn_stale_serve_runtimes)Ú_refresh_dashboard_after_updatez*Legacy unit check during update failed: %sN)Úalready_restarted_unitsTz0Failed to check for surviving serve runtimes: %sz-Tip: You can now select a provider and model:z7  hermes model              # Select provider and modelz%Fleet version verification failed: %s)Úprint_fleet_version_matrix)Úsignal_stale_fleet_survivorsuq   
âš  Fleet version check returned no rows even though gateway runtimes were expected â€” verification incomplete.z)Runtime-outcome reconciliation failed: %s)Úmatch_runtime_outcomesÚreport_unaccounted_runtimes)Úrow_is_externalrD   )	Úrestarted_servicesÚrelaunched_profilesÚexternally_supervised_profilesÚkilled_pidsÚfailed_unitsÚstale_serve_pidsÚfailed_respawn_pidsÚexternal_gateway_pidsÚlive_gateway_pidsr{   )Údefer_manual_server°   r±   )Úrequire_aliveÚdeferredÚruntime_outcomeszOwed-gateway check failed: %suW     âš  A gateway owed a restart by a previous update is still not serving this checkout.r�   )Úrecord_followupÚgateway_restart)r»   r¼   r½   z(Fleet restart inventory not recorded: %sz"Update receipt finalize failed: %s)Úfinalize_update_receiptÚsuccess)rg   zUpdate receipt written: %s)Úmaybe_auto_migrate_after_updatez0Multiplex auto-migration after update failed: %su2     âš  Gateway multiplex migration did not finish: z% (run `hermes gateway migrate` later)r   );r\   rM   Úhermes_cli.update_cmdrË   rÌ   rÍ   Úhermes_cli.update_cmd_maintrÎ   r   r   r«   rr   rÕ   r¦   r¥   r   r.   rÐ   Úfleet_probe_signalsÚ_fleet_probe_expected_runtimesr>   Ú%hermes_cli.update_cmd_stale_survivorsrÑ   Ú_gateway_drain_budgetrz   rµ   rÒ   rÓ   rÔ   ru   rÖ   r×   rØ   r'   r‰   r|   Ú#hermes_cli.update_serve_obligationsrÞ   Úzipr¹   r   Ú	ExceptionÚupdate_receiptÚ_currentÚdatarš   r/   râ   r‹   rÉ   r–   rä   ÚloggerÚinfoÚ#_clear_fleet_restart_pending_markerÚhermes_cli.gateway_migrateræ   Ú
SystemExitÚwarning)'r8   Ú_pre_update_planÚ_windows_gateway_resumeÚupdate_completerg   rË   rÌ   rÍ   rÎ   Ú_gateway_owedÚ_dashboards_downÚ_stale_serves_owedÚ_stale_serve_rowsÚ_fleet_snapshotrÐ   Ú_pre_restartÚ_killedÚ_fleet_rows_expectedrÑ   rÒ   rÓ   rÔ   Ú_live_gateway_pidsr)   Ú_runtime_outcomesr|   rÞ   r“   r°   Ú_missed_gatewayÚ_missed_servesÚ_urÚ_activerâ   rÅ   rä   Ú_receipt_pathræ   Úexcs'   &$$$                                   r
   Ú_verify_fleet_after_updater  ù   s  € õ 5÷ñ õ LÜ	ÐB×	CÕ	CÜ#Ô%÷ 
Dô 0°Ó8€Mñ
 7Ü # G×$>Ñ$>Ó ?Ä#Àg×FcÑFcÓBdÕ dôfÐçØ!ˆÔÜ!›eÐð &*ÐÜ	ÐH×	IÕ	IÙ@ÐAQÓRÐßÙ&Ð'8Ô9÷ 
Jô
 
„GÜ	Ð
9Ô:Ü	Ð
CÔDð
 €OÜ	Ð=×	>Õ	>ÝHð !(× ;Ñ ;Ó =Ñˆ�gÙ!›t×BÑBØÐ,C×E_ÑE_Ðahó 
Ðô 2°'Ð;OÓPˆÙ% o×6Ò6Ø15Ð5ˆGÔ õ [Ù(¨À5×C^ÑC^ÓC`Õaß ×%9ô ðOô	ð 26Ð5ˆGÔ ÷C 
?ôJ 
ÐA×	BÕ	Bð Ó'Ð,<×,E×,EÑ,EßiÝAô "?¸Ó!OÐÙ 6Ø Ø#*×#=Ñ#=Ø$+×$?Ñ$?Ø/6×/UÑ/UØ#×/Ñ/Ø$×:Ñ:ð
 )Ò4ñ 0AÓAÑ/@¨�S—W‘W˜U–^Ñ/@ÒAàà$4áAPÓ&iÁ¸#ÑTcÐdg×Th¤~ s§w¡w¨u¦~ÁÑ&iØ"4ô#!Ðõ& +ÝNä$'Ð(8×(AÑ(AÐCTÖ$UÑ �˜Ø˜9Õ%¨Ö6Ñ;MÉfÐU\ËoÐmq×;rÕ;rØ)3�G˜IÓ&ñ %Vñ +Ð+<×=Ò=Ø%)�Ô"Ü2DÐEVÓ2WÑ/� Ø Õ0�Ø" nÕ4Ð"Üœ)×$Õ$Ý7ØŸ,™,×*Ñ*Ó,�ØÒ&Ø7H�G—L‘LÐ!3Ñ4÷	 %÷W 
Cðb ××ÐÜÐ9×:Õ:ô *×+Ò+ô ÐoÔpØ59Ð9�Ô" ]÷ ;ô ˆwÐ/°×6Ò6ð .2Ð1ˆÔ˜]Ø××Ðõ 	>Üœ Ð*AÀ4ÓH×NÐNÈBÓOˆÙÐ)Ô+?Ø�W¨=ÜÐ,×2Ð2°Ó3ô,5ô 	6ô ÐD×EÕEÜ*Ð+;¸WÔE÷ Fä	Ð:×	;Õ	;ÝEñ 0°	ÀÔQˆØÒ$Ü�K‰KÐ4°mÔD÷ 
<ð ××ÐÙØ	×-Ñ-Ô/ßñ 	ðoÝNÙ'Ö)÷Y 
D×	CÐ	Cú÷: 
J×	IÐ	Iú÷ 
?×	>Ð	>üòx Bùò 'j÷ %×$Ð$ú÷W 
C×	BÐ	Bú÷d ;×:Ð:ú÷, F×EÐEúç	;×	;ûô( ”zÐ"ô oÜ�‰ÐIÈ3ÔOÜÐBÀ3À%ÐGlÐm×nÒnûðoúsÍ   ªS,Â,T ÄBTÆTÆTÆ>UÇAUÈ2T(É	UÉT-É*T-É?<UË UËUË/>UÌ-4T2	Í!UÎ%UÑU.Ñ;+VÓV Ó,S=	Ô T	ÔT%	Ô(
UÔ2UÔ=	UÕU	ÕU+	Õ.U?	ÖV	ÖWÖ&%W×W)r   )Ú__doc__r…   Úloggingrc   Útimer1   Ú
contextlibr   Úhermes_cli.update_cmd_commonr   Ú	getLoggerró   r3   r   r>   r5   r7   ru   r–   rš   r¢   r«   r¹   rÄ   rÁ   rÃ   rÉ   r  r   r   r
   Ú<module>r     s“   ðñó Û Û Û Ý å 5ð 
×	Ò	Ð2Ó	3€ð
 ',Ð #õ7õ*õ@Zõõ0÷$&^õR	5õXõ\õNð .Ð ØcÐ Ø=Ð õJô:|or   