<!-- task=m-iop-agent-cli-runtime/21+13,17,20_project_log_sink plan=3 tag=REVIEW_API -->

# Code Review Reference - REVIEW_API

> **[IMPLEMENTING AGENT — READ FIRST] Filling in this file is the mandatory final step of implementation.**
> The task is NOT complete until every implementation-owned section below is filled in.
> Complete the `Implementation Checklist`; the final checklist item is mandatory before saving.
> Fill implementation-owned sections, then stop with active files in place and report ready for review.
> If implementation is blocked, record the exact blocker, attempted commands/output, and resume condition only in implementation-owned evidence fields.
> Do not ask the user directly, present choices, call user-input tools, create control-plane stop files, or classify the next state.
> Finalization (`Code Review Result`, log rename, `complete.log`, archive moves, `Review-Only Checklist`) is review-agent-only, even after compaction/resume.
> Follow the ownership table at the bottom of this file for which sections you own.

## Overview

date=2026-07-30
task=m-iop-agent-cli-runtime/21+13,17,20_project_log_sink, plan=3, tag=REVIEW_API

## Roadmap Targets

- Milestone: `agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-cli-runtime.md`
- Milestone link: [Milestone document](agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-cli-runtime.md)
- Task ids:
  - `project-logs`: project-local event/log plus WORK_LOG loop/attempt/locator and exactly-once archive lifecycle
- Completion mode: check-on-pass

## Archive Evidence Snapshot

- Current pair to archive during review finalization:
  - `agent-task/m-iop-agent-cli-runtime/21+13,17,20_project_log_sink/plan_cloud_G10_2.log`
  - `agent-task/m-iop-agent-cli-runtime/21+13,17,20_project_log_sink/code_review_cloud_G10_2.log`
- Prior verdict: `FAIL`.
- Required finding: `apps/agent/internal/projectlog/store.go:389` selects the caller-supplied work journal before checking `SeenRecords`, so changed logical content under one manager `EventID` is not rejected when `WorkUnitID` changes or the event crosses the project-only/work boundary.
- Suggested findings: none.
- Nit findings: none.
- Fresh reviewer evidence: a focused production-store reproducer appended the event under work A and checked the same record identity plus a changed logical fingerprint under work B; it returned `false, <nil>` instead of `ErrRecordReplayConflict`.
- Prior verification evidence: the declared focused, full, race, vet, formatting, contract, and diff commands passed, but `TestStoreRejectsLogicalEventIDReuse` reused the original scope and did not cover scope drift.
- Roadmap carryover remains `project-logs`; no completion may be reported until project-wide replay identity passes.

## For the Review Agent

> **[REVIEW AGENT ONLY]** The finalization steps below are review-agent only. Implementing agents must not execute this section.

Compare implementation of each item against source files and verify that output in `Verification Results` matches code.
Review completion means the following steps are finished:

1. Append verdict and `review_rework_count` / `evidence_integrity_failure` routing signals.
2. Archive `CODE_REVIEW-cloud-G10.md` → `code_review_cloud_G10_3.log` and `PLAN-cloud-G10.md` → `plan_cloud_G10_3.log`.
3. If PASS, write `complete.log` and move active task directory to `agent-task/archive/YYYY/MM/m-iop-agent-cli-runtime/21+13,17,20_project_log_sink/`. If WARN/FAIL, fully write the next filesystem state required by the code-review skill.
4. If PASS and task group is `m-iop-agent-cli-runtime`, report completion event metadata. Roadmap state check and `update-roadmap` calls are runtime responsibilities.
5. Check applicable `Review-Only Checklist` items at the final `.log` location before reporting.

---

## Implementation Item Completion

| Item | Status |
|------|---------|
| REVIEW_API-1 | [x] |
| REVIEW_API-2 | [x] |
| REVIEW_API-3 | [x] |

## Implementation Checklist

