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

# HANDOFF S05 composite receipt와 최종 live-tree closure

## For the Implementing Agent

`CODE_REVIEW-cloud-G08.md`의 implementation-owned 섹션 작성은 필수다. encoded predecessor 14의 exactly one final PASS를 확인하고, Task 13 archive는 검색하지 말고 `HANDOFF.md`에 이미 기록된 literal exact pointers만 strict-resolve한다. Task 13 pre-deletion receipt, Task 14 removal completion, post-deletion live tree/regressions, rollback/lock/promotion evidence를 결합해 `HANDOFF.md` 자체를 S05 final composite receipt로 갱신한다. active pair를 유지한 채 review 준비 완료만 보고하며 finalization은 code-review agent만 수행한다.

## Background

Pre-deletion receipt만으로는 migration inputs가 실제로 제거됐는지 또는 최종 IOP tree가 provider-only인지 증명하지 못한다. Removal audit만으로는 original/delta/addendum/state/bundle provenance가 없다. 이 task는 두 evidence layers를 actual archive digests로 결합하고, effective matrix의 live-tree disposition과 fresh regressions를 재검증해 `HANDOFF.md`를 최종 handoff entrypoint로 만든다. Chronos 구현이나 IOP-to-Chronos 연결을 만들지 않으며 canonical promotion은 pending으로 유지한다.

## Roadmap Targets

- Milestone: `agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-chronos-extraction-decoupling.md`
- Milestone link: [Milestone 문서](agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-chronos-extraction-decoupling.md)
- Task ids:
  - `handoff-gate`: pre-deletion provenance, removal completion, final regressions, rollback와 downstream lock을 결합한 final receipt
- Completion mode: `milestone-task` evidence aggregation; final Task state is evaluated from all aggregated evidence.

## Archive Evidence Snapshot

- `plan_local_G07_0.log` / `code_review_cloud_G07_0.log`는 D02 generic Node 기준의 미착수 final audit pair다.
- `plan_local_G08_1.log` / `code_review_cloud_G08_1.log`는 HANDOFF를 Task 14 pointer로만 두고 Task 13 archive를 재탐색하며 pre-deletion receipt를 final S05 receipt로 오인한 미착수 pair다.
- 두 pair 모두 implementation evidence, verdict, Roadmap completion이 없다. 새 plan은 HANDOFF literal pointer chain만 사용하고 HANDOFF 자체를 final composite receipt로 갱신한다.

## Analysis

### Files Read

- `agent-roadmap/phase/automation-runtime-bridge/PHASE.md`
- `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`
- `README.md`
- `HANDOFF.md`
- `Makefile`
- `agent-contract/index.md`
- `agent-spec/index.md`
- `agent-spec/runtime/iop-agent-cli-runtime.md`
- `agent-spec/runtime/edge-node-execution.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`
- `agent-task/m-iop-agent-chronos-extraction-decoupling/13+09,10_receipt_lock_audit/PLAN-cloud-G09.md`
- `agent-task/m-iop-agent-chronos-extraction-decoupling/14+13_remove_migration_surface/PLAN-local-G08.md`
- `agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/PLAN-local-G08.md`
- `agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/CODE_REVIEW-cloud-G08.md`
- `agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/plan_local_G07_0.log`
- `agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/code_review_cloud_G07_0.log`
- `agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/plan_local_G08_1.log`
- `agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/code_review_cloud_G08_1.log`
- `agent-task/m-iop-agent-chronos-extraction-decoupling/WORK_LOG.md`
- `/config/workspace/.agent-roadmap-sync/locks.yaml`

### SDD Criteria

- SDD는 `[승인됨]`, 잠금 `해제`이며 첫 줄 `milestone-task=handoff-gate`의 direct target은 S05 / `handoff-gate`다.
- S05 Evidence Map은 whole state, final cross-repo disposition, rollback와 downstream lock identity를 하나의 Roadmap completion evidence에서 추적할 수 있어야 한다. HANDOFF front matter가 그 composite receipt이고 `final-handoff-audit.log`가 actual final run evidence다.
- S01은 Task 13 base receipt의 original/delta/addendum/effective provenance, S03/S04는 Task 10 import graph와 provider-only boundary, deletion barrier는 Task 14 exact pre/post audit로 결합한다.
- Final live tree는 모든 `transfer-remove` path absent, `retain-rewrite/create-neutral` final path present, renamed `retain-rewrite` old source absent, unclassified/duplicate 0, IOP Node owner `model-provider-device`, Chronos connection/CLI agent-terminal-workspace surface 0이어야 한다.

### Verification Context

- Predecessor 14는 immutable removal evidence directory를 제공해야 하므로 active candidate를 허용하지 않는다. 구현은 archive의 실제 존재하는 `complete.log`만 수집하고 exactly one archived log와 exactly one Summary final-PASS marker를 확인하며, 같은 directory의 `migration-removal-audit.log`만 named artifact로 읽는다.
- Task 13 archive를 glob/find하지 않는다. HANDOFF의 모든 required literal `*_path` fields를 strict parse해 모두 같은 exact archived `13+09,10_receipt_lock_audit` directory와 expected basename인지 확인하고 paired SHA-256을 재계산한다.
- Task 13 archived verifier는 HANDOFF의 `task13_verifier_path`로만 실행한다. `check-archived`는 base artifacts/receipt를, `check-live`는 effective matrix의 original/addendum disposition against current IOP tree와 renamed old-source absence를 검증한다.
- Task 14 removal audit에는 exact 12 targets의 pre-delete digest, post-delete absence, external before/after equality와 `task14_removal_status=pass`가 있어야 한다. HANDOFF에는 Task 14 complete log/audit actual archive paths와 digests를 새로 기록한다.
- Final regressions are fresh `go test -count=1 ./apps/node/...`, `go test -count=1 ./...`, `make readability-audit`; negative scan은 return code 1만 성공이다. Chronos scan은 Task 10과 같은 import, `/config/workspace/chronos`, `CHRONOS_`, upper/lower camel·snake·kebab Target/Registry/Bridge/Server/Node/Control/Connector/Gateway pattern set을 code/proto/config/active contract/spec roots에 적용한다.
- Chronos, canonical IOP, lock registry는 final audit before/after HEAD/status/lock digest가 동일해야 한다. Lock checker expected identities are staging `none`, canonical `rely-on:chronos:chronos-architecture-ownership-boundary`.
- Bash/repository-root, Python 3, Git, `rg`, Go와 Make가 필요하다. External service, credential, user runner는 없다. Confidence는 high이고 Task 14 PASS가 scheduling precondition이다.

