<!-- task=m-iop-owned-single-request-agent-execution/09+08_workspace_wire plan=0 tag=API milestone-task=tool-executor -->

# Code Review Reference - 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.
> Execute the plan's selected root cause, scope, files, and dependency decisions as written. Do not choose another owner, narrow/expand the write boundary, or replace a fix with another verification attempt.
> 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-08-06
task=m-iop-owned-single-request-agent-execution/09+08_workspace_wire, plan=0, tag=API

## 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-G09.md` → `code_review_cloud_G09_0.log` and `PLAN-cloud-G08.md` → `plan_cloud_G08_0.log`.
3. If PASS, write `complete.log` and move active task directory to `agent-task/archive/YYYY/MM/m-iop-owned-single-request-agent-execution/09+08_workspace_wire/`. If WARN/FAIL, fully write the next filesystem state required by the code-review skill.
4. If PASS, preserve the first-line `milestone-task=tool-executor` metadata in `complete.log` and report it for runtime aggregation. Roadmap state evaluation belongs to `sync-milestone-workstate`.
5. Check applicable `Review-Only Checklist` items at the final `.log` location before reporting.

---

## Implementation Item Completion

| Item | Status |
|------|---------|
| API-1 Define the workspace protocol and catalog payload | [ ] |
| API-2 Register compatible parsers and optional Node handlers | [ ] |
| API-3 Dispatch only to the admitted generation | [ ] |

## Implementation Checklist

- [ ] Define and generate a dedicated typed workspace config/open/tool/cancel/cleanup protocol with closed operations, identities, statuses, error codes, and bounded result fields.
- [ ] Deliver approved capabilities in `NodeConfigPayload` and register backward-compatible Edge/Node parsers plus an optional Node workspace handler.
- [ ] Implement a generation-fenced service wire client that never reselects a Node and propagates timeout/context cancellation without raw logging.
- [ ] Prove proto generation cleanliness, parser/round-trip/cancel/stale-generation behavior, and synchronize the wire contract/living spec.
- [ ] Run dependency, proto, focused race, package, vet, documentation, and whitespace verification.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

## Review-Only Checklist

> **[REVIEW AGENT ONLY]** Implementing agents must not modify or check this section.

- [ ] Append PASS/WARN/FAIL with verified routing signals and matching findings/dimensions.
- [ ] Archive the active pair to the routed `*_0.log` names.
- [ ] Verify the managed `.gitignore` block.
- [ ] On PASS write `complete.log`, preserve/report Milestone metadata, and move this directory to the monthly archive.
- [ ] Keep the active task-group parent while siblings remain.
- [ ] On WARN/FAIL write only the code-review skill's required next state.

## Deviations from Plan

_Record deviations and rationale here._

## Key Design Decisions

_Record key implemented decisions here._

## Reviewer Checkpoints

- Confirm no workspace data was added to `RunRequest`, provider execution, or `NodeCommand`.
- Confirm protobuf field numbering, oneof use, closed enums, bounds, and generated-file provenance.
- Confirm existing `Handler` mocks remain source-compatible through an optional interface.
- Confirm every dispatch checks admitted Node id/generation and never reselects after reconnect.
- Confirm logs/errors do not expose raw tool inputs/results or config secrets.

## Verification Results

Paste actual stdout/stderr for every command; record any replacement under deviations.

### 1. Dependency

`test -f agent-task/m-iop-owned-single-request-agent-execution/08+03,07_workspace_admission/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/08+03,07_workspace_admission/complete.log' | wc -l)" -eq 1`

```text
[fill]
```

### 2. Protobuf generation

`make proto`

```text
[fill]
```

### 3. Generated-file scope

`git diff --exit-code -- proto/gen/iop/agent.pb.go proto/gen/iop/control.pb.go proto/gen/iop/job.pb.go proto/gen/iop/node.pb.go`

```text
[fill]
```

### 4. Focused race tests

`go test -race ./apps/edge/internal/node ./apps/edge/internal/service ./apps/edge/internal/transport ./apps/node/internal/transport -run 'Test(BuildConfigPayload.*Workspace|WorkspaceWire|NodeParserMapWorkspace|SessionWorkspace|EdgeParserMapWorkspace)' -count=1`

```text
[fill]
```

### 5. Package regression

`go test ./apps/edge/internal/node ./apps/edge/internal/service ./apps/edge/internal/transport ./apps/node/internal/transport -count=1`

```text
[fill]
```

### 6. Vet

`go vet ./apps/edge/internal/node ./apps/edge/internal/service ./apps/edge/internal/transport ./apps/node/internal/transport`

```text
[fill]
```

### 7. Contract/spec search

`rg --sort path -n 'Workspace(Open|Tool|Cancel|Cleanup)|RunRequest|NodeCommand|generation|raw' agent-contract/inner/edge-node-runtime-wire.md agent-spec/runtime/edge-node-execution.md`

```text
[fill]
```

### 8. Whitespace

`git diff --check`

```text
[fill]
```

---

> **[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) |
| 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 |
