+
    jHàjyx  ã                  óæ  € R t ^ RIHt ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RI	H
t
 R R ltR R ltR	 R
 ltRR/R R lltR<RR/R R llltR R lt]! 0 R=m4      tR R ltR R ltR R lt^tR>t^tR R ltR R ltRR/R  R! lltR" R# ltR$ R% lt]! R&R'04      tR( R) ltR* R+ lt R, R- lt!R. R/ lt"R0 R1 lt#R2 R3 lt$R4R/R5 R6 llt%R7 R8 lt&R<R9 R: llt'](R;8X  d   ])! ]'! 4       4      hR# )?a  Pre-venv entry point for PM's dependency transaction.

Stdlib-only at import: installers call this before dependencies exist.
All checkout roots use PM's selected generation and facts; sealed payloads
remain build-owned. ``--check`` is passive and never provisions tools.
)ÚannotationsN)ÚPath)ÚUPDATE_MECHANISMSc               ó   € V ^8„  d   QhRR/# )é   Úreturnr   © )Úformats   "Ú9/home/ubuntu/.hermes/hermes-agent/hermes_cli/venv_sync.pyÚ__annotate__r      s   € ÷ /ñ /�tñ /ó    c                 ó^   € \        \        4      P                  4       P                  ^,          # )é   )r   Ú__file__ÚresolveÚparentsr   r   r
   Ú_project_rootr      s    € Ü”‹>×!Ñ!Ó#×+Ñ+¨AÕ.Ð.r   c               ó    € V ^8„  d   QhRRRR/# )r   Úproject_rootr   r   Úboolr   )r	   s   "r
   r   r      s   € ÷ ñ ˜Tð  dñ r   c                ó"  € V R,          P                  4       '       d   R# ^ RIHp ^ RIHp V! V 4      pV! V 4      pV'       g   R# VP                  R4      \        9  d0   \        RVP                   RRP                  \        4       R	24      hR
# )uÆ  A sealed tree ships its interpreter; only checkouts own a venv.

The stamp file is the authority (shared with hermes_cli.steward).
A tree with BOTH a stamp and .git is a dev tree â€” treat as checkout.

A stamp without a valid ``updateMechanism`` is a build-lane bug and
must not be silently read as "not sealed" (that is exactly the
misclassification that made sealed trees look updatable) â€” same
guard as hermes_cli.version_info._stamp_version_info.
ú.gitF©Úread_install_stamp)Úinstall_stamp_pathÚupdateMechanismzinstall-stamp.json at z. is missing a valid 'updateMechanism' (one of z, zg). The build lane that wrote this stamp must pass --update-mechanism to scripts/write_install_stamp.py.T)
ÚexistsÚhermes_cli.stewardr   Úpm.pathsr   Úgetr   ÚRuntimeErrorÚparentÚjoin)r   r   r   Ú
stamp_pathÚdatas   &    r
   Ú
_is_sealedr%      sŽ   € ð 	�vÕ×%Ñ%×'Ò'ÙÝ5Ý+Ù# LÓ1€JÙ˜lÓ+€DßÙØ‡x�xÐ!Ó"Ô*;Ô;ÜØ$ Z×%6Ñ%6Ð$7ð 8)Ø)-¯©Ô3DÓ)EÐ(Fð G.ð.ó
ð 	
ñ r   c               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   ú
str | Noner   )r	   s   "r
   r   r   3   s   € ÷ Gñ G ð G¨ñ Gr   c                óF  € ^ RI p^ RIHpHp \	        V 4      R,          P                  4       '       d   V! V 4      P                  R4      R8w  d   R# VP                  4       pV'       g   R# V! \	        V 4      4      pV'       d   RV R2MRpR	R
P                  V4       RV 2# )zCOne passive startup verdict; callers only choose stderr or logging.N)r   Úsealed_stewardr   r   Úselfzthis z1-managed install must rebuild the artifact to fixzrun `hermes pm install`zinstall out of sync (ú; u   ) â€” )	Úpmr   r   r)   r   r   r   Úactivater"   )r   r,   r   r)   ÚproblemsÚstewardÚremedys   &      r
   Úcheck_runtimer1   3   s•   € ãßEäˆ\Ó˜VÕ#×+Ñ+×-Ò-Ñ2DÀ\Ó2R×2VÑ2VÐWhÓ2iÐmsÔ2sÙà�{‰{‹}€HßÙÙœT ,Ó/Ó0€Gçð �g�YÐOÑPØ7ð à" 4§9¡9¨XÓ#6Ð"7°v¸f¸XÐFÐFr   ÚcreateTc               ó$   € V ^8„  d   QhRRRRRR/# )r   r   r   r2   r   r   ÚNoner   )r	   s   "r
   r   r   D   s&   € ÷ Xñ X Dð X°Tð XÀTñ Xr   c               ó†  € ^ RI p^ RIHpHpHpHp ^ RIHp \        V 4      pVP                  \        4      p	\        V4      '       d   V	P                  RV4       R# V! V4      P                  R4      R8X  d   V	P                  RV4       R# V! V4      f#   V	P                  RWˆR	,          R
