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

# Execution Preset Schema and Hot-Mode Registry

## For the Implementing Agent

Implement this plan, run every verification command, and fill every implementation-owned section of `CODE_REVIEW-cloud-G03.md` with actual notes and stdout/stderr. Keep the active files in place and report ready for review. If blocked, record only the exact blocker, attempted commands/output, and resume condition in implementation-owned evidence fields; finalization belongs to the code-review skill.

## Background

The Edge config has model/provider catalogs but no execution policy that can freeze selector, allowed modes, downstream stages, and workspace bindings as one declarative shape. This child adds only the compatible schema and registered `direct`/`light` vocabulary.

## Analysis

### Files Read

- `agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-hot-path-one-shot-execution.md`
- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-hot-path-one-shot-execution/SDD.md`
- `packages/go/config/config.go`
- `packages/go/config/edge_types.go`
- `packages/go/config/provider_types.go`
- `packages/go/config/load.go`
- `packages/go/config/validate.go`
- `packages/go/config/provider_catalog_config_test.go`
- `packages/go/config/provider_catalog_validation_config_test.go`

### SDD Criteria

The approved/unlocked SDD scenarios S02/S04 require preset decode/normalize behavior and registered `direct`/`light` shapes while rejecting `heavy` and custom handlers. This child covers the data-only schema and fail-closed shape validation portion.

### Verification Context

Repository-native Go tests are sufficient. Fresh and race-enabled config tests are required; no external provider, credential, port, or workspace runner is needed. Confidence: high.

### Test Coverage Gaps

Existing config tests cover provider/model catalogs but not preset shape, mode registry, or invalid stage/binding combinations. Deep-clone behavior belongs to child 02, which publishes runtime generations.

### Symbol References

No symbol is renamed or removed. The new types extend `EdgeConfig` and are consumed by the next preset-generation child.

### Split Judgment

This is the first refined child of the former preset catalog pair. Its independently verifiable contract is that valid preset shapes decode and normalize while invalid or unsupported mode shapes fail closed. Child 02 consumes these types after this directory has `complete.log`.

### Scope Rationale

Do not add model-to-preset references, runtime snapshots, live refresh, principal authorization, selector execution, request state, manifests, or defaults that activate a preset.

### Final Routing

`evaluation_mode=isolated-reassessment`; `finalizer=finalize-task-policy.sh` (`pair`). Build closures are all true; scores `(scope=1,state=0,blast=1,evidence=1,verification=0)` yield G03, base/final route `local-fit`, `large_indivisible_context=false`, matched risks `boundary_contract,variant_product` (2), rework 0, evidence-integrity failure false, no capability gap; canonical file `PLAN-local-G03.md`. Review uses the same scores and official cloud G03 with `CODE_REVIEW-cloud-G03.md` (`gpt-5.6-sol`, xhigh).

## Implementation Checklist

- [ ] Define the execution preset catalog, selector/stage/workspace binding shapes, and registered direct/light descriptors.
- [ ] Fail closed on invalid ids, routes, options, binding shapes, and unsupported handlers while preserving provider-only compatibility.
- [ ] Run focused, race, vet, and diff verification exactly as written.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [API-1] Define the preset schema and hot-mode registry

#### Problem

`EdgeConfig` exposes only `Models` and `ProtocolProfiles`, so the SDD preset fields cannot be decoded or validated and unsupported mode handlers have no startup rejection boundary.

#### Solution

Add a cohesive preset type file containing selector stage, ordered route stages/options, allowed modes, and declarative workspace binding alternatives. Validate unique ids, canonical model references, exact current route shapes (`direct` has no downstream stages; `light` is `local,review`), bounded options, and only registered mode descriptors. Config owns pure descriptors, not executable handlers.

#### Modified Files and Checklist

- [ ] `packages/go/config/config.go` — document the new responsibility file.
- [ ] `packages/go/config/edge_types.go` — add the top-level catalog.
- [ ] `packages/go/config/execution_preset_types.go` — define the data types, pure mode-shape descriptors, and validation; runtime-generation clone helpers belong to child 02.
- [ ] `packages/go/config/load.go` — validate and normalize presets before model admission.
- [ ] `packages/go/config/execution_preset_config_test.go` — cover valid direct/light and invalid ids, stages, options, handlers, and binding shapes.

#### Test Strategy

Write `TestLoadEdgeExecutionPresetCatalog` and `TestLoadEdgeExecutionPresetRejectsInvalidShape`. Assert ordered stages/options survive decode, `direct`/`light` pass, unsupported keys and malformed/dangling references fail deterministically, and existing provider-only fixtures still load.

#### Verification

Run `go test -count=1 ./packages/go/config`; expect PASS.

## Modified Files Summary

| File | Items |
|------|-------|
| `packages/go/config/config.go` | API-1 |
| `packages/go/config/edge_types.go` | API-1 |
| `packages/go/config/execution_preset_types.go` | API-1 |
| `packages/go/config/load.go` | API-1 |
| `packages/go/config/execution_preset_config_test.go` | API-1 |
| `agent-task/m-iop-hot-path-one-shot-execution/01_preset_schema/CODE_REVIEW-cloud-G03.md` | API-1 |

## Final Verification

```bash
go test -count=1 ./packages/go/config
go test -race -count=1 ./packages/go/config
go vet ./packages/go/config
git diff --check
```

Expected: every command exits 0; direct/light shapes load, unsupported shapes fail before runtime dispatch, and provider-only fixtures remain compatible. After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`.
