+
    iHàj™$  ã                  ó  € R t ^ RIHt ^ RIt^ RIt^ RIHt ^ RIHtH	t	 ^ RI
Ht ^tRt]! 0 Rm4      t]! 0 Rm4      t0 Rmt0 R m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 R ltR^ R^/R R lltRR.tR# )"zéTurn-end verification guard for coding edits. Policy-only: it never runs
checks itself, it turns the passive verification ledger into a bounded follow-up
when the model tries to finish right after editing code without fresh evidence.)ÚannotationsN)ÚPath)ÚAnyÚIterable)Úelidei°  c               ó    € V ^8„  d   QhRRRR/# )é   ÚrawÚstrÚreturnÚbool© )Úformats   "Ú</home/ubuntu/.hermes/hermes-agent/agent/verification_stop.pyÚ__annotate__r       s   € ÷ rñ r˜3ð r 4ñ ró    c                ó  €  \        \        V 4      4      pTP                  P	                  4       pT\
        9   ;'       g1    T'       * ;'       d"    TP                  P	                  4       \        9   #   \         d     R# i ; i)zGTrue when a changed path is documentation/prose with nothing to verify.F)r   r
   Ú	ExceptionÚsuffixÚlowerÚ_NON_CODE_VERIFY_EXTENSIONSÚnameÚ_NON_CODE_VERIFY_FILENAMES)r	   Úpr   s   &  r   Ú_is_non_code_pathr       sh   € ðÜ”�S“‹Nˆð �X‰X�^‰^Ó€FØÔ0Ñ0×qÐq¸´Z×5pÐ5pÀAÇFÁFÇLÁLÃNÔVpÑDpÐqøô ô Úðús   ‚A1 Á1B Á?B c               ó   € V ^8„  d   QhRR/# )r   r   r   r   )r   s   "r   r   r   *   s   € ÷ ñ  tñ r   c                 óB   €  ^ RI Hp  V ! 4       #   \         d     R# i ; i)z“Whether this turn is delivered over a human messaging channel. An
unreachable gateway package means no messaging channel (verify-on-stop stays on).©Úsession_is_messaging_surfaceF)Úgateway.session_contextr   r   r   s    r   Ú_session_is_messaging_surfacer    *   s%   € ðÝHá+Ó-Ð-øÜô Úðús   ‚ ��c               ó    € V ^8„  d   QhRRRR/# )r   Úconfigzdict[str, Any] | Noner   r   r   )r   s   "r   r   r   5   s   € ÷ #ñ #Ð#8ð #ÀDñ #r   c                ón  € \         P                  P                  R4      pVe&   VP                  4       P	                  4       \
        9  # V f    ^ RIHp V! 4       p \        V \        4      '       d   T ;'       g    / P                  R4      MRp\        V\        4      '       d   VP                  R4      MRp\        V\        4      '       d   V# \        V\        4      '       d   VP                  4       P	                  4       MRpVR8X  d   \        4       '       * # V\        9   #   \         d    / p  LØi ; i)a¬  Return whether edit -> verify-before-finish behavior is enabled.

Precedence: ``HERMES_VERIFY_ON_STOP`` env var, then ``agent.verify_on_stop``
config; default OFF (opt-in). A bool forces the behavior; ``"auto"`` is the
legacy surface-aware mode: ON for interactive coding surfaces and
programmatic callers, OFF for messaging surfaces where the verification
narrative is chat noise. Missing/unrecognized values fall back to OFF.
ÚHERMES_VERIFY_ON_STOPN)Úload_config_readonlyÚagentÚverify_on_stopÚ Úauto)ÚosÚenvironÚgetÚstripr   Ú_FALSY_TOKENSÚhermes_cli.configr%   r   Ú
isinstanceÚdictr   r
   r    Ú_TRUTHY_TOKENS)r"   Úenvr%   Ú	agent_cfgÚcfg_valÚtokens   &     r   Úverify_on_stop_enabledr7   5   s÷   € ô �*‰*�.‰.Ð0Ó