,          4       R# V! WˆR	,          R
,          4      p
\        V
4      \        V4      8w  d   ^ RIHp V! RRR4      hV! W�R7      pVR,          '       g3   ^ RI pVP                  \        4      P                  RVR,          4       R# R# )zHRefresh durable commands; bootstrap repairs only existing PATH exposure.N)ÚENTRY_POINTSÚensure_install_launchersÚ
expose_cliÚresolve_store_pythonr   z*launchers: sealed tree at %s keeps its ownr   Úexternalz/launchers: external runtime at %s keeps its ownz<launchers: no managed interpreter under %s; %s not publishedú.hermesÚbin)ÚInstallErrorÚ	launchersz"source launcher publication failedzretry the source update)r2   ÚokzCLI exposure failed: %sÚerror)ÚloggingÚhermes_cli._launchersr6   r7   r8   r9   r   r   r   Ú	getLoggerÚ__name__r%   Úinfor   ÚwarningÚlenÚ
pm.packager=   )r   r2   rA   r6   r7   r8   r9   r   ÚrootÚlogÚwrittenr=   Úresults   &$           r
   Úpublish_launchersrM   D   s  € ãçnÓnÝ5ä�Ó€DØ
×
Ñ
œHÓ
%€CÜ�$×ÒØ�‰Ð=¸tÔDÙÙ˜$Ó×#Ñ#Ð$5Ó6¸*ÔDØ�‰ÐBÀDÔIÙÙ˜DÓ!Ò)ð 	�‰ÐRØ Õ*¨UÕ2ô	4áÙ& t°IÕ-=ÀÕ-EÓF€GÜ
ˆ7ƒ|”s˜<Ó(Ô(Ý+á˜;Ð(LÐNgÓhÐhÙ˜Ô,€FØ�$�<Œ<Ûà×Ñœ(Ó#×+Ñ+Ð,EÀvÈgÅÖWñ r   ÚcheckFc               ó$   € V ^8„  d   QhRRRRRR/# )r   r   úPath | NonerN   r   r   Údictr   )r	   s   "r
   r   r   f   s&   € ÷ Dñ D�{ð D°Tð DÀdñ Dr   c          	     ó  € ^ RI Hp V e   \        V 4      M	\        4       p\	        V4      '       d   RRRR/# VR,          P                  4       '       g   RRRR	R
RV 2/#  ^ RIpVP                  VR7      '       d   V'       g   \        V4       RRRR/# V'       d   RRRR/# V! R4       \        V4       VP                  RVRR7       \        V4       \        V4       RRRR/#   \         d   pRRRR	R
\        T4      /u Rp?# Rp?ii ; i)zHReport or sync dependencies. A malformed install stamp is a build error.)Úpublish_stageNÚstateÚsealedr?   Túpyproject.tomlÚfailedFÚdetailzno pyproject.toml under ©r   Úcurrentz
would-synczUpdating Python dependencies©Úexplicitr   Úevict_incompatible_pluginsÚsynced)Úhermes_cli.update_stagerS   r   r   r%   Úis_filer,   Úvenv_is_currentrM   Úrefuse_foreign_owned_venvÚ	sync_venvÚcollect_superseded_generationsÚ	ExceptionÚstr)r   rN   rS   rI   r,   Úexcs   &$    r
   Úsyncrh   f   s  € å5à!-Ò!9Œ4�Ô¼}»€DÜ�$×ÒØ˜ 4¨Ð.Ð.ØÐ#Õ#×,Ñ,×.Ò.Ø˜ 4¨°Ð<TÐUYÐTZÐ:[Ð\Ð\ðDÛà×Ñ¨4Ð×0Ò0ßÜ! $Ô'Ø˜Y¨¨dÐ3Ð3ßØ˜\¨4°Ð6Ð6ÙÐ4Ô5Ü! $Ô'Ø
�‰˜d°ÐRVˆÔWÜ& tÔ,Ü˜$ÔØ˜ 4¨Ð.Ð.øÜô DØ˜ 4¨°¼#¸c»(ÐCÕCûðDús=   Á C& Á<C& ÂC& ÂC& ÂC& Â#AC& Ã&DÃ1DÄDÄDc               ó    € V ^8„  d   QhRRRR/# ©r   r   r   r   r4   r   )r	   s   "r
   r   r   ‚   s   € ÷ eñ e°ð e¸$ñ er   c                óp  € ^ RI p^ RIHp ^ RIHp ^ RIHp  V! V 4      V! V! V 4      R,          4      ,           pT'       d1   TP                  \        4      P                  R\        T4      4       R# R#   \        \        3 d1   pTP                  \        4      P                  RT4        Rp?R# Rp?ii ; i)a  Collect what a publish just superseded, as the Docker boot already does.

Without this only a manual `hermes pm gc` reclaimed old environments. Safe
right after a sync: the collectors skip leased, selected and day-young
generations and yield to any in-flight install instead of waiting.
N)Úcollect_generations©Úinstall_state_dir)Úcollect_runtime_generationsz
pm-runtimez)dependency generation cleanup skipped: %sz*collected %d unused dependency generations)rA   Úhermes_cli.runtime_staterl   Úpm.environmentsrn   Ú
pm.runtimero   ÚOSErrorÚ
ValueErrorrC   rD   rF   rE   rG   )r   rA   rl   rn   ro   Úremovedrg   s   &      r
   rd   rd   ‚   s�   € ó å<Ý1Ý6ðÙ% lÓ3Ñ6QÙ˜lÓ+¨lÕ:ó7<õ <ˆ÷ Ø×Ñœ(Ó#×(Ñ(Ð)UÔWZÐ[bÓWcÖdñ øô	 ”ZÐ ô à×Ñœ(Ó#×+Ñ+Ð,WÐY\Ô]Ýûðús   ˜"A4 Á4B5Â%B0Â0B5c               ó    € V ^8„  d   QhRRRR/# )r   Úcommandú	list[str]r   r   r   )r	   s   "r
   r   r   Ÿ   s   € ÷ 0ñ 0¨)ð 0¸ñ 0r   c                ó   € V R,          RR.8H  # )zNWhether *command* is the recovery diagnostic that must not run an update tail.:Nr   NÚgatewayÚstatusr   )rw   s   &r
   Ú_is_read_only_gateway_statusr|   Ÿ   s   € à�2�;˜9 hÐ/Ñ/Ð/r   c               ó    € V ^8„  d   QhRRRR/# ©r   r   r   r   r   )r	   s   "r
   r   r   ¤   s   € ÷ 	Iñ 	I¨$ð 	I°4ñ 	Ir   c                ó,   € ^ RI Hp V! V 4      R,          # )a  Marker for a source update whose dependency sync committed but whose tail
