<!-- task=m-multi-provider-protocol-profile-native-messages/04+02_pi_responses_regression plan=1 tag=TEST -->

# Pi openai-responses installer regression

## For the Implementing Agent

CODE_REVIEW-cloud-G01.md의 구현 담당 섹션을 채우는 것이 구현의 필수 마지막 단계다. 선행 02+01_messages_ingress/complete.log를 확인한 뒤 temp HOME 기반 Pi installer regression과 README clarification만 구현한다. 실제 stdout/stderr를 review에 기록하고 active 파일을 유지한 채 review 준비 완료를 보고한다. 최종 판정, log rename, complete.log, archive 이동은 code-review skill만 수행한다.

## Background

Pi installer는 Seulgivibe Codex에 api: openai-responses를 쓰고 기존 defaults/API keys를 보존하지만 실행 가능한 회귀 테스트가 없다. 이 child는 실제 installer를 격리된 temp HOME에서 실행해 해당 소비 계약과 idempotency를 credential-free로 고정한다.

## Analysis

### Files Read

- agent-roadmap/phase/operational-observability-provider-management/milestones/multi-provider-protocol-profile-native-messages.md
- agent-roadmap/sdd/operational-observability-provider-management/multi-provider-protocol-profile-native-messages/SDD.md
- agent-client/pi/README.md
- agent-client/pi/install.sh

### SDD Criteria

- S08 / responses-regression 중 Pi가 openai-responses 소비 동작, user settings, keys, timeout semantics를 유지해야 한다.
- Responses live smoke is not required.

### Verification Context

- Python unittest uses a temporary HOME and fake keys only.
- The real shell installer is executed without network.
- No user home or existing secret may be changed.

### Test Coverage Gaps

- No executable temp-home regression currently covers installer merge behavior or idempotency.

### Symbol References

- install.sh setup semantics and provider API/defaults remain unchanged.
- README clarification documents existing behavior; it does not introduce a new setup path.

### Split Judgment

- The original final pair is split once into Responses production regression, this independent Pi regression, and a dependent contract/spec closure.
- This child does not modify Edge code, contracts, or specs.

### Scope Rationale

- A failing assertion may justify a narrowly scoped installer correction only when needed to preserve the already planned behavior; any such change must be recorded as a deviation.
- Full Go and documentation closure belongs to 05+03,04_contract_spec_sync.

### Final Routing

- status: routed; evaluation_mode: isolated-reassessment; finalizer: finalize-task-policy.sh (pair).
- build closures: scope/context/verification/evidence/ownership/decision all true; capability gap none.
- build grade scores: scope_coupling=0, state_concurrency=0, blast_irreversibility=0, evidence_diagnosis=0, verification_complexity=1 -> G01.
- build route: base=local-fit, large_indivisible_context=false, matched loop risks=none, review_rework_count=0, evidence_integrity_failure=false, route=local-fit.
- review closures: all true; grade scores 0/0/0/0/1 -> G01; route=official-review, cloud, Codex gpt-5.6-sol, xhigh.
- canonical files: PLAN-local-G01.md, CODE_REVIEW-cloud-G01.md.

## Dependencies and Execution Order

1. 02+01_messages_ingress — agent-task/m-multi-provider-protocol-profile-native-messages/02+01_messages_ingress/complete.log must exist.
2. Run the installer regression only with the test-created temporary HOME.

## Implementation Checklist

- [ ] Add an executable temp-home Pi installer regression for openai-responses consumption, merge preservation, timeout cleanup, and idempotency.
- [ ] Clarify the credential-free maintained Responses path in the Pi README without changing setup semantics.
- [ ] Run the Python and shell focused verification without touching a user home.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [TEST-2] Pi openai-responses consumption regression

#### Problem

agent-client/pi/install.sh writes api: openai-responses, preserves defaults/API keys, and removes provider timeout override, but no executable test protects this behavior.

#### Solution

Add a Python unittest that creates a temp HOME with representative settings.json and models.json, runs the real installer, asserts Seulgivibe Codex remains openai-responses, verifies existing defaults/key/dev-corp data and timeout semantics, reruns for idempotency, and uses fake keys only.

#### Modified Files and Checklist

- [ ] agent-client/pi/install_test.py: add temp-home merge and idempotency regression around the real installer.
- [ ] agent-client/pi/README.md: document credential-free validation and retained Pi Responses consumption.

#### Test Strategy

Implement test_preserves_openai_responses_consumption_and_user_settings and test_is_idempotent. Invoke bash agent-client/pi/install.sh with HOME pointing to the temporary directory and inspect resulting JSON and backups.

#### Verification

~~~bash
command -v python3 && python3 --version
python3 agent-client/pi/install_test.py
bash -n agent-client/pi/install.sh
~~~

Expected: both temp-home tests pass, shell syntax is valid, and no real user home or credential is touched.

## Modified Files Summary

| File | Items |
|------|-------|
| `agent-client/pi/install_test.py` | TEST-2 |
| `agent-client/pi/README.md` | TEST-2 |
| `agent-task/m-multi-provider-protocol-profile-native-messages/04+02_pi_responses_regression/CODE_REVIEW-cloud-G01.md` | evidence |

## Final Verification

Run after predecessor PASS:

~~~bash
test -f agent-task/m-multi-provider-protocol-profile-native-messages/02+01_messages_ingress/complete.log
command -v python3 && python3 --version
python3 agent-client/pi/install_test.py
bash -n agent-client/pi/install.sh
git diff --check
~~~

Expected: dependency exists, isolated installer tests and syntax checks pass, and diff check is clean.

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