1€CØ
‚Ø�y‰y‹{× Ñ Ó"¬-Ñ7Ð7Ø‚~ð	Ý>á)Ó+ˆFô 0:¸&Ä$×/GÒ/G�—�˜2×"Ñ" 7Ô+ÈT€IÜ1;¸IÄt×1LÒ1Lˆi�m‰mÐ,Ô-ÐRV€GÜ�'œ4× Ò ØˆÜ'1°'¼3×'?Ò'?ˆG�M‰M‹O×!Ñ!Ô#ÀR€EØ�„Ü0Ó2Ô2Ð2Ø”NÑ"Ð"øô ô 	ØŠFð	ús   ÁD$ Ä$D4Ä3D4c               ó    € V ^8„  d   QhRRRR/# )r   ÚpathsúIterable[str]r   z
list[Path]r   )r   s   "r   r   r   R   s   € ÷ 	#ñ 	#˜=ð 	#¨Zñ 	#r   c                óX  € / p\        RV 4       Fg  p \        V4      P                  4       pTP                  \	        VP                  4       '       d   TMVP                  P                  4       4      4       Ki  	  V Uu. uF  p\        V4      NK  	  up#   \         d     K”  i ; iu upi )zODistinct resolved directories (a file's parent) for the edited paths, in order.N)	Úfilterr   Ú
expanduserÚ
setdefaultr
   Úis_dirÚparentÚresolver   )r9   Úseenr	   Úpathr   s   &    r   Ú_candidate_cwdsrD   R   sŠ   € à€DÜ�d˜EÖ"ˆð	Ü˜“9×'Ñ'Ó)ˆDØ�O‰OœC¨¯©¯ª¡¸D¿K¹K× PÑ PÓ RÓSÖTñ #ñ "Ó"™T˜ŒD�ŽG™TÑ"Ð"øô ô 	Úð	üâ"s   “A#BÁ>B'ÂB$Â#B$c               ó$   € V ^8„  d   QhRRRRRR/# )r   Ú
session_idú
str | NoneÚchanged_pathsú	list[str]r   z,tuple[dict[str, Any], dict[str, Any]] | Noner   )r   s   "r   r   r   ^   s$   € ÷ ñ ØðØ.7ðà1ñr   c                ó  €  ^ RI Hp ^ RIHp Rp\        T4       FY  pT! T4      pT'       g   K  T! YR7      pT;'       g    Yv3p\        TP                  R4      ;'       g    R4      R8w  g   KV  Yv3u # 	  T#   \         d     R# i ; i)zƒ``(status, facts)`` for the first edited workspace needing proof, else the
first recognized workspace when every one is ``passed``.)Úproject_facts_for)Úverification_statusN)rF   ÚcwdÚstatusÚ
unverifiedÚpassed)Úagent.coding_contextrK   Úagent.verification_evidencerL   r   rD   r
   r,   )rF   rH   rK   rL   Úfirst_snapshotrM   ÚfactsrN   s   $$      r   Ú_verification_snapshotrU   ^   s�   € ð
Ý:ÝCð DH€NÜ˜}Ö-ˆÙ! #Ó&ˆßÙÙ$°
ÔDˆØ'×:Ð:¨F¨?ˆÜˆv�z‰z˜(Ó#×3Ð3 |Ó4¸Ö@Ø�=Ò ñ .ð Ðøô ô Úðús   ‚A: Á:B	ÂB	c               ó    € V ^8„  d   QhRRRR/# )r   r9   rI   r   r
   r   )r   s   "r   r   r   u   s   € ÷ ñ  ð ¨sñ r   c                óà   € V R \           Uu. uF	  pRV R2NK  	  pp\        V 4      \         8”  d*   VP                  R\        V 4      \         ,
           R24       RP                  V4      # u upi )Nz- `Ú`z
- ... and z moreÚ
)Ú_MAX_CHANGED_PATHS_IN_NUDGEÚlenÚappendÚjoin)r9   rC   Úliness   &  r   Ú_format_changed_pathsr_   u   sk   € Ø',Ð-IÔ.IÑ'JÓKÑ'J˜tˆs�4�&˜‹]Ñ'J€EÐKÜ
ˆ5ƒzÔ/Ô/Ø�‰�z¤# e£*Ô/JÕ"JÐ!KÈ5ÐQÔRØ�9‰9�UÓÐùò Ls   ŒA+c               ó    € V ^8„  d   QhRRRR/# )r   Úrootr   r   r   r   )r   s   "r   r   r   |   s   € ÷ ñ ¨ð °ñ r   c                ó
  € V '       g   R#  ^ RI Hp ^ RIHp \	        \        V 4      4      pV! V4      P                  4       '       d   R# V! V4      p\        VRJ;'       d    VP                  4      #   \         d     R# i ; i)uË   Whether ``hermes verify`` has a runtime recipe here: a saved
