<!-- SPDX-License-Identifier: MIT -->
<!-- SPDX-FileCopyrightText: 2025-2026 Marcus Quinn -->

# t1364.3: Wire Verification into Pre-Edit-Check and Dispatch Pipeline

## Origin

- **Created:** 2026-02-28
- **Session:** claude-code:headless
- **Created by:** ai-interactive
- **Parent task:** t1364
- **Conversation context:** Decomposition of issue #2558 item 1. This subtask wires the verification system into the existing pipeline.

## What

Integration of parallel model verification into three pipeline points: pre-edit-check.sh, dispatch.sh, and full-loop. After this, high-stakes operations are automatically verified before execution.

## Why

The taxonomy (t1364.1) and mechanism (t1364.2) are useless without pipeline integration. This is the "last mile" that makes verification actually happen.

## How (Approach)

- **pre-edit-check.sh**: After branch check passes, source verify-operation-helper.sh and call `check_operation()` with the pending command/operation description. If high-stakes, invoke `verify_operation()`. Gate based on policy.
- **dispatch.sh**: Before `build_cli_cmd()`, check if the task description contains high-stakes indicators. If so, verify the task plan before committing a worker.
- **full-loop**: Add verification step before destructive git operations and production deployments. Interactive mode shows result and asks confirmation. Headless follows policy.
- **Documentation**: Update build.txt security section and AGENTS.md capabilities.

## Acceptance Criteria

- [ ] pre-edit-check.sh calls verification for high-stakes operations
  ```yaml
  verify:
    method: codebase
    pattern: "verify.operation"
    path: ".agents/scripts/pre-edit-check.sh"
  ```
- [ ] dispatch.sh checks task for high-stakes indicators before dispatch
  ```yaml
  verify:
    method: codebase
    pattern: "verify\\|high.stakes\\|bundle"
    path: ".agents/scripts/supervisor/dispatch.sh"
  ```
- [ ] build.txt documents verification rules
  ```yaml
  verify:
    method: codebase
    pattern: "verification"
    path: "prompts/build.txt"
  ```
- [ ] All modified scripts pass ShellCheck
  ```yaml
  verify:
    method: bash
    run: "shellcheck .agents/scripts/pre-edit-check.sh"
  ```

## Context & Decisions

- Verification is opt-out, not opt-in — high-stakes operations are verified by default
- Policy can be configured per-repo to disable verification for repos where speed matters more than safety
- Interactive sessions show verification result; headless sessions follow policy silently

## Relevant Files

- `.agents/scripts/pre-edit-check.sh:1` — main integration point
- `.agents/scripts/supervisor/dispatch.sh` — dispatch integration
- `.agents/workflows/full-loop.md` — full-loop documentation
- `prompts/build.txt` — security rules

## Dependencies

- **Blocked by:** t1364.1, t1364.2
- **Blocks:** none

## Estimate Breakdown

| Phase | Time | Notes |
|-------|------|-------|
| Research/read | 30m | Review pre-edit-check, dispatch |
| Implementation | 1.5h | Three integration points |
| Testing | 1h | End-to-end verification flow |
| **Total** | **~3h** | |
