<!-- task=m-iop-hot-path-one-shot-execution/10+07,09_light_flow plan=3 tag=REVIEW_API milestone-task=light-flow -->

# Complete - m-iop-hot-path-one-shot-execution/10+07,09_light_flow

## Completion Time

2026-08-03

## Summary

Completed the fourth implementation/review loop with a final PASS after preserving bounded opaque stage correlations in a deterministic single-line JSON representation and requiring decoded OpenAI Chat and Anthropic Messages tunnel evidence.

## Loop History

| Plan | Review | Verdict | Notes |
|------|--------|---------|-------|
| `plan_cloud_G10_0.log` | `code_review_cloud_G10_0.log` | FAIL | Provider-visible local/review stage inputs omitted committed predecessor correlations. |
| `plan_local_G05_1.log` | `code_review_cloud_G05_1.log` | FAIL | Raw opaque correlations could alter prompt structure, and the Messages tunnel builder was not exercised. |
| `plan_cloud_G05_2.log` | `code_review_cloud_G05_2.log` | FAIL | Strict token validation rejected contract-valid provider IDs, while tunnel assertions remained optional and undecoded. |
| `plan_cloud_G05_3.log` | `code_review_cloud_G05_3.log` | PASS | Opaque correlations round-trip through line-safe JSON and both selected protocol payloads are decoded and required. |

## Implementation and Cleanup

- Kept IOP-owned stage and run identities on the strict logical-request validator.
- Accepted non-empty opaque response, provider, and terminal correlations up to 256 bytes while rejecting control characters.
- Serialized each committed stage correlation as deterministic single-line JSON.
- Made selected-protocol preparation and body construction mandatory in light-flow regressions and decoded the exact first user message for OpenAI Chat and Anthropic Messages.

## Final Verification

- `go test -race -count=1 ./apps/edge/internal/openai -run '^TestHotPathStageInputIsolation$'` - PASS; `ok iop/apps/edge/internal/openai 1.073s`.
- `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(LightLocal|StageInput)'` - PASS; `ok iop/apps/edge/internal/openai 1.151s`.
- `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(Light|Review|StageInput)'` - PASS; `ok iop/apps/edge/internal/openai 1.455s`.
- `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` - PASS for all four packages.
- `go vet ./apps/edge/internal/openai` - PASS with no output.
- `gofmt -d apps/edge/internal/openai/hot_path_stage_input.go apps/edge/internal/openai/hot_path_light_test.go` - PASS with no output.
- `git diff --check` - PASS with no output.
- Repository Edge-Node diagnostics, supplemental E2E smoke, full-cycle execution, and credentialed provider smoke were not run because this task is deterministic S08 stage-input hardening; S16 owns live Hot Path smoke.

## Remaining Nit

- None.

## Follow-up Work

- None for this task.