### Test Coverage Gaps

- This task changes no product source and adds no unit tests. It runs existing focused/full suites and structured provenance/live-tree audits.
- Negative assertions precheck every root and accept only `rg` exit 1 as no-match; search errors are failures. Required receipt fields are individually unique, not an alternation any-match.

### Symbol References

- Product runtime symbols are read-only. Forbidden families include old Agent runtime/provider/CLI surfaces, session-terminal-workspace controls and direct Chronos imports/connectors.
- Evidence symbols are HANDOFF fields, Task 13 verifier/receipt/matrix and Task 14 removal audit.

### Split Judgment

- Base receipt, removal audit, live dispositions, regressions and lock snapshot jointly decide S05. Splitting would allow a final receipt without one evidence layer, so this remains one atomic gate.
- Stable invariant is that HANDOFF alone names immutable archived inputs and contains their verified composite result, while final audit supplies reproducible actual commands/results.

### Scope Rationale

- Task 13/14 archived files are read-only. Product source, README, roadmap/SDD, Chronos, canonical IOP and lock registry are not modified.
- Canonical promotion and Chronos Server/Node/loop/agent/terminal implementation remain downstream work gated by the formal lock.

### Final Routing

- `evaluation_mode=isolated-reassessment`, finalizer=`finalize-task-policy.sh`, mode=`pair`.
- Build closures all true. Scores=`2,0,2,2,2`, grade=`G08`, base/route=`local-fit`, lane=`local`.
- Review closures all true. Scores=`2,0,2,2,2`, route=`official-review`, lane=`cloud`, grade=`G08`.
- `large_indivisible_context=false`; positive loop risks=`boundary_contract` (1); `review_rework_count=0`; `evidence_integrity_failure=false`; capability gap 없음.
- Canonical files: `PLAN-local-G08.md`, `CODE_REVIEW-cloud-G08.md`.

## Dependencies and Execution Order

1. Bash/repository-root preflight로 exactly one archived PASS Task 14 complete log와 same-directory removal audit를 resolve한다.
2. HANDOFF front matter를 strict parse하고 literal Task 13 pointers/digests만 따라가 archived verifier `check-archived`를 실행한다. Task 13 archive search는 0이어야 한다.
3. Final external before snapshot을 잡고 archived verifier `check-live`, exact absence/negative scan과 fresh regressions를 실행해 final audit에 command/stdout/stderr/exit code를 기록한다.
4. Task 14 actual pointers/digests와 base receipt fields/final results를 HANDOFF에 결합하고 external after/lock equality 및 composite schema를 검증한다.

## Implementation Checklist

- [ ] Refuse to start unless Bash runs at repository root and exactly one archived Task 14 complete.log with exactly one Summary final-PASS marker resolves with a valid same-directory removal audit.
- [ ] Strict-resolve only literal Task 13 archive pointers already in HANDOFF; verify expected basenames, common exact parent, recomputed digests, archived receipt schema and record `task13_archive_searches=0`.
- [ ] Verify Task 14's twelve pre-delete digests/post-delete absences, then audit archived effective matrix against the post-deletion live tree and run fail-closed forbidden-surface scans plus fresh Node/full/readability regressions.
- [ ] Update HANDOFF itself to the exact S05 final composite schema, adding Task 14 actual archive pointers/digests and copied base receipt counts/digests/import provenance plus final rollback/lock/promotion/result fields.
- [ ] Capture deterministic command ids, stdout/stderr digests, exit codes and equal external before/after identities in `final-handoff-audit.log`.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [TEST-1] Literal pointer chain, removal receipt와 post-deletion live tree

**Problem**

Task 13 archive를 다시 검색하면 HANDOFF가 authoritative pointer가 아니고, Task 14 PASS만 신뢰하면 deletion evidence와 base receipt가 실제 bytes에 연결되지 않는다. Matrix digest만 맞아도 live tree가 final dispositions를 위반할 수 있다.

**Solution**

Task 14 complete log만 exact dependency lookup으로 resolve한다. Task 13은 HANDOFF literal fields로만 접근해 all paths의 common exact archive parent/basename/digest를 검사하고 archived verifier를 실행한다. Archived receipt/verifier는 fixed `bundle-member:acceptance-v1/state/state-export-v1.json` provenance와 stored member digest/count binding을 offline으로 재검증한다. Task 14 audit의 12 pre/post pairs를 검증한 뒤 `check-live`로 original+addendum dispositions를 current IOP root에 대조한다.

**Modified Files and Checklist**

- [ ] `agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/final-handoff-audit.log` — pointer/removal/live-tree/test/lock command evidence.

**Test Strategy**

- No Task 13 glob/find is permitted. A structured parser enforces exact HANDOFF fields and calls the referenced verifier. Live checks require transfer-remove residuals, retained mismatches, renamed-source residuals, unclassified and duplicates all zero. The final fail-closed scan records zero residuals separately for Chronos import, workspace path, env prefix, camel, snake and kebab families.