(launchers, products, maintenance) has not finished.

Lives beside PM's facts, not in the checkout: it is per-install state, and a
root-level file would trip the ZIP updater's dirty-tree check.
rm   zsource-completion-pending)rq   rn   )r   rn   s   & r
   Úcompletion_pending_pathr€   ¤   s   € õ 2á˜\Ó*Ð-HÕHÐHr   c               ó    € V ^8„  d   QhRRRR/# r~   r   )r	   s   "r
   r   r   °   s   € ÷ ñ  ð ¨$ñ r   c                ó|   € \        V 4      pVP                  P                  RRR7       VP                  RRR7       V# )zIPersist the tail obligation before selecting a new dependency generation.T)r   Úexist_okz source update tail not finished
úutf-8©Úencoding)r€   r!   ÚmkdirÚ
write_text)r   Úpendings   & r
   Úarm_completionrŠ   °   s<   € ä% lÓ3€GØ‡N�N×Ñ °ÐÔ5Ø×ÑÐ:ÀWÐÔMØ€Nr   c               ó    € V ^8„  d   QhRRRR/# r~   r   )r	   s   "r
   r   r   Ä   s   € ÷ Yñ Y¨Dð Y°Tñ Yr   c                ó6   € \        V 4      P                  R 4      # )zsource-completion-attempts)r€   Ú	with_namerY   s   &r
   Ú_completion_attempts_pathrŽ   Ä   s   € Ü" <Ó0×:Ñ:Ð;WÓXÐXr   c               ó$   € V ^8„  d   QhRRRRRR/# )r   rI   r   rW   r   r   r4   r   )r	   s   "r
   r   r   È   s!   € ÷ ñ  Tð °dð ¸tñ r   c               óN  € \        V 4      pV'       g   VP                  RR7       R#  \        VP                  RR7      P	                  4       ;'       g    R4      ^,           p VP                  V R2RR7       R#   \
        \        3 d    ^p L.i ; i  \
         d     R# i ; i)	ag  Track consecutive completion-tail failures beside the pending marker.

The pending marker itself is armed *before* the tail runs (a crash between
the dependency commit and the tail must leave the obligation), so the
marker alone cannot distinguish "never tried" from "tried and failed N
times". The attempts record can: success clears both, failure bumps it.
T©Ú
missing_okNú	utf-8-sigr…   Ú0Ú
r„   )rŽ   ÚunlinkÚintÚ	read_textÚstriprs   rt   rˆ   )rI   rW   ÚrecordÚattemptss   &$  r
   Ú_record_completion_attemptrœ   È   s¢   € ô ' tÓ,€FßØ�‰ ˆÔ&ÙðÜ�v×'Ñ'°Ð'Ó=×CÑCÓE×LÐLÈÓMÐPQÕQˆðØ×Ñ˜X˜J b˜/°GÐÖ<øô ”ZÐ ô ØŠðûô ô Úðús)   ©+A< ÁA< Á$B Á<BÂBÂB$Â#B$Únowc               ó    € V ^8„  d   QhRRRR/# )r   r   r   r   ztuple[bool, int, int]r   )r	   s   "r
   r   r   Þ   s   € ÷ Hñ H¨ð HÐ?Tñ Hr   c               ó"  € ^ RI p\        V 4      p \        VP                  RR7      P	                  4       ;'       g    R4      pT^ 8:  d   R# T\        8¼  d   RT^ 3# T\        8  d   RT^ 3#  TP                  4       P                  pT;'       g    TP                   ! 4       p\        RYe,
          4      pT\        8¼  d
   RT\        3# RT\        \        T,
          4      3#   \
        \        3 d    Ru # i ; i  \
         d	    RT^ 3u # i ; i)	uý   ``(may_retry_now, attempts, backoff_seconds)`` for the owed tail.

Never raises; an unreadable record answers ``(True, 0, 0)`` â€” the
historical unbounded behavior â€” because a bookkeeping failure must not
stop a launch from finishing its own update.
Nr“   r…   r”   TFg        )Té    r    )ÚtimerŽ   r—   r˜   r™   rs   rt   ÚCOMPLETION_RETRY_MAX_ATTEMPTSÚ!COMPLETION_RETRY_BACKOFF_ATTEMPTSÚstatÚst_mtimeÚmaxÚ COMPLETION_RETRY_BACKOFF_SECONDS)r   r�   Ú_timerš   r›   ÚmtimeÚ	referenceÚages   &$      r
   Úcompletion_retry_stater¬   Þ   s"  € ó ä& |Ó4€FðÜ�v×'Ñ'°Ð'Ó=×CÑCÓE×LÐLÈÓMˆð �1„}ØÐØÔ0Ô0Ø�h Ð!Ð!ØÔ3Ô3ð �X˜qÐ Ð ð!Ø—‘“×&Ñ&ˆð ×"Ð"˜Ÿ
