<!-- task=m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure plan=4 tag=REVIEW_REVIEW_TEST milestone-task=handoff-gate -->

# Replace contradicted HANDOFF mapping evidence

## For the Implementing Agent

Filling the implementation-owned sections in `CODE_REVIEW-cloud-G04.md` is mandatory. Run every verification command exactly as written, paste actual stdout/stderr and exit codes, keep the active files in place, and report ready for review. If blocked, record only the exact blocker, attempted commands/output, and resume condition 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`; finalization belongs to the code-review agent.

## Background

The prior follow-up corrected the final receipt data, but its active review claimed that Verification 1 loaded the stable bundle receipt while the recorded command did not. Fresh reviewer execution of that exact command failed with `KeyError: 'real_state_export_location'`, contradicting the recorded exit code 0. This evidence-only follow-up records one exact runnable mapping oracle and preserves the already-correct receipt and audit bytes.

## Archive Evidence Snapshot

- `plan_cloud_G05_3.log` and `code_review_cloud_G05_3.log` are the immediately preceding pair. The review verdict is FAIL with 1 Required, 0 Suggested, and 0 Nit findings; `review_rework_count=2` and `evidence_integrity_failure=true`.
- Required finding: `code_review_cloud_G05_3.log:74` says Verification 1 gained a stable-receipt JSON lookup, but its command imports only `hashlib`; fresh execution returned exit code 1 with `KeyError: 'real_state_export_location'` while the implementation evidence claimed exit code 0 and PASS stdout.
- Fresh reviewer evidence: the exact prior Verifications 2, 3, 5, 6, and 7 passed; `go test -count=1 ./apps/node/... && go test -count=1 ./... && make readability-audit` also passed. The defect is isolated to the contradicted Verification 1 record.
- The corrected artifacts are currently pinned at `HANDOFF.md` SHA-256 `d3cc54cb07932f2b4b6cb78e03c17fbb58d040a8c19e4aba6b4d55bdcafb78b0` and `final-handoff-audit.log` SHA-256 `8e14c350a0dc5cb11fc44a24a11de531f25e8a165d4787161fa373de8e787e7b`; this follow-up must not change either file.
- Exact immutable inputs are `agent-task/archive/2026/08/m-iop-agent-chronos-extraction-decoupling/13+09,10_receipt_lock_audit/pre-deletion-transfer-receipt-v1.md` and the literal files it names. Do not search other archive paths.
- Roadmap carryover remains `milestone-task=handoff-gate`, SDD scenario S05. Roadmap mutation remains deferred to runtime aggregation after a later PASS.

## Analysis

### Files Read

- `HANDOFF.md`
- `agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/PLAN-cloud-G05.md`
- `agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/CODE_REVIEW-cloud-G05.md`
- `agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/final-handoff-audit.log`
- `agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/code_review_cloud_G08_2.log`
- `agent-task/archive/2026/08/m-iop-agent-chronos-extraction-decoupling/13+09,10_receipt_lock_audit/pre-deletion-transfer-receipt-v1.md`
- `agent-task/archive/2026/08/m-iop-agent-chronos-extraction-decoupling/13+09,10_receipt_lock_audit/iop-agent-chronos-transfer-bundle-receipt-v1.json`
- `agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-chronos-extraction-decoupling.md`
- `agent-roadmap/sdd/automation-runtime-bridge/iop-agent-chronos-extraction-decoupling/SDD.md`
- `agent-spec/runtime/edge-node-execution.md`
- `agent-contract/inner/execution-runtime.md`
- `agent-contract/inner/edge-node-runtime-wire.md`
- `agent-ops/rules/project/domain/node/rules.md`
- `agent-ops/rules/project/domain/platform-common/rules.md`
- `agent-ops/rules/project/domain/testing/rules.md`
- `agent-test/local/rules.md`
- `agent-test/local/node-smoke.md`
- `agent-test/local/platform-common-smoke.md`
- `agent-test/local/testing-smoke.md`
- `.gitignore`

### SDD Criteria

- SDD: `agent-roadmap/sdd/automation-runtime-bridge/iop-agent-chronos-extraction-decoupling/SDD.md`; status `[승인됨]`, lock released.
- First-line target: `milestone-task=handoff-gate`.
- Acceptance Scenario S05 requires the tracked final composite receipt to trace the Task 13 disposition/state inputs, Task 14 deletion/regression evidence, rollback, and downstream lock identity.
- Evidence Map S05 requires a final composite receipt whose field provenance is runnable and reviewable. The checklist therefore requires the stable receipt JSON enrichment to appear in the exact recorded command and protects the already-correct receipt/audit bytes from further mutation.

### Verification Context

- Handoff source: raw Required finding and fresh reviewer execution from `code_review_cloud_G05_3.log`.
- Preconditions: current checkout `/config/workspace/iop-s1`; Python 3, Git, and `sha256sum` are available. `go version` reported `go1.26.2 linux/arm64`; `go env GOMOD` resolved `/config/workspace/iop-s1/go.mod`.
- Exact failure: the prior recorded command lacks `import json`, never resolves `stable_receipt_path`, and fails before comparing `real_state_export_*`/`bundle_*` fields.
- Repository-native fallback: the corrected command already embedded in `final-handoff-audit.log` shows the required enrichment shape; the reviewer independently reran all other prior verification commands and the uncached Go/readability regression successfully.
- External Verification Preflight: not applicable. This follow-up reads only the current checkout and exact pinned archive files; it does not inspect or mutate Chronos, canonical IOP, or the workspace lock registry.
- Constraints: modify only the new active review evidence file. Do not modify `HANDOFF.md`, `final-handoff-audit.log`, immutable archives, product source, roadmap/SDD, external repositories, or lock state.
- Gaps: none. Confidence: high.

### Test Coverage Gaps

- No product behavior changes are planned, so no Go test file is added.
- The missing coverage is the review artifact's exact end-to-end receipt mapping command. The new deterministic Python oracle covers the stable JSON enrichment, differently named fields, pinned digests, and table row counts.

### Symbol References

- None. No runtime symbol is renamed or removed.

### Split Judgment

- Keep one compact plan: corrected command text and its actual output are one verification-trust invariant and independently pass without changing receipt bytes.
- The directory dependency `15+14` remains satisfied by the exact Task 14 evidence already pinned in `HANDOFF.md`; this follow-up does not re-resolve predecessor archives.

### Scope Rationale

- Modify only `agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/CODE_REVIEW-cloud-G04.md` to record exact, truthful evidence.
- Exclude `HANDOFF.md`, `final-handoff-audit.log`, immutable archives, product source/tests, roadmap/SDD, external repositories, and locks because fresh review already established that their current bytes and non-mapping checks pass.

### Final Routing

- `evaluation_mode=isolated-reassessment`; finalizer=`finalize-task-policy.sh`, mode=`pair`.
- Build closures: scope/context/verification/evidence/ownership/decision all true. Scores=`1,0,0,2,1`, grade=`G04`, base=`local-fit`, route=`recovery-boundary`, lane=`cloud`.
- Review closures: scope/context/verification/evidence/ownership/decision all true. Scores=`1,0,0,2,1`, route=`official-review`, lane=`cloud`, grade=`G04`.
- `large_indivisible_context=false`; positive loop risks=`boundary_contract,structured_interpretation` (2); `review_rework_count=2`; `evidence_integrity_failure=true`; recovery boundary matched; no capability gap.
- Canonical files: `PLAN-cloud-G04.md`, `CODE_REVIEW-cloud-G04.md`.

## Implementation Checklist

- [ ] Run the exact corrected HANDOFF-to-receipt mapping oracle with stable receipt JSON enrichment, preserve the pinned `HANDOFF.md` and `final-handoff-audit.log` bytes, and record actual command output without reconstruction.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [REVIEW_REVIEW_TEST-1] Record one runnable mapping oracle

**Problem**

`code_review_cloud_G05_3.log:74` claims that Verification 1 loads the stable JSON receipt, but `code_review_cloud_G05_3.log:98` imports only `hashlib` and the command later maps keys absent from the Markdown receipt. The exact command therefore fails while its recorded result says exit code 0.

**Solution**

Record the exact replacement command in the new review evidence. Add `json`, resolve the pinned Markdown receipt's `stable_receipt_path`, load that JSON, derive the six `real_state_export_*`/`bundle_*` values, then perform the complete mapping/digest/row-count checks.

```text
Before (`code_review_cloud_G05_3.log:96-99`)
python3 - <<'PY'
from pathlib import Path
import hashlib

