<!-- task=m-iop-hot-path-one-shot-execution/01_preset_catalog plan=0 tag=API milestone-task=preset-schema,hot-preset -->

# Code Review Reference - API

> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is the mandatory final step of implementation.**
> The task is NOT complete until every implementation-owned section below is filled in.
> Complete the `Implementation Checklist`; the final checklist item is mandatory before saving.
> Fill implementation-owned sections, then stop with active files in place and report ready for review.
> If implementation is blocked, record the exact blocker, attempted commands/output, and resume condition only in implementation-owned evidence fields.
> Do not ask the user directly, present choices, call user-input tools, create control-plane stop files, or classify the next state.
> Finalization (`Code Review Result`, log rename, `complete.log`, archive moves, `Review-Only Checklist`) is review-agent-only, even after compaction/resume.
> Follow the ownership table at the bottom of this file for which sections you own.

## Overview

date=2026-08-02
task=m-iop-hot-path-one-shot-execution/01_preset_catalog, plan=0, tag=API

## For the Review Agent

> **[REVIEW AGENT ONLY]** The finalization steps below are review-agent only. Implementing agents must not execute this section.

Compare implementation of each item against source files and verify that output in `Verification Results` matches code. Review completion means: append verdict and routing signals; archive the active review and plan; on PASS write `complete.log`, preserve milestone metadata, archive the task directory, and update the final `.log` review checklist; on WARN/FAIL write the exact next state required by the code-review skill.

## Implementation Item Completion

| Item | Status |
|------|---------|
| API-1 Define the preset schema and hot-mode registry | [ ] |
| API-2 Publish immutable preset generations at startup and refresh | [ ] |

## Implementation Checklist

- [ ] Define and fail-closed validate the execution preset catalog and registered direct/light mode shapes.
- [ ] Propagate a deeply cloned preset generation through startup and live config refresh without changing active snapshots.
- [ ] Run the focused, race, vet, and diff verification commands exactly as written.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

## Review-Only Checklist

> **[REVIEW AGENT ONLY]** This checklist is used only by the review agent. Implementing agents must not modify or check this section.

- [ ] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure` to `Code Review Result`.
- [ ] Verify that verdict, `Dimension Assessment`, and Required/Suggested/Nit classifications match.
- [ ] Archive active `CODE_REVIEW-*-G??.md` to `code_review_cloud_G07_0.log`.
- [ ] Archive active `PLAN-*-G??.md` to `plan_local_G07_0.log`.
- [ ] Verify that the Agent-Ops managed block in `.gitignore` unignores `agent-task/**/*.md` and `agent-task/**/*.log` and ignores `agent-roadmap/current.md`.
- [ ] If PASS, write `complete.log` based on `agent-ops/skills/common/code-review/templates/complete-log-template.md` and leave no active `.md` files.
- [ ] If PASS, move this active task directory to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/01_preset_catalog/` and update this checklist at the final archive path.
- [ ] If PASS, preserve and report `milestone-task=preset-schema,hot-preset` without modifying roadmap state directly.
- [ ] If PASS for split work, remove the empty active parent or verify it was kept due to remaining siblings/files.
- [ ] If WARN/FAIL, write the next filesystem state matching the verdict and do not write `complete.log`.

## Deviations from Plan

_Implementer: replace with actual deviations or “None”._

## Key Design Decisions

_Implementer: replace with actual decisions._

## Reviewer Checkpoints

- Preset cloning is deep across nested stage/options/binding maps and slices.
- Config owns data-only mode descriptors, runtime owns executable handlers, and their keys agree; direct/light load while unsupported modes fail before dispatch.
- Refresh replaces the aggregate for new reads and cannot mutate a retained snapshot.

## Verification Results

Paste actual stdout/stderr below each exact command. Record any replacement and reason in Deviations.

### API-1 item verification

```bash
go test -count=1 ./packages/go/config
```

_Actual stdout/stderr:_

### API-2 item verification

```bash
go test -count=1 ./apps/edge/internal/configrefresh ./apps/edge/internal/bootstrap ./apps/edge/internal/openai
```

_Actual stdout/stderr:_

### Focused tests

```bash
go test -count=1 ./packages/go/config ./apps/edge/internal/configrefresh ./apps/edge/internal/bootstrap ./apps/edge/internal/openai
```

_Actual stdout/stderr:_

### Common race tests

```bash
go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service
```

_Actual stdout/stderr:_

### Vet and diff

```bash
go vet ./packages/go/config ./apps/edge/internal/configrefresh ./apps/edge/internal/bootstrap ./apps/edge/internal/openai
git diff --check
```

_Actual stdout/stderr:_

---

> **[IMPLEMENTING AGENT — BEFORE SAVING] Have you filled in every implementation-owned section?**
> If anything is blank, go back and fill it in before saving this file.
> Leave review-agent-only sections unchanged.

## Section Ownership

| Section | Owner | Note |
|---------|-------|------|
| Header comment, Overview, Review Agent Instructions | Fixed at stub creation | Implementer must not modify or execute these |
| Implementation Item Completion (item names) | Fixed at stub creation | Implementer checks `[ ]` to `[x]` only |
| Implementation Checklist (item text/order) | Fixed at stub creation from plan | Implementer checks `[ ]` to `[x]` only |
| Review-Only Checklist | Review agent only | Implementer must not modify or check this section |
| Deviations from Plan, Key Design Decisions | Implementing agent | Replace placeholder text with actual content |
| Reviewer Checkpoints | Fixed at stub creation | Pre-filled from plan |
| Verification Results headings and commands | Fixed at stub creation | Implementer fills actual stdout/stderr; changes require a deviation entry |
| Code Review Result | Review agent appends | Not included in stub |