**Verification**

- `bash -euo pipefail -c 'test "$PWD" = /config/workspace/iop-s1; shopt -s nullglob; group=m-iop-agent-chronos-extraction-decoupling; task=14+13_remove_migration_surface; logs=(); for archived in agent-task/archive/*/*/"$group"/"$task"/complete.log; do test -f "$archived"; logs+=("$archived"); done; test "${#logs[@]}" -eq 1; awk '\''/^## (Summary|요약)$/ {s=1; next} /^## / && s {exit} s && (/final verdict: PASS/ || /최종 verdict: PASS/) {p++} END {exit p==1?0:1}'\'' "${logs[0]}"; d=${logs[0]%/complete.log}; test -f "$d/migration-removal-audit.log"'`
- `python3 -c 'from pathlib import Path; import hashlib,subprocess,sys; text=Path("HANDOFF.md").read_text(); assert text.startswith("---\n") and "\n---\n" in text; lines=text.split("\n---\n",1)[0].splitlines()[1:]; kv={}; [( (_ for _ in ()).throw(AssertionError(k)) if k in kv else kv.__setitem__(k,v) ) for k,v in (line.split(": ",1) for line in lines)]; expected={"task13_complete_log_path":("complete.log","task13_complete_log_sha256"),"pre_deletion_receipt_path":("pre-deletion-transfer-receipt-v1.md","pre_deletion_receipt_sha256"),"pre_deletion_audit_path":("pre-deletion-audit.log","pre_deletion_audit_sha256"),"task13_verifier_path":("verify-pre-deletion-receipt-v1.py","task13_verifier_sha256"),"original_manifest_artifact_path":("iop-agent-chronos-ownership-manifest.tsv","original_manifest_sha256"),"boundary_delta_artifact_path":("boundary-disposition-delta-v1.tsv","boundary_delta_sha256"),"boundary_addendum_artifact_path":("boundary-surface-addendum-v1.tsv","boundary_addendum_sha256"),"effective_matrix_artifact_path":("effective-disposition-matrix-v1.tsv","effective_matrix_sha256"),"state_schema_artifact_path":("iop-agent-chronos-transfer-state-v1.schema.json","state_schema_sha256"),"state_fixture_artifact_path":("iop-agent-chronos-transfer-state-v1.json","state_fixture_sha256"),"bundle_receipt_artifact_path":("iop-agent-chronos-transfer-bundle-receipt-v1.json","bundle_receipt_sha256")}; paths={k:Path(kv[k]) for k in expected}; assert all(not p.is_absolute() and ".." not in p.parts and "*" not in str(p) and "..." not in str(p) and p.name==expected[k][0] and p.is_file() for k,p in paths.items()); parents={p.parent for p in paths.values()}; assert len(parents)==1; parent=parents.pop(); assert len(parent.parts)==6 and parent.parts[:2]==("agent-task","archive") and len(parent.parts[2])==4 and parent.parts[2].isdigit() and len(parent.parts[3])==2 and parent.parts[3].isdigit() and parent.parts[-2:]==("m-iop-agent-chronos-extraction-decoupling","13+09,10_receipt_lock_audit"); assert all(hashlib.sha256(p.read_bytes()).hexdigest()==kv[expected[k][1]] for k,p in paths.items()); subprocess.run([sys.executable,str(paths["task13_verifier_path"]),"check-archived","--artifact-dir",str(parent),"--receipt",str(paths["pre_deletion_receipt_path"]),"--audit",str(paths["pre_deletion_audit_path"])],check=True)'`
- `python3 -c 'from pathlib import Path; import subprocess,sys; text=Path("HANDOFF.md").read_text(); lines=text.split("\n---\n",1)[0].splitlines()[1:]; kv=dict(line.split(": ",1) for line in lines); verifier=Path(kv["task13_verifier_path"]); subprocess.run([sys.executable,str(verifier),"check-live","--artifact-dir",str(verifier.parent),"--receipt",kv["pre_deletion_receipt_path"],"--iop-root",".","--audit","agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/final-handoff-audit.log"],check=True)'`
- `bash -euo pipefail -c 'paths=(apps/agent packages/go/agentruntime packages/go/agentprovider packages/go/provider/cli proto/iop/agent.proto agent-contract/inner/iop-agent-cli-runtime.md cmd/iop-chronos-transfer scripts/verify-iop-agent-chronos-boundary.py scripts/verify_iop_agent_chronos_boundary_test.py scripts/fixtures/iop-agent-chronos-ownership-manifest.tsv scripts/fixtures/iop-agent-chronos-transfer-state-v1.schema.json scripts/fixtures/iop-agent-chronos-transfer-state-v1.json scripts/fixtures/iop-agent-chronos-transfer-bundle-receipt-v1.json scripts/fixtures/iop-agent-chronos-boundary-disposition-delta-v1.tsv scripts/fixtures/iop-agent-chronos-boundary-disposition-delta-v1.sha256 scripts/fixtures/iop-agent-chronos-boundary-surface-addendum-v1.tsv scripts/fixtures/iop-agent-chronos-boundary-surface-addendum-v1.sha256); for p in "${paths[@]}"; do test ! -e "$p"; done; roots=(apps packages cmd configs proto agent-contract agent-spec); for r in "${roots[@]}"; do test -d "$r"; done; set +e; out=$(rg --sort path -n "verify-iop-agent-chronos-boundary\\.py|verify_iop_agent_chronos_boundary_test\\.py|git\\.toki-labs\\.com/toki/chronos|/config/workspace/chronos|CHRONOS_|[Cc]hronos(Target|Registry|Bridge|Server|Node|Control|Connector|Gateway)|chronos_(target|registry|bridge|server|node|control|connector|gateway)|chronos-(target|registry|bridge|server|node|control|connector|gateway)|agent_bridge|CLIAdapterConfig|CLIProfileConfig|AgentUsageStatus|persistent_(terminal|process)|TERMINATE_SESSION|SESSION_LIST|USAGE_STATUS|codex-app-server|opencode-sse|quota[-_]?probe" "${roots[@]}" 2>&1); rc=$?; set -e; test "$rc" -eq 1 || { printf "%s\n" "$out" >&2; exit 1; }'`