™
Ð"Ó%€IÜ
ˆc�9Õ$Ó
%€CØ
Ô.Ô.Ø�XÔ?Ð?Ð?Ø�(œCÔ @À3Õ FÓGÐGÐGøô' ”ZÐ ô ØÒðûô ô !Ø�X˜qÐ Ò ð!ús(   ‘+C" ½C" Á.C; Ã"C8Ã7C8Ã;DÄDc               ó    € V ^8„  d   QhRRRR/# )r   rI   r   r   r4   r   )r	   s   "r
   r   r      s   € ÷ <ñ <˜4ð < Dñ <r   c                ór   € \        V 4      P                  R R7       \        V 4      P                  R R7       R# )Tr‘   N)r€   r–   rŽ   )rI   s   &r
   Úclear_completionr¯      s.   € Ü˜DÓ!×(Ñ(°DÐ(Ô9Ü˜dÓ#×*Ñ*°dÐ*Ö;r   c               ó    € V ^8„  d   QhRRRR/# rj   r   )r	   s   "r
   r   r     s   € ÷ ñ ¨Dð °Tñ r   c                óº  € \        \        R4      '       g   R# \        P                  ! 4       p\        V 4      p^ RIHp W"R,          VR,          VR,          V! V4      .pVR,          VR,          VR,          3 EF  pT\        P                  R8X  d   RMR	,          .VP                  R
4      O FÎ  pVP                  4       '       g   K  VP                  V4       \        VP                  4       4      R,           F~  pVP                  V4       VP                  P                  R4      '       g   K7  VP                  4       '       g   KO  VP                  \        VP                  4       4      R,          4       K€  	  KÐ  	  EK  	  V F<  p VP                  4       P                  p	Y‘8w  g   K&  \#        RT RT RT	 RT R2	4      h	  R#   \          d     KP  i ; i)zORefuse cross-user mutation before PM changes the selected environment (#83529).ÚgeteuidN)Úselected_venvÚvenvz.venvr;   ÚntÚScriptsr<   zlib/python*/site-packages:NiÐ  Nz
.dist-info:Néd   Nzrefusing to update z: z is owned by uid z, not the current uid z"; repair ownership before retryingéÿÿÿÿ)ÚhasattrÚosr²   r   rq   r³   ÚnameÚglobÚis_dirÚappendÚlistÚiterdirÚendswithÚextendÚlstatÚst_uidÚFileNotFoundErrorr    )
r   ÚuidrI   r³   Ú
candidatesr´   Ú	directoryÚentryÚpathÚowners
   &         r
   rb   rb     sš  € ä”2�y×!Ò!ÙÜ
�*Š*‹,€CÜ�Ó€Dõ .Ø˜v� t¨g¥~°t¸iÕ7GÉÐW[ÓI\Ð]€JØ˜•  w¥°
¸2µÔ?ˆØ¬r¯w©w¸$¬¡)ÀEÕJð CØŸ9™9Ð%@ÓAóCˆIà×Ñ×!Ô!Ø×!Ñ! )Ô,Ü! )×"3Ñ"3Ó"5Ó6°u×=Ð=�EØ×%Ñ% eÔ,Ø—z‘z×*Ñ*¨<×8Ô8¸U¿\¹\¿^¼^Ø"×)Ñ)¬$¨u¯}©}«Ó*?ÀÕ*EÖFó >ô	Cñ @ó ˆð	Ø—J‘J“L×'Ñ'ˆEð Ž<ÜØ% d V¨2¨d¨VÐ3DÀUÀGð L'Ø'* eÐ+MðOóð ó øô !ô 	Úð	ús   ÆGÇGÇGzsource_completion.pyzupdate_completion.pyc               ó$   € V ^8„  d   QhRRRRRR/# )r   rI   r   Úargv0rf   r   r   r   )r	   s   "r
   r   r   *  s&   € ÷ [ñ [˜$ð [ sð [¨tñ [r   c                ó–   € \        V4      pVP                  \        9   ;'       d%    VP                  4       P                  V R,          8H  # )zPExact own-script identity; argv is not inherited by the processes a tail spawns.Ú
hermes_cli)r   r»   Ú_TAIL_SCRIPTSr   r!   )rI   rÍ   Úscripts   && r
   Ú_is_tail_scriptrÒ   *  s9   € ä�%‹[€FØ�;‰;œ-Ñ'×ZÐZ¨F¯N©NÓ,<×,CÑ,CÀtÈlÕGZÑ,ZÐZr   c               ó   € V ^8„  d   QhRR/# )r   r   r   r   )r	   s   "r
   r   r   0  s   € ÷ 
ñ 
˜4ñ 
r   c                 ój   € \         ;QJ d    R R 4       F  '       g   K   R# 	  R# ! R R 4       4      # )u4  A launcher-marked child: booted by a manager, not a user's shell.

Launcher markers only â€” not INVOCATION_ID, which systemd exports to every
descendant: an ordinary hermes command inside a CI runner still owes its repair.
Parsed as a truthy flag, so an explicit ``0``/``false`` does not suppress the tail.
c              3  ó    "  € T FD  p\         P                  P                  VR 4      P                  4       P	                  4       R9   x € KF  	  R# 5i)Ú N)Ú1ÚtrueÚyesÚon)rº   Úenvironr   r™   Úlower)Ú.0r»   s   & r
   Ú	<genexpr>Ú$_supervised_child.<locals>.<genexpr>7  s>   é € ð áMˆDô 	�
‰
�‰�t˜RÓ ×&Ñ&Ó(×.Ñ.Ó0Ð4NÖNÛMùs   ‚AATF)ÚHERMES_SUPERVISED_CHILDÚHERMES_S6_SUPERVISED_CHILD)Úanyr   r   r
   Ú_supervised_childrã   0  s?   € ÷ ‹3ñ áMó�3Œ3ð Š3ð ˆ3ñ áMóó ð r   c               ó    € V ^8„  d   QhRRRR/# )r   rI   r   r   r   r   )r	   s   "r
   r   r   =  s   € ÷ 4ñ 4¨ð 4°ñ 4r   c                óê  € ^ RI Hp ^ RIHp V! V 4      pVP	                  R4      p\        V\        4      '       d%   V'       d   RV9   g   VP	                  R4      RJd   R# \        V 4      pVP                  4       '       dA   VP                  4       P                  V R,          P                  4       P                  8¼  d   R# V! V RR	7      pVP                  V8H  ;'       d    VP                  '       * # )
a×  True when the checkout is the exact clean tree the last install/update completed.

Every finished tail records its tree in install-stamp.json (write_source_stamp);
when that commit is a clean HEAD, the products in the tree were built for it, so a
stale venv only needs re-provisioning and a marker armed BEFORE that stamp is a
leftover from a previous home/install, never a rebuild of the same SHA (fresh
Windows installs and pristine HERMES_HOMEs hit exactly this: #123314). A marker
armed after the stamp is newer debt (a same-commit ``hermes update`` that failed
or was killed) and is still owed. Boot-time adoption also stamps HEAD but builds
nothing, so its stamp (``adoptedAt``) is not evidence; neither is a dirty tree.
r   )Ú_git_version_infoÚcommitÚ	adoptedAtÚdirtyFzinstall-stamp.jsonT)Úinclude_untracked)r   r   Úhermes_cli.version_inforæ   r   Ú
isinstancerf   r€   r`   r¤   r¥   rç   ré   )rI   r   ræ   Ústamprç   r‰   rE   s   &      r
   Ú_tree_matches_completed_stamprî   =  s¸   € õ 6Ý9á˜tÓ$€EØ�Y‰Y�xÓ €FÜ�fœc×"Ò"¯&°KÀ5Ô4HÈEÏIÉIÐV]ÓL^ÐfkÓLkÙÜ% dÓ+€GØ‡�×Ò˜WŸ\™\›^×4Ñ4¸Ð@TÕ9T×8ZÑ8ZÓ8\×8eÑ8eÔeÙÙ˜T°TÔ:€DØ�;‰;˜&Ñ ×3Ð3¨¯©¤^Ð3r   c               ó$   € V ^8„  d   QhRRRRRR/# )r   r   r   Úargvrx   r   rP   r   )r	   s   "r
   r   r   W  s&   € ÷ tñ t ð t¨Yð t¸;ñ tr   c                ó¶  € ^ RI p^ RIp\        V 4      P                  4       p\	        WCP
                  ^ ,          4      '       d   R# ^ RIHp ^ RIH	p V! V4      pVR,          R.8X  g—   \        \        V4      ,          '       g{   \        V4      '       gj   VP                  P                  RR4      P                  4       R9   g;   VR,          P!                  4       '       d   VR	,          P#                  4       '       g   R# V! V4      pV'       g   ^ R
IHp	 V	! V4       V! V4      pVP                  R4      R8w  d   R# ^ RIp
^ RIHp ^ RIHpHp V
P5                  VR7      p^ RIHp V! V4      pVe   \;        VVVR7      # \=        V4      pT;'       d#    VP#                  4       ;'       d    \?        4       p\A        V4      w  pppV'       g*   V\B        8¼  d   \E        RV R2VPF                  RR7       EMV'       g   MúV'       gó   V'       d   VP#                  4       '       dÕ   V! VRR7      pVPI                  4       '       g   \K        R4      h VPL                  '       gX   V! VR7      eM   V'       d    VPO                  4        R# \Q        VRR7       V
P5                  VR7      '       g   \K        R4      hM/VPS                  V4      '       g   \K        R4      h\U        WNVR7       VPO                  4        V! V4      pVf   \K        R4      hVPV                  PY                  VPV                  P[                  V4      4      VPV                  PY                  VPV                  P[                  VP\                  4      4      8H  pV'       d	   V'       g   \_        V4       V# V'       d   \E        RVPF                  RR7       R#   TPO                  4        i ; i) aÍ  Finish a self-managed source update before importing app dependencies.

PM's successful input stamp signals a finished dependency sync; the
``source-completion-pending`` marker signals the tail still owed after it,
so a tail that failed is retried on the next launch WITHOUT rebuilding
dependencies that are already current. Old updaters need not write a
marker (and cannot accidentally clear this obligation).
A supervised child leaves that tail to ``hermes update`` when its dependencies
are current: its manager restarts it on every start, so a sticky marker would
re-run the tail (and its environment builds) on each boot until the disk fills.
Return the store interpreter when this process must restart cleanly.
N)Úcommand_argvr   :Nr   Nr,   ÚHERMES_DISABLE_LAZY_INSTALLSrÖ   r   rV   )Ústep_adopt_blessed_checkoutr   r*   ©r9   )Ú
UpdateLockÚread_live_updaterY   )Úowning_home_root)rZ   z=hermes: a source update could not be finished automatically (z9 attempts); run `hermes update` from a shell to finish itT©ÚfileÚflushF©Úinstall_rootÚcheckout_firstúEan update is still running; wait for it to exit, then relaunch Hermes)rý   ©Úarmú-dependency sync left this install out of date)rZ   r‰   ú<source update has no managed Python; run `hermes pm install`zThermes: a source update is unfinished; run `hermes update` from a shell to finish it)r×   rØ   rÙ   )0rº   Úsysr   r   rÒ   rð   Úhermes_cli._parserrò   r   r   Ú_METADATA_FLAGSÚsetr|   rÛ   r   rÜ   r   r`   Úhermes_cli.post_updaterô   r,   rB   r9   Úhermes_cli.update_lockrö   r÷   ra   rq   rø   Ú_prepare_borrowed_launchr€   rã   r¬   r¢   ÚprintÚstderrÚacquirer    ÚacquiredÚreleaseÚ_sync_source_dependenciesÚacquire_checkoutÚ_finish_source_updaterÊ   ÚnormcaseÚabspathÚ
executablerM   )r   rð   rº   r  rI   rò   r   rw   rí   rô   r,   r9   rö   r÷   rZ   rø   rË   r‰   Úowed_to_cliÚ
_may_retryÚ	_attemptsÚ_backoffÚlockÚpythonÚsames   &&                       r
   Úprepare_launchr  W  s  € ó Ûä�Ó×%Ñ%Ó'€Dä�tŸX™X a�[×)Ò)Ùå/Ý5á˜4Ó €GØ��˜�vÔÜ¤ T£×*Ô*ô ,¨G×4Ò4Ø�z‰z�~‰~Ð<¸bÓA×GÑGÓIÐMaÔaØ˜6•M×)Ñ)×+Ò+ØÐ+Õ+×4Ñ4×6Ò6ÙÙ˜tÓ$€EßÝFá# DÔ)Ù" 4Ó(ˆØ‡y�yÐ"Ó# vÔ-ÙãÝ:ßCà× Ñ ¨dÐ Ó3€GÝ0á˜TÓ"€EØÒÜ'¨¨e¸WÔEÐEÜ% dÓ+€GØ×GÐG˜gŸo™oÓ/×GÐGÔ4EÓ4G€KÜ&<¸TÓ&BÑ#€J�	˜8ß˜)Ô'DÔDô 	ðØˆ{ÐSðUà—‘ 4÷	
