<!-- task=agent_task_english_contract plan=1 tag=REVIEW_REFACTOR -->

# Complete the Agent-Task English Artifact Contract

## For the Implementing Agent

Filling implementation-owned sections in `CODE_REVIEW-*-G??.md` is the mandatory final implementation step. Run every verification command, record actual notes and stdout/stderr, keep the active files in place, and report ready for review. Finalization belongs only to the code-review skill. If blocked, record the exact blocker, attempted commands/output, and resume condition only in implementation-owned evidence fields; do not ask the user, call user-input tools, create control-plane stop files, classify the next state, archive logs, or write `complete.log`.

## Background

The first migration pass added canonical English task artifacts and legacy Korean readers, but official review found incomplete schema references and untrusted regression evidence. This follow-up closes only those findings: canonical skill consistency, deterministic legacy/canonical recovery coverage, restoration of a disabled restart test, and stabilization of the observed full-suite concurrency failure.

## Archive Evidence Snapshot

- Prior plan: `agent-task/agent_task_english_contract/plan_local_G06_0.log`
- Prior review: `agent-task/agent_task_english_contract/code_review_cloud_G06_0.log`
- Verdict: `FAIL`
- Required findings: restore the removed restart-test coroutine execution; replace canonical-write references that still point only to legacy headings; complete identity-matching recovery/template-language coverage and stabilize the completion-scan concurrency test.
- Verification evidence: reviewer `py_compile`, five focused language-contract tests, and `git diff --check` passed; the fresh 267-test suite failed at `DispatcherConvergenceSimulationTest.test_parallel_multi_task_followup_dependency_and_terminal_completion`; the disabled restart test returned a vacuous PASS in `0.000s`.
- Roadmap carryover: none. This task is not Milestone-linked and has no `Roadmap Targets`.
- Implementation rule: use this snapshot and the two named logs as prior-loop evidence; do not search `agent-task/archive/**`.

## Analysis

### Files Read

- `agent-ops/rules/project/rules.md`
- `agent-ops/rules/common/rules-roadmap.md`
- `agent-ops/rules/common/philosophy.md`
- `agent-ops/rules/project/domain/testing/rules.md`
- `agent-ops/skills/common/router.md`
- `agent-ops/skills/common/plan/SKILL.md`
- `agent-ops/skills/common/code-review/SKILL.md`
- `agent-ops/skills/common/finalize-task-routing/SKILL.md`
- `agent-ops/skills/common/plan/templates/review-stub-template.md`
- `agent-ops/skills/project/orchestrate-agent-task-loop/SKILL.md`
- `agent-ops/skills/project/orchestrate-agent-task-loop/scripts/dispatch.py`
- `agent-ops/skills/project/orchestrate-agent-task-loop/scripts/dispatcher_observation.py`
- `agent-ops/skills/project/orchestrate-agent-task-loop/scripts/select_execution_target.py`
- `agent-ops/skills/project/orchestrate-agent-task-loop/scripts/execution_target_policy.py`
- `agent-ops/skills/project/orchestrate-agent-task-loop/tests/test_dispatch.py`
- `agent-test/local/rules.md`
- `agent-test/local/testing-smoke.md`
- `agent-spec/index.md`
- `agent-contract/index.md`
- `.gitignore`
- `agent-task/agent_task_english_contract/plan_local_G06_0.log`
- `agent-task/agent_task_english_contract/code_review_cloud_G06_0.log`

### SDD Criteria

Not applicable. This is non-roadmap Agent-Ops artifact-contract maintenance.

### Test Environment Rules

- `test_env=local`.
- `agent-test/local/rules.md` and `agent-test/local/testing-smoke.md` were read.
- The Edge/Node smoke and live-provider profiles do not apply to an isolated Python Markdown parser and task-artifact workflow change.
- Applied verification is fresh `py_compile`, focused deterministic unittest cases, the complete dispatcher unittest discovery command, and `git diff --check`.
- No external checkout, provider invocation, Docker runtime, or non-local preflight is required.
- Dispatcher tests must retain provider-deny guards and must not construct or execute real provider commands.

### Test Coverage Gaps

- The prior test edit removed `asyncio.run(_async_run())` from an existing restart test, so its assertions no longer execute.
- Canonical and legacy verdict parsing is covered, but archived plan/review identity matching is not exercised by the new recovery test.
- The template test checks only four headings and does not prove that canonical write/finalization instructions use the English schema while Korean names remain legacy aliases.
- The completion-triggered scan assertion relies on sleep timing and failed once in the fresh full suite; deterministic synchronization is missing.