### [TEST-2] HANDOFF final composite receipt와 fresh regression/lock evidence

**Problem**

Base receipt, removal audit와 final regression이 별도 파일에만 있으면 Milestone S05 completion이 어느 bytes/results를 승인했는지 하나의 entrypoint에서 판단할 수 없다. Single external snapshot은 이 task가 external state를 바꾸지 않았다는 증거도 아니다.

**Solution**

HANDOFF front matter를 아래 exact ordered key set으로 갱신하며 unknown/duplicate/missing key를 거부한다. `<...>`는 referenced artifacts에서 계산한 actual literal value이고 결과에 placeholder로 남을 수 없다.

```text
handoff_version: 1
handoff_status: final
source_revision: 3155be0e275437a8eedc1aa93497955a7d30465b
rollback_revision: 3155be0e275437a8eedc1aa93497955a7d30465b
task13_complete_log_path: <exact-archive-path>
task13_complete_log_sha256: <sha256>
pre_deletion_receipt_path: <exact-task13-archive-path>
pre_deletion_receipt_sha256: <sha256>
pre_deletion_audit_path: <exact-task13-archive-path>
pre_deletion_audit_sha256: <sha256>
task13_verifier_path: <exact-task13-archive-path>
task13_verifier_sha256: <sha256>
original_manifest_artifact_path: <exact-task13-archive-path>
original_manifest_sha256: <sha256>
original_manifest_row_count: 303
boundary_delta_artifact_path: <exact-task13-archive-path>
boundary_delta_sha256: <sha256>
boundary_delta_row_count: 137
boundary_addendum_artifact_path: <exact-task13-archive-path>
boundary_addendum_sha256: <sha256>
boundary_addendum_row_count: <count>
effective_matrix_artifact_path: <exact-task13-archive-path>
effective_matrix_sha256: <sha256>
effective_matrix_row_count: <303-plus-addendum-count>
state_schema_artifact_path: <exact-task13-archive-path>
state_schema_sha256: <sha256>
state_fixture_artifact_path: <exact-task13-archive-path>
state_fixture_sha256: <sha256>
bundle_receipt_artifact_path: <exact-task13-archive-path>
bundle_receipt_sha256: <sha256>
state_original_manifest_logical_id_count: 10
state_addendum_logical_id_count: 2
state_logical_id_count: 12
state_logical_ids_sha: 9bce499e286514baeb7ad9bc7c59119a3b5725f69763706dfeba06569d7404b9
state_fixture_record_count: 12
state_fixture_category_count: 8
state_fixture_quarantine_count: 1
real_state_export_location: bundle-member:acceptance-v1/state/state-export-v1.json
real_state_export_sha256: <sha256>
real_state_export_record_count: <actual-count>
real_state_export_category_count: <actual-count>
real_state_export_quarantine_count: <actual-count>
bundle_location: withheld-owner-local
bundle_sha256: <sha256>
task09_complete_log_path: <exact-archive-path>
task09_complete_log_sha256: <sha256>
task10_complete_log_path: <exact-archive-path>
task10_complete_log_sha256: <sha256>
import_graph_audit_path: <exact-task10-archive-path>/node-boundary-audit.log
import_graph_audit_sha256: <sha256>
import_graph_residuals: 0
task14_complete_log_path: <exact-archive-path>
task14_complete_log_sha256: <sha256>
task14_removal_audit_path: <exact-task14-archive-path>/migration-removal-audit.log
task14_removal_audit_sha256: <sha256>
task14_removal_status: pass
removed_target_count: 12
pre_delete_digest_count: 12
post_delete_absence_count: 12
final_transfer_remove_residuals: 0
final_retained_path_mismatches: 0
final_renamed_source_residuals: 0
final_unclassified_paths: 0
final_duplicate_paths: 0
provider_node_regression: pass
full_go_regression: pass
readability_audit: pass
forbidden_surface_scan: pass
iop_node_owner: model-provider-device
chronos_connection_surfaces: 0
cli_agent_terminal_workspace_surfaces: 0
chronos_repository_mutations: 0
external_mutations: 0
canonical_promotion: pending
downstream_lock: chronos:chronos-architecture-ownership-boundary
staging_lock_identity: iop-s1:agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-chronos-extraction-decoupling.md
staging_lock_result: none
canonical_lock_identity: iop:agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-chronos-extraction-decoupling.md
canonical_lock_result: rely-on:chronos:chronos-architecture-ownership-boundary
```

Each field occurs exactly once and every base value equals the referenced pre-deletion receipt. Final audit records external before and after HEAD/status-byte/lock digests individually and requires equality; it also records every command id with `exit_code=0`, stdout digest and stderr digest.

**Modified Files and Checklist**

- [ ] `HANDOFF.md` — S05 final composite receipt and human-readable ownership handoff.

**Test Strategy**

- Run fresh Node/full/readability suites. Parse exact HANDOFF schema and compare base values to receipt plus Task 14 paths/digests. Validate audit marker uniqueness, command results, lock values and external before/after equality.

**Verification**