÷
 ð 	ß§'¨W¯_©_×->Ò->ñ  t¸EÔBˆØ�|‰|�~Š~ÜÐfÓgÐgð	ð —=—=�=Ñ%5À4Ô%HÒ%TßØð  �L‰LŽNô *¨$°EÕ:Ø×)Ñ)°tÐ)×<Ò<ä&Ð'VÓWÐWð =ð ×,Ñ,¨T×2Ò2Ü&Ð'nÓoÐoÜ% dÀWÕMà�L‰LŒNÙ! $Ó'€FØ‚~ÜÐYÓZÐZð �7‰7×Ñ˜BŸG™GŸO™O¨FÓ3Ó4¸¿¹×8HÑ8HÈÏÉÏÉÐY\×YgÑYgÓIhÓ8iÑi€DßŸ$Ü˜$ÔØˆßô 	ÐdØ—:‘: Tõ	+áøð% �L‰L�Nús   ÉO É'O ÊAO ËO ÏOc               ó(   € V ^8„  d   QhRRRRRRRR/# )r   rI   r   rË   rZ   r   r   rP   r   )r	   s   "r
   r   r   Î  s(   € ÷  7ñ  7 4ð  7°ð  7À$ð  7È;ñ  7r   c               ó‚  € ^ RI p^ RIp^ RIp^ RIHp ^ RIHp V'       gn   V! V RR7      pVP                  4       '       g   \        R4      h \        V RVR7       VP                  4        VP                  V R7      '       g   \        R	4      hV! V 4      p	V	f   \        R
4      hVP                  P                  VP                  P                  V	4      4      VP                  P                  VP                  P                  VP                  4      4      8H  p
V'       d	   V
'       g   V	# R#   TP                  4        i ; i)a…  Launch a checkout that another data root owns (#123238).

Dependency state is per data root, so a borrowing root -- a test's temporary
``HERMES_HOME``, a per-task home -- still gets an environment of its own, synced exactly
as a process spawned under a live update syncs. The rest is the checkout's, and so the
owner's: launchers, product builds, post-update maintenance, the install stamp and the
owner's own update markers. None of it is armed, run or published from here, so a
borrowing launch cannot rebind the shared launchers, rebuild products another root is
serving, or race the owner's tail under a lock that lives in a different home.
Nrõ   )rö   Frü   rÿ   )r  Úborrowed_fromrY   r  r  )rº   r  r,   rB   r9   r	  rö   r  r    r  r  ra   rÊ   r  r  r  )rI   rË   rZ   rº   r  r,   r9   rö   r  r  r  s   &&$        r
   r
  r
  Î  só   € ó ÛÛÝ:Ý1çÙ t¸EÔBˆØ�|‰|�~Š~ÜÐfÓgÐgð	Ü% d°ÀUÕKà�L‰LŒNØ×!Ñ!¨tÐ!×4Ò4äÐNÓOÐOÙ! $Ó'€FØ‚~ÜÐYÓZÐZØ�7‰7×Ñ˜BŸG™GŸO™O¨FÓ3Ó4¸¿¹×8HÑ8HÈÏÉÏÉÐY\×YgÑYgÓIhÓ8iÑi€Dß ¯ˆ6Ð6°$Ð6øð �L‰L�Nús   ÁD, Ä,D>c               ó(   € V ^8„  d   QhRRRRRRRR/# )r   rI   r   rZ   r   r‰   r   r4   r   )r	   s   "r
   r   r   ñ  s(   € ÷ >ñ > ð >°$ð >Àð >È$ñ >r   c               ó  a€ ^ RI p^ RIHo ^ RIHp V'       g¨   V R,          V R,          3p\
        ;QJ d    V3R lV 4       F  '       g   K   RM	  RM! V3R lV 4       4      '       d   \        R	4      h\        R
VP                  RR7       \        V 4      p\        W'       * R7       V'       d   \        V 4       R# M6\        V 4      '       d   \        V 4       R# \        RVP                  RR7       V R,          pVR,          P                  4       ;'       g"    \        VR,          P                  R4      4      p^ RIHp	Hp
  T
! VP"                  RRR\%        V R,          4      R\%        V 4      R.V'       d   RMRORW! V 4      VP&                  R7      P(                  pV^ 8w  d   \-        V RR7       \        R4      h\        V 4       R#   T	 d2   p\        RTP*                   2TP                  RR7       ^p Rp?L_Rp?ii ; i)zOSync dependencies when they are stale, then run the tail the marker still owes.N)Ú_marker_owner_is_live)Úactivation_environmentú.update-incompleteú.lazy-refresh-incompletec              3  ó4   <"  € T F  pS! V4      x € K  	  R # 5i©Nr   )rÝ   Úmarkerr#  s   & €r
   rÞ   Ú(_finish_source_update.<locals>.<genexpr>û  s   øé € ÐJ¹>°Ñ$ V×,Ð,»>ùs   ƒTFrÿ   z0hermes: completing source-update dependencies...rù   r   z1hermes: finishing an interrupted source update...zapps/desktopzdist/index.htmlr  Ú*)ÚCustodyRefusedÚrunú-Iz-Bz-uzhermes_cli/source_completion.pyz--sourcez--finish-update)Úinherit_lockÚcwdÚenvÚstdoutzhermes: )rW   zAsource update completion failed; run `hermes update` to finish it)z	--desktopr   )r  Úhermes_cli._early_recoveryr#  rq   r$  râ   r    r  r  rî   r  r¯   r`   r¼   Úhermes_cli.update_custodyr,  r-  r  rf   Ú
