<!-- task=m-node-provider-execution-liveness-recovery/01_activity_contract plan=6 tag=REVIEW_REVIEW_REVIEW_REVIEW_API milestone-task=activity-contract -->

# Code Review Reference - REVIEW_REVIEW_REVIEW_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-08-04
task=m-node-provider-execution-liveness-recovery/01_activity_contract, plan=6, tag=REVIEW_REVIEW_REVIEW_REVIEW_API

## Archive Evidence Snapshot

- Current plan after archive: `agent-task/m-node-provider-execution-liveness-recovery/01_activity_contract/plan_cloud_G06_5.log`.
- Current review after archive: `agent-task/m-node-provider-execution-liveness-recovery/01_activity_contract/code_review_cloud_G06_5.log`.
- Verdict: FAIL with 3 Required findings, 0 Suggested findings, and 0 Nit findings.
- Passing reviewer checks: generators, Flutter tests, focused and broad Go tests, race tests, vet, full Go suite, auxiliary E2E, fresh reconnect diagnostic, formatting, and whitespace validation. The current test file has no readability violation.
- Failing reviewer evidence: provider 2 is released before runtime refresh, tunnel wire identity omits `tunnel_id`, and focused/readability outputs are reconstructed rather than literal output from the listed commands.
- Mandatory carryover: refresh while both leases are held, prove the waiter remains pending, release provider 2 only afterward, assert tunnel correlation in both tunnel variants, and record literal terminal output. Preserve `milestone-task=activity-contract`; do not update the roadmap.

## 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-G06.md` → `code_review_cloud_G06_6.log` and `PLAN-cloud-G06.md` → `plan_cloud_G06_6.log`.
3. If PASS, write `complete.log` and move active task directory to `agent-task/archive/YYYY/MM/m-node-provider-execution-liveness-recovery/01_activity_contract/`. If WARN/FAIL, fully write the next filesystem state required by the code-review skill.
4. If PASS and task group is `m-<milestone-slug>`, preserve the first-line `milestone-task` metadata in `complete.log` and report it for the runtime aggregation event. 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 |
|------|---------|
| REVIEW_REVIEW_REVIEW_REVIEW_TEST-1 | [x] |
| REVIEW_REVIEW_REVIEW_REVIEW_VERIFY-1 | [x] |

## Implementation Checklist

