Let an assistant verify its own change
Before you begin
- Plan
- Included in Pro and Team. How plans and limits work
- Role
- Viewer or higher to read a report and Editor or higher to cancel a run.
- You need
- An assistant [connected to MockHub](/guides/ai-assistants/connect/) with a token that can create preview environments, and a verification suite as in [Verify an application against a mock dependency](/guides/cli/verify-an-application/)
A coding assistant that changes your application can check the change against the same suite your pipeline uses. The assistant runs the application and the CLI through its own tools on your machine, because MockHub cannot reach a process there. It then reads the report through MockHub to see what held.
-
Ask the assistant to run the suite with the CLI, for example: Change the checkout so it retries a failed payment three times with the same idempotency key, then run
mockhub verify run --file mockhub.verification.yaml --before-case ./point-app-at-dependency.sh --jsonand tell me the verdict. The command exits0forpassed,1for a failed assertion and2for anything else. -
Ask it to read the report if the verdict is not
passed: Get the verification report for the last run and explain which assertion failed or could not be decided. The assistant reads the run withlist_verification_runsandget_verification_report. -
Ask it to fix the application, not the suite, and run it again. A suite whose assertions were loosened to make a change pass proves nothing, so review any change to
mockhub.verification.yamlyourself.
What the assistant sees
Section titled “What the assistant sees”The report summary holds the verdict, each case’s outcome and observation window, and each assertion’s outcome, whether MockHub observed the evidence or the runner reported it, the expected and observed values, and the reason a result could not be decided. It lists the number of calls the dependency received, not the calls themselves. The assistant also sees the reasons a result may not repeat, such as the cases running one after another.
An inconclusive verdict is not a pass: it means MockHub could not decide, for example because a result was not reported or a call could not be accounted for. Ask the assistant to say so rather than to retry until the verdict changes.
Stop a run
Section titled “Stop a run”cancel_verification_run closes a run that is still going and deletes its preview environments. A run that nobody finishes is cancelled by MockHub after its lease runs out, and always within 15 minutes.
Limits
Section titled “Limits”- The assistant cannot start a run through MockHub. It starts one with the CLI on your machine.
- It sees your own runs with a personal token, or the runs its machine token created. An Admin or Owner sees every run.
- A report is kept for the time your plan allows, then it is gone.