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
hope-voice-ios/.artifacts/20260831-105824-plan-code-ui-audit/iterations/07-request.md
T
2026-08-31 19:50:46 -04:00

3.1 KiB

Iteration 07 Request

  • Task: 20260831-105824-plan-code-ui-audit
  • Requested by: build from iterations/06-review.md
  • Owner: coder
  • Status: changes-requested

Exact Corrections

  1. Do not expose .failed until failure teardown is complete. teardownForFailure(message:) must become one idempotent retained/guarded operation: mark teardown active before any await, keep Start unavailable during cleanup (a dedicated .disconnecting state or another non-retry state is acceptable), capture and disconnect the exact failed room, complete media/state/wake-lock cleanup, install a fresh room, then publish .failed(message). connect() must reject/await active teardown. Add a deterministic test seam if practical.
  2. Use one retained microphone operation chain for both begin and end. Every new operation captures and awaits the prior operation. Begin increments a sequence, then after predecessor completion mutes and records ownership only after success. End is also assigned to that retained chain, awaits begin, and un-mutes only for matching sequence/generation/ownership/shouldResume. A newer begin must order after an in-flight old end/unmute and finish by muting again. Never launch an unretained end task.
  3. On cross-source duplicate suppression, remove/consume the matched recent record; do not transfer it to the arriving source. Add P1,D1,P2,D2 and D1,P1,D2,P2 tests expecting exactly two canonical and persisted rows.
  4. Make server replacement coalesce rapid accepted values and construct from the captured validated config. Keep pendingServerURL (latest wins); if replacement is active, retain the pending value rather than dropping it. After old-session cleanup, build the new session from the captured config/URL, set activeServerURL to that exact URL, then process any newer pending URL. Permit Apply for fully torn-down .failed sessions as well as .idle. Make SettingsView directly observe a nonoptional VoiceSession so disabled/help state is reactive. Disable or otherwise guard Apply during active call/teardown; update preview/init call sites as needed. Add a pure/coordinator test if practical.
  5. Add a retained media interruption task/token/sequence. Every .began increments the sequence, marks active, cancels/supersedes prior control work, and pauses. The should-resume task must capture the sequence and recheck it plus !isInterruptionActive, scope, and generation immediately before player.play(). A newer begin must make an old resume task incapable of playing. Preserve no-resume suppression semantics.
  6. Correct artifact suite counts to the actual discovered breakdown: TranscriptDedupeTests 22 (plus any newly added tests), MediaReconcileTests 7, ConversationStateTests 5, MediaAPITests 1, PinnedMediaResourceLoaderTests 12. Rename the stale unknown-total test title so it no longer says fallback. Use the next actual log as source of truth.

Verification

  • Full XcodeBuildMCP tests, separate build, git diff --check.
  • Write iterations/07-implementation.md; update implementation.md/manifest accurately.
  • No broad UI redesign/reference changes/commit/self-approval.