- `go test -count=1 ./apps/node/... && go test -count=1 ./... && make readability-audit`
- `python3 -c 'from pathlib import Path; import hashlib; text=Path("HANDOFF.md").read_text(); assert text.startswith("---\n") and "\n---\n" in text; lines=text.split("\n---\n",1)[0].splitlines()[1:]; kv={}; [( (_ for _ in ()).throw(AssertionError(k)) if k in kv else kv.__setitem__(k,v) ) for k,v in (line.split(": ",1) for line in lines)]; exact={"handoff_version":"1","handoff_status":"final","rollback_revision":"3155be0e275437a8eedc1aa93497955a7d30465b","task14_removal_status":"pass","real_state_export_location":"bundle-member:acceptance-v1/state/state-export-v1.json","removed_target_count":"12","pre_delete_digest_count":"12","post_delete_absence_count":"12","final_transfer_remove_residuals":"0","final_retained_path_mismatches":"0","final_renamed_source_residuals":"0","final_unclassified_paths":"0","final_duplicate_paths":"0","provider_node_regression":"pass","full_go_regression":"pass","readability_audit":"pass","forbidden_surface_scan":"pass","iop_node_owner":"model-provider-device","chronos_connection_surfaces":"0","cli_agent_terminal_workspace_surfaces":"0","chronos_repository_mutations":"0","external_mutations":"0","downstream_lock":"chronos:chronos-architecture-ownership-boundary","staging_lock_result":"none","canonical_lock_result":"rely-on:chronos:chronos-architecture-ownership-boundary","canonical_promotion":"pending"}; assert all(kv.get(k)==v and sum(1 for x in lines if x.startswith(k+": "))==1 for k,v in exact.items()); receipt=Path(kv["pre_deletion_receipt_path"]); rlines=receipt.read_text().split("\n---\n",1)[0].splitlines()[1:]; rv=dict(x.split(": ",1) for x in rlines); copied=["source_revision","original_manifest_sha256","original_manifest_row_count","boundary_delta_sha256","boundary_delta_row_count","boundary_addendum_sha256","boundary_addendum_row_count","effective_matrix_sha256","effective_matrix_row_count","state_schema_sha256","state_fixture_sha256","bundle_receipt_sha256","state_original_manifest_logical_id_count","state_addendum_logical_id_count","state_logical_id_count","state_logical_ids_sha","state_fixture_record_count","state_fixture_category_count","state_fixture_quarantine_count","real_state_export_location","real_state_export_sha256","real_state_export_record_count","real_state_export_category_count","real_state_export_quarantine_count","bundle_location","bundle_sha256","task09_complete_log_path","task09_complete_log_sha256","task10_complete_log_path","task10_complete_log_sha256","import_graph_audit_path","import_graph_audit_sha256","import_graph_residuals","downstream_lock"]; assert all(kv.get(k)==rv.get(k) for k in copied); assert all((lambda p,k: not p.is_absolute() and ".." not in p.parts and p.is_file() and hashlib.sha256(p.read_bytes()).hexdigest()==kv[k+"_sha256"])(Path(kv[k+"_path"]),k) for k in ("task14_complete_log","task14_removal_audit"))'`
- `bash -euo pipefail -c 'staging=$(agent-ops/bin/roadmap-dependency-checker.sh --find-milestone "iop-s1:agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-chronos-extraction-decoupling.md" both /config/workspace/.agent-roadmap-sync/locks.yaml); canonical=$(agent-ops/bin/roadmap-dependency-checker.sh --find-milestone "iop:agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-chronos-extraction-decoupling.md" both /config/workspace/.agent-roadmap-sync/locks.yaml); test "$staging" = none; test "$canonical" = rely-on:chronos:chronos-architecture-ownership-boundary'`
- `python3 -c '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=["task13_archive_searches=0","task13_pointer_digest_mismatches=0","task14_removal_status=pass","removed_target_count=12","pre_delete_digest_count=12","post_delete_absence_count=12","bundle_member_path=acceptance-v1/state/state-export-v1.json","bundle_member_exactly_once=1","bundle_archive_paths_safe=1","bundle_member_regular_file=1","real_state_export_location=bundle-member:acceptance-v1/state/state-export-v1.json","real_state_export_digest_match=1","real_state_export_counts_match=1","real_state_export_logical_ids_match=1","state_manifest_records=10","state_supplemental_records=2","state_supplemental_ids=state:cache-root,state:temp-root","state_fixture_records=12","state_coverage_missing=0","state_coverage_unknown=0","state_logical_id_count=12","state_logical_id_sha256=9bce499e286514baeb7ad9bc7c59119a3b5725f69763706dfeba06569d7404b9","state_logical_ids_sha_match=1","state_fixture_categories=8","state_fixture_quarantine=1","state_logical_id_mismatches=0","renamed_source_residuals=0","transfer_remove_residuals=0","retained_path_mismatches=0","unclassified_paths=0","duplicate_paths=0","forbidden_surface_scan=pass","forbidden_chronos_import_residuals=0","forbidden_chronos_workspace_path_residuals=0","forbidden_chronos_env_prefix_residuals=0","forbidden_chronos_camel_residuals=0","forbidden_chronos_snake_residuals=0","forbidden_chronos_kebab_residuals=0","iop_node_owner=model-provider-device","chronos_connection_surfaces=0","cli_agent_terminal_workspace_surfaces=0","chronos_repository_mutations=0","external_mutations=0","canonical_promotion=pending"]; assert all(lines.count(x)==1 for x in required); keys=["chronos_head","chronos_status_sha256","canonical_iop_head","canonical_iop_status_sha256","lock_sha256"]; get=lambda k,p: next(x.split("=",1)[1] for x in lines if x.startswith(p+"_"+k+"=")); assert all(get(k,"before")==get(k,"after") for k in keys); command_ids=[x.split("=",1)[1] for x in lines if x.startswith("command_id=")]; assert command_ids and len(command_ids)==len(set(command_ids)); assert all(lines.count("command_exit_code="+c+":0")==1 and sum(1 for x in lines if x.startswith("command_stdout_sha256="+c+":"))==1 and sum(1 for x in lines if x.startswith("command_stderr_sha256="+c+":"))==1 for c in command_ids)'`

