<!-- task=m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification plan=8 tag=REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_API milestone-task=workspace-binding,claude-smoke -->

# Repair Claude stream-json CLI argument compatibility

## For the Implementing Agent

Filling the implementation-owned sections of `CODE_REVIEW-cloud-G05.md` is the mandatory last implementation step. Implement only the repository-owned CLI argument and fake coverage repair, run every verification command, keep the active pair in place, and report ready for official review. Do not invoke Claude or any external provider, ask the user, create a stop file, archive artifacts, or write `complete.log`.

## Background

The plan-7 live call used clean API-key auth but the installed Claude 2.1.177 rejected the harness command before Edge ingress: `--print --output-format=stream-json` requires `--verbose`. The self-test did not catch this because its fake help and live path omitted that invariant. The consumed external authorization is not renewed by this repair; this packet is deterministic and provider-free.

## Archive Evidence Snapshot

- Prior pair: `plan_cloud_G10_7.log` / `code_review_cloud_G10_7.log`; verdict `FAIL`, `review_rework_count=6`, `evidence_integrity_failure=false`.
- Required R1: `scripts/e2e-single-request-claude.sh:657,803,1181,1197` omits `--verbose` from help admission, supervised command assembly, and fake behavior.
- External evidence: clean config reported `auth=api_key`; zero-child preflight passed; the sole live child exited 1 before HTTP; ingress/result/manifest stayed `0/absent/absent`; no retry occurred.
- Installed-binary static evidence: `Error: When using --print, --output-format=stream-json requires --verbose`.
- The wrapper `status` variable issue is a Nit for the next external plan and is not a repository runtime change in this packet.

## Finding Resolution Map

| Finding | Mode | Exact fix | Changed precondition |
|---|---|---|---|
| R1 | direct-fix | Add `--verbose` to required help flags and the supervised command; expose it in fake help and reject fake live execution unless exactly one occurrence is present. | The deterministic fake now enforces the same argument relation as installed Claude 2.1.177, so a missing `--verbose` breaks self-test before any future live authorization. |

## Analysis

### Files Read

- `agent-ops/rules/project/domain/testing/rules.md`
- `agent-test/dev/rules.md`
- `agent-test/dev/edge-smoke.md`
- `scripts/e2e-single-request-claude.sh`
- `plan_cloud_G10_7.log`
- `code_review_cloud_G10_7.log`

### SDD Criteria

- Milestone contribution remains `workspace-binding,claude-smoke`; implementation lock and SDD lock are released.
- S12 requires a real Claude request, so the harness command must first satisfy the installed CLI's local argument contract. This packet repairs that prerequisite only and does not claim S12 evidence or completion.

### Verification Context

- No external handoff is needed for this repair. The installed executable's static validation string and source command assembly identify the mismatch.
- `make test-single-request-claude-smoke-self-test` is the repository-native provider-free oracle. The fake must enforce the flag, not merely advertise it in help.
- No external CLI/provider command is authorized. A later external plan must use `live_rc`, not zsh's reserved `status`, and must obtain new exactly-one authorization.

### Test Coverage Gaps

- Current self-test validates four help flags but not `--verbose`.
- Current fake accepts any live argument list, so omission of a required runtime flag is invisible. Exact-one fake validation closes this regression.

### Symbol References

No symbol is renamed. The changed command list is local to `run_claude_child`; fake constants and the fake shell body are consumed only by the self-test generator in the same script.

### Split Judgment

Keep one packet: help admission, real command assembly, and fake enforcement are one compact CLI compatibility invariant and share one self-test oracle.

### Scope Rationale

Modify only `scripts/e2e-single-request-claude.sh` and active review evidence. Do not touch product runtime, configs, schema, Makefile, contracts/specs, evidence manifest, remote candidate, workspace, or any external process.

### Final Routing

- `status=routed`, `evaluation_mode=isolated-reassessment`, `finalizer=finalize-task-policy.sh`, `finalizer_mode=pair`.
- Build closures all `true`; scores `1/1/1/1/1` => `G05`; base `local-fit`, `review_rework_count=6` selects `recovery-boundary`, lane `cloud`, filename `PLAN-cloud-G05.md`, catalog route `worker/cloud/G05`.
- `large_indivisible_context=false`; matched risk `structured_interpretation`; count `1`; `evidence_integrity_failure=false`.
- Review closures all `true`; scores `1/1/1/1/1` => `G05`; `official-review`, `CODE_REVIEW-cloud-G05.md`, catalog route `review/cloud/G05`.

