<!-- task=m-iop-owned-single-request-agent-execution/01_preset_config plan=4 tag=REVIEW_REVIEW_API milestone-task=preset-binding -->

# Complete the Single-request Preset Regression Matrix

## For the Implementing Agent

Implement this plan exactly within the listed write boundary. Run every verification command, fill all implementation-owned sections of `CODE_REVIEW-cloud-G02.md` with actual notes and stdout/stderr, keep both active files in place, and report ready for review. Finalization belongs only to the code-review skill. If blocked, record the exact blocker, attempted commands/output, and resume condition in implementation-owned evidence fields; do not ask the user, call user-input tools, create control-plane stop files, classify the next state, archive logs, or write `complete.log`.

## Background

The production validator now enforces one fixed selector/plan/work/review binding and the approved millisecond schema. The latest review found that the test source does not directly prove every route role and malformed-input branch required by the prior plan, so the checked evidence claim is incomplete. This follow-up is test-only and must not alter the conformant production validator.

## Archive Evidence Snapshot

- Failed pair after finalization: `plan_cloud_G04_3.log` and `code_review_cloud_G04_3.log`; verdict `FAIL` with Required R1, R2, and R3, zero Suggested findings, and no residual Nit.
- Fresh formatting, focused config, build, full config, vet, shared-package regression, and `git diff --check` all passed; the failure is missing direct regression evidence in `packages/go/config/single_request_execution_preset_config_test.go`.
- Roadmap carryover: `milestone-task=preset-binding`, approved SDD S02, immutable fixed-light binding evidence, and exact millisecond/strict-decode diagnostics.

## Finding Resolution Map

| Finding | Mode | Exact resolution | Changed precondition |
|---------|------|------------------|----------------------|
| Required R1 | `direct-fix` | Add deterministic table-driven cases in `packages/go/config/single_request_execution_preset_config_test.go` for plan/work/review route-only model and option divergence, a route-only dangling model, and route-only work `reasoning_effort` leakage. | The prior suite exercised only work divergence and malformed both copies together; each effective binding branch will now have an independent failing fixture. |
| Required R2 | `direct-fix` | Add a stale `stage_timeout_sec` fixture that leaves the approved `timeout_ms` key absent and asserts the diagnostic names `stage_timeout_sec`. | Both removed second-based keys will be proved fail-closed instead of only `wall_clock_sec`. |
| Required R3 | `direct-fix` | Strengthen the four nested unknown-field cases to require their injected key names in the strict-decode error. | An unrelated generic decode failure can no longer satisfy a nested schema test. |

## Analysis

### Files Read

- `packages/go/config/execution_preset_types.go`
- `packages/go/config/load.go`
- `packages/go/config/execution_preset_config_test.go`
- `packages/go/config/single_request_execution_preset_config_test.go`
- `apps/edge/internal/openai/principal_routes.go`
- `apps/edge/internal/openai/route_resolution.go`
- `agent-roadmap/phase/knowledge-tool-optimization-extension/PHASE.md`
- `agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/iop-owned-single-request-agent-execution.md`
- `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-owned-single-request-agent-execution/SDD.md`
- `agent-contract/inner/edge-config-runtime-refresh.md`
- `agent-contract/outer/anthropic-compatible-api.md`
- `agent-spec/runtime/provider-pool-config-refresh.md`
- `agent-test/local/rules.md`
- `agent-test/local/platform-common-smoke.md`

### SDD Criteria

- SDD: `agent-roadmap/sdd/knowledge-tool-optimization-extension/iop-owned-single-request-agent-execution/SDD.md`; status `[승인됨]`, lock released, and no user review.
- First-line Milestone task: `preset-binding`; targeted Acceptance Scenario: S02.
- S02 and its Evidence Map require immutable fixed-light decode/binding evidence. The checklist therefore covers each plan/work/review representation independently, and final verification retains config compatibility plus strict nested decode checks.

### Verification Context

- No separate verification handoff was supplied. Repository-native fallback came from `agent-test/local/rules.md`, `agent-test/local/platform-common-smoke.md`, the approved SDD, the config contract, and the current config tests.
- Reviewer preflight confirmed `/config/workspace/iop-s0`, Go `go1.26.2 linux/arm64`, and the shared dirty worktree. No credential, network service, remote runner, or external provider is required.
- Fresh `gofmt -d`, both focused config commands, `go build ./packages/go/...`, full config tests, `go vet ./packages/go/...`, `go test ./packages/go/... -count=1`, and `git diff --check` passed before this plan.
- Tests must use `-count=1`; cached output is not acceptable. Actual Claude/provider smoke remains a later Milestone-wide task because this follow-up changes only deterministic config regression evidence.
- Preconditions: the current production validator remains unchanged. Constraint: do not expand into refresh publication, runtime handlers, contracts, specs, or tracked config. Confidence: high.

### Test Coverage Gaps

- Route/policy parity: work-only model and option mismatch are covered; plan/review mismatches are missing.
- Route catalog membership: the existing dangling case makes the typed policy dangling too, so route-only validation is not covered.
- Work reasoning absence: both representations currently carry the forbidden key; route-only leakage is not covered.
- Legacy millisecond schema: `wall_clock_sec` rejection is covered; `stage_timeout_sec` rejection is missing.
- Nested strict decode: all four levels reject unknown input, but their assertions do not require the injected key name.

### Symbol References

- None. This follow-up changes no production symbol, public field, or import dependency.

### Split Judgment

- Keep one compact test-only packet. All findings close the same config-admission evidence gap in one fixture file and share one deterministic focused command; splitting would not yield an independently useful contract.

### Scope Rationale

