<!-- Terminal verification is ENABLED for this project. -->

## Terminal Mode (when `terminal.verifyPatterns` matches an edited file)

> **Precondition: the change must have terminal-observable behavior.** If the change is a web-only UI with no command-line / REPL / TUI surface, this section does NOT apply — `tdt_*` tools spawn a program attached to a PTY. Just do browser verification.

If the project has terminal verification enabled (`ironbee terminal enable` once at setup) and your edits touch matching paths, the Stop hook also enforces a terminal cycle. The same `verification-start` covers both cycles; one platform-agnostic verdict covers both.

### Mode behavior (terminal cycle)
- **default** (no arg or `default`): exercise only the commands / code paths your diff touched.
- **full**: exercise every terminal-reachable code path from files matching `terminal.verifyPatterns`.
- `visual` / `functional`: browser-only modes; terminal cycle behaves as `default` when they are passed.

### Steps (run within step 3 of the Universal steps above)
1. **Pick an evidence path** for the changed code:
   - **Run-evidence** (proves a non-interactive command works): run the affected command one-shot with `mcp__terminal-devtools__tdt_pty_run` — it spawns the command attached to a PTY, runs it to completion, and returns the FULL output plus exit code. Confirm the output shows the expected result AND the exit code matches expectation. Best for CLIs, build targets, scripts, and test runs.
   - **Interactive-evidence** (proves a REPL / shell / TUI change works):
     - Spawn the program: `mcp__terminal-devtools__tdt_pty_start` (returns a `paneId`).
     - Drive input: `mcp__terminal-devtools__tdt_interaction_send-keys` (tmux key syntax — `Enter`, `C-c`, `Up`, `Tab`, …) and `mcp__terminal-devtools__tdt_interaction_send-text` (literal text).
     - Synchronize before reading: `mcp__terminal-devtools__tdt_sync_wait-for` (block until the expected output appears — prefer over delays).
     - Capture output: `mcp__terminal-devtools__tdt_content_capture` — `mode: stream` for line-oriented programs (REPLs, shells; incremental `since` cursor reads only new lines), `mode: screen` for full-screen TUIs. Confirm it shows the expected result.
     - Stop the pane: `mcp__terminal-devtools__tdt_pty_stop`.
     - Auxiliary (NOT gate evidence): `mcp__terminal-devtools__tdt_sync_wait-for-idle`, `mcp__terminal-devtools__tdt_content_get-cursor`, `mcp__terminal-devtools__tdt_pty_resize`, `mcp__terminal-devtools__tdt_pty_signal`, `mcp__terminal-devtools__tdt_pty_list`.
2. **Submit verdict** — platform-agnostic, just status + checks (+ issues/fixes).

### Verdict (platform-agnostic)
```json
{
  "session_id": "...",
  "status": "pass",
  "checks": ["`mycli build` exits 0 with the new summary line", "REPL `:help` lists the new command"]
}
```

For a multi-cycle pass, both browser and terminal pass criteria must hold.

---

## Default Mode (terminal cycle)

Focus on the commands or code paths your diff touched — not the entire program.

### 1. Study the changes
1. Run `git diff --name-only` and `git diff --name-only HEAD~1`
2. **Ignore `.ironbee/`, `.claude/`, `.cursor/`** — tool config, not application code
3. **Read the full diff** for every terminal file in scope — note new commands, changed flags, new output lines, changed exit codes, new REPL/TUI behavior
4. Before spawning, identify: which command / subcommand / REPL command / TUI screen is affected? What input exercises it? What output / exit code proves it works?

### 2. Verify against the running program
- **Run-evidence**: run the affected command via `tdt_pty_run`; the output must show the expected result and the exit code must match expectation
- **Interactive-evidence**: spawn the program, drive the affected input flow (send-keys / send-text), wait for the expected output (`tdt_sync_wait-for`), and capture it (`tdt_content_capture`) — the capture must show the expected state after your change

---

## Full Mode (`$ironbee-verify full`, terminal cycle)

Verify every terminal-reachable code path from files matching `terminal.verifyPatterns`, not just the changed files. Do NOT run `git diff` or scope to recent changes.

- Exercise every command / subcommand / REPL command / TUI screen in scope
- Drive at least one happy-path flow AND one error-path flow per command (confirm both the success output/exit `0` and the expected failure output/non-zero exit)
- Capture output (run-evidence or interactive-evidence) for each path; no unexpected crashes or stack traces
