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

# t1364.2: Create Cross-Provider Verification Agent and Helper Script

## 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 builds the verification mechanism — the agent doc and helper script.

## What

The verification agent and helper script that performs parallel model verification for high-stakes operations.

Produces:
1. `.agents/tools/verification/parallel-verify.md` — subagent doc with verification prompt template, cross-provider selection logic, disagreement handling
2. `.agents/scripts/verify-operation-helper.sh` — CLI with verify/check/config subcommands
3. Integration point documentation (where hooks go — actual wiring is t1364.3)

## Why

The core mechanism that makes parallel verification work. Without this, the taxonomy (t1364.1) has no enforcement and the pipeline integration (t1364.3) has nothing to call.

## How (Approach)

- Create subagent doc following existing patterns (gemini-reviewer.md, gpt-reviewer.md)
- Cross-provider selection: if primary model is Anthropic, use Google for verification (and vice versa)
- Use `ai-research` MCP tool for the second model call (supports model selection)
- Structured response format: { verified, confidence, concerns, recommendation }
- Disagreement protocol: if verifier disagrees with primary, escalate to opus or block
- Helper script follows existing patterns (ShellCheck clean, `local var="$1"`, explicit returns)
- Log all verification decisions to observability DB via observability-helper.sh

## Acceptance Criteria

- [ ] Subagent doc exists at `.agents/tools/verification/parallel-verify.md`
  ```yaml
  verify:
    method: bash
    run: "test -f .agents/tools/verification/parallel-verify.md"
  ```
- [ ] Helper script exists and passes ShellCheck
  ```yaml
  verify:
    method: bash
    run: "shellcheck .agents/scripts/verify-operation-helper.sh"
  ```
- [ ] Cross-provider selection logic documented (Anthropic → Google, Google → Anthropic)
- [ ] Disagreement handling protocol defined
- [ ] Verification results logged to observability DB

## Context & Decisions

- Using ai-research MCP rather than direct API calls — keeps the verification lightweight and uses existing infrastructure
- Verification prompt should be concise — describe the operation, ask "should this proceed?", provide context
- The verifier sees the same context as the primary model but is asked independently — no access to primary's reasoning

## Relevant Files

- `.agents/reference/high-stakes-operations.md` — taxonomy (from t1364.1)
- `.agents/tools/context/model-routing.md` — model tier definitions
- `.agents/scripts/observability-helper.sh` — logging
- Existing cross-review: gemini-reviewer.md, gpt-reviewer.md

## Dependencies

- **Blocked by:** t1364.1
- **Blocks:** t1364.3

## Estimate Breakdown

| Phase | Time | Notes |
|-------|------|-------|
| Research/read | 30m | Review cross-review patterns |
| Agent doc | 1h | Prompt template, selection logic |
| Helper script | 1.5h | CLI implementation |
| Testing | 1h | ShellCheck, manual verification |
| **Total** | **~4h** | |
