<!-- task=m-node-provider-execution-liveness-recovery/14+11,12,13_observability_contracts plan=0 tag=REFACTOR milestone-task=ops-evidence -->

# Liveness Operational Evidence Contract Closure

## For the Implementing Agent

Start only after all three dependency `complete.log` files exist. Re-read their exact completion evidence and the implemented source, update only the three declared shared documents, run every verification command, and fill all implementation-owned sections of `CODE_REVIEW-cloud-G05.md` with actual notes and raw output. Keep active files in place and report ready for review; finalization belongs to the code-review skill. If blocked, record exact blocker evidence, attempted commands/output, and resume conditions only. 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 three operational-evidence producers are intentionally independent: child 11 owns Node response-stall evidence, child 12 owns Edge provider-health overlay evidence, and child 13 owns OpenAI recovery evidence. The checkpoint refinement removed their overlapping shared-document writes but left those writes with no active owner. This dependency-ordered closure child restores the pre-refine intent by synchronizing the execution contract, wire-boundary contract, and living Edge/Node implementation spec only after all producers have passed review.

## Archive Evidence Snapshot

- Replaced pair evidence: `agent-task/m-node-provider-execution-liveness-recovery/11+06_node_liveness_observability/plan_local_G05_2.log` and `agent-task/m-node-provider-execution-liveness-recovery/11+06_node_liveness_observability/code_review_cloud_G05_2.log`; the pair was unimplemented and had no official verdict or verification output.
- Pre-refine intent at checkpoint `729f458a42f2c0c05fcb5d1c84738b41b41cd7cf`: the immediate prior pair set assigned `agent-contract/inner/execution-runtime.md`, `agent-contract/inner/edge-node-runtime-wire.md`, and `agent-spec/runtime/edge-node-execution.md` across children 11/12/13. Refinement removed overlap but did not create a replacement owner.
- Carryover: preserve disjoint implementation write sets and document only reviewed behavior. Do not copy planned claims into current contracts/specs before dependencies pass, and do not reopen the overlay-specific or OpenAI-specific documents that remain owned by children 12 and 13.

## Analysis

### Files Read

- `agent-roadmap/phase/operational-observability-provider-management/milestones/node-provider-execution-liveness-recovery.md`
- `agent-roadmap/sdd/operational-observability-provider-management/node-provider-execution-liveness-recovery/SDD.md`
- `agent-task/m-node-provider-execution-liveness-recovery/08+07_health_overlay/PLAN-cloud-G09.md`
- `agent-task/m-node-provider-execution-liveness-recovery/10+09_stall_recovery/PLAN-cloud-G08.md`
- `agent-task/m-node-provider-execution-liveness-recovery/11+06_node_liveness_observability/PLAN-local-G05.md`
- `agent-task/m-node-provider-execution-liveness-recovery/12+08_health_overlay_observability/PLAN-cloud-G08.md`
- `agent-task/m-node-provider-execution-liveness-recovery/13+10_recovery_observability/PLAN-cloud-G08.md`
- `agent-contract/index.md`
- `agent-contract/inner/execution-runtime.md`
- `agent-contract/inner/edge-node-runtime-wire.md`
- `agent-spec/index.md`
- `agent-spec/runtime/edge-node-execution.md`
- `apps/node/internal/node/node.go`
- `apps/node/internal/node/liveness_watchdog.go`
- `apps/node/internal/node/liveness_health_evidence.go`
- `apps/edge/internal/service/bootstrap.go`
- `apps/edge/internal/service/service.go`
- `apps/edge/internal/openai/server.go`
- `apps/edge/internal/openai/provider_observation.go`
- `packages/go/observability/observability.go`
- `agent-test/local/node-smoke.md`
- `agent-test/local/edge-smoke.md`
- `agent-test/local/platform-common-smoke.md`

### SDD Criteria