- [x] Add checksum-covered integration-record snapshot and atomic multi-record CAS primitives without breaking the single-record API.
- [x] Enforce one retained project-wide event identity index and atomically couple it to project/work journal appends, including legacy scoped-index recovery.
- [x] Add agentstate, store, and production sink regressions for stale batch CAS, scope drift, concurrency, migration, prune/restart replay, and align both runtime contracts.
- [x] Run the focused, full, race, platform-common, vet, formatting, contract, and diff verification commands exactly as written.
- [x] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

## Review-Only Checklist

> **[REVIEW AGENT ONLY]** This checklist is used only by the review agent.
> Implementing agents must not modify or check this section.

- [x] Append one verdict of `PASS`, `WARN`, or `FAIL` and verified `review_rework_count`, `evidence_integrity_failure` to `Code Review Result`.
- [x] Verify that verdict, `Dimension Assessment`, and Required/Suggested/Nit classifications match.
- [x] Archive active `CODE_REVIEW-*-G??.md` to `code_review_cloud_G10_3.log`.
- [x] Archive active `PLAN-*-G??.md` to `plan_cloud_G10_3.log`.
- [x] Verify that the Agent-Ops managed block in `.gitignore` unignores `agent-task/**/*.md` and `agent-task/**/*.log` and ignores `agent-roadmap/current.md`.
- [x] If PASS, write `complete.log` based on `agent-ops/skills/common/code-review/templates/complete-log-template.md` and leave no active `.md` files.
- [x] If PASS, move active task directory `agent-task/m-iop-agent-cli-runtime/21+13,17,20_project_log_sink/` to `agent-task/archive/YYYY/MM/m-iop-agent-cli-runtime/21+13,17,20_project_log_sink/` and update this checklist at the final archive path.
- [x] If PASS and task group is `m-iop-agent-cli-runtime`, report completion event metadata for runtime, without modifying roadmap or directly calling `update-roadmap`.
- [x] If PASS for split work, remove empty active parent `agent-task/m-iop-agent-cli-runtime/` or verify it was kept due to remaining siblings/files.
- [ ] If WARN/FAIL, write the next filesystem state matching code-review verdict and do not write `complete.log`.

## Deviations from Plan

None. Every planned verification command was executed unchanged.

## Key Design Decisions

- `agentstate.Store` now exposes cloned prefix snapshots and validates a complete multi-record update before taking the exclusive file lock. It checks every key-local expected revision before mutation, writes the checksum-covered envelope once, and preserves the single-record API through one-element delegation.
- A schema-versioned project/workspace replay index owns each manager record identity, exact project-only or work-unit scope, task-local sequence, and stable event fingerprint. New events commit that index and exactly one scoped journal in the same atomic batch.
- Replay checks consult the project-wide index before caller scope or evidence resolution. Work-to-work, project-to-work, and work-to-project scope drift fails closed, while exact volatile replay returns the original retained sequence.
- Missing index entries are recovered from checksum-covered legacy journal snapshots. Matching entries persist by CAS, conflicting duplicates and malformed identities fail closed, and generic records without event fingerprints remain scope-local.
- The dirty-worktree preflight showed unrelated active task and runtime changes; those changes were preserved, and edits were restricted to the plan's declared files.

## Reviewer Checkpoints

- The integration-record batch API validates the complete request before mutation, rejects one stale expected revision without updating any key, preserves unrelated records and manager state, and keeps the single-record API source-compatible.
- The retained manager-event index is project/workspace-wide, owns the exact project-only/work scope and assigned task-local sequence, and is consulted before a caller-supplied scope.
- New event appends commit the shared index and exactly one target journal in one atomic state-store write; concurrent different-scope claimants cannot both succeed.
- Legacy scoped `SeenRecords` entries are discovered from checksum-covered snapshots, conflicting duplicates fail closed, and recovered global entries survive reopen.
- Work A → work B, project-only → work, and work → project-only reuse under one EventID all return `ErrRecordReplayConflict` without a second journal record.
- The production `Sink.Emit` regression rejects changed cross-scope content before calling the evidence resolver, while unchanged timestamp/state-revision replay still returns the original sequence.
- Archive/prune leaves the project-wide identity entry intact; S12 independent work archives and race verification still pass.
- Both inner contracts name the project-wide atomic index, legacy recovery, scope-drift behavior, and exact focused/race evidence.