## Implementation Checklist

- [ ] Require and pass exactly one `--verbose` flag in the real supervised Claude command and advertise it in the runtime help contract.
- [ ] Extend the deterministic fake so every fake live invocation rejects missing or duplicate `--verbose` while preserving all existing failure/signal scenarios.
- [ ] Run syntax, self-test, focused source assertions, and diff hygiene without invoking an external provider.
- [ ] Fill implementation-owned sections in CODE_REVIEW-*-G??.md with actual implementation notes and verification output.

### [REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_API-1] Align the real CLI command

**Problem**

At `scripts/e2e-single-request-claude.sh:657` preflight accepts a help surface without `--verbose`, while line 803 constructs a stream-json print command without that flag. Claude 2.1.177 exits locally with status 1.

**Solution**

Add `--verbose` to the required help list and once to the command array before the prompt.

Before:

```python
"--print", "--output-format", "stream-json", "--no-session-persistence", "--bare",
```

After:

```python
"--print", "--output-format", "stream-json", "--verbose", "--no-session-persistence", "--bare",
```

**Modified Files and Checklist**

- [ ] Update `scripts/e2e-single-request-claude.sh` help validation and command assembly.

**Test Strategy**

Existing self-test is retained and strengthened by item 2; no external test is allowed.

**Verification**

Run Final Verification 1 and 3; syntax passes and source assertions find exactly one command flag.

### [REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_API-2] Make the fake enforce compatibility

**Problem**

At `scripts/e2e-single-request-claude.sh:1181,1197`, fake help omits `--verbose`, and the fake live path never checks received arguments. The prior self-test therefore passed an invalid real command.

**Solution**

Add `--verbose` to fake help and count it in the fake's received arguments, exiting non-zero unless the count is exactly one before recording a simulated invocation.

Before:

```sh
printf '%s\n' '--print' '--output-format' '--no-session-persistence' '--bare'
```

After:

```sh
printf '%s\n' '--print' '--output-format' '--verbose' '--no-session-persistence' '--bare'
```

**Modified Files and Checklist**

- [ ] Update `scripts/e2e-single-request-claude.sh` fake help and exact-one flag assertion.

**Test Strategy**

`make test-single-request-claude-smoke-self-test` runs the fake across success, rejection, cleanup, and signal scenarios. Every live fake path must traverse the new assertion.

**Verification**

Run Final Verification 2; it must pass with no real Claude/provider process.

### [REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_API-3] Record provider-free evidence

**Problem**

The next official review must distinguish this deterministic repair from a prohibited second external call.

**Solution**

Fill the review with exact command output and explicitly record that no Claude/provider command ran and no remote/local manifest or qualification document changed.

**Modified Files and Checklist**

- [ ] Fill `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/CODE_REVIEW-cloud-G05.md`.

**Test Strategy**

No additional test is written; review evidence lists only provider-free commands.

**Verification**

The review has no implementation placeholders and matches the scoped diff.

## Modified Files Summary

| File | Items |
|---|---|
| `scripts/e2e-single-request-claude.sh` | REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_API-1, REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_API-2 |
| `agent-task/m-iop-owned-single-request-agent-execution/25+23,24_claude_smoke_qualification/CODE_REVIEW-cloud-G05.md` | REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_REVIEW_API-3 |

## Final Verification

Fresh output is required. None of these commands may invoke the installed Claude executable or any external provider.

1. `bash -n scripts/e2e-single-request-claude.sh` — exits zero.
2. `make test-single-request-claude-smoke-self-test` — all deterministic fake scenarios pass.
3. `python3 - <<'PY'
from pathlib import Path
s=Path("scripts/e2e-single-request-claude.sh").read_text()
assert 'for flag in --print --output-format --verbose --no-session-persistence --bare' in s
assert '"--print", "--output-format", "stream-json", "--verbose", "--no-session-persistence", "--bare",' in s
assert "printf '%s\\n' '--print' '--output-format' '--verbose' '--no-session-persistence' '--bare'" in s
assert 'verbose_count' in s and '[ "$verbose_count" -eq 1 ] || exit 26' in s
PY` — exact source invariants pass.
4. `git diff --check` — no whitespace errors.

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