- SDD: `agent-roadmap/sdd/operational-observability-provider-management/node-provider-execution-liveness-recovery/SDD.md`; status `[승인됨]`; first-line `milestone-task=ops-evidence`.
- Acceptance Scenario S06 and Evidence Map S06 require the living Source of Truth to describe Node stall count/duration/fence/probe evidence, Edge recovery-owner commit/eligibility/result evidence, provider unhealthy/fresh recovery overlay visibility, deterministic verification, and the no-high-cardinality/no-raw-payload boundary.
- The SDD names `execution-runtime.md`, `edge-node-runtime-wire.md`, and `edge-node-execution.md` as shared source-of-truth surfaces. REFACTOR-1 owns the two contracts; REFACTOR-2 owns the living implementation spec.

### Verification Context

- No handoff artifact was supplied. The requested comparison checkpoint is `729f458a42f2c0c05fcb5d1c84738b41b41cd7cf`, which matched HEAD during preparation. No product source had changed relative to the plans being reviewed.
- This child is dependency-waiting at creation: predecessor indices 11 (`11+06_node_liveness_observability`), 12 (`12+08_health_overlay_observability`), and 13 (`13+10_recovery_observability`) are active and their `complete.log` files are missing. At implementation, check the active sibling first and then the same task group's matching archived sibling; exactly one candidate per index must exist.
- Once unblocked, completion evidence and current source—not planned symbol names alone—are authoritative. Verification reuses the focused/package tests required by the three producer children, then checks the exact documented metric families and a clean diff.
- No external service is required. This is a documentation-only closure over locally reviewed implementation and repository-local tests.

### Documentation Gaps

- `agent-contract/inner/execution-runtime.md` describes liveness terminals and planned overlay/recovery behavior but does not yet define the bounded operational metric/log projections, their owners, or the raw/high-cardinality exclusion boundary.
- `agent-contract/inner/edge-node-runtime-wire.md` does not make explicit that these operational projections are local observations derived from established execution/health evidence and do not widen the Node↔Edge wire schema.
- `agent-spec/runtime/edge-node-execution.md` still treats portions of overlay and recovery observability as future work and lacks reviewed source/test evidence for the complete S06 matrix.

### Symbol References

- None are fixed at planning time. The implementing agent must use the exact reviewed symbols and test names recorded by children 11, 12, and 13, avoiding speculative documentation if implementation differs from their plans.

### Split Judgment

- This is the smallest stable closure unit: three documents describe one cross-component operational-evidence contract after three producers pass. Splitting each document would duplicate dependency reads and could create inconsistent metric ownership language.
- The child has no production-code writes and depends explicitly on predecessor 11 (missing active completion), predecessor 12 (missing active completion), and predecessor 13 (missing active completion). It does not overlap child 12's `edge-config-runtime-refresh.md`/`provider-pool.md` documents or child 13's OpenAI/streamgate documents. No further split is warranted.

### Scope Rationale

Update only the current behavior proven by all three dependency completion logs and implemented source. Do not change Go code or tests, wire/config schemas, metric exporters, retry policy, provider selection, dashboards, roadmap/SDD state, child-owned overlay/OpenAI contracts/specs, or any central rule/skill. Do not add request, session, run, attempt, provider, adapter, target, raw prompt/response, credential, or other unbounded identifiers to documented metric labels or general structured logs.

### Final Routing

- `evaluation_mode=isolated-reassessment`; finalizer=`finalize-task-policy.sh pair`.
- Build closure true; scores `(2,0,1,1,1)`, grade G05, route `local-fit` -> `PLAN-local-G05.md`.
- Review closure true; scores `(2,0,1,1,1)`, grade G05, route `official-review` -> `CODE_REVIEW-cloud-G05.md` (`codex`, `gpt-5.6-sol`, `xhigh`).
- `large_indivisible_context=false`; positive loop risks: `boundary_contract`, `variant_product` (2). No recovery signal, capability gap, review rework, or evidence-integrity failure.