### Symbol References

No production symbol is renamed or removed. Keep `extract_write_set`, `markdown_section`, `implementation_review_errors`, `verdict_from_text`, `read_verdict`, `latest_verdict_log`, `matching_plan_log`, and prompt function names stable.

### Split Judgment

Keep one plan. The pair schema, recovery parser evidence, and review finalization instructions form one compatibility invariant; separating documentation from regression evidence would allow an internally inconsistent active pair to pass independently.

### Scope Rationale

- Modify only `plan/SKILL.md`, `code-review/SKILL.md`, and `test_dispatch.py`.
- Do not change dispatcher production behavior unless a newly deterministic test proves a direct defect; current findings are instruction drift and test-harness gaps.
- Do not translate `USER_REVIEW.md`, `complete.log`, `WORK_LOG.md`, roadmap documents, runtime banners, or user-facing Korean final responses.
- Do not modify prior logs, roadmap state, agent-spec, agent-contract, `.clinerules`, or unrelated user changes.

### Final Routing

- `evaluation_mode=isolated-reassessment`
- `finalizer=finalize-task-policy.sh`, `finalizer_mode=pair`
- Build closures: scope/context/verification/evidence/ownership/decision are all `true`.
- Build grade scores: scope=1, state=2, blast=1, evidence=2, verification=1, total=`G07`.
- Build base/final route: `local-fit` -> `recovery-boundary`, lane=`cloud`, filename=`PLAN-cloud-G07.md`.
- Review closures: scope/context/verification/evidence/ownership/decision are all `true`.
- Review grade scores: scope=1, state=2, blast=1, evidence=2, verification=1, total=`G07`.
- Review route: `official-review`, lane=`cloud`, Codex `gpt-5.6-sol` xhigh, filename=`CODE_REVIEW-cloud-G07.md`.
- `large_indivisible_context=false`.
- Positive loop risks: `temporal_state`, `concurrent_consistency`, `boundary_contract`, `structured_interpretation`, `variant_product`; count=5.
- `review_rework_count=1`, `evidence_integrity_failure=true`.
- `risk_boundary_matched=true`, `recovery_boundary_matched=true`.
- Capability gap: none.

## Implementation Checklist

- [ ] [REVIEW_REFACTOR-1] Make canonical English PLAN/CODE_REVIEW write and finalization references consistent across the paired plan and code-review skills while preserving explicit legacy Korean aliases.
- [ ] [REVIEW_REFACTOR-2] Restore the disabled restart test, add identity-matching canonical/legacy recovery and complete template-language regression coverage, and make the completion-scan concurrency test deterministic so the fresh full suite passes.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [REVIEW_REFACTOR-1] Canonical schema references

#### Problem

`agent-ops/skills/common/plan/SKILL.md:54-57,147,196,294,319,324,366-375` still directs new output through legacy-only section names such as `검증 결과`, `계획 대비 변경 사항`, and `구현 체크리스트`. `agent-ops/skills/common/code-review/SKILL.md:168,289` likewise names only the legacy checklist during canonical comparison and finalization. These instructions conflict with the new English template and can produce or finalize the wrong schema.

#### Solution

Use canonical English names for every new write and finalization instruction:

```text
Verification Results
Deviations from Plan
Background
Analysis
Split Judgment
Dependencies and Execution Order
Implementation Checklist
Review-Only Checklist
Code Review Result
```

Where an active legacy pair must still be read or finalized, state the Korean name only as an explicit legacy alias beside the canonical name. Keep roadmap and `USER_REVIEW.md` Korean protocol literals unchanged.

#### Modified Files and Checklist

- [ ] `agent-ops/skills/common/plan/SKILL.md`: replace remaining new-output references with canonical English labels and mark legacy aliases explicitly where dual-read is required.
- [ ] `agent-ops/skills/common/code-review/SKILL.md`: compare and finalize `Implementation Checklist` / `Review-Only Checklist` canonically, with legacy aliases documented only for legacy active pairs.
- [ ] Preserve all unrelated user-authored workflow rules and runtime ownership boundaries.

#### Test Strategy

Extend `ArtifactLanguageContractTest` in `agent-ops/skills/project/orchestrate-agent-task-loop/tests/test_dispatch.py` with deterministic text-contract assertions covering every canonical write/finalization label and the allowed legacy-alias locations. Do not enforce translation of roadmap, user-review, banner, or user-facing literals.

#### Verification

```bash
python3 agent-ops/skills/project/orchestrate-agent-task-loop/tests/test_dispatch.py ArtifactLanguageContractTest
```