``.hermes/environment.json`` or a statically detected recipe with a start
command. Fail-silent and cheap â€” it only decorates the nudge text.F)Úmanifest_path)Údetect_recipeTN)
Úagent.verify.environmentrc   Úagent.verify.recipesrd   r   r
   Úis_filer   Ústartr   )ra   rc   rd   Ú	root_pathÚrecipes   &    r   Ú_workspace_has_runnable_reciperk   |   sq   € ÷ Ùð
Ý:Ý6äœ˜T›“Oˆ	Ù˜Ó#×+Ñ+×-Ò-ÙÙ˜yÓ)ˆÜ�F $Ð&×7Ð7¨6¯<©<Ó8Ð8øÜô Úðús   Œ<A3 Á
A3 Á"A3 Á3BÂBc               ó    € V ^8„  d   QhRRRR/# )r   rN   zdict[str, Any]r   r
   r   )r   s   "r   r   r   �   s   € ÷ ñ ˜>ð ¨cñ r   c                ó@  € \        V P                  R 4      ;'       g    R4      p\        V P                  R4      \        4      '       d   V P                  R4      MRpV'       g   V# VP                  R4      ;'       g    VP                  R4      p\        VP                  R4      ;'       g    R4      P	                  4       pV.pV'       d   VP                  RV R	24       V'       d%   \        V\        4      pVP                  R
V 24       RP                  V4      # )rN   rO   ÚevidenceNÚcanonical_commandÚcommandÚoutput_summaryr(   zlast command `rX   zlast output:
rY   )	r
   r,   r0   r1   r-   r\   r   Ú_MAX_STATUS_SUMMARY_CHARSr]   )rN   Ústatern   rp   ÚsummaryÚpartss   &     r   Ú_status_detailrv   �   sá   € Ü�—