## Verification Results

For every command below, paste the exact command, exit code, and actual stdout/stderr. Do not summarize or reconstruct output. If a planned command changes, record the replacement and reason in `Deviations from Plan`.

### REVIEW_API-1 Focused Verification

```bash
go test -count=1 ./packages/go/agentstate -run 'TestStoreIntegrationRecordSnapshot|TestStoreIntegrationRecordBatchCAS'
```

Exit code: 0

```text
ok  	iop/packages/go/agentstate	0.045s
```

### REVIEW_API-2 Focused Verification

```bash
go test -count=1 ./apps/agent/internal/projectlog -run 'TestStoreRejectsLogicalEventIDReuseAcrossScopes|TestStoreEventReplayIndex|TestStoreEventReplayFingerprintSurvivesPruneAndRestart'
```

Exit code: 0

```text
ok  	iop/apps/agent/internal/projectlog	0.049s
```

### REVIEW_API-2 Race Verification

```bash
go test -count=1 -race ./packages/go/agentstate ./apps/agent/internal/projectlog -run 'TestStoreIntegrationRecordBatchCAS|TestStoreEventReplayIndexSerializesCrossScopeCAS'
```

Exit code: 0

```text
ok  	iop/packages/go/agentstate	1.043s
ok  	iop/apps/agent/internal/projectlog	1.024s
```

### REVIEW_API-3 Sink Verification

```bash
go test -count=1 ./apps/agent/internal/projectlog -run 'TestSinkRejectsLogicalEventIDReuseAcrossScopesBeforeEvidenceResolution|TestSinkReplayShortCircuitsEvidenceAfterClockAndStateAdvance'
```

Exit code: 0

```text
ok  	iop/apps/agent/internal/projectlog	0.026s
```

### REVIEW_API-3 Contract Verification

```bash
rg --sort path -n 'project-wide replay index|atomic.*journal|scope drift|TestSinkRejectsLogicalEventIDReuseAcrossScopesBeforeEvidenceResolution|TestStoreEventReplayIndexSerializesCrossScopeCAS' agent-contract/inner/agent-runtime.md agent-contract/inner/iop-agent-cli-runtime.md
```

Exit code: 0

