Workflows

Verify Code Changes

How to use Munk AI to automatically verify the behavioral impact of your code changes locally or in CI.

Munk AI goes beyond static analysis. The verify change workflow turns your code modifications into a structured, executable verification run. It launches your app, performs the necessary actions to cover your changes, and validates that the intended behavior works without breaking nearby features.

Why use this?

  • Before Merge: Gain confidence that your PR actually works on a real browser or device.
  • For Coding Agents: A machine-friendly way for AI coding assistants to validate their own implementation.
  • Actionable Feedback: Get structured findings, execution traces, and screenshots instead of generic "looks good to me" comments.

Prerequisites

Before running a verification, ensure:

  1. Munk CLI is installed and configured.
  2. Your target environment is ready (e.g., local web dev server is running on localhost:3000, or an Android emulator is booted).

Quick Example

The recommended way to verify a change is by passing a JSON request file. This keeps your configuration reproducible and avoids complex shell escaping.

munk verify change \
  --request-file ./verify-request.json \
  --config ./munk.yaml

The Request File (verify-request.json)

The request file defines what changed and what cases to verify. Here is a minimal, copy-pasteable example for a Web application:

{
  "app_id": "munk-web-site",
  "change_summary": "Fix docs page navigation after header refactor",
  "app_target": {
    "app_id": "munk-web-site",
    "platform": "web",
    "web": {
      "base_url": "http://127.0.0.1:3000/",
      "origin": "http://127.0.0.1:3000"
    },
    "launch_context": {
      "browser": "chromium",
      "headless": "true"
    }
  },
  "provided_cases": [
    {
      "case_id": "docs-header-navigation-works",
      "title": "Docs header navigation works",
      "intent": "Verify the website can navigate from the homepage header into the Docs page after the header change.",
      "expected": [
        "The homepage loads successfully.",
        "Clicking the header Docs entry opens the Docs page.",
        "The resulting page shows Docs-specific content rather than the homepage hero."
      ],
      "runner_goal": "Open the website homepage, click the header Docs navigation entry, and verify the Docs page is shown."
    }
  ],
  "enable_plan_agent": false
}

Key Fields Explained

  • app_target: Tells Munk AI how to connect to your app. For Android, you would use "platform": "android" and specify the "package_name".
  • change_summary / changed_files: Context about what you just modified.
  • provided_cases: Explicit instructions on what to test. A strong debugging engineer writes cases covering the fix path (does it work?) and regression path (did it break anything nearby?).
  • enable_plan_agent: Set to true if you want Munk AI to autonomously plan additional regression coverage around your change. Set to false to strictly run your provided cases.

What Happens Next?

Once you execute the command, Munk AI will:

  1. Analyze the context: Read your change_summary and provided_cases.
  2. Launch the target: Open the Chromium browser (or Android app) defined in app_target.
  3. Execute & Observe: Perform the actions described in runner_goal and capture the screen state.
  4. Assert: Verify if the expected conditions are met.

After completion, Munk AI outputs structured artifacts in your workspace:

  • report.json: The final verification verdict (passed, failed, or inconclusive).
  • diagnostics.json: System logs and execution details.
  • artifact_manifest.json: Links to screenshots and traces collected during the run.