__stderr__Ú
returncodeÚreasonrœ   )rI   rZ   r‰   r  r$  Úlegacy_markersÚ	completedÚdesktop_appÚdesktopr,  r-  Úcoderg   r#  s   &$$          @r
   r  r  ñ  sÏ  ø€ ãÝ@Ý6çð Ð!5Õ5°tÐ>XÕ7XÐYˆß‹3ÔJ¹>ÓJ�3�3Š3ÔJ¹>ÓJ×JÒJÜÐfÓgÐgÜÐ@ÀsÇzÁzÐY]Õ^Ü1°$Ó7ˆ	ô 	" $¬MÕ:ßÜ˜TÔ"Ùð ô 
' t×	,Ò	,ô 	˜ÔÙäÐAÈÏ
É
ÐZ^Õ_ð ˜Õ'€KØÐ/Õ/×8Ñ8Ó:÷ ;ð ;Ü�{ YÕ.×4Ñ4°SÓ9Ó:ð ÷
 >ð
ÙØ�^‰^˜T 4¨Ü�Ð9Õ9Ó:Øœ˜T›Ð$5ð3÷ ")‰~¨bð3ð  4Ð-CÀDÓ-IÐRU×R`ÑR`ô
÷ ‰*ð 	ð ˆq„yÜ" 4°Õ5ÜØOó
ð 	
ô �TÖøð ô Ü�˜Ÿ™˜Ð%¨C¯J©J¸dÕCØ�ûðús   Å	AG ÇH
Ç'HÈH
r   c               ó(   € V ^8„  d   QhRRRRRRRR/# )	r   rI   r   r  r   r   rP   r   r4   r   )r	   s   "r
   r   r   2  s)   € ÷ #.ñ #. Dð #.°$ð #.À{ð #.Ð^bñ #.r   c               óà  € ^ RI p^ RIp^ RIHp ^ RIHp ^ RIHp Ve   \        RV R2VP                  RR7       M V'       g   \        R	VP                  RR7       \        V 4       V'       d   \        V 4       V! V 4      P                  4       '       g	   V! V 4      MRpV! 4        VP                  VRV RR