## Dependencies and Execution Order

1. Predecessor index 11, `11+06_node_liveness_observability`, must produce one active or same-task-group archived `complete.log`; it is active and missing at plan creation.
2. Predecessor index 12, `12+08_health_overlay_observability`, must produce one active or same-task-group archived `complete.log`; it is active and missing at plan creation.
3. Predecessor index 13, `13+10_recovery_observability`, must produce one active or same-task-group archived `complete.log`; it is active and missing at plan creation.
4. Implement REFACTOR-1 before REFACTOR-2 so the living spec cites the finalized shared contract language.

If any predecessor has zero or multiple matching completion candidates, do not modify the shared documents. Record the exact missing or ambiguous dependency candidates in the review stub and stop as blocked.

## Implementation Checklist

- [ ] REFACTOR-1 synchronizes the shared execution and wire contracts with the reviewed Node stall, provider-health overlay, and recovery operational evidence, including owner, bounded label/log vocabulary, and the unchanged-wire boundary.
- [ ] REFACTOR-2 synchronizes the living Edge/Node execution spec with the exact reviewed source symbols, behavior, tests, and deterministic S06 verification while removing superseded future-work claims only where implementation now exists.
- [ ] Confirm all dependency gates, run every focused/package/document/diff command in Final Verification with fresh output, and verify the three-document write set is exact.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [REFACTOR-1] Consolidate operational-evidence contracts

**Problem:** The shared execution contract already defines liveness evidence and the wire contract defines terminal transport, but neither provides a complete current contract for the operational metric/log projections implemented by children 11-13. Leaving consolidation implicit would make ownership, bounded labels, and the no-wire-widening boundary unverifiable.

**Solution:** After all dependencies pass, read their completion evidence and implemented sources. Update `execution-runtime.md` with the exact metric family names, observation owners, event names, closed label/status values, timing semantics, exactly-once seams, and prohibited raw/high-cardinality fields for Node stalls, provider health transitions/snapshots, recovery eligibility/owner commit/results. State how fresh health recovery appears in the existing provider snapshot overlay. Update `edge-node-runtime-wire.md` only to clarify that local metrics/logs project established terminal, health, and recovery decisions and introduce no new Node↔Edge frame, field, ordering, or retry semantic. Preserve richer request-scoped identifiers where the existing wire contract already requires them; the observability exclusion applies to metric labels and general logs, not to removal of valid typed terminal metadata.

Before (`agent-contract/inner/execution-runtime.md:55` and `agent-contract/inner/edge-node-runtime-wire.md:47`):

```text
Probe completion is evidence only; Edge overlay and recovery remain owned by later slices.
The wire defines the typed response-stall terminal but no local operational projection boundary.
```

After:

```text
Reviewed Node and Edge owners expose bounded operational projections from existing evidence; no operational projection widens the wire protocol.
```

**Modified Files and Checklist:**

- [ ] `agent-contract/inner/execution-runtime.md`: document the reviewed operational evidence, owners, bounded fields, timing/exact-once semantics, overlay reflection, and leakage boundary.
- [ ] `agent-contract/inner/edge-node-runtime-wire.md`: document the local-projection/no-wire-widening boundary without inventing a frame or schema change.

**Test Strategy:** No new product test is added in this documentation-only child. Re-run the producer-focused and package tests in Final Verification, and compare documented names and values with the dependency completion evidence and current source.

**Verification:** the dependency gate and Verifications 2-4 below must pass before the document diff is accepted.

### [REFACTOR-2] Synchronize the living Edge/Node execution spec

**Problem:** `agent-spec/runtime/edge-node-execution.md` is the matching current implementation spec, but it cannot truthfully describe the full S06 operational surface until children 11-13 pass. The refined pair set otherwise leaves the current spec stale after implementation.

