# Complete - m-iop-agent-run-bridge/04+03_revision_scan_event

## 완료 일시

2026-06-16

## 요약

`revision-event` task review loop completed after 4 reviews; final verdict PASS.

## 루프 이력

| Plan | Review | Verdict | 메모 |
|------|--------|---------|------|
| `plan_local_G06_0.log` | `code_review_local_G06_0.log` | FAIL | production worker scanner injection, scan request assertions, sanitized scan error payload required follow-up. |
| `plan_local_G07_1.log` | `code_review_local_G07_1.log` | FAIL | worker scanner used a nil broadcaster, so matched revision events were not published/stored. |
| `plan_cloud_G07_2.log` | `code_review_cloud_G07_2.log` | FAIL | empty operation id outbox rows could not be read from Postgres and publish failure advanced cursor/dedupe state. |
| `plan_cloud_G07_3.log` | `code_review_cloud_G07_3.log` | PASS | nullable operation id scan and publish-failure retry boundary verified. |

## 구현/정리 내용

- Worker commit/push success path triggers revision scan and records sanitized revision scan result metadata.
- Worker scan path now uses an outbox-backed broadcaster so matched `branch.updated` events are persisted.
- Generic branch event outbox rows with empty `OperationID` are stored as SQL NULL and read back safely.
- Publish/store failure no longer advances the revision cursor or leaves a dedupe record that suppresses retry.

## 최종 검증

- `cd services/core && go test -count=1 ./internal/controlplane ./internal/storage` - PASS; controlplane and storage packages passed.
- `cd services/core && go test -count=1 ./internal/worker ./internal/controlplane ./internal/storage` - PASS; worker/controlplane/storage packages passed.
- `cd services/core && go test ./...` - PASS; all core packages passed.
- `cd services/core && go test -v -count=1 ./internal/controlplane -run 'TestRuntimeScanAgentRunRevisionPublishFailureDoesNotAdvanceDurableState|TestRuntimeScanAgentRunRevision' && go test -v -count=1 ./internal/storage -run 'TestScanOperationEventAllowsNullOperationID|TestPostgresOperationEventStoreAppendsListsMarksPublishedAndValidates'` - PASS; targeted regression tests passed, with the Postgres integration test skipped because `GITO_TEST_DATABASE_URL` is not set.
- `rg --sort path -n "proto-socket|REST|gRPC|ChangeRequest|Operation|Event|agent_shell|agent-shell|iop" packages/contracts README.md docs` - PASS; contract keyword scan completed.
- `git diff --check` - PASS; no whitespace errors.

## Roadmap Completion

- Milestone: `agent-roadmap/phase/agent-shell-iop-execution/milestones/iop-agent-run-bridge.md`
- Completed task ids:
  - `revision-event`: PASS; evidence=`agent-task/archive/2026/06/m-iop-agent-run-bridge/04+03_revision_scan_event/plan_cloud_G07_3.log`, `agent-task/archive/2026/06/m-iop-agent-run-bridge/04+03_revision_scan_event/code_review_cloud_G07_3.log`; verification=`cd services/core && go test ./...`, `rg --sort path -n "proto-socket|REST|gRPC|ChangeRequest|Operation|Event|agent_shell|agent-shell|iop" packages/contracts README.md docs`, `git diff --check`
- Not completed task ids: 없음

## 잔여 Nit

- 없음

## 후속 작업

- 없음