```text
agent-contract/inner/agent-runtime.md:65:- The sink derives a bounded SHA-256 record identity from the required manager `event_id` and checks a project-wide replay index before it trusts the caller-supplied project-only or work-unit scope and before it resolves evidence. The index retains the exact scope, task-local sequence, and stable logical event fingerprint. The fingerprint covers every logical `Event` field except `Timestamp`; projection `StateRevision` is not part of it. Timestamp or unrelated manager revision changes therefore replay the original sequence across restart/archive/prune, while changed logical content or scope drift under the same `EventID` fails closed for work-to-work, project-to-work, and work-to-project reuse.
agent-contract/inner/agent-runtime.md:66:- An unseen manager event updates the project-wide replay index and exactly one scoped journal through one atomic multi-record state-store commit. A stale shared-index revision changes neither record. When the index is absent or lacks a retained event, recovery scans checksum-covered project-log journal snapshots, accepts only matching project/workspace identities, rejects conflicting legacy duplicates, and persists the recovered entry before replay converges. Generic records without an event fingerprint remain scope-local and require normal evidence resolution.
agent-contract/inner/agent-runtime.md:67:- The durable-delivery implementation is `packages/go/agenttask/types.go`, `state_machine.go`, `manager.go`, `reconcile.go`, and `review.go`; the replay implementation is `apps/agent/internal/projectlog/sink.go` and `store.go`, backed by the atomic integration-record API in `packages/go/agentstate/store.go`. Exact production-ordering/recovery oracles are `TestManagerEventDeliveryUsesCommittedEvidence` and `TestManagerEventDeliveryRecoversSinkFailure`; project-wide replay oracles are `TestSinkRejectsLogicalEventIDReuseAcrossScopesBeforeEvidenceResolution`, `TestStoreRejectsLogicalEventIDReuseAcrossScopes`, and `TestStoreEventReplayIndexSerializesCrossScopeCAS`; S12 archive coverage is `TestS12LoopParallelArchiveMatrix`. Run `go test -count=1 -race ./packages/go/agentstate ./packages/go/agenttask ./apps/agent/internal/projectlog -run 'TestStoreIntegrationRecordBatchCAS|TestStoreEventReplayIndexSerializesCrossScopeCAS|TestManagerEventDelivery|TestS12LoopParallelArchiveMatrix'`.
agent-contract/inner/iop-agent-cli-runtime.md:43:| S12 | `TestManagerEventDeliveryUsesCommittedEvidence` and `TestManagerEventDeliveryRecoversSinkFailure` in `packages/go/agenttask/manager_integration_test.go`; `TestSinkPendingDeliveryUsesExactCommittedEvidence`, `TestSinkReplayShortCircuitsEvidenceAfterClockAndStateAdvance`, `TestSinkRejectsLogicalEventIDReuseAcrossScopesBeforeEvidenceResolution`, `TestStoreEventReplayFingerprintSurvivesPruneAndRestart`, `TestStoreRejectsLogicalEventIDReuseAcrossScopes`, `TestStoreEventReplayIndexRecoversLegacyScopedEntry`, `TestStoreEventReplayIndexSerializesCrossScopeCAS`, and `TestS12LoopParallelArchiveMatrix` in `apps/agent/internal/projectlog/*_test.go`; atomic state-store coverage in `TestStoreIntegrationRecordBatchCAS`; fresh race verification: `go test -count=1 -race ./packages/go/agentstate ./apps/agent/internal/projectlog -run 'TestStoreIntegrationRecordBatchCAS|TestStoreEventReplayIndexSerializesCrossScopeCAS|TestS12LoopParallelArchiveMatrix'` | `project-logs` proves commit-before-observe manager ordering, returned-but-recoverable sink failure, exact pending-delivery evidence, project-wide replay identity before volatile projection or caller scope, atomic index/journal persistence, fail-closed legacy recovery and scope drift, 11 explicit review-failure/follow-up pairs, independent same-project task completion, complete redacted WORK_LOG JSONL, and exactly-once task-scoped terminal archive reconciliation for every crash phase. |
agent-contract/inner/iop-agent-cli-runtime.md:72:- Work records are journaled under deterministic project/workspace/work-unit scopes, while one project-wide replay index owns each manager `EventID` projection across all those scopes. The retained entry includes the exact project-only or work-unit scope, assigned task-local sequence, and stable logical event fingerprint. The sink checks this entry before evidence resolution and before trusting caller scope; `Timestamp` and projection `StateRevision` changes retain the original sequence across restart/archive/prune, while changed logical content or scope drift under one manager `EventID` fails closed for work-to-work, project-to-work, and work-to-project reuse.
agent-contract/inner/iop-agent-cli-runtime.md:73:- A new manager event uses one atomic integration-record batch to commit the project-wide replay index and exactly one target journal. Stale shared-index writers cannot leave a partial journal record. When an index entry is absent, the host scans checksum-covered legacy scoped journals for the same project/workspace, rejects conflicting duplicate ownership, and persists a recovered entry before replay. Generic records without an event fingerprint remain scope-local and require normal evidence resolution.
agent-contract/inner/iop-agent-cli-runtime.md:153:- For S12 changes, run `go test -count=1 -race ./packages/go/agenttask ./apps/agent/internal/projectlog -run 'TestManagerEventDelivery|TestS12LoopParallelArchiveMatrix'`, `go test -count=1 -race ./packages/go/agentstate ./apps/agent/internal/projectlog -run 'TestStoreIntegrationRecordBatchCAS|TestStoreEventReplayIndexSerializesCrossScopeCAS'`, and the full fresh `agenttask`, `projectlog`, and `agentstate` race suites.
```

### Final Verification

`command -v go`

Exit code: 0

```text
/config/.local/bin/go
```

`go version`

Exit code: 0

```text
go version go1.26.2 linux/arm64
```

`go env GOROOT`

Exit code: 0

```text
/config/opt/go
```

`test -z "$(gofmt -d packages/go/agentstate/store.go packages/go/agentstate/store_test.go apps/agent/internal/projectlog/store.go apps/agent/internal/projectlog/store_test.go apps/agent/internal/projectlog/sink_test.go)"`

Exit code: 0

```text
```

`go test -count=1 ./packages/go/agentstate -run 'TestStoreIntegrationRecordSnapshot|TestStoreIntegrationRecordBatchCAS'`

Exit code: 0

```text
ok  	iop/packages/go/agentstate	0.045s
```

`go test -count=1 ./apps/agent/internal/projectlog -run 'TestStoreRejectsLogicalEventIDReuseAcrossScopes|TestStoreEventReplayIndex|TestStoreEventReplayFingerprintSurvivesPruneAndRestart|TestSinkRejectsLogicalEventIDReuseAcrossScopesBeforeEvidenceResolution|TestSinkReplayShortCircuitsEvidenceAfterClockAndStateAdvance'`

Exit code: 0

```text
ok  	iop/apps/agent/internal/projectlog	0.065s
```

`go test -count=1 -race ./packages/go/agentstate ./apps/agent/internal/projectlog -run 'TestStoreIntegrationRecordBatchCAS|TestStoreEventReplayIndexSerializesCrossScopeCAS|TestS12LoopParallelArchiveMatrix'`

Exit code: 0

```text
ok  	iop/packages/go/agentstate	1.051s
ok  	iop/apps/agent/internal/projectlog	10.212s
```

`go test -count=1 ./packages/go/agentstate ./apps/agent/internal/projectlog`

Exit code: 0

```text
ok  	iop/packages/go/agentstate	0.115s
ok  	iop/apps/agent/internal/projectlog	2.086s
```

`go test -count=1 ./packages/go/...`

Exit code: 0

```text
ok  	iop/packages/go/agentconfig	0.046s
ok  	iop/packages/go/agentguard	0.019s
ok  	iop/packages/go/agentpolicy	0.036s
ok  	iop/packages/go/agentprovider/catalog	0.117s
ok  	iop/packages/go/agentprovider/cli	32.527s
?   	iop/packages/go/agentprovider/cli/internal/testutil	[no test files]
ok  	iop/packages/go/agentprovider/cli/status	40.400s
ok  	iop/packages/go/agentruntime	0.857s
ok  	iop/packages/go/agentstate	0.172s
ok  	iop/packages/go/agenttask	1.996s
ok  	iop/packages/go/agentworkspace	23.286s
ok  	iop/packages/go/audit	0.005s
?   	iop/packages/go/auth	[no test files]
ok  	iop/packages/go/config	0.153s
?   	iop/packages/go/events	[no test files]
ok  	iop/packages/go/hostsetup	0.008s
?   	iop/packages/go/jobs	[no test files]
?   	iop/packages/go/metadata	[no test files]
ok  	iop/packages/go/observability	0.033s
?   	iop/packages/go/policy	[no test files]
ok  	iop/packages/go/streamgate	0.922s
?   	iop/packages/go/version	[no test files]
```

`go test -count=1 -race ./packages/go/agentstate ./apps/agent/internal/projectlog`

Exit code: 0

```text
ok  	iop/packages/go/agentstate	1.111s
ok  	iop/apps/agent/internal/projectlog	11.466s
```

`go vet ./packages/go/... ./apps/agent/internal/projectlog`

Exit code: 0

```text
```

`rg --sort path -n 'project-wide replay index|atomic.*journal|scope drift|TestSinkRejectsLogicalEventIDReuseAcrossScopesBeforeEvidenceResolution|TestStoreEventReplayIndexSerializesCrossScopeCAS' agent-contract/inner/agent-runtime.md agent-contract/inner/iop-agent-cli-runtime.md`

Exit code: 0

```text
agent-contract/inner/agent-runtime.md:65:- The sink derives a bounded SHA-256 record identity from the required manager `event_id` and checks a project-wide replay index before it trusts the caller-supplied project-only or work-unit scope and before it resolves evidence. The index retains the exact scope, task-local sequence, and stable logical event fingerprint. The fingerprint covers every logical `Event` field except `Timestamp`; projection `StateRevision` is not part of it. Timestamp or unrelated manager revision changes therefore replay the original sequence across restart/archive/prune, while changed logical content or scope drift under the same `EventID` fails closed for work-to-work, project-to-work, and work-to-project reuse.
agent-contract/inner/agent-runtime.md:66:- An unseen manager event updates the project-wide replay index and exactly one scoped journal through one atomic multi-record state-store commit. A stale shared-index revision changes neither record. When the index is absent or lacks a retained event, recovery scans checksum-covered project-log journal snapshots, accepts only matching project/workspace identities, rejects conflicting legacy duplicates, and persists the recovered entry before replay converges. Generic records without an event fingerprint remain scope-local and require normal evidence resolution.
agent-contract/inner/agent-runtime.md:67:- The durable-delivery implementation is `packages/go/agenttask/types.go`, `state_machine.go`, `manager.go`, `reconcile.go`, and `review.go`; the replay implementation is `apps/agent/internal/projectlog/sink.go` and `store.go`, backed by the atomic integration-record API in `packages/go/agentstate/store.go`. Exact production-ordering/recovery oracles are `TestManagerEventDeliveryUsesCommittedEvidence` and `TestManagerEventDeliveryRecoversSinkFailure`; project-wide replay oracles are `TestSinkRejectsLogicalEventIDReuseAcrossScopesBeforeEvidenceResolution`, `TestStoreRejectsLogicalEventIDReuseAcrossScopes`, and `TestStoreEventReplayIndexSerializesCrossScopeCAS`; S12 archive coverage is `TestS12LoopParallelArchiveMatrix`. Run `go test -count=1 -race ./packages/go/agentstate ./packages/go/agenttask ./apps/agent/internal/projectlog -run 'TestStoreIntegrationRecordBatchCAS|TestStoreEventReplayIndexSerializesCrossScopeCAS|TestManagerEventDelivery|TestS12LoopParallelArchiveMatrix'`.
agent-contract/inner/iop-agent-cli-runtime.md:43:| S12 | `TestManagerEventDeliveryUsesCommittedEvidence` and `TestManagerEventDeliveryRecoversSinkFailure` in `packages/go/agenttask/manager_integration_test.go`; `TestSinkPendingDeliveryUsesExactCommittedEvidence`, `TestSinkReplayShortCircuitsEvidenceAfterClockAndStateAdvance`, `TestSinkRejectsLogicalEventIDReuseAcrossScopesBeforeEvidenceResolution`, `TestStoreEventReplayFingerprintSurvivesPruneAndRestart`, `TestStoreRejectsLogicalEventIDReuseAcrossScopes`, `TestStoreEventReplayIndexRecoversLegacyScopedEntry`, `TestStoreEventReplayIndexSerializesCrossScopeCAS`, and `TestS12LoopParallelArchiveMatrix` in `apps/agent/internal/projectlog/*_test.go`; atomic state-store coverage in `TestStoreIntegrationRecordBatchCAS`; fresh race verification: `go test -count=1 -race ./packages/go/agentstate ./apps/agent/internal/projectlog -run 'TestStoreIntegrationRecordBatchCAS|TestStoreEventReplayIndexSerializesCrossScopeCAS|TestS12LoopParallelArchiveMatrix'` | `project-logs` proves commit-before-observe manager ordering, returned-but-recoverable sink failure, exact pending-delivery evidence, project-wide replay identity before volatile projection or caller scope, atomic index/journal persistence, fail-closed legacy recovery and scope drift, 11 explicit review-failure/follow-up pairs, independent same-project task completion, complete redacted WORK_LOG JSONL, and exactly-once task-scoped terminal archive reconciliation for every crash phase. |
agent-contract/inner/iop-agent-cli-runtime.md:72:- Work records are journaled under deterministic project/workspace/work-unit scopes, while one project-wide replay index owns each manager `EventID` projection across all those scopes. The retained entry includes the exact project-only or work-unit scope, assigned task-local sequence, and stable logical event fingerprint. The sink checks this entry before evidence resolution and before trusting caller scope; `Timestamp` and projection `StateRevision` changes retain the original sequence across restart/archive/prune, while changed logical content or scope drift under one manager `EventID` fails closed for work-to-work, project-to-work, and work-to-project reuse.
agent-contract/inner/iop-agent-cli-runtime.md:73:- A new manager event uses one atomic integration-record batch to commit the project-wide replay index and exactly one target journal. Stale shared-index writers cannot leave a partial journal record. When an index entry is absent, the host scans checksum-covered legacy scoped journals for the same project/workspace, rejects conflicting duplicate ownership, and persists a recovered entry before replay. Generic records without an event fingerprint remain scope-local and require normal evidence resolution.
agent-contract/inner/iop-agent-cli-runtime.md:153:- For S12 changes, run `go test -count=1 -race ./packages/go/agenttask ./apps/agent/internal/projectlog -run 'TestManagerEventDelivery|TestS12LoopParallelArchiveMatrix'`, `go test -count=1 -race ./packages/go/agentstate ./apps/agent/internal/projectlog -run 'TestStoreIntegrationRecordBatchCAS|TestStoreEventReplayIndexSerializesCrossScopeCAS'`, and the full fresh `agenttask`, `projectlog`, and `agentstate` race suites.
```

`git diff --check`

Exit code: 0

```text
```

---

> **[IMPLEMENTING AGENT — BEFORE SAVING] Have you filled in every implementation-owned section?**
> If anything is blank, go back and fill it in before saving this file.
> Leave review-agent-only sections unchanged.

## Section Ownership

| Section | Owner | Note |
|---------|-------|------|
| Header comment, Overview, Review Agent Instructions | Fixed at stub creation | Implementing agent must not modify or execute these (archive, complete.log, and task-directory archive move are review-agent only) |
| Roadmap Targets | Fixed at stub creation from plan when present | Implementing agent must not modify; code-review copies it into `complete.log` as `Roadmap Completion` only on PASS |
| Archive Evidence Snapshot | Fixed at stub creation from plan when present | Implementing agent uses it as default prior-loop context; read only the specific archive files cited there when more detail is required |
| Implementation Item Completion (item names) | Fixed at stub creation | Implementing agent checks `[ ]` → `[x]` only |
| Implementation Checklist (item text/order) | Fixed at stub creation from plan | Implementing agent checks `[ ]` → `[x]` only |
| Review-Only Checklist | Review agent only | Implementing agent must not modify or check this section |
| Deviations from Plan, Key Design Decisions | Implementing agent | Replace placeholder text with actual content |
| Reviewer Checkpoints | Fixed at stub creation | Pre-filled from plan |
| Verification Results (section headings + commands) | Fixed at stub creation | Implementing agent fills in command output only; command changes require a `Deviations from Plan` entry |
| Code Review Result | Review agent appends | Not included in stub |

## Code Review Result

- Overall Verdict: PASS
- Dimension Assessment:
  - Correctness: Pass
  - Completeness: Pass
  - Test Coverage: Pass
  - API Contract: Pass
  - Code Quality: Pass
  - Implementation Deviation: Pass
  - Verification Trust: Pass
  - Spec Conformance: Pass
- Findings: None.
- Routing Signals:
  - `review_rework_count=3`
  - `evidence_integrity_failure=false`
- Next Step: Write `complete.log`, archive the active pair, move the completed task under `agent-task/archive/2026/07/`, and report the milestone completion event metadata.
