<!-- task=m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle plan=4 tag=REVIEW_REVIEW_REVIEW_API milestone-task=route-observability -->

# Complete - m-iop-hot-path-one-shot-execution/19+17,18_observation_lifecycle

## Completed At

2026-08-04

## Summary

Completed the OpenAI direct-tool fixture repair after five plan/review iterations; final verdict PASS.

## Loop History

| Plan | Review | Verdict | Notes |
|------|--------|---------|-------|
| `plan_local_G08_0.log` | `code_review_cloud_G09_0.log` | SUPERSEDED | The initial pair was replaced before implementation and contains no verdict evidence. |
| `plan_local_G08_1.log` | `code_review_cloud_G09_1.log` | FAIL | Required a production observation sink, failed-attempt coverage, single logical admission, post-write terminal ownership, and non-vacuous handler evidence. |
| `plan_cloud_G09_2.log` | `code_review_cloud_G09_2.log` | FAIL | Required post-write winning-disposition ownership for direct and Light endpoint writes. |
| `plan_cloud_G07_3.log` | `code_review_cloud_G07_3.log` | FAIL | The OpenAI direct-tool fixture was malformed and failed before Hot Path dispatch. |
| `plan_cloud_G01_4.log` | `code_review_cloud_G01_4.log` | PASS | The corrected fixture reached dispatch and every required fresh verification passed. |

## Implementation and Cleanup

- Corrected the OpenAI direct-tool provider fixture so its nested `function.arguments` value is encoded exactly once as `{"path":"README.md"}`.
- Preserved the production terminal ownership logic, exact dispatch-to-`caller_cancel` traces, and exact terminal metric-delta assertions for both supported protocols.

## Final Verification

- `go test -race -count=1 ./apps/edge/internal/openai -run '^TestHotPathObservationLifecycle_(DirectCallerWriteFailure|LightLengthCallerWriteFailure)$'` - PASS; `ok iop/apps/edge/internal/openai 3.135s`.
- `go test -race -count=1 ./apps/edge/internal/openai -run 'TestHotPath(ObservationLifecycle|ObservationRejectsRawValues|MetricLabels|ObserverFailureIsolation|EndpointTerminalMatrix|Cleanup)'` - PASS; `ok iop/apps/edge/internal/openai 10.889s`.
- `go test -race -count=1 ./packages/go/streamgate ./packages/go/config ./apps/edge/internal/openai ./apps/edge/internal/service` - PASS; all four packages passed fresh under `-race`.
- `gofmt -d apps/edge/internal/openai/hot_path_direct.go apps/edge/internal/openai/hot_path_light.go apps/edge/internal/openai/hot_path_observation_test.go` - PASS; no output.
- `git diff --check` - PASS; no output.

## Remaining Nits

- None.

## Follow-up Work

- None.
