<!-- task=m-iop-hot-path-one-shot-execution/02+01_preset_model plan=0 tag=API milestone-task=preset-model -->

# 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`, fill actual notes/output, then stop with active files in place and report ready for review. If blocked, record only the exact blocker, attempts/output, and resume condition. Do not ask the user, call user-input tools, create stop files, classify the next state, archive, or write `complete.log`; finalization is review-agent-only.

## Overview

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

## For the Review Agent

> **[REVIEW AGENT ONLY]** Implementers must not execute this section.

Compare each item against source and Verification Results. Append verdict/signals, archive the active pair, and on PASS write `complete.log`, preserve milestone metadata, archive the task directory, and update the final `.log` checklist. WARN/FAIL must create the code-review skill's exact next state.
## Implementation Item Completion

| Item | Status |
|------|---------|
| API-1 Add model-to-preset one-of validation | [ ] |
| API-2 Resolve virtual model authorization and public identity | [ ] |

## Implementation Checklist

- [ ] Enforce the provider-map versus execution-preset one-of and reference validation at config load.
- [ ] List and admit a virtual model only when selector and every allowed stage route resolve uniquely for the principal, preserving public identity.
- [ ] 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]** Implementers must not modify or check this section.

- [ ] Append one PASS/WARN/FAIL verdict with verified `review_rework_count` and `evidence_integrity_failure`.
- [ ] Verify verdict, Dimension Assessment, and Required/Suggested/Nit classifications match.
- [ ] Archive the active review to `code_review_cloud_G07_0.log`.
- [ ] Archive the active plan to `plan_local_G07_0.log`.
- [ ] Verify the Agent-Ops `.gitignore` block.
- [ ] On PASS write `complete.log` from `agent-ops/skills/common/code-review/templates/complete-log-template.md` and leave no active `.md`.
- [ ] On PASS archive to `agent-task/archive/YYYY/MM/m-iop-hot-path-one-shot-execution/02+01_preset_model/` and update this checklist there.
- [ ] On PASS preserve/report `milestone-task=preset-model` without direct roadmap mutation.
- [ ] On PASS remove the active parent only if no siblings/files remain.
- [ ] On WARN/FAIL write the mandated next state without `complete.log`.

## Deviations from Plan

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

## Key Design Decisions

_Implementer: replace with actual decisions._

## Reviewer Checkpoints

- Model config accepts exactly one of provider map or preset id.
- Managed listing/admission requires unique selector and every-stage authorization.
- No synthetic projection/credential route exists; external model echo is stable.

## Verification Results

Paste actual stdout/stderr; replacement commands require a deviation entry.

### 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/openai -run 'Test(VirtualPreset|Managed.*Model|ModelCatalog)'
```

_Actual stdout/stderr:_

### Dependency and focused tests

```bash
test -f agent-task/m-iop-hot-path-one-shot-execution/01_preset_catalog/complete.log
go test -count=1 ./packages/go/config ./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/openai
git diff --check
```

_Actual stdout/stderr:_

---

> **[IMPLEMENTING AGENT — BEFORE SAVING] Have you filled in every implementation-owned section?** Leave review-only sections unchanged.

## Section Ownership

| Section | Owner | Note |
|---------|-------|------|
| Header/Overview/instructions, item names, checklist text, checkpoints, commands | Fixed | Do not rewrite |
| Item status, Deviations, Key Design Decisions, actual output | Implementer | Must complete |
| Review-Only Checklist and Code Review Result/finalization | Review agent | Implementer must not modify |
