+
    .pÐj%  ã                   ó®   € R t ^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t
 ]P                  ! ]4      tRR/R R lltR R	 ltR
RRR/R R lltR# )zGDurable manual-serve handoffs, independent of gateway restart receipts.N)ÚPath)Úget_hermes_homeÚrequire_aliveFc                ó<   € V ^8„  d   QhR\         R\        R\        /# )é   Úruntimer   Úreturn)ÚdictÚbool)Úformats   "Ú2/opt/hermes/hermes_cli/update_serve_obligations.pyÚ__annotate__r      s!   € ÷ +ñ +¤ð +¼ð +Ìñ +ó    c               óŒ  € ^ RI Hp V P                  R4      R9  g-   V P                  R4      R8w  g   V P                  R4      R8w  d   R# V P                  R4      pV P                  R	4      p\        V\        4      '       g   R# VP                  R
4      p\        V4      \        Jg   V^ 8:  d   R# \        V4      \        \        39   ;'       d$    \        P                  ! V4      ;'       d    V^ 8„  pV'       g   V'       * ;'       d    V! VR4      RJ #  V! W54      pV'       d	   VRJd   R# VRJ d   R# \        4       R,          pVP                  RRR7       RV R,          RV P                  RR4      RVR
V/p	Wƒ R\        V4      P                  4        R2,          p
Rp \        P                  ! RRVRR7      ;_uu_ 4       p\        VP                   4      p\"        P$                  ! Wœ4       VP'                  4        \(        P*                  ! VP-                  4       4       RRR4       \(        P.                  ! Wº4       Ve   VP1                  RR7       R#   + '       g   i     L>; i  Te   TP1                  RR7       i i ; i  \2        \4        \6        3 d"   p\8        P;                  RT4        Rp?R# Rp?ii ; i)zJTransfer an identified manual runtime to its own durable restart reminder.©Ú_pid_alive_matchesÚkindÚ
supervisorúmanual-serveÚrestart_viazrespawn-argvFÚpidÚdetailÚcreate_timeNTÚserve_restart_pending)ÚparentsÚexist_okÚprofileÚunknownÚ-z.jsonÚwzutf-8)ÚmodeÚencodingÚdirÚdelete©Ú
missing_okz.Could not preserve manual serve obligation: %s©ÚserveÚ	dashboard)Úhermes_cli.process_identityr   ÚgetÚ
isinstancer	   ÚtypeÚintÚfloatÚmathÚisfiniter   ÚmkdirÚhexÚtempfileÚNamedTemporaryFiler   ÚnameÚjsonÚdumpÚflushÚosÚfsyncÚfilenoÚreplaceÚunlinkÚOSErrorÚ
ValueErrorÚ	TypeErrorÚloggerÚdebug)r   r   r   r   r   ÚcreatedÚ
identifiedÚaliveÚ	directoryÚrowÚtargetÚ	temporaryÚhandleÚexcs   &$            r   Údefer_manual_serverL      s]  € å>à‡{�{�6ÓÐ"8Ô8¸G¿K¹KÈÓ<UÐYgÔ<gÐkr×kvÑkvð  xEó  lFð  JXô  lXÙØ
�+‰+�eÓ
€CØ�[‰[˜Ó"€FÜ�fœd×#Ò#ÙØ�j‰j˜Ó'€GÜˆCƒyœÓ˜s aœxÙÜ�g“¤3¬ ,Ñ.×YÐY´4·=²=ÀÓ3I×YÐYÈgÐXYÉk€Jßð !Ô ×KÐKÑ%7¸¸TÓ%BÀeÐ%KÐKðÙ" 3Ó0ˆß˜U¨$Ó.ÙØ�E‹>ÙÜ#Ó%Ð(?Õ?ˆ	Ø�‰ ¨tˆÔ4Ø�w˜v•¨	°7·;±;¸yÈ)Ó3TÐV[Ð]`ÐboÐqxÐyˆØ˜u A¤e¨G£n×&8Ñ&8Ó&:Ð%;¸5ÐAÕAˆàˆ	ð		2Ü×,Ò,°#ÀÈYÐ_d×eÕeÐioÜ  §¡Ó-�	Ü—	’	˜#Ô&Ø—‘”Ü—’˜Ÿ™›Ô)÷	 fô
 �JŠJ�yÔ)àÒ$Ø× Ñ ¨DÐ Ô1Ù÷ f×eûð Ò$Ø× Ñ ¨DÐ Õ1ð %ûô ”Z¤Ð+ô Ü�‰ÐEÀsÔKÝûðúsV   ÄJ Ä0J Ä8A,J Æ%"I0 ÇA IÈ'I0 ÉJ ÉI-	É(I0 É0J	Ê	J ÊKÊ"J>Ê>Kc                óF   € V ^8„  d   QhR\         R\        \         ,          /# )r   Úreceiptr   )r	   Úlist)r   s   "r   r   r   >   s   € ÷ ñ ¬$ð ´4¼µ:ñ r   c                ó"  € V P                  R4      ;'       g    / p\        VP                  R4      ;'       g    . 4      \        V P                  R4      ;'       g    . 4      ,           pT\        V P                  R4      ;'       g    . 4      ,          p. pV Fs  p\        V\        4      '       d-   VP                  R4      R9  g   VP                  R4      R8w  d   KG  \	        V4      '       d   KZ  WC9  g   Kb  VP                  V4       Ku  	  V# )	a1  Return transfers still owed so receipt rotation cannot discard failed writes.

``carried_manual_serves`` is the durable running record's copy of the previous receipt's rows
(update_receipt.begin): read it too, or the warning vanishes while an update runs and after a
run killed before its ``plan`` stage.
ÚplanÚruntimesÚpending_manual_servesÚcarried_manual_servesr   r   r   r&   )r*   rO   r+   r	   rL   Úappend)rN   rQ   ÚrowsÚpendingrG   s   &    r   Úretain_receipt_manual_servesrX   >   sâ   € ð �;‰;�vÓ×$Ð$ "€DÜ�—‘˜Ó$×*Ð*¨Ó+¬d°7·;±;Ð?VÓ3W×3]Ð3]Ð[]Ó.^Õ^€DØŒD�—‘Ð4Ó5×;Ð;¸Ó<Õ<€DØ€GÛˆÜ˜#œt×$Ò$¨¯©°«Ð?UÔ(UÐY\×Y`ÑY`ÐamÓYnð  sAô  ZAÙÜ! #×&Ô&¨3Ö+=Ø�N‰N˜3Öñ	 ð
 €Nr   ÚstartupÚpending_manualc                óX   € V ^8„  d   QhR\         R\        \        ,          R,          RR/# )r   rY   rZ   Nr   )r
   rO   r	   )r   s   "r   r   r   Q   s1   € ÷ jñ j¬4ð jÌÌdÍÐVZÕIZð jÐfjñ jr   c                óf  € ^ RI Hp ^ RIHp V '       d   \        P
                  M\        P                  pVf   \        V! 4       ;'       g    / 4      pV F¾  p\        RVR,           RVP                  RR4       R	VP                  R