## Modified Files Summary

| File | Item |
|------|------|
| `HANDOFF.md` | TEST-2 |
| `agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/final-handoff-audit.log` | TEST-1, TEST-2 |
| `agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/CODE_REVIEW-cloud-G08.md` | TEST-1, TEST-2 |

## Final Verification

1. `bash -euo pipefail -c 'test "$PWD" = /config/workspace/iop-s1; shopt -s nullglob; group=m-iop-agent-chronos-extraction-decoupling; task=14+13_remove_migration_surface; logs=(); for archived in agent-task/archive/*/*/"$group"/"$task"/complete.log; do test -f "$archived"; logs+=("$archived"); done; test "${#logs[@]}" -eq 1; awk '\''/^## (Summary|요약)$/ {s=1; next} /^## / && s {exit} s && (/final verdict: PASS/ || /최종 verdict: PASS/) {p++} END {exit p==1?0:1}'\'' "${logs[0]}"; d=${logs[0]%/complete.log}; test -f "$d/migration-removal-audit.log"'`
2. `python3 -c 'from pathlib import Path; import hashlib,subprocess,sys; text=Path("HANDOFF.md").read_text(); assert text.startswith("---\n") and "\n---\n" in text; lines=text.split("\n---\n",1)[0].splitlines()[1:]; kv={}; [( (_ for _ in ()).throw(AssertionError(k)) if k in kv else kv.__setitem__(k,v) ) for k,v in (line.split(": ",1) for line in lines)]; expected={"task13_complete_log_path":("complete.log","task13_complete_log_sha256"),"pre_deletion_receipt_path":("pre-deletion-transfer-receipt-v1.md","pre_deletion_receipt_sha256"),"pre_deletion_audit_path":("pre-deletion-audit.log","pre_deletion_audit_sha256"),"task13_verifier_path":("verify-pre-deletion-receipt-v1.py","task13_verifier_sha256"),"original_manifest_artifact_path":("iop-agent-chronos-ownership-manifest.tsv","original_manifest_sha256"),"boundary_delta_artifact_path":("boundary-disposition-delta-v1.tsv","boundary_delta_sha256"),"boundary_addendum_artifact_path":("boundary-surface-addendum-v1.tsv","boundary_addendum_sha256"),"effective_matrix_artifact_path":("effective-disposition-matrix-v1.tsv","effective_matrix_sha256"),"state_schema_artifact_path":("iop-agent-chronos-transfer-state-v1.schema.json","state_schema_sha256"),"state_fixture_artifact_path":("iop-agent-chronos-transfer-state-v1.json","state_fixture_sha256"),"bundle_receipt_artifact_path":("iop-agent-chronos-transfer-bundle-receipt-v1.json","bundle_receipt_sha256")}; paths={k:Path(kv[k]) for k in expected}; assert all(not p.is_absolute() and ".." not in p.parts and "*" not in str(p) and "..." not in str(p) and p.name==expected[k][0] and p.is_file() for k,p in paths.items()); parents={p.parent for p in paths.values()}; assert len(parents)==1; parent=parents.pop(); assert len(parent.parts)==6 and parent.parts[:2]==("agent-task","archive") and len(parent.parts[2])==4 and parent.parts[2].isdigit() and len(parent.parts[3])==2 and parent.parts[3].isdigit() and parent.parts[-2:]==("m-iop-agent-chronos-extraction-decoupling","13+09,10_receipt_lock_audit"); assert all(hashlib.sha256(p.read_bytes()).hexdigest()==kv[expected[k][1]] for k,p in paths.items()); subprocess.run([sys.executable,str(paths["task13_verifier_path"]),"check-archived","--artifact-dir",str(parent),"--receipt",str(paths["pre_deletion_receipt_path"]),"--audit",str(paths["pre_deletion_audit_path"])],check=True)'`
3. `python3 -c 'from pathlib import Path; import subprocess,sys; text=Path("HANDOFF.md").read_text(); lines=text.split("\n---\n",1)[0].splitlines()[1:]; kv=dict(line.split(": ",1) for line in lines); verifier=Path(kv["task13_verifier_path"]); subprocess.run([sys.executable,str(verifier),"check-live","--artifact-dir",str(verifier.parent),"--receipt",kv["pre_deletion_receipt_path"],"--iop-root",".","--audit","agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/final-handoff-audit.log"],check=True)'`
4. `bash -euo pipefail -c 'paths=(apps/agent packages/go/agentruntime packages/go/agentprovider packages/go/provider/cli proto/iop/agent.proto agent-contract/inner/iop-agent-cli-runtime.md cmd/iop-chronos-transfer scripts/verify-iop-agent-chronos-boundary.py scripts/verify_iop_agent_chronos_boundary_test.py scripts/fixtures/iop-agent-chronos-ownership-manifest.tsv scripts/fixtures/iop-agent-chronos-transfer-state-v1.schema.json scripts/fixtures/iop-agent-chronos-transfer-state-v1.json scripts/fixtures/iop-agent-chronos-transfer-bundle-receipt-v1.json scripts/fixtures/iop-agent-chronos-boundary-disposition-delta-v1.tsv scripts/fixtures/iop-agent-chronos-boundary-disposition-delta-v1.sha256 scripts/fixtures/iop-agent-chronos-boundary-surface-addendum-v1.tsv scripts/fixtures/iop-agent-chronos-boundary-surface-addendum-v1.sha256); for p in "${paths[@]}"; do test ! -e "$p"; done; roots=(apps packages cmd configs proto agent-contract agent-spec); for r in "${roots[@]}"; do test -d "$r"; done; set +e; out=$(rg --sort path -n "verify-iop-agent-chronos-boundary\\.py|verify_iop_agent_chronos_boundary_test\\.py|git\\.toki-labs\\.com/toki/chronos|/config/workspace/chronos|CHRONOS_|[Cc]hronos(Target|Registry|Bridge|Server|Node|Control|Connector|Gateway)|chronos_(target|registry|bridge|server|node|control|connector|gateway)|chronos-(target|registry|bridge|server|node|control|connector|gateway)|agent_bridge|CLIAdapterConfig|CLIProfileConfig|AgentUsageStatus|persistent_(terminal|process)|TERMINATE_SESSION|SESSION_LIST|USAGE_STATUS|codex-app-server|opencode-sse|quota[-_]?probe" "${roots[@]}" 2>&1); rc=$?; set -e; test "$rc" -eq 1 || { printf "%s\n" "$out" >&2; exit 1; }'`
5. `go test -count=1 ./apps/node/... && go test -count=1 ./... && make readability-audit`
6. `python3 -c 'from pathlib import Path; import hashlib; text=Path("HANDOFF.md").read_text(); assert text.startswith("---\n") and "\n---\n" in text; lines=text.split("\n---\n",1)[0].splitlines()[1:]; kv={}; [( (_ for _ in ()).throw(AssertionError(k)) if k in kv else kv.__setitem__(k,v) ) for k,v in (line.split(": ",1) for line in lines)]; exact={"handoff_version":"1","handoff_status":"final","rollback_revision":"3155be0e275437a8eedc1aa93497955a7d30465b","task14_removal_status":"pass","real_state_export_location":"bundle-member:acceptance-v1/state/state-export-v1.json","removed_target_count":"12","pre_delete_digest_count":"12","post_delete_absence_count":"12","final_transfer_remove_residuals":"0","final_retained_path_mismatches":"0","final_renamed_source_residuals":"0","final_unclassified_paths":"0","final_duplicate_paths":"0","provider_node_regression":"pass","full_go_regression":"pass","readability_audit":"pass","forbidden_surface_scan":"pass","iop_node_owner":"model-provider-device","chronos_connection_surfaces":"0","cli_agent_terminal_workspace_surfaces":"0","chronos_repository_mutations":"0","external_mutations":"0","downstream_lock":"chronos:chronos-architecture-ownership-boundary","staging_lock_result":"none","canonical_lock_result":"rely-on:chronos:chronos-architecture-ownership-boundary","canonical_promotion":"pending"}; assert all(kv.get(k)==v and sum(1 for x in lines if x.startswith(k+": "))==1 for k,v in exact.items()); receipt=Path(kv["pre_deletion_receipt_path"]); rv=dict(x.split(": ",1) for x in receipt.read_text().split("\n---\n",1)[0].splitlines()[1:]); copied=["source_revision","original_manifest_sha256","original_manifest_row_count","boundary_delta_sha256","boundary_delta_row_count","boundary_addendum_sha256","boundary_addendum_row_count","effective_matrix_sha256","effective_matrix_row_count","state_schema_sha256","state_fixture_sha256","bundle_receipt_sha256","state_original_manifest_logical_id_count","state_addendum_logical_id_count","state_logical_id_count","state_logical_ids_sha","state_fixture_record_count","state_fixture_category_count","state_fixture_quarantine_count","real_state_export_location","real_state_export_sha256","real_state_export_record_count","real_state_export_category_count","real_state_export_quarantine_count","bundle_location","bundle_sha256","task09_complete_log_path","task09_complete_log_sha256","task10_complete_log_path","task10_complete_log_sha256","import_graph_audit_path","import_graph_audit_sha256","import_graph_residuals","downstream_lock"]; assert all(kv.get(k)==rv.get(k) for k in copied); assert all((lambda p,k: not p.is_absolute() and ".." not in p.parts and p.is_file() and hashlib.sha256(p.read_bytes()).hexdigest()==kv[k+"_sha256"])(Path(kv[k+"_path"]),k) for k in ("task14_complete_log","task14_removal_audit"))'`
7. `bash -euo pipefail -c 'staging=$(agent-ops/bin/roadmap-dependency-checker.sh --find-milestone "iop-s1:agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-chronos-extraction-decoupling.md" both /config/workspace/.agent-roadmap-sync/locks.yaml); canonical=$(agent-ops/bin/roadmap-dependency-checker.sh --find-milestone "iop:agent-roadmap/phase/automation-runtime-bridge/milestones/iop-agent-chronos-extraction-decoupling.md" both /config/workspace/.agent-roadmap-sync/locks.yaml); test "$staging" = none; test "$canonical" = rely-on:chronos:chronos-architecture-ownership-boundary'`
8. `python3 -c '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=["task13_archive_searches=0","task13_pointer_digest_mismatches=0","task14_removal_status=pass","removed_target_count=12","pre_delete_digest_count=12","post_delete_absence_count=12","bundle_member_path=acceptance-v1/state/state-export-v1.json","bundle_member_exactly_once=1","bundle_archive_paths_safe=1","bundle_member_regular_file=1","real_state_export_location=bundle-member:acceptance-v1/state/state-export-v1.json","real_state_export_digest_match=1","real_state_export_counts_match=1","real_state_export_logical_ids_match=1","state_manifest_records=10","state_supplemental_records=2","state_supplemental_ids=state:cache-root,state:temp-root","state_fixture_records=12","state_coverage_missing=0","state_coverage_unknown=0","state_logical_id_count=12","state_logical_id_sha256=9bce499e286514baeb7ad9bc7c59119a3b5725f69763706dfeba06569d7404b9","state_logical_ids_sha_match=1","state_fixture_categories=8","state_fixture_quarantine=1","state_logical_id_mismatches=0","renamed_source_residuals=0","transfer_remove_residuals=0","retained_path_mismatches=0","unclassified_paths=0","duplicate_paths=0","forbidden_surface_scan=pass","forbidden_chronos_import_residuals=0","forbidden_chronos_workspace_path_residuals=0","forbidden_chronos_env_prefix_residuals=0","forbidden_chronos_camel_residuals=0","forbidden_chronos_snake_residuals=0","forbidden_chronos_kebab_residuals=0","iop_node_owner=model-provider-device","chronos_connection_surfaces=0","cli_agent_terminal_workspace_surfaces=0","chronos_repository_mutations=0","external_mutations=0","canonical_promotion=pending"]; assert all(lines.count(x)==1 for x in required); keys=["chronos_head","chronos_status_sha256","canonical_iop_head","canonical_iop_status_sha256","lock_sha256"]; get=lambda k,p: next(x.split("=",1)[1] for x in lines if x.startswith(p+"_"+k+"=")); assert all(get(k,"before")==get(k,"after") for k in keys); command_ids=[x.split("=",1)[1] for x in lines if x.startswith("command_id=")]; assert command_ids and len(command_ids)==len(set(command_ids)); assert all(lines.count("command_exit_code="+c+":0")==1 and sum(1 for x in lines if x.startswith("command_stdout_sha256="+c+":"))==1 and sum(1 for x in lines if x.startswith("command_stderr_sha256="+c+":"))==1 for c in command_ids)'`
9. `python3 -c 'from pathlib import Path; text=Path("HANDOFF.md").read_text(); front=text.split("\n---\n",1)[0].splitlines()[1:]; pairs=[x.split(": ",1) for x in front]; keys=[x[0] for x in pairs]; kv=dict(pairs); expected="handoff_version handoff_status source_revision rollback_revision 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 original_manifest_row_count boundary_delta_artifact_path boundary_delta_sha256 boundary_delta_row_count boundary_addendum_artifact_path boundary_addendum_sha256 boundary_addendum_row_count effective_matrix_artifact_path effective_matrix_sha256 effective_matrix_row_count state_schema_artifact_path state_schema_sha256 state_fixture_artifact_path state_fixture_sha256 bundle_receipt_artifact_path bundle_receipt_sha256 state_original_manifest_logical_id_count state_addendum_logical_id_count state_logical_id_count state_logical_ids_sha state_fixture_record_count state_fixture_category_count state_fixture_quarantine_count real_state_export_location real_state_export_sha256 real_state_export_record_count real_state_export_category_count real_state_export_quarantine_count bundle_location bundle_sha256 task09_complete_log_path task09_complete_log_sha256 task10_complete_log_path task10_complete_log_sha256 import_graph_audit_path import_graph_audit_sha256 import_graph_residuals task14_complete_log_path task14_complete_log_sha256 task14_removal_audit_path task14_removal_audit_sha256 task14_removal_status removed_target_count pre_delete_digest_count post_delete_absence_count final_transfer_remove_residuals final_retained_path_mismatches final_renamed_source_residuals final_unclassified_paths final_duplicate_paths provider_node_regression full_go_regression readability_audit forbidden_surface_scan iop_node_owner chronos_connection_surfaces cli_agent_terminal_workspace_surfaces chronos_repository_mutations external_mutations canonical_promotion downstream_lock staging_lock_identity staging_lock_result canonical_lock_identity canonical_lock_result".split(); assert keys==expected; rv=dict(x.split(": ",1) for x in Path(kv["pre_deletion_receipt_path"]).read_text().split("\n---\n",1)[0].splitlines()[1:]); copied="source_revision rollback_revision original_manifest_sha256 original_manifest_row_count boundary_delta_sha256 boundary_delta_row_count boundary_addendum_sha256 boundary_addendum_row_count effective_matrix_sha256 effective_matrix_row_count state_schema_sha256 state_fixture_sha256 bundle_receipt_sha256 state_original_manifest_logical_id_count state_addendum_logical_id_count state_logical_id_count state_logical_ids_sha state_fixture_record_count state_fixture_category_count state_fixture_quarantine_count real_state_export_location real_state_export_sha256 real_state_export_record_count real_state_export_category_count real_state_export_quarantine_count bundle_location bundle_sha256 task09_complete_log_path task09_complete_log_sha256 task10_complete_log_path task10_complete_log_sha256 import_graph_audit_path import_graph_audit_sha256 import_graph_residuals iop_node_owner chronos_connection_surfaces chronos_repository_mutations canonical_promotion downstream_lock staging_lock_identity staging_lock_result canonical_lock_identity canonical_lock_result".split(); assert all(kv[k]==rv[k] for k in copied); assert kv["real_state_export_location"]=="bundle-member:acceptance-v1/state/state-export-v1.json"; assert kv["state_original_manifest_logical_id_count"]=="10" and kv["state_addendum_logical_id_count"]=="2" and kv["state_logical_id_count"]=="12" and kv["state_logical_ids_sha"]=="9bce499e286514baeb7ad9bc7c59119a3b5725f69763706dfeba06569d7404b9"; assert kv["state_fixture_record_count"]=="12" and kv["state_fixture_category_count"]=="8" and kv["state_fixture_quarantine_count"]=="1"; assert kv["final_renamed_source_residuals"]=="0"; audit=Path("agent-task/m-iop-agent-chronos-extraction-decoupling/15+14_handoff_closure/final-handoff-audit.log").read_text().splitlines(); assert audit.count("renamed_source_residuals=0")==1 and audit.count("state_logical_id_mismatches=0")==1'`
10. `git diff --check`

Commands containing `go test -count=1` require fresh output; all other checks are rerun against the current checkout.

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