---
description: "MANDATORY verification after code changes — IronBee enforcement (per-cycle verification gate)"
alwaysApply: true
---

You MUST verify all code changes through real tools before completing any task. After every verification attempt, you MUST submit a verdict (pass or fail) via `ironbee hook submit-verdict` before doing anything else. If verification fails, submit the fail verdict first, then fix.

Verification runs in **cycles** decided by file-pattern match — you don't choose, the gate detects. Multiple cycles can run in parallel within a single stop hook; each one has its own activation patterns, tools, and verdict fields.

**See the platform sections near the bottom of this file** for which cycles are active for this project, the tools they expose, and the per-cycle verdict fields you must include.

## Application lifecycle

You manage the running application during verification:
- **Build** if needed (e.g. `npm run build`, `docker compose build`).
- **Start** before navigating/connecting (e.g. `npm run dev`, `docker compose up -d`).
- **Stop** the dev server after verification is complete.

Skip start if already running. Fix build errors before proceeding. **Don't guess ports** — check actual via `docker compose ps`, process output, or config.

## Required steps

1. Build and start the application if not already running.
2. **Start verification**: `echo '{"session_id":"<your-session-id>"}' | ironbee hook verification-start` — required before any devtools tool call.
3. **Run the per-cycle flow for every active cycle** — see the platform sections near the bottom of this file. Multiple cycles can be active in the same stop run; every one of them must be exercised within this single verification cycle.
4. Stop the dev server when done — every cycle, including the final one.
5. **Honor any cycle-specific teardown** noted in the platform sections BEFORE submit-verdict.
6. **IMMEDIATELY submit your verdict** — do NOT edit any code before submitting: `echo '<verdict-json>' | ironbee hook submit-verdict`.
   - Platform-agnostic shape: `status`, `checks` (always required); add `issues` on fail; add `fixes` on pass-after-fail. One verdict regardless of how many cycles ran.

The stop hook checks tool usage for every active cycle and that the verdict carries non-empty `checks`. After EVERY verification attempt, you MUST submit a verdict before doing anything else — even if it failed. Do not skip to fixing code.

If verification fails: submit fail verdict → fix the code → re-verify → submit again.

Every file edit automatically clears your verdict, requiring re-verification.

## BANNED

- Writing `verdict.json` directly — always use `ironbee hook submit-verdict`.
- Skipping the fail verdict — always submit fail before fixing, so issues are tracked.
- Submitting a verdict without actually performing verification through real tools.
- Submitting a verdict based on assumptions, code reading, or prior knowledge.
- Copying example verdicts from hook messages without doing real verification first.
- Calling devtools tools for any cycle without first opening a verification cycle (`ironbee hook verification-start`).

<!--IRONBEE:PLATFORM:browser-->
<!--/IRONBEE:PLATFORM:browser-->

<!--IRONBEE:PLATFORM:node-->
<!--/IRONBEE:PLATFORM:node-->

<!--IRONBEE:PLATFORM:backend-->
<!--/IRONBEE:PLATFORM:backend-->

<!--IRONBEE:PLATFORM:android-->
<!--/IRONBEE:PLATFORM:android-->

<!--IRONBEE:PLATFORM:terminal-->
<!--/IRONBEE:PLATFORM:terminal-->