7       \        V 4       Ve   R# R F  p	W	,          P                  RR7       K  	  R# )zúCommit the tree's dependency generation; *arm* also owes the tail afterwards.

*borrowed_from* names the data root that owns the checkout when this one only borrows
it: the sync is this root's own, but the checkout's update markers stay the owner's.
N)Úensure_tools_for_sync)Úruntime_facts_path)Úlegacy_selectionzThermes: preparing dependencies for this data root (the checkout's updates belong to z)...Trù   z1hermes: preparing dependencies for this update...r[   r‘   )r%  r&  )r  r,   Ú	pm.clientr?  rq   r@  Ú	pm.extrasrA  r  r  rb   rŠ   r`   rc   rd   r–   )
rI   r  r   r  r,   r?  r@  rA  Úextrasr»   s
   &$$       r
   r  r  2  sÖ   € ó ÛÝ/Ý2Ý*àÒ ÜÐdØ�˜tð%Ø+.¯:©:¸Tö	CçÜÐAÈÏ
É
ÐZ^Õ_Ü˜dÔ#ß
ô 	�tÔñ ,>¸dÓ+C×+KÑ+K×+MÒ+MÑ˜dÔ#ÐSW€Fñ ÔØ‡L�L� $°TÐVZ€LÔ[Ü" 4Ô(ØÒ Ùó CˆØ	�×Ñ¨ÐÖ-ó Cr   c               ó0   € V ^8„  d   QhRRRRRRRRRRR	R/# )
r   r  r   rI   rð   rx   ÚoriginalÚmoduler'   r   r   )r	   s   "r
   r   r   X  s<   € ÷ >ñ >Øð>Øð>Ø$-ð>Ø9Bð>ØLVð>àñ>r   c                óR  € . p^pV\        V4      8  d   W6,          pVR9   g   VP                  R4      '       g   MWVP                  V4       V^,          pVR9   g   KZ  V\        V4      8  g   Kl  VP                  W6,          4       V^,          pKŽ  R\        V4      : RV: R2pV^ ,          R8X  d   RW6^,           ,          : R2p	MEV'       d   VR8w  d	   R	V: R
2p	M.R\        \	        V^ ,          4      P                  4       4      : R2p	\        V 4      .VORNRNW‰,           N# )zÚRe-enter the same script/module/launcher with the managed interpreter.

An old venv may use a different Python ABI. Do not add the new generation
to that interpreter, and do not depend on its obsolete editable finder.
ú-cÚ-z&import sys, runpy; sys.path.insert(0, z); sys.argv = r+   zexec(Ú)Ú__main__zrunpy.run_module(z&, run_name='__main__', alter_sys=True)zrunpy.run_path(z, run_name='__main__')r.  )rI  z-mz--rJ  )z-Wz-X)rG   Ú
startswithr¾   rf   r   Úabsolute)
r  rI   rð   rF  rG  ÚoptionsÚindexÚoptionÚprefixÚbodys
   &&&&&     r
   Úrelaunch_commandrT  X  s  € ð €GØ€EØ
