# Complete - m-stream-evidence-gate-core/04+01,03_codec_contract_fixtures

## 완료 일시

2026-07-24

## 요약

Stream Gate consumer codec contract fixture의 latest-four failure cause 순서 검증을 보완했고, 네 번째 리뷰 루프에서 PASS했다.

## 루프 이력

| Plan | Review | Verdict | 메모 |
|------|--------|---------|------|
| `plan_local_G04_0.log` | `code_review_local_G05_0.log` | FAIL | consumer fixture가 codec 및 cause-chain 계약을 충분히 증명하지 못했다. |
| `plan_local_G05_1.log` | `code_review_local_G05_1.log` | FAIL | distinct codec/lifecycle assertion과 endpoint error fixture 보완이 필요했다. |
| `plan_local_G05_2.log` | `code_review_local_G06_2.log` | FAIL | latest-four retained cause의 index 1/2 값과 순서 assertion이 누락됐다. |
| `plan_local_G02_3.log` | `code_review_local_G03_3.log` | PASS | expected slice로 four-position retained order를 직접 검증했다. |

## 구현/정리 내용

- `TestReleaseSinkCommitsSingleExternalTerminal`이 `chain.All()`의 retained cause 네 개를 expected latest-four slice와 index별로 비교하도록 강화했다.
- dropped prelude 부재와 Chat SSE/Responses JSON의 endpoint별 단일 terminal fixture를 유지했다.

## 최종 검증

- `GOTOOLCHAIN=go1.24.12 go test -count=1 -v ./packages/go/streamgate -run '^TestReleaseSinkCommitsSingleExternalTerminal$'` - PASS; Chat SSE, Responses JSON, second commit subtest 모두 통과.
- `GOTOOLCHAIN=go1.24.12 go test -count=1 -v ./packages/go/streamgate -run 'Test(OpenAIAndAgentCodecContractMatrix|ProviderErrorRetainsTerminalBaseDisposition|ReleaseSinkCommitsSingleExternalTerminal|StreamgateProductionImportsStayTransportAgnostic)$'` - PASS.
- `make proto` - PASS; 생성 성공, 생성물 변경 없음.
- `GOTOOLCHAIN=go1.24.12 go test -count=1 ./packages/go/streamgate` - PASS.
- `GOTOOLCHAIN=go1.24.12 go test -count=1 ./apps/edge/internal/transport ./apps/node/internal/transport` - PASS.
- `if rg --sort path -n '"iop/(apps/.*/internal|proto/gen/iop)"' packages/go/streamgate --glob '*.go' --glob '!**/*_test.go'; then exit 1; fi` - PASS; forbidden production import 없음.
- `GOTOOLCHAIN=go1.24.12 go vet ./packages/go/streamgate` - PASS.
- `gofmt -d packages/go/streamgate/consumer_contract_test.go` 및 `git diff --check -- packages/go/streamgate proto/gen/iop` - PASS; 출력 없음.

## Roadmap Completion

- Milestone: `agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/stream-evidence-gate-core.md`
- Milestone link: [Milestone 문서](agent-roadmap/phase/knowledge-tool-optimization-extension/milestones/stream-evidence-gate-core.md)
- Completed task ids:
  - `event-contract`: PASS; evidence=`plan_local_G02_3.log`, `code_review_local_G03_3.log`; verification=`GOTOOLCHAIN=go1.24.12 go test -count=1 ./packages/go/streamgate` 및 focused S21 fixture
- Not completed task ids: 없음

## 잔여 Nit

- 없음

## 후속 작업

- 없음