- Modify only `packages/go/config/single_request_execution_preset_config_test.go` and the active review evidence file.
- Exclude `packages/go/config/execution_preset_types.go`; inspection and fresh tests show its generic role loop and key-presence check already enforce the required behavior.
- Exclude refresh classification, `configs/edge.yaml`, contract/spec publication, authorization/model echo, handlers, provider execution, Node workspace execution, protobuf, and SSE. Those remain owned by other milestone packets.

### Final Routing

- `evaluation_mode=isolated-reassessment`; finalizer `finalize-task-policy.sh` in `pair` mode.
- Build closures scope/context/verification/evidence/ownership/decision are true; scores 0/0/0/0/1 = G01; base `local-fit`, final route `recovery-boundary`, lane `cloud`, canonical filename `PLAN-cloud-G01.md`.
- Build signals: `large_indivisible_context=false`; positive loop risks `structured_interpretation` and `variant_product` (2); `review_rework_count=2`; `evidence_integrity_failure=true`; no capability gap.
- Review closures are true; scores 0/0/0/1/1 = G02; route `official-review`, lane `cloud`, canonical filename `CODE_REVIEW-cloud-G02.md`.

## Implementation Checklist

- [ ] Add independent plan/work/review route-binding, route-only dangling-model, and route-only work-reasoning regression rows for Required R1.
- [ ] Add exact `stage_timeout_sec` rejection and exact injected-key assertions for Required R2 and R3.
- [ ] Run fresh formatting, focused config, build, full config, vet, full shared-package regression, and `git diff --check` verification.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

## Implementation Plan

### [REVIEW_REVIEW_API-1] Close the preset admission evidence gaps

**Problem**

- `packages/go/config/single_request_execution_preset_config_test.go:579` and line 653 prove only work-route divergence, not the plan/review branches of the generic parity loop.
- `packages/go/config/single_request_execution_preset_config_test.go:731` makes both policy and route work models dangling, so the typed-stage catalog check can satisfy the test before the route-only check runs.
- `packages/go/config/single_request_execution_preset_config_test.go:394` covers only one removed second-based key, and lines 1780, 1854, 1928, and 2002 accept generic decoder text without naming the injected key.

**Solution**

Before (`packages/go/config/single_request_execution_preset_config_test.go:579`):

```go
t.Run("divergent route stage model rejected", func(t *testing.T) {
    // one work-only inline fixture
})
```

After:

```go
func requireSingleRequestLoadError(t *testing.T, yaml string, want ...string) {
    t.Helper()
    // Write one deterministic fixture, require LoadEdge failure, and require
    // every exact diagnostic fragment supplied by the table row.
}

for _, tc := range []struct {
    name string
    yaml string
    want []string
}{
    // plan/work/review route-only model and option divergence,
    // route-only dangling model, and route-only work reasoning leakage.
} {
    t.Run(tc.name, func(t *testing.T) { requireSingleRequestLoadError(t, tc.yaml, tc.want...) })
}
```

Use exact, uniquely counted fixture mutations or explicit compact fixtures so each row changes only the intended route/policy copy. Add a `stage_timeout_sec` stale-key row. Keep the four nested fixtures but require their injected key names in the returned error. Do not change production validation to make a test pass.

**Modified Files and Checklist**

- [ ] `packages/go/config/single_request_execution_preset_config_test.go` — add the complete independent binding/schema matrix and exact diagnostics.
- [ ] `agent-task/m-iop-owned-single-request-agent-execution/01_preset_config/CODE_REVIEW-cloud-G02.md` — record actual implementation and verification evidence.

**Test Strategy**

- Add `TestLoadEdgeSingleRequestExecutionPresetRejectsDivergentEffectiveBindings` with plan/work/review model and option rows plus route-only dangling and work reasoning leakage rows.
- Extend `TestLoadEdgeSingleRequestExecutionPresetRejectsInvalidShape` with `stage_timeout_sec`, requiring the stale key name.
- Strengthen `TestLoadEdgeSingleRequestExecutionPresetRejectsUnknownNestedFields` so each subtest requires its exact injected key.
- Retain ordinary direct/light compatibility and clone-isolation coverage unchanged.

**Verification**

- `go test ./packages/go/config -run 'TestLoadEdgeSingleRequestExecutionPresetRejects(DivergentEffectiveBindings|InvalidShape|UnknownNestedFields)$' -count=1`
- Expected: every independent malformed representation fails with the role/key-specific diagnostic.

## Modified Files Summary

| File | Item |
|------|------|
| `packages/go/config/single_request_execution_preset_config_test.go` | REVIEW_REVIEW_API-1 |
| `agent-task/m-iop-owned-single-request-agent-execution/01_preset_config/CODE_REVIEW-cloud-G02.md` | REVIEW_REVIEW_API-1 |

## Final Verification

1. `gofmt -d packages/go/config/single_request_execution_preset_config_test.go`
2. `go test ./packages/go/config -run 'TestLoadEdgeSingleRequestExecutionPresetRejects(DivergentEffectiveBindings|InvalidShape|UnknownNestedFields)$' -count=1`
3. `go build ./packages/go/...`
4. `go test ./packages/go/config -run 'Test(LoadEdgeSingleRequestExecutionPreset|CloneExecutionPresetSingleRequestIsolation|LoadEdgeExecutionPresetCatalog|LoadEdgeExecutionPresetRejectsInvalidShape)$' -count=1`
5. `go test ./packages/go/config -count=1`
6. `go vet ./packages/go/...`
7. `go test ./packages/go/... -count=1`
8. `git diff --check`

Expected: formatting emits no diff; every command exits 0; each route role and stale/unknown key has direct fail-closed evidence; ordinary presets and clone isolation remain compatible.

**After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`.**