After
python3 - <<'PY'
from pathlib import Path
import hashlib, json
...
stable = receipt.parent / rv['stable_receipt_path']
bundle = json.loads(stable.read_text())
...
```

**Modified Files and Checklist**

- [ ] `agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/CODE_REVIEW-cloud-G04.md` — paste actual stdout/stderr and exit codes for both fixed verification commands, complete implementation-owned notes, and check the implementation checklist.

**Test Strategy**

- Do not add a product unit test because no product behavior changes. Use the deterministic document oracle as the regression test and a byte-identity check to prevent evidence mutation.

**Verification**

- Run both commands in `Final Verification` exactly. Expect the mapping PASS line, both pinned files `OK`, `final_handoff_audit=PASS`, and exit code 0.

## Modified Files Summary

| File | Item |
|------|------|
| `agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/CODE_REVIEW-cloud-G04.md` | REVIEW_REVIEW_TEST-1 |

## Final Verification

1. Run the corrected fail-closed mapping oracle exactly as recorded:

```bash
python3 - <<'PY'
from pathlib import Path
import hashlib, json

text = Path('HANDOFF.md').read_text()
assert text.startswith('---\n') and '\n---\n' in text
front = text.split('\n---\n', 1)[0].splitlines()[1:]
pairs = [line.split(': ', 1) for line in front]
keys = [key for key, _ in pairs]
assert len(keys) == len(set(keys))
kv = dict(pairs)