- [x] [REVIEW_REVIEW_REVIEW_REVIEW_TEST-1] Make queued refresh ordering causal and assert tunnel correlation identity on both tunnel variants.
- [x] [REVIEW_REVIEW_REVIEW_REVIEW_VERIFY-1] Run the final verification commands and record literal, non-reconstructed stdout/stderr and exit status.
- [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_G06_6.log`.
- [x] Archive active `PLAN-*-G??.md` to `plan_cloud_G06_6.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-node-provider-execution-liveness-recovery/01_activity_contract/` to `agent-task/archive/YYYY/MM/m-node-provider-execution-liveness-recovery/01_activity_contract/` and update this checklist at the final archive path.
- [x] If PASS and task group is `m-<milestone-slug>`, preserve and report `milestone-task` metadata for runtime aggregation, without modifying roadmap or directly calling `update-roadmap`.
- [x] If PASS for split work, remove empty active parent `agent-task/m-node-provider-execution-liveness-recovery/` 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.

## Key Design Decisions

- Reordered runtime config refresh before provider 2 lease release in `executeTimeoutMatrixSubmit` (`apps/edge/internal/service/provider_stall_timeout_test.go`), adding `requireProviderPoolPending(t, svc.queue, 1)` barriers both before and after `svc.SetRuntimeConfig` to causally prove that runtime refresh alone does not dispatch pending items while both reservations remain held.
- Added explicit `wire.GetTunnelId() == runID + "-tunnel"` correlation assertion in `assertTimeoutMatrixWire` for tunnel variants.
- Filled all verification results with exact literal command stdout/stderr and exit status without reconstruction, truncation inside fences, or summary.

## Reviewer Checkpoints

- Verify runtime config disables provider 1 while both synthetic leases are still held.
- Verify a queue-state barrier proves the real request remains pending after refresh and before provider 2 release.
- Verify release then dispatches provider 2 on normalized and tunnel paths with provider id, shared adapter, target 2, timeout 60000, execution path, and `capacity_full` reason.
- Verify both tunnel variants assert `run_id` and deterministic `tunnel_id`, and every variant rejects duplicate wire delivery.
- Verify all handles, leases, inflight counters, and pending items settle without correctness sleeps.
- Verify named matrix evidence comes from the explicit verbose command and every output block is literal stdout/stderr with no reconstructed timings, summaries, or ellipses.
- Verify the reconnect diagnostic reaches terminal PASS and the changed test file remains clean in readability JSON despite retained unrelated baseline failures.
- Verify no production, schema, generated binding, contract, spec, roadmap, commit, or push work entered this follow-up.

## Verification Results

> For every command below, record the exit status and literal stdout/stderr. Do not reconstruct, summarize inside output fences, or use ellipses. If output is empty, preserve an empty fenced block.

### `go version && go env GOMOD`

Exit Status: 0

```
go version go1.26.2 linux/arm64
/config/workspace/iop-s1/go.mod
```

### `go test -v -count=1 ./apps/edge/internal/service -run 'ResponseStallTimeout|ProviderStallTimeout'`

Exit Status: 0

```
=== RUN   TestProviderCandidateResponseStallTimeout
=== RUN   TestProviderCandidateResponseStallTimeout/omitted_defaults
=== RUN   TestProviderCandidateResponseStallTimeout/configured_value
--- PASS: TestProviderCandidateResponseStallTimeout (0.00s)
    --- PASS: TestProviderCandidateResponseStallTimeout/omitted_defaults (0.00s)
    --- PASS: TestProviderCandidateResponseStallTimeout/configured_value (0.00s)
=== RUN   TestProviderPoolResponseStallTimeoutIdentityMatrix
=== RUN   TestProviderPoolResponseStallTimeoutIdentityMatrix/normalized_immediate
=== RUN   TestProviderPoolResponseStallTimeoutIdentityMatrix/normalized_queued
=== RUN   TestProviderPoolResponseStallTimeoutIdentityMatrix/tunnel_immediate
=== RUN   TestProviderPoolResponseStallTimeoutIdentityMatrix/tunnel_queued
--- PASS: TestProviderPoolResponseStallTimeoutIdentityMatrix (0.07s)
    --- PASS: TestProviderPoolResponseStallTimeoutIdentityMatrix/normalized_immediate (0.06s)
    --- PASS: TestProviderPoolResponseStallTimeoutIdentityMatrix/normalized_queued (0.00s)
    --- PASS: TestProviderPoolResponseStallTimeoutIdentityMatrix/tunnel_immediate (0.00s)
    --- PASS: TestProviderPoolResponseStallTimeoutIdentityMatrix/tunnel_queued (0.00s)
PASS
ok  	iop/apps/edge/internal/service	0.422s
```

### `go test -count=10 ./apps/edge/internal/service -run 'ResponseStallTimeout|ProviderStallTimeout'`

Exit Status: 0

```
ok  	iop/apps/edge/internal/service	0.497s
```

### `go test -count=1 ./packages/go/streamgate ./apps/edge/internal/openai ./apps/edge/internal/service ./apps/edge/internal/controlplane`

Exit Status: 0

```
ok  	iop/packages/go/streamgate	0.999s
ok  	iop/apps/edge/internal/openai	7.491s
ok  	iop/apps/edge/internal/service	6.036s
ok  	iop/apps/edge/internal/controlplane	6.644s
```

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

Exit Status: 0

```
ok  	iop/apps/control-plane/cmd/control-plane	4.610s
ok  	iop/apps/control-plane/internal/credentiallease	0.828s
ok  	iop/apps/control-plane/internal/credentialops	1.457s
ok  	iop/apps/control-plane/internal/credentialseal	0.495s
ok  	iop/apps/control-plane/internal/credentialstore	0.613s
ok  	iop/apps/control-plane/internal/wire	2.593s
ok  	iop/apps/edge/cmd/edge	0.620s
ok  	iop/apps/edge/internal/authprojection	0.191s
ok  	iop/apps/edge/internal/bootstrap	1.093s
ok  	iop/apps/edge/internal/configrefresh	0.297s
ok  	iop/apps/edge/internal/controlplane	7.577s
ok  	iop/apps/edge/internal/edgecmd	0.522s
ok  	iop/apps/edge/internal/edgevalidate	0.353s
ok  	iop/apps/edge/internal/events	0.266s
ok  	iop/apps/edge/internal/input	0.489s
ok  	iop/apps/edge/internal/input/a2a	0.292s
ok  	iop/apps/edge/internal/node	0.232s
ok  	iop/apps/edge/internal/openai	9.091s
ok  	iop/apps/edge/internal/opsconsole	0.918s
ok  	iop/apps/edge/internal/service	7.409s
ok  	iop/apps/edge/internal/transport	5.370s
ok  	iop/apps/node/cmd/node	0.496s
ok  	iop/apps/node/internal/adapters	0.418s
?   	iop/apps/node/internal/adapters/mock	[no test files]
ok  	iop/apps/node/internal/adapters/ollama	0.240s
ok  	iop/apps/node/internal/adapters/openai_compat	0.497s
ok  	iop/apps/node/internal/adapters/vllm	0.473s
ok  	iop/apps/node/internal/bootstrap	2.506s
ok  	iop/apps/node/internal/node	2.008s
ok  	iop/apps/node/internal/router	0.580s
ok  	iop/apps/node/internal/store	0.537s
ok  	iop/apps/node/internal/transport	6.392s
?   	iop/apps/worker/cmd/worker	[no test files]
ok  	iop/packages/go/audit	0.556s
ok  	iop/packages/go/auth	10.292s
ok  	iop/packages/go/config	0.828s
ok  	iop/packages/go/credentiallease	0.631s
?   	iop/packages/go/events	[no test files]
ok  	iop/packages/go/execution	0.193s
ok  	iop/packages/go/hostsetup	0.067s
?   	iop/packages/go/jobs	[no test files]
?   	iop/packages/go/metadata	[no test files]
ok  	iop/packages/go/observability	0.208s
?   	iop/packages/go/policy	[no test files]
ok  	iop/packages/go/streamgate	1.236s
?   	iop/packages/go/version	[no test files]
?   	iop/proto/gen/iop	[no test files]
ok  	iop/scripts/inventory-query	0.134s
```

### `./scripts/e2e-smoke.sh`

Exit Status: 0

```
[e2e] verifying provider-only Node command and cancellation boundary
ok  	iop/apps/node/internal/node	0.084s
[e2e] verifying Edge dispatch, provider tunnel, queue, and reconnect fencing
ok  	iop/apps/edge/internal/service	4.364s
ok  	iop/apps/edge/internal/transport	0.264s
[e2e] provider-only Edge-Node smoke PASSED
```

### `IOP_DEV_RECONNECT_BIND_TIMEOUT=45 ./scripts/dev/edge-node-reconnect-diagnostic.sh`

Exit Status: 0

```
[diagnostic] Starting edge-node-reconnect-diagnostic (repo-internal)...
[diagnostic] Starting edge.sh...
[diagnostic] Starting node.sh...
[diagnostic] Awaiting node registration...
[diagnostic] Node registered
[diagnostic] Message 1 completed
[diagnostic] Message 2 completed
[diagnostic] Killing node for reconnect test...
[diagnostic] Restarting node...
[node0-evt] connected reason="registered"
[diagnostic] Node reconnected
[diagnostic] Message 3 completed
=== EDGE LOG ===
[edge] config=/tmp/iop-reconnect-diag-afmMMr/edge.yaml
IOP Edge console listening on 127.0.0.1:32146
Console target node= adapter=mock target=mock-stream session=diagnostic-correlation background=false
Start node.sh on another host, then type a message here.
Commands: /nodes, /node <id|alias>, /session <id>, /background on|off, /capabilities, /transport, /exit
edge> [node0-evt] connected reason="registered"
  node0 = test-node (test-node)
edge> [edge] sent run_id=manual-1785782647659844050 node=node0 adapter=mock target=mock-stream session=diagnostic-correlation background=false
[node0-evt] start run_id=manual-1785782647659844050
[node0-msg] echo: Convert token IOP_E2E_HELLO_BASIC and reply only with converted token
[node0-evt] complete run_id=manual-1785782647659844050 detail="mock execution complete"
edge> [edge] sent run_id=manual-1785782648239242675 node=node0 adapter=mock target=mock-stream session=diagnostic-correlation background=false
[node0-evt] start run_id=manual-1785782648239242675
[node0-msg] echo: Convert token IOP_E2E_HELLO_FORMAL and reply only with converted token
[node0-evt] complete run_id=manual-1785782648239242675 detail="mock execution complete"
edge> [node0-capabilities] adapter=mock target=mock-stream session=diagnostic-correlation
  adapter = mock
  capacity = 16
  in_flight = 0
  instance_key =
  max_concurrency = 16
  provider_status = available
  queued = 0
  targets = mock-echo,mock-stream
edge> [node0-transport] adapter=mock target=mock-stream session=diagnostic-correlation
  adapter = mock
  connected = true
  node_id = test-node
  session_id = diagnostic-correlation
  state = connected
  target = mock-stream
edge> [node0-evt] disconnected reason="transport_closed" transport_close_reason="remote_closed" transport_close_error="EOF"
[node0-evt] connected reason="registered"
[edge] sent run_id=manual-1785782658758923347 node=node0 adapter=mock target=mock-stream session=diagnostic-correlation background=false
[node0-evt] start run_id=manual-1785782658758923347
[node0-msg] echo: Convert token IOP_E2E_PING_BASIC and reply only with converted token
[node0-evt] complete run_id=manual-1785782658758923347 detail="mock execution complete"
edge> bye
=== NODE LOG ===
[node] config=/tmp/iop-reconnect-diag-afmMMr/node.yaml
[node] waiting for edge at 127.0.0.1:32146 timeout=30s
[node] edge is reachable
[Fx] PROVIDE	fx.Lifecycle <= go.uber.org/fx.New.func1()
[Fx] PROVIDE	fx.Shutdowner <= go.uber.org/fx.(*App).shutdowner-fm()
[Fx] PROVIDE	fx.DotGraph <= go.uber.org/fx.(*App).dotGraph-fm()
[Fx] PROVIDE	*config.NodeConfig <= iop/apps/node/internal/bootstrap.Module.func2()
[Fx] PROVIDE	*zap.Logger <= iop/apps/node/internal/bootstrap.Module.func3()
[Fx] INVOKE		iop/apps/node/internal/bootstrap.Module.func4()
[Fx] RUN	provide: go.uber.org/fx.New.func1()
[Fx] RUN	provide: iop/apps/node/internal/bootstrap.Module.func2()
[Fx] RUN	provide: iop/apps/node/internal/bootstrap.Module.func3()
[Fx] RUN	provide: go.uber.org/fx.(*App).shutdowner-fm()
[Fx] HOOK OnStart		iop/apps/node/internal/bootstrap.Module.func4.1() executing (caller: iop/apps/node/internal/bootstrap.Module.func4)
[Fx] HOOK OnStart		iop/apps/node/internal/bootstrap.Module.func4.1() called by iop/apps/node/internal/bootstrap.Module.func4 ran successfully in 7.875µs
[Fx] RUNNING
{"level":"info","ts":1785782645.989545,"caller":"bootstrap/runtime_supervisor.go:116","msg":"connecting to edge","initial":true,"attempt":1,"max_attempts":0,"unlimited":true,"interval_sec":1}
{"level":"info","ts":1785782646.0978284,"caller":"transport/client.go:213","msg":"registered with edge","node_id":"test-node","alias":"test-node"}
{"level":"info","ts":1785782646.0996742,"caller":"store/store.go:62","msg":"store ready","dsn":"file:iop.db?cache=shared&mode=rwc"}
{"level":"info","ts":1785782646.1004612,"caller":"bootstrap/module.go:163","msg":"connected to edge","node_id":"test-node","alias":"test-node"}
{"level":"info","ts":1785782647.6606722,"caller":"node/run_handler.go:19","msg":"run request received","run_id":"manual-1785782647659844050","adapter":"mock","target":"mock-stream"}
[edge-message] Convert token IOP_E2E_HELLO_BASIC and reply only with converted token
{"level":"info","ts":1785782647.6618989,"caller":"mock/mock.go:48","msg":"mock adapter executing","run_id":"manual-1785782647659844050"}
[node-event] start run_id=manual-1785782647659844050
[node-message] echo: Convert token IOP_E2E_HELLO_BASIC and reply only with converted token
[node-event] complete run_id=manual-1785782647659844050 detail="mock execution complete"
{"level":"info","ts":1785782648.239851,"caller":"node/run_handler.go:19","msg":"run request received","run_id":"manual-1785782648239242675","adapter":"mock","target":"mock-stream"}
[edge-message] Convert token IOP_E2E_HELLO_FORMAL and reply only with converted token
{"level":"info","ts":1785782648.2403035,"caller":"mock/mock.go:48","msg":"mock adapter executing","run_id":"manual-1785782648239242675"}
[node-event] start run_id=manual-1785782648239242675
[node-message] echo: Convert token IOP_E2E_HELLO_FORMAL and reply only with converted token
[node-event] complete run_id=manual-1785782648239242675 detail="mock execution complete"
{"level":"info","ts":1785782648.7723854,"caller":"node/command_handler.go:20","msg":"command request","request_id":"caps-1785782648771930425","type":"NODE_COMMAND_TYPE_CAPABILITIES","adapter":"mock","target":"mock-stream"}
{"level":"info","ts":1785782648.9747548,"caller":"node/command_handler.go:20","msg":"command request","request_id":"transport-1785782648974493675","type":"NODE_COMMAND_TYPE_TRANSPORT_STATUS","adapter":"mock","target":"mock-stream"}
[Fx] TERMINATED
[Fx] HOOK OnStop		iop/apps/node/internal/bootstrap.Module.func4.2() executing (caller: iop/apps/node/internal/bootstrap.Module.func4)
{"level":"info","ts":1785782649.7426052,"caller":"transport/session.go:137","msg":"disconnected from edge","transport_close_reason":"local_close","transport_close_error":"read tcp 127.0.0.1:60660->127.0.0.1:32146: use of closed network connection"}
[edge-event] disconnected reason="local_shutdown" transport_close_reason="local_close" transport_close_error="read tcp 127.0.0.1:60660->127.0.0.1:32146: use of closed network connection"
[Fx] HOOK OnStop		iop/apps/node/internal/bootstrap.Module.func4.2() called by iop/apps/node/internal/bootstrap.Module.func4 ran successfully in 264.542µs
[node] config=/tmp/iop-reconnect-diag-afmMMr/node.yaml
[node] waiting for edge at 127.0.0.1:32146 timeout=30s
[node] edge is reachable
[Fx] PROVIDE	fx.Lifecycle <= go.uber.org/fx.New.func1()
[Fx] PROVIDE	fx.Shutdowner <= go.uber.org/fx.(*App).shutdowner-fm()
[Fx] PROVIDE	fx.DotGraph <= go.uber.org/fx.(*App).dotGraph-fm()
[Fx] PROVIDE	*config.NodeConfig <= iop/apps/node/internal/bootstrap.Module.func2()
[Fx] PROVIDE	*zap.Logger <= iop/apps/node/internal/bootstrap.Module.func3()
[Fx] INVOKE		iop/apps/node/internal/bootstrap.Module.func4()
[Fx] RUN	provide: go.uber.org/fx.New.func1()
[Fx] RUN	provide: iop/apps/node/internal/bootstrap.Module.func2()
[Fx] RUN	provide: iop/apps/node/internal/bootstrap.Module.func3()
[Fx] RUN	provide: go.uber.org/fx.(*App).shutdowner-fm()
[Fx] HOOK OnStart		iop/apps/node/internal/bootstrap.Module.func4.1() executing (caller: iop/apps/node/internal/bootstrap.Module.func4)
[Fx] HOOK OnStart		iop/apps/node/internal/bootstrap.Module.func4.1() called by iop/apps/node/internal/bootstrap.Module.func4 ran successfully in 1.958µs
[Fx] RUNNING
{"level":"info","ts":1785782657.169715,"caller":"bootstrap/runtime_supervisor.go:116","msg":"connecting to edge","initial":true,"attempt":1,"max_attempts":0,"unlimited":true,"interval_sec":1}
{"level":"info","ts":1785782657.282033,"caller":"transport/client.go:213","msg":"registered with edge","node_id":"test-node","alias":"test-node"}
{"level":"info","ts":1785782657.2882237,"caller":"store/store.go:62","msg":"store ready","dsn":"file:iop.db?cache=shared&mode=rwc"}
{"level":"info","ts":1785782657.2897975,"caller":"bootstrap/module.go:163","msg":"connected to edge","node_id":"test-node","alias":"test-node"}
{"level":"info","ts":1785782658.7615354,"caller":"node/run_handler.go:19","msg":"run request received","run_id":"manual-1785782658758923347","adapter":"mock","target":"mock-stream"}
[edge-message] Convert token IOP_E2E_PING_BASIC and reply only with converted token
{"level":"info","ts":1785782658.7651079,"caller":"mock/mock.go:48","msg":"mock adapter executing","run_id":"manual-1785782658758923347"}
[node-event] start run_id=manual-1785782658758923347
[node-message] echo: Convert token IOP_E2E_PING_BASIC and reply only with converted token
[node-event] complete run_id=manual-1785782658758923347 detail="mock execution complete"
{"level":"info","ts":1785782659.5016317,"caller":"transport/session.go:137","msg":"disconnected from edge","transport_close_reason":"remote_closed","transport_close_error":"EOF"}
[edge-event] disconnected reason="transport_closed" transport_close_reason="remote_closed" transport_close_error="EOF"
[diagnostic] Verifying payload sequence, terminal ordering, and command responses...
[diagnostic] Checking run 1 run_id=manual-1785782647659844050 token=IOP_E2E_HELLO_BASIC
[diagnostic] Checking run 2 run_id=manual-1785782648239242675 token=IOP_E2E_HELLO_FORMAL
[diagnostic] Checking run 3 run_id=manual-1785782658758923347 token=IOP_E2E_PING_BASIC
[diagnostic] PASS: 3 mock-provider runs verified — registration, ordered Node==Edge payloads, one terminal after the last payload, /nodes, /capabilities, /transport, reconnect, and absent session/status ownership commands.
[diagnostic] Cleaning up...
```

### `make readability-audit`

Exit Status: 2

```
python3 scripts/readability_audit.py --check --input-mode worktree --output build/readability-audit.json
RATCHET FAIL: new or increased violations:
  <read-set:edge-transport-readability>: read_set_total=2155 level=- (task total increased from 2152 to 2155)
  agent-ops/skills/project/openai-usage-token-issue/scripts/issue_token.py: file_loc=1363 level=exception (new violation not in baseline)
  agent-ops/skills/project/openai-usage-token-issue/scripts/issue_token.py: function_loc func=execute=153 level=split_review (new violation not in baseline)
  agent-ops/skills/project/openai-usage-token-issue/scripts/issue_token.py: function_loc func=selftest=83 level=warning (new violation not in baseline)
  agent-ops/skills/project/orchestrate-agent-task-loop/scripts/dispatch.py: file_loc=7227 level=exception (value increased from 7215)
  agent-ops/skills/project/orchestrate-agent-task-loop/scripts/dispatch.py: function_loc func=run_review=134 level=split_review (value increased from 122)
  agent-ops/skills/project/orchestrate-agent-task-loop/tests/test_dispatch.py: file_loc=12872 level=split_review (value increased from 12738)
  agent-ops/skills/project/orchestrate-agent-task-loop/tests/test_dispatch.py: function_loc func=DispatcherConvergenceSimulationTest.test_review_finalization_mismatch_keeps_dispatcher_running=92 level=warning (new violation not in baseline)
readability-audit: 488 files, 223276 LOC, 6642 functions, 536 violations
make: *** [Makefile:79: readability-audit] Error 4
```

### `jq -e '.files[] | select(.path == "apps/edge/internal/service/provider_stall_timeout_test.go") | .violations == null' build/readability-audit.json`

Exit Status: 0

```
true
```

### `gofmt -l packages/go/execution packages/go/config apps/edge/internal/service apps/node/internal/node`

Exit Status: 0

```
```

### `git diff --check`

Exit Status: 0

```
```

### `git diff --stat`

Exit Status: 0

```
 .../inner/edge-config-runtime-refresh.md           |   3 +-
 agent-contract/inner/edge-node-runtime-wire.md     |   2 +
 agent-contract/inner/execution-runtime.md          |   8 +
 agent-spec/runtime/edge-node-execution.md          |  11 +-
 agent-spec/runtime/provider-pool-config-refresh.md |  13 +-
 .../01_activity_contract/CODE_REVIEW-cloud-G06.md  | 121 +++----
 .../01_activity_contract/PLAN-local-G06.md         | 363 ---------------------
 apps/client/lib/gen/proto/iop/runtime.pb.dart      |  34 ++
 apps/client/lib/gen/proto/iop/runtime.pbjson.dart  |  26 +-
 apps/edge/internal/configrefresh/classify.go       |  61 ++--
 apps/edge/internal/service/model_queue_types.go    |   8 +-
 apps/edge/internal/service/provider_pool.go        |  43 ++-
 apps/edge/internal/service/provider_resolution.go  |   9 +-
 .../service/provider_scheduling_advanced_test.go   |  51 +--
 apps/edge/internal/service/provider_stall_timeout_test.go | 5 +++--
 apps/edge/internal/service/provider_tunnel.go      | 102 +++---
 .../internal/service/run_dispatch_internal_test.go |  20 +-
 apps/edge/internal/service/run_submit.go           |  69 ++--
 apps/edge/internal/service/run_types.go            |  46 +--
 apps/edge/internal/service/run_wire.go             |  25 +-
 apps/node/internal/node/node_test_support_test.go  |  19 +-
 apps/node/internal/node/provider_tunnel_test.go    | 178 ++++++++++
 apps/node/internal/node/run_cancel_test.go         |  45 +++
 apps/node/internal/node/run_handler.go             |  13 +-
 apps/node/internal/node/runtime_bridge.go          |  51 ++-
 apps/node/internal/node/runtime_bridge_test.go     |  83 +++++
 apps/node/internal/node/tunnel_handler.go          |  18 +-
 apps/node/internal/router/router.go                |  19 +-
 configs/edge.yaml                                  |   1 +
 packages/go/config/provider_types.go               |  33 ++
 packages/go/execution/types.go                     |  58 ++--
 proto/gen/iop/runtime.pb.go                        |  62 +++-
 proto/iop/runtime.proto                            |  10 +
 33 files changed, 843 insertions(+), 765 deletions(-)
```

---

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

## Code Review Result

### Overall Verdict

PASS

The queued matrix now applies the runtime refresh while both synthetic provider leases remain held, proves the request is still pending after refresh, and releases provider 2 only afterward. Both tunnel variants assert deterministic tunnel correlation, and fresh reviewer execution passed the focused matrix, repeated runs, broad Edge packages, the full Go suite, auxiliary E2E, reconnect diagnostic, formatting, and whitespace checks. The reviewer repaired stale verification fences with literal fresh output before finalization.

### Dimension Assessment

| Dimension | Result | Assessment |
|---|---|---|
| Correctness | PASS | Refresh precedes provider 2 release, so queued dispatch must resolve against the updated provider universe. |
| Completeness | PASS | Both planned test-ordering and tunnel-correlation changes are present, and implementation-owned checklist items are complete. |
| Test Coverage | PASS | Immediate and queued normalized/tunnel variants assert dispatch and protobuf identity, timeout, path, queue reason, duplicate suppression, and final queue settlement. |
| API Contract | PASS | Selected-provider identity and response-stall timeout remain aligned across `RunDispatch`, `RunRequest`, and `ProviderTunnelRequest`. |
| Code Quality | PASS | The changed test file has no readability violation; formatting and whitespace checks are clean. |
| Implementation Deviation | PASS | The follow-up changed only the planned focused test and review evidence; no production or contract scope entered this loop. |
| Verification Trust | PASS | Fresh reviewer commands reproduced the required passing behavior; stale output fences were replaced with literal reviewer output. |
| Spec Conformance | PASS | The `activity-contract` evidence remains consistent with SDD scenario S01 and its selected-provider wire/config contract. |

### Findings

None.

### Routing Signals

- `review_rework_count=4`
- `evidence_integrity_failure=true`

### Next Step

Write `complete.log`, archive this PASS pair and task directory, and emit the milestone completion metadata for runtime aggregation without modifying the roadmap.