Expected: all language-contract tests pass without provider invocation.

### [REVIEW_REFACTOR-2] Trustworthy recovery and concurrency regression evidence

#### Problem

`agent-ops/skills/project/orchestrate-agent-task-loop/tests/test_dispatch.py:10008` omits the original `asyncio.run(_async_run())`, disabling `ThroughputQuotaBatchTest.test_retry_restart_does_not_duplicate_provider_or_mutate_sibling`. The recovery test at `test_dispatch.py:10093` checks only `read_verdict`, not matching plan/review identities. The fresh full suite also failed at `test_dispatch.py:6538` because its completion-triggered scan assertion depends on scheduler sleep timing rather than an explicit synchronization point.

#### Solution

- Restore `asyncio.run(_async_run())` at the end of the existing restart test before `ArtifactLanguageContractTest`.
- Extend canonical/legacy recovery coverage with paired plan/review log identities and assertions through `latest_verdict_log` plus `matching_plan_log` or the equivalent recovery path.
- Convert the primary fixtures for changed semantic fields to canonical English and retain separately named legacy compatibility cases.
- Replace the completion-scan sleep race with `asyncio.Event` or another deterministic barrier that guarantees one task remains active when a completion-triggered scan is asserted.
- Keep all runner/provider seams mocked or denied.

#### Modified Files and Checklist

- [ ] `agent-ops/skills/project/orchestrate-agent-task-loop/tests/test_dispatch.py`: restore the coroutine invocation.
- [ ] `agent-ops/skills/project/orchestrate-agent-task-loop/tests/test_dispatch.py`: add identity-matching canonical and legacy recovery cases plus full template/prompt language assertions.
- [ ] `agent-ops/skills/project/orchestrate-agent-task-loop/tests/test_dispatch.py`: synchronize the convergence simulation deterministically instead of relying on sleep timing.
- [ ] Do not weaken existing assertions, reduce discovered test count, or call real provider commands.

#### Test Strategy

Update these focused cases:

- `ThroughputQuotaBatchTest.test_retry_restart_does_not_duplicate_provider_or_mutate_sibling`
- `DispatcherConvergenceSimulationTest.test_parallel_multi_task_followup_dependency_and_terminal_completion`
- `ArtifactLanguageContractTest.test_recovery_accepts_canonical_and_legacy_logs`
- `ArtifactLanguageContractTest.test_templates_and_prompts_separate_artifact_and_final_languages`

Use temporary directories, synthetic paired logs with matching/mismatching identity headers, and explicit async synchronization. Network and provider processes remain forbidden.

#### Verification

```bash
python3 -m unittest \
  agent-ops.skills.project.orchestrate-agent-task-loop.tests.test_dispatch.ThroughputQuotaBatchTest.test_retry_restart_does_not_duplicate_provider_or_mutate_sibling \
  agent-ops.skills.project.orchestrate-agent-task-loop.tests.test_dispatch.DispatcherConvergenceSimulationTest.test_parallel_multi_task_followup_dependency_and_terminal_completion \
  agent-ops.skills.project.orchestrate-agent-task-loop.tests.test_dispatch.ArtifactLanguageContractTest
```

Expected: every selected test executes assertions and passes; no provider command is constructed or invoked.

## Modified Files Summary

| File | Item |
|---|---|
| `agent-ops/skills/common/plan/SKILL.md` | REVIEW_REFACTOR-1 |
| `agent-ops/skills/common/code-review/SKILL.md` | REVIEW_REFACTOR-1 |
| `agent-ops/skills/project/orchestrate-agent-task-loop/tests/test_dispatch.py` | REVIEW_REFACTOR-1, REVIEW_REFACTOR-2 |

## Final Verification

```bash
python3 -m py_compile agent-ops/skills/project/orchestrate-agent-task-loop/scripts/dispatch.py
```

Expected: exit code 0 with no stdout/stderr.

```bash
python3 agent-ops/skills/project/orchestrate-agent-task-loop/tests/test_dispatch.py ArtifactLanguageContractTest
```

Expected: the complete language-contract class passes without provider invocation.

```bash
python3 -m unittest discover -s agent-ops/skills/project/orchestrate-agent-task-loop/tests -p 'test_*.py'
```

Expected: every discovered dispatcher test passes in a fresh run, the restored restart test executes its async assertions, and no real provider process starts.

```bash
git diff --check
```

Expected: exit code 0.

After completing all code changes, fill implementation-owned sections in `CODE_REVIEW-*-G??.md`.