”#�h“-Ô
Ø•ˆØÐ,Ô,°F×4EÑ4EÀc×4JÒ4JØØ�‰�vÔØ��
ˆØ�\Ö! e¬c°(«mÖ&;Ø�N‰N˜8�?Ô+Ø�Q�JŠEØ5´c¸$³i±]À.ÐQUÑPXÐXZÐ[€FØˆA…w�$„Ø�x¨¥	Õ*Ñ-¨QÐ/‰ß	�F˜jÔ(Ø" 6¡*Ð,RÐS‰ð !¤¤T¨$¨q­'£]×%;Ñ%;Ó%=Ó!>Ñ AÐAWÐXˆÜ�‹KÐ=˜'Ð= 4Ð=¨Ð=¨v­}Ð=Ð=r   c               ó    € V ^8„  d   QhRRRR/# )r   rð   zlist | Noner   r—   r   )r	   s   "r
   r   r   x  s   € ÷ $ñ $ˆ{ð $ cñ $r   c                óF  € \         P                  ! R R7      pVP                  RRR7       VP                  RRRR7       VP                  R	RR
7       VP                  V 4      p\	        VP
                  '       d   \        VP
                  4      MRVP                  R7      pVP                  '       d!   \        \        P                  ! V4      4       M=VP                  R4      '       d   RVR,           R2MRp\        RVR,           V 24       VR,          '       d   ^ # ^# )zhermes_cli.venv_sync)Úprogz--project-rootN)Údefaultz--checkÚ
store_truezreport; change nothing)ÚactionÚhelpz--json)rZ  )rN   rX   z (rK  rÖ   zvenv sync: rT   r?   )ÚargparseÚArgumentParserÚadd_argumentÚ
parse_argsrh   r   r   rN   Újsonr  Údumpsr   )rð   ÚparserÚargsrL   rX   s   &    r
   Úmainrd  x  sý   € Ü×$Ò$Ð*@ÔA€FØ
×ÑÐ(°$ÐÔ7Ø
×ÑØ˜,Ð-Eð ô ð ×Ñ˜¨ÐÔ6Ø×Ñ˜TÓ"€DäØ#'×#4×#4Ð#4ŒˆT×ÑÔ¸$ÀdÇjÁjô€Fð ‡y‡y€yÜŒd�jŠj˜Ó Õ!à-3¯Z©Z¸×-AÒ-A�2�f˜XÕ&Ð' qÑ)ÀrˆÜ�˜F 7�OÐ,¨V¨HÐ5Ô6Ø�t—”ˆ1Ð# !Ð#r   rL  r(  >   ú-Vú-hú--helpú	--versioni„  )*Ú__doc__Ú
__future__r   r\  r`  rº   Ú
subprocessÚpathlibr   r   r   r   r%   r1   rM   rh   rd   Ú	frozensetr  r|   r€   rŠ   r£   r§   r¢   rŽ   rœ   r¬   r¯   rb   rÐ   rÒ   rã   rî   r  r
  r  r  rT  rd  rD   Ú
SystemExitr   r   r
   Ú<module>ro     s  ðñõ #ã Û Û 	Û Ý å 0õ/õõ:Gð"X¸D÷ XñDD¸E÷ Dð Dõ8eñ4 Ò?Ó@€õ0õ
	Iõð %&Ð !Ø#*Ð  Ø !Ð õYõð,H°d÷ HõD<õ
ñD Ð1Ð3IÐJÓK€õ[õ
õ4õ4tõn 7õF>ðB#.ÐUY÷ #.õL>÷@$ð* ˆzÔÙ
‘T“VÓ
Ðñ r   