‘
˜8Ó$×4Ð4¨Ó5€EÜ)3°F·J±J¸zÓ4JÌD×)QÒ)Qˆv�z‰z˜*Ô%ÐW[€HßØˆà�l‰lÐ.Ó/×JÐJ°8·<±<À	Ó3J€GÜ�(—,‘,Ð/Ó0×6Ð6°BÓ7×=Ñ=Ó?€GØˆG€EßØ�‰�~ g Y¨aÐ0Ô1ßÜ˜Ô!:Ó;ˆØ�‰�~ g YÐ/Ô0Ø�9‰9�UÓÐr   ÚattemptsÚmax_attemptsc          
     ó,   € V ^8„  d   QhRRRRRRRRRR/# )	r   rF   rG   rH   r:   rw   Úintrx   r   r   )r   s   "r   r   r       s;   € ÷ Cñ CØðCØ.;ðCØGJðCØ\_ðCàñCr   c           	     ó  € \        V Uu0 uF*  qD'       g   K  \        V4      '       d   K  \        V4      kK,  	  up4      pV'       d   W#8¼  d   R# \        WR7      pVf   R# Vw  rx\        VP	                  R4      ;'       g    R4      R8X  d   R# VP	                  R4      ;'       g    .  U	u. uF=  p	\        V	4      P                  4       '       g   K$  \        V	4      P                  4       NK?  	  p
p	\        VP	                  R4      4      p ^ RIHp V! 4       pV'       d   R	V 2MR
pV
'       dY   RRP                  R V
R,           4       4      ,           \        V
4      ^8”  d   RMR
,           R,           pV'       d
   VR,          pMCV'       d   RpM8\        P                  P                  \        P                   ! 4       4      pRV R2pR\#        V4       R\%        V4       R	V RV R2	# u upi u up	i   \         d    Rp Lìi ; i)zGReturn a synthetic follow-up when edited code lacks fresh verification.N)rF   rH   rN   rO   rP   ÚverifyCommandsra   )Úcoding_verify_guidancez

r(   z+Run the relevant verification command now (z, c              3  ó.   "  € T F  pR V R 2x € K  	  R# 5i)rX   Nr   )Ú.0Úcmds   & r   Ú	<genexpr>Ú-build_verify_on_stop_nudge.<locals>.<genexpr>¾   s   é € ÐBÑ.A s˜!˜C˜5 �
Ó.Aùs   ‚:Né   Nz, ...z@), read any failure, repair the code, and summarize what passed.u°    For a full check including a runtime boot (build + test + start + readiness), prefer `hermes verify --json` â€” a passing run records verification evidence for this workspace.a4  No canonical test/lint/build command was detected, but the project has a runnable verification recipe. Run `hermes verify --json` (detect -> build -> test -> boot -> readiness poll); a passing run records verification evidence for this workspace. Read any failure, repair the code, and summarize what passed.ziNo canonical test/lint/build command was detected. Create a focused temporary verification script under `z×` using an OS-safe `tempfile` path with a `hermes-verify-` filename prefix, run it against the changed behavior, clean it up when possible, and summarize it explicitly as ad-hoc verification rather than suite green.z†[System: You edited code in this turn, but the workspace does not have fresh passing verification evidence yet.

Verification status: z

Changed paths:
zn If verification is not possible, explain the concrete blocker instead of claiming the work is fully verified.Ú])Úsortedr   r
   rU   r,   r-   rk   Úagent.verify_hooksr}   r   r]   r[   r*   rC   ÚrealpathÚtempfileÚ
gettempdirrv   r_   )rF   rH   rw   rx   r   r9   ÚsnapshotrN   rT   r€   Úverify_commandsÚ
has_reciper}   ÚguidanceÚaddendumÚcommand_instructionÚtemp_dirs   $$$$             r   Úbuild_verify_on_stop_nudger‘       s  € ô
 ¡MÓT¡M˜q³Q”FÔ?PÐQR×?S”F”C˜–F¡MÑTÓU€Eß�HÔ,Ùä%°ÔQ€HØÒÙØ�M€FÜ
ˆ6�:‰:�hÓ×/Ð/ <Ó0°HÔ<ÙØ49·I±IÐ>NÓ4O×4UÐ4UÐSUÐ4UÓkÑ4U¨CÔZ]Ð^aÓZb×ZhÑZh×ZjÔ'”s˜3“x—~‘~Ö'Ñ4U€OÐkÜ/°·	±	¸&Ó0AÓB€JðÝ=á)Ó+ˆ÷ %-��h�ZÑ °"€Hçà9Ø�i‰iÑB¨o¸bÖ.AÓBÓBõCä˜oÓ.°Ô2‰w¸õ<ð QõQð 	÷ ØðHõÐø÷
 
ðLñ 	ô —7‘7×#Ñ#¤H×$7Ò$7Ó$9Ó:ˆð4Ø4<°:ð >ðð 	ð	 ä .¨vÓ 6Ð7ð 8Ü0°Ó7Ð8¸ØÐ
ð  Kàˆ*�Að	ðùòm Uùò løô ô ØŠðús-   Š	G/˜G/«G/Â/!G4ÃG4ÄG9 Ç9H	ÈH	r‘   r7   >   ú.mdú.csvú.logú.mdxú.orgú.rstú.tsvú.txtú.adocú.textú	.asciidocú	.markdown>   ÚnoticeÚauthorsÚlicenceÚlicenseÚ	changelogÚ
codeownersÚcontributors>   Ú0ÚnoÚoffÚfalse>   Ú1ÚonÚyesÚtrue)N)Ú__doc__Ú
__future__r   r*   rˆ   Úpathlibr   Útypingr   r   Úagent.compression_markerr   rZ   rr   Ú	frozensetr   r   r.   r2   r   r    r7   rD   rU   r_   rk   rv   r‘   Ú__all__r   r   r   Ú<module>r´      s¨   ðñSõ #ã 	Û Ý ß  å *ð  Ð Ø Ð ñ
 (ÚoóÐ ñ 'ÚZóÐ ò ,€Ú+€õrõ÷#õ:	#õõ.õõ&ð"CØKLðCØ`a÷CðL (Ð)AÐ
B‚r   