This repository has been archived on 2026-10-04. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2026-08-31 19:50:46 -04:00

44 lines
5.2 KiB
Markdown

# Iteration 04 Request
- Task: 20260831-105824-plan-code-ui-audit
- Requested by: build from independent reviewer report
- Owner: coder
- Status: changes-requested
- Reviewer source: `../review.md` (openai-codex/gpt-5.6-sol)
## Baseline
The aborted iteration-03 invocation left partial unreported edits in the shared worktree. Preserve valid work, but first fix the current compile failure at `PinnedMediaResourceLoader.swift` caused by mixing `Int?` and `Int64` in total-length handling. Do not revert earlier validated changes.
## Required Product Corrections
1. Complete every item in `iterations/03-request.md`, including symmetric time-bounded transcript dedupe, lifecycle-safe mic interruption ownership, media interruption pause/resume semantics, correct 206 total length, construction-only stream URL, stale comments, tests, build, and reports.
2. Centralize terminal VoiceSession failure cleanup. Final agent timeout and active-room terminal disconnect must cancel wait work, invalidate stale callbacks, disconnect/recreate the room, stop conversation state, restore `isIdleTimerDisabled`, clean media conversation scope appropriately, and leave retry using a fresh room/token. Avoid recursive state races and add the smallest practical lifecycle tests or document integration-only seams.
3. Enforce the text-mode microphone invariant inside `VoiceSession`: text mode must not permit `setMuted(false)`/mic enable. Hide or disable the separate mic toggle while text mode is active. Add a focused state/API test if practical.
4. Fix server configuration semantics. Do not silently connect/media-call the default host when the visible user value is invalid. Avoid recreating sessions on every settings keystroke. Validate and apply on explicit submit/save, provide a visible validation error, serialize replacement, and either disable active-session changes or clearly defer one until idle. Sanitize legacy invalid persisted configuration to the documented default at initialization if needed. Add pure config/store tests.
5. Make persisted transcript history visible and Clear truthful. Use one coherent visible transcript model that restores up to 50 finals, avoids duplicating live finals, preserves partial updates, and atomically clears both visible rows and persisted history. Do not clear restored history merely because Start was tapped. Add restoration, max-50, live-update, and clear tests.
6. Align conversation-state inference with the current web reference (`hope-voice-api/web/app.js:414-426`): remote speech ending must return to listening rather than becoming thinking forever. If thinking is retained, it must be entered explicitly by an actual turn action and exited deterministically. Add state-transition tests.
7. Make media-state publishing stale-safe: capture exact LiveKit room and session generation before spawning, then verify both remain current before publish. Invalidate/cancel old-scope reporting/publishing where practical.
8. Finish resource-loader hardening beyond the total-length parser: share a pinned session, retain upstream tasks per loading request, cancel/remove them on AVAsset cancellation, reject non-200/206 responses, and clean request bookkeeping. Keep loader identity mapping bounded where feasible. Add focused parser/status/cancellation tests without building an excessive test server.
9. Support the documented configurable HTTPS behavior safely: apply the fixed self-signed pin only to the configured/default pinned LAN host; allow normal system trust evaluation for other HTTPS hosts. Never weaken trust for `192.168.86.2`. Ensure token/media sessions receive the relevant host policy and add trust-policy unit coverage where possible.
10. Fix the model picker disconnected copy by branching on actual readiness/state, not session non-nil.
## Documentation Corrections
11. Update `PLAN.md` and `README.md` to stop claiming all phases/full parity are completely qualified. Preserve historical implementation evidence, but clearly classify real-device exits, supported-format media playback, interruption paths, accessibility/visual redesign, app icon, and any remaining review risks as pending or blocked. Do not mark the UI redesign spec as implemented.
12. Update `docs/DEVICE_TESTING.md` wording: `isIdleTimerDisabled` prevents automatic idle lock but cannot prevent a user pressing the side button from locking the device.
## Scope Guard
- Do not implement the broad Hope UI redesign in this correction round; `ui-ux-spec.md` is the approved specification deliverable, not current product behavior.
- Do not modify `hope-voice-api` or `hope_companion`.
- Keep changes minimal and testable. If a reviewer recommendation would require a large architecture rewrite, implement the smallest safe invariant and document residual risk.
- No commits.
## Verification And Reports
- Use XcodeBuildMCP skill, show defaults, run the complete simulator tests and a separate simulator build.
- Run `git diff --check` and report exact test counts/log paths.
- Write `iterations/03-implementation.md` to account for the partial iteration-03 work, then `iterations/04-implementation.md` for this correction, and update `implementation.md`/manifest without erasing history.
- Return to independent reviewer only after current build and tests pass.