Skip to main content
After a refactor, you want to know two things: did the code actually get better, and did anything break? A file can look shorter because statements were squeezed onto fewer lines, and a moved function can leave another file importing something that no longer exists. Verification answers both questions. It compares your edited code with a saved copy from before you started, called the baseline, and gives one of three verdicts. Putting the same code on fewer lines does not count as an improvement.

Acting on the results

When verification finds a problem, it also gives a correction: the problems to fix and any checks that could not run. You can pass it to your coding agent.

Verification checks

Compare saved code and settings with current code, check for real improvement and new problems, then read the verdict.Compare saved code and settings with current code, check for real improvement and new problems, then read the verdict.

Verification compares the saved starting point with the code after your edits.

A helper is a new file or function that takes over some of the original work. Verification checks changed helpers as well as the original file. Imports and exports are the connections that let those files use each other’s code. In short, verification looks for a real improvement in the measure that was failing, and for new problems: imports that no longer work, import loops, removed exports that other files still use, files it cannot read, and new findings. Each check has an ID, listed below.

Checks reference

The comparison covers added, changed and deleted source files, even a new helper the caller did not mention. Each helper is checked with the settings that apply to it. Findings are compared one by one, including their severity. Keeping the same total number of findings does not hide a finding that has changed.

Packing detection

A shorter file is not necessarily simpler. Joining several statements onto one line hides the length without reducing the work the code does. Iris Code calls this packing. Tokens are the pieces of code, such as names and operators. Comparing how much the line count and token count fall helps tell removed work apart from squeezed formatting. For example, if code lines fall from 100 to 50 but tokens only fall from 1,000 to 950, the ratio is 0.05 / 0.50 = 0.10. The default threshold is 0.6, so that reduction is put down mainly to packing. The verdict reports how many lines it attributes to packing and the ratio used. Verification counts code lines without comments. Ordinary file-length findings still count total lines, as before. The exact result of an offered mechanical fix is exempt from the packing penalty. Iris Code checks, against the saved starting point, that the whole file matches either one offered fix or the complete batch. Extra edits or line packing do not qualify. The exemption does not skip the other checks. Broken imports, removed exports, code that cannot be analysed and new findings are still reported.

Baselines

The baseline is the copy of the code that verification compares with. Where it comes from depends on where you got the plan. The editor and the MCP server (the connection a coding agent uses to call Iris Code tools) can keep the plan’s copy in memory. A separate CLI command cannot: once that command ends, its copy is gone. The CLI therefore normally compares your edits with your last commit, called Git HEAD. In plain terms: an MCP plan’s copy lasts only while that server runs, and an agent cannot supply its own “before” file. An editor plan includes your unsaved changes and lasts until the editor closes. An unknown baseline ID is refused rather than quietly replaced with your last commit. Every verdict reports disabledChecks and packingRatioUsed, so you can see when switched-off checks left less to go on.

Settings are saved with the plan

The saved starting point also keeps the plan’s refactor settings, including maxCorrections and the verification switches. Changing those settings afterwards cannot make the same plan easier to pass. The result shows policyChangedSincePlan: true when those settings change. Get a new plan to use the new settings. Permission for an agent to use Iris Code is still checked on every call. Your analysis settings decide which problems Iris Code reports. Loosening a threshold or turning off a detector could hide a problem the edit introduced. So if an applicable .irisconfig.json is changed, added or removed after an editor or MCP plan, verification reports regressed and configChangedSincePlan: true. Restore the config or get a new plan before verifying again. A comparison against your last commit works differently: it treats a config edit as part of your uncommitted work.

Restricted folders

Over MCP, a changed file in a folder where the agent handoff is off is left out of the results and the correction. The result shows only how many were withheld, as withheldByPolicy, and the verdict still counts them.

Limits

Verification gives advice; it cannot prove that the program still behaves exactly the same. Run your tests as well. A regressed verdict does not make the CLI command exit with an error code. Read the verdict rather than treating a successful command as a successful refactor. Invalid arguments and baseline errors still fail the command. Corrections name the problems to address and any checks that could not run.