**Solution:** Replace only superseded future-state wording with reviewed current behavior. Record exact source ownership and source/test evidence for Node stall observations, provider health transition/snapshot observations, and OpenAI recovery observations. Describe their relation to established fence/probe, overlay, eligibility, owner-commit, and result semantics. Retain future-work statements for anything not proven by the completion logs. Document the deterministic test matrix and prohibited-field assertions without duplicating child-specific contract detail owned by the provider-pool, configuration, streamgate, or OpenAI specs.

Before (`agent-spec/runtime/edge-node-execution.md:147`):

```text
Edge reception-generation binding, stale-observation validation, Edge health overlay, Node retry, recovery, and candidate selection remain future work.
```

After:

```text
The current spec maps reviewed Node and Edge observability producers to S06 behavior and deterministic tests.
```

**Modified Files and Checklist:**

- [ ] `agent-spec/runtime/edge-node-execution.md`: synchronize current behavior, exact reviewed source/test evidence, bounded-data guarantees, and remaining future work.

**Test Strategy:** No new product test. Verify the spec only cites symbols/tests that exist after dependency completion and that focused test selectors execute matching tests rather than zero tests.

**Verification:** Verifications 2-5 below must pass and the final diff must contain no unrelated spec edits.

## Modified Files Summary

| File | Item |
|------|------|
| `agent-contract/inner/execution-runtime.md` | REFACTOR-1 |
| `agent-contract/inner/edge-node-runtime-wire.md` | REFACTOR-1 |
| `agent-spec/runtime/edge-node-execution.md` | REFACTOR-2 |
| `agent-task/m-node-provider-execution-liveness-recovery/14+11,12,13_observability_contracts/CODE_REVIEW-cloud-G05.md` | REFACTOR-1, REFACTOR-2 |

## Final Verification

Fresh output is required; cached output is not acceptable.

1. `bash -O nullglob -c 'for index in 11 12 13; do matches=(agent-task/m-node-provider-execution-liveness-recovery/${index}_*/complete.log agent-task/m-node-provider-execution-liveness-recovery/${index}+*/complete.log agent-task/archive/*/*/m-node-provider-execution-liveness-recovery/${index}_*/complete.log agent-task/archive/*/*/m-node-provider-execution-liveness-recovery/${index}+*/complete.log); ((${#matches[@]} == 1)) || exit 1; done'` — PASS only when exactly one active or same-task-group archived completion exists for each predecessor index.
2. `go test -count=1 ./packages/go/execution ./apps/node/internal/node ./apps/edge/internal/service ./packages/go/streamgate ./apps/edge/internal/openai` — PASS for all affected runtime packages.
3. `go test -count=1 ./apps/node/internal/node -run '^TestNodeLivenessObservability' && go test -count=1 ./apps/edge/internal/service -run '^TestProviderHealthObservability' && go test -count=1 ./apps/edge/internal/openai -run '^(TestOpenAILivenessObservationSink|TestOpenAILivenessRecoveryObservability)$'` — PASS with matching tests executed for all three producer surfaces; if reviewed children use different exact names, record the source-backed selector substitutions in Deviations from Plan.
4. `rg --sort path -n 'iop_node_response_stalls_total|iop_edge_provider_health_evidence_total|iop_edge_liveness_recovery_eligibility_total|node_response_stall_observation|edge_provider_health_observation|edge_liveness_recovery_observation' agent-contract/inner/execution-runtime.md agent-contract/inner/edge-node-runtime-wire.md agent-spec/runtime/edge-node-execution.md` — output contains the exact reviewed metric/event names and no speculative name.
5. `git diff -- agent-contract/inner/execution-runtime.md agent-contract/inner/edge-node-runtime-wire.md agent-spec/runtime/edge-node-execution.md agent-task/m-node-provider-execution-liveness-recovery/14+11,12,13_observability_contracts/CODE_REVIEW-cloud-G05.md` — only declared contract/spec and implementation-evidence edits appear.
6. `git diff --check` — no whitespace errors.

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