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

# t1364.1: Define High-Stakes Operation Taxonomy and Verification Trigger Rules

## Origin

- **Created:** 2026-02-28
- **Session:** claude-code:headless
- **Created by:** ai-interactive
- **Parent task:** t1364
- **Conversation context:** Decomposition of issue #2558 item 1 (parallel model verification). This subtask defines WHAT gets verified — the taxonomy and trigger rules.

## What

A reference document and configuration schema that defines which operations are "high-stakes" and should trigger parallel model verification before execution.

Produces:
1. `.agents/reference/high-stakes-operations.md` — taxonomy document
2. Verification policy schema (JSON) for per-repo configuration
3. Trigger detection patterns for command matching and context detection

## Why

Without a clear taxonomy, the verification system either triggers too often (wasting model calls on safe operations) or too rarely (missing genuinely dangerous operations). The taxonomy must be defined before the verification agent (t1364.2) can be built.

## How (Approach)

- Survey existing aidevops safety mechanisms: pre-edit-check.sh branch protection, security rules in build.txt
- Categorize operations by risk level (critical/high/medium) and reversibility
- Define trigger patterns: command regex, context signals (branch name, environment), explicit tags
- Design policy schema for repos.json / .aidevops.json configuration
- Reference Perplexity Computer's approach but scope to targeted verification

## Acceptance Criteria

- [ ] Taxonomy document exists at `.agents/reference/high-stakes-operations.md`
  ```yaml
  verify:
    method: bash
    run: "test -f .agents/reference/high-stakes-operations.md"
  ```
- [ ] At least 5 operation categories defined (git destructive, production deploy, data migration, security, financial)
  ```yaml
  verify:
    method: codebase
    pattern: "### (Git|Production|Data|Security|Financial)"
    path: ".agents/reference/high-stakes-operations.md"
  ```
- [ ] Trigger pattern format documented with examples
- [ ] Policy schema supports per-repo override via repos.json or .aidevops.json
- [ ] Gate behaviours defined: block, warn, log

## Context & Decisions

- Risk levels: critical (always verify), high (verify by default, can disable), medium (opt-in)
- Cross-provider is preferred but not required — same-provider different-model also catches hallucinations
- The taxonomy is guidance for AI agents, not a mechanical regex filter — agents use judgment to decide if an operation matches

## Relevant Files

- `.agents/scripts/pre-edit-check.sh` — existing safety mechanism
- `prompts/build.txt` — security rules section
- `.agents/tools/context/model-routing.md` — model tier definitions

## Dependencies

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

## Estimate Breakdown

| Phase | Time | Notes |
|-------|------|-------|
| Research/read | 30m | Review existing safety mechanisms |
| Implementation | 1.5h | Write taxonomy + schema |
| **Total** | **~2h** | |