R4       R2VR7       \        VP                  R4      \        4      '       d   VP                  R4      M/ p\        VP                  R4      4      \        \        39   d   \        RVR7       K±  \        RVR7       KÀ  	  \        4       R,          p\!        VP#                  R4      4       F’  p \$        P&                  ! VP)                  RR7      4      pV! VR
,          VR,          4      RJ d   VP+                  RR7       KY  \        RVR,           RVR,           R	VR
,           R2VR7       \        RVR7       K”  	  R#   \,        \.        \0        \2        3 d<   p	\4        P7                  RY‰4       \        RTP8                   2TR7        Rp	?	Ké  Rp	?	ii ; i)ziWarn about manual debt independently of gateway evidence; optionally reuse a snapshot's failed transfers.r   )Úread_latest_receiptNu     âš  r   z [r   r   z] pid r   z\: manual restart reminder could not be saved; restart remains pending in the update receipt.)Úfiler   r   zu    Ask its owner to relaunch `hermes serve` / `hermes dashboard`; check reminder storage permissions and free space.zÔ    This host could not read the process creation time, so no durable reminder could be filed; ask its owner to relaunch `hermes serve` / `hermes dashboard`, and the warning clears once the pid is confirmed gone.r   z*.jsonz	utf-8-sig)r!   FTr$   zM: manual restart still pending; this process may still serve pre-update code.zi    Ask its owner to relaunch `hermes serve` / `hermes dashboard` (reconnect Desktop for an SSH backend).z2Could not reconcile manual serve obligation %s: %su;     âš  Manual serve restart reminder could not be verified: )r)   r   Úhermes_cli.update_receiptr]   ÚsysÚstderrÚstdoutrX   Úprintr*   r+   r	   r,   r-   r.   r   ÚsortedÚglobr6   ÚloadsÚ	read_textr=   r>   r?   ÚKeyErrorr@   rA   rB   r5   )
rY   rZ   r   r]   ÚstreamrG   r   rF   ÚpathrK   s
   $$        r   Úwarn_pending_manual_servesrk   Q   s  € å>Ý=ç"ŒS�ZŠZ¬¯
©
€FØÒÜ5Ñ6IÓ6K×6QÐ6QÈrÓRˆÛˆÜ��s˜6•{�m 2 c§g¡g¨i¸Ó&CÐ%DÀFÈ3Ï7É7ÐSXÐZcÓKdÐJeð  fBð  Cð  JPõ  	QÜ&0°·±¸Ó1BÄD×&IÒ&I�—‘˜Ô"ÈrˆÜ�—
‘
˜=Ó)Ó*¬s´E¨lÔ:Üð  Jð  QW÷  Xô ð  ið  pv÷  wñ ô  Ó!Ð$;Õ;€IÜ�y—~‘~ hÓ/Ö0ˆð		jÜ—*’*˜TŸ^™^°[˜^ÓAÓBˆCÙ! # e¥*¨c°-Õ.@ÓAÀUÓJØ—‘ t�Ô,ÙÜ�F˜3˜v�;˜- r¨#¨i­.Ð)9¸ÀÀEÅ
¸|ð  LYð  Zð  agõ  hÜÐ}ð  EK÷  Ló 1øô œ¤X¬yÐ9ô 	jÜ�L‰LÐMÈtÔYÜÐOÐPT×PYÑPYÈ{Ð[Ðbh×iÓiûð	jús   ÅAGÆ9GÇH0Ç50H+È+H0)Ú__doc__r6   Úloggingr/   r9   r`   r3   Úpathlibr   Úhermes_constantsr   Ú	getLoggerÚ__name__rA   rL   rX   rk   © r   r   Ú<module>rs      s_   ðÙ Mã Û Û Û 	Û 
Û Ý å ,à	×	Ò	˜8Ó	$€ð+¸u÷ +õ\ð&j°%ð jÐ]a÷ jñ jr   