receipt = Path(kv['pre_deletion_receipt_path'])
assert not receipt.is_absolute() and '..' not in receipt.parts and receipt.is_file()
receipt_front = receipt.read_text().split('\n---\n', 1)[0].splitlines()[1:]
receipt_pairs = [line.split(': ', 1) for line in receipt_front]
receipt_keys = [key for key, _ in receipt_pairs]
assert len(receipt_keys) == len(set(receipt_keys))
rv = dict(receipt_pairs)

stable = receipt.parent / rv['stable_receipt_path']
assert stable == Path(kv['bundle_receipt_artifact_path'])
assert not stable.is_absolute() and '..' not in stable.parts and stable.is_file()
assert hashlib.sha256(stable.read_bytes()).hexdigest() == rv['stable_receipt_sha256'] == kv['bundle_receipt_sha256']
bundle = json.loads(stable.read_text())
rv.update({
    'real_state_export_location': 'bundle-member:acceptance-v1/state/state-export-v1.json',
    'real_state_export_sha256': bundle['real_state_export_sha'],
    'real_state_export_record_count': str(bundle['state_record_count']),
    'real_state_export_category_count': str(bundle['state_category_count']),
    'real_state_export_quarantine_count': str(bundle['quarantine_record_count']),
    'bundle_location': 'withheld-owner-local',
    'bundle_sha256': bundle['real_bundle_sha'],
})

mapping = {
    'source_revision': 'source_revision',
    'rollback_revision': 'rollback_revision',
    'original_manifest_sha256': 'manifest_sha256',
    'original_manifest_row_count': 'manifest_row_count',
    'original_manifest_file_count': 'manifest_file_count',
    'original_manifest_state_count': 'manifest_state_count',
    'original_manifest_retain_generic_count': 'manifest_retain_generic_count',
    'task03_historical_row_count': 'task03_historical_row_count',
    'task03_historical_file_count': 'task03_historical_file_count',
    'task03_historical_state_count': 'task03_historical_state_count',
    'task03_universe_residuals': 'task03_universe_residuals',
    'task03_duplicate_rows': 'task03_duplicate_rows',
    'boundary_delta_sha256': 'delta_sha256',
    'boundary_delta_row_count': 'delta_row_count',
    'boundary_addendum_sha256': 'addendum_sha256',
    'boundary_addendum_row_count': 'addendum_row_count',
    'effective_matrix_sha256': 'effective_matrix_sha256',
    'effective_matrix_row_count': 'effective_matrix_row_count',
    'state_schema_sha256': 'state_schema_sha256',
    'state_fixture_sha256': 'state_fixture_sha256',
    'bundle_receipt_sha256': 'stable_receipt_sha256',
    'state_original_manifest_logical_id_count': 'state_original_manifest_logical_id_count',
    'state_addendum_logical_id_count': 'state_addendum_logical_id_count',
    'state_logical_id_count': 'state_logical_id_count',
    'state_logical_ids_sha': 'state_logical_ids_sha256',
    'state_fixture_record_count': 'state_record_count',
    'state_fixture_category_count': 'state_category_count',
    'state_fixture_quarantine_count': 'state_quarantine_count',
    'real_state_export_location': 'real_state_export_location',
    'real_state_export_sha256': 'real_state_export_sha256',
    'real_state_export_record_count': 'real_state_export_record_count',
    'real_state_export_category_count': 'real_state_export_category_count',
    'real_state_export_quarantine_count': 'real_state_export_quarantine_count',
    'bundle_location': 'bundle_location',
    'bundle_sha256': 'bundle_sha256',
    'task09_complete_log_path': 'task09_complete_log_path',
    'task09_complete_log_sha256': 'task09_complete_log_sha256',
    'task10_complete_log_path': 'task10_complete_log_path',
    'task10_complete_log_sha256': 'task10_complete_log_sha256',
    'import_graph_audit_path': 'task10_import_audit_path',
    'import_graph_audit_sha256': 'task10_import_audit_sha256',
    'import_graph_residuals': 'import_graph_residuals',
    'downstream_lock': 'downstream_lock',
    'staging_lock_identity': 'staging_lock_identity',
    'staging_lock_result': 'staging_lock_result',
    'canonical_lock_identity': 'canonical_lock_identity',
    'canonical_lock_result': 'canonical_lock_result',
}
mismatches = [(left, kv.get(left), right, rv.get(right)) for left, right in mapping.items() if kv.get(left) != rv.get(right)]
assert not mismatches, mismatches

path_digest_fields = {
    'task13_complete_log_path': 'task13_complete_log_sha256',
    'pre_deletion_receipt_path': 'pre_deletion_receipt_sha256',
    'pre_deletion_audit_path': 'pre_deletion_audit_sha256',
    'task13_verifier_path': 'task13_verifier_sha256',
    'original_manifest_artifact_path': 'original_manifest_sha256',
    'boundary_delta_artifact_path': 'boundary_delta_sha256',
    'boundary_addendum_artifact_path': 'boundary_addendum_sha256',
    'effective_matrix_artifact_path': 'effective_matrix_sha256',
    'state_schema_artifact_path': 'state_schema_sha256',
    'state_fixture_artifact_path': 'state_fixture_sha256',
    'bundle_receipt_artifact_path': 'bundle_receipt_sha256',
    'task14_complete_log_path': 'task14_complete_log_sha256',
    'task14_removal_audit_path': 'task14_removal_audit_sha256',
}
for path_key, digest_key in path_digest_fields.items():
    path = Path(kv[path_key])
    assert not path.is_absolute() and '..' not in path.parts and path.is_file()
    assert hashlib.sha256(path.read_bytes()).hexdigest() == kv[digest_key]

tables = {
    'original_manifest_artifact_path': 'original_manifest_row_count',
    'boundary_delta_artifact_path': 'boundary_delta_row_count',
    'boundary_addendum_artifact_path': 'boundary_addendum_row_count',
    'effective_matrix_artifact_path': 'effective_matrix_row_count',
}
for path_key, count_key in tables.items():
    assert sum(1 for _ in Path(kv[path_key]).open()) - 1 == int(kv[count_key])

print('handoff_receipt_mapping=PASS current_manifest_rows=300 historical_rows=303 stable_receipt_enriched=1')
PY
```

Expected: exit code 0, the single PASS line on stdout, and empty stderr.

2. Prove the corrected receipt/audit bytes remain unchanged and the audit structure is still complete:

```bash
sha256sum --check <<'EOF'
d3cc54cb07932f2b4b6cb78e03c17fbb58d040a8c19e4aba6b4d55bdcafb78b0  HANDOFF.md
8e14c350a0dc5cb11fc44a24a11de531f25e8a165d4787161fa373de8e787e7b  agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/final-handoff-audit.log
EOF
python3 - <<'PY'
from pathlib import Path

lines = Path('agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/final-handoff-audit.log').read_text().splitlines()
required = [
    'current_manifest_row_count=300',
    'current_manifest_artifact_row_count=300',
    'task03_historical_row_count=303',
    'manifest_count_mapping_match=1',
    'task14_removal_status=pass',
    'pre_delete_digest_count=12',
    'post_delete_absence_count=12',
    'transfer_remove_residuals=0',
    'retained_path_mismatches=0',
    'renamed_source_residuals=0',
    'unclassified_paths=0',
    'duplicate_paths=0',
    'forbidden_surface_scan=pass',
    'chronos_repository_mutations=0',
    'external_mutations=0',
    'canonical_promotion=pending',
]
assert all(lines.count(marker) == 1 for marker in required)
command_ids = [line.split('=', 1)[1] for line in lines if line.startswith('command_id=')]
assert command_ids and len(command_ids) == len(set(command_ids))
assert all(lines.count('command_exit_code=' + command_id + ':0') == 1 for command_id in command_ids)
print('final_handoff_audit=PASS')
PY
git diff --check
```

Expected: exit code 0, both `sha256sum` checks report `OK`, `final_handoff_audit=PASS`, and `git diff --check` is silent.

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