<!-- task=m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop plan=0 tag=API milestone-task=tool-loop -->

# Complete - m-iop-owned-single-request-agent-execution/12+05,06,08,11_internal_tool_loop

## Completed At

2026-08-07

## Summary

The coordinator-owned internal workspace tool loop completed in one review loop with a final PASS verdict.

## Loop History

| Plan | Review | Verdict | Notes |
|------|--------|---------|-------|
| `plan_cloud_G09_0.log` | `code_review_cloud_G10_0.log` | PASS | Closed schemas, saved-stage continuation, immutable budgets, cancellation, and one-POST private multi-tool evidence were verified. |

## Implementation and Cleanup

- Added service-owned closed read/list/write/delete/command tool schemas and strict decoding without caller-facing codec reuse.
- Added ordered exact-generation workspace execution, one pending correlated result, saved-stage-only continuation, immutable iteration/output/deadline budgets, and typed cancellation.
- Added deterministic service race tests and a real marked Anthropic HTTP POST test with multiple private Node wire round trips and no public continuation protocol.
- Synchronized the Anthropic outer contract and the matching input/runtime living specs.

## Final Verification

- `test -f agent-task/m-iop-owned-single-request-agent-execution/05+03_single_ingress/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/05+03_single_ingress/complete.log' | wc -l)" -eq 1` - PASS; exit 0.
- `test -f agent-task/m-iop-owned-single-request-agent-execution/06+05_stream_terminal/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/06+05_stream_terminal/complete.log' | wc -l)" -eq 1` - PASS; exit 0.
- `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` - PASS; exit 0.
- `test -f agent-task/m-iop-owned-single-request-agent-execution/11+10_workspace_command/complete.log || test "$(compgen -G 'agent-task/archive/*/*/m-iop-owned-single-request-agent-execution/11+10_workspace_command/complete.log' | wc -l)" -eq 1` - PASS; exit 0.
- `go test -race ./apps/edge/internal/service -run 'Test(InternalWorkspaceTool|SingleRequestInternalToolLoop)' -count=1` - PASS; `ok iop/apps/edge/internal/service 1.106s`.
- `go test ./apps/edge/internal/openai -run 'TestAnthropicSingleRequest(UsesOnePost|InternalToolsStayPrivate)' -count=1` - PASS; `ok iop/apps/edge/internal/openai 0.034s`.
- `go test ./apps/edge/internal/service ./apps/edge/internal/openai -count=1` - PASS; service `6.198s`, openai `7.872s`.
- `go vet ./apps/edge/internal/service ./apps/edge/internal/openai` - PASS; exit 0 with no output.
- `rg --sort path -n 'internal tool|tool_use|second|workspace|defer' agent-contract/outer/anthropic-compatible-api.md agent-spec/input/openai-compatible-surface.md agent-spec/runtime/edge-node-execution.md` - PASS; matching implementation and deferral text is present in all selected documents.
- `git diff --check` - PASS; exit 0 with no output.

## Remaining Nits

- None.

## Follow-up Work

- None.
