
    `gjU
                    \    d Z ddlmZ ddlmZmZ ddlmZ dZdZ	dddZ
ddd	Zdd
Zg dZy)u  Verification-loop helpers for the ``pre_verify`` round-end gate.

When the agent has edited code and is about to verify/finish, the loop fires the
``pre_verify`` hook (user directives resolved by
:func:`hermes_cli.plugins.get_pre_verify_continue_message`). A directive keeps
the agent going one more turn — run a check, defer it, tidy the diff — instead of
stopping immediately.

The shipped coding guidance lives on the evidence-based verification-stop nudge
(``agent/verification_stop.py``), not as a second default stop gate. That keeps
the default token cost tied to the existing "missing verification evidence"
decision while preserving ``pre_verify`` for user/plugin policy.
    )annotations)AnyOptional)is_truthy_value   a`  [Coding] Before you run tests/linters or call this done: if this is creative UI/visual work, hold off on tests and linters until the user says they like the result or you're about to commit. And before every commit, clean your work: keep it KISS/DRY, match the surrounding code style, and be elitist, shorthand, clever, concise, efficient, and elegant.Nc                    t        |       }|j                  d      }	 t        dt        |            S # t        t
        f$ r	 t        cY S w xY w)zHBound on consecutive ``pre_verify`` continue directives per turn (>= 0).max_verify_nudgesr   )
_agent_cfggetmaxint	TypeError
ValueErrorDEFAULT_MAX_VERIFY_NUDGES)config	agent_cfgraws      E/root/.hermes/venv/lib/python3.12/site-packages/agent/verify_hooks.pyr	   r	   #   sK    6"I
--+
,C)1c#hz" )(()s   3 A
Ac                \    t        t        |       j                  dd      d      syt        S )zBReturn the optional guidance appended to verification-stop nudges.verify_guidanceT)defaultN)r   r
   r   CODING_VERIFY_GUIDANCE)r   s    r   coding_verify_guidancer   -   s)    :f-112CTJTXY!!    c                    | 	 ddl m}  |       } t        | t              r| xs i j                  d      nd }t        |t              r|S i S # t        $ r i } Y Hw xY w)Nr   )load_configagent)hermes_cli.configr   	Exception
isinstancedictr   )r   r   r   s      r   r
   r
   4   sa    ~	5 ]F 0:&$/G2""7+TI"9d39;;  	F	s   A AA)r   r   r   r	   )N)r   Optional[dict[str, Any]]returnr   )r   r"   r#   zOptional[str])r   r"   r#   zdict[str, Any])__doc__
__future__r   typingr   r   utilsr   r   r   r	   r   r
   __all__ r   r   <module>r*      s<    #   ! C )"	<r   