Skip to content

fix(macapp): surface rewind divergence and require explicit force confirmation #997

Description

@dennisonbertram

Parent: #991
Depends on: #996

Summary

The client supports safe rewind refusal and force: true, but the GUI collapses 409 rewind_refused into a generic status string. There is no way to inspect divergent paths or intentionally retry with a distinct second confirmation.

Evidence

  • macapp/Sources/HarnessKit/ClientConversations.swift:126-146 documents that 409 is a safety feature and must never auto-force.
  • macapp/Sources/GoCodeUI/ProjectSession.swift:384-398 catches HarnessError but retains only message text, losing the structured refusal state needed by the view.
  • macapp/Sources/GoCodeUI/SessionsView.swift:146-152 explicitly documents the missing GUI path.
  • This remains finding 9 in open review issue Front-end code quality: 15 findings from adversarial review #951.

Scope

  • Preserve structured rewind_refused data (including divergent paths when present) in a typed UI action result.
  • First confirmation remains the normal destructive rewind confirmation.
  • On 409 only, show divergent paths and require a second, clearly distinct “Restore Anyway” confirmation.
  • Never auto-force; Cancel/Escape is safe.
  • Refresh transcript and checkpoints only after acknowledged success.

Tests first

  • Stub 409 response proves no automatic second POST occurs.
  • Force retry sends force: true only after the second confirmation.
  • Cancel after 409 sends nothing further and preserves state.
  • Success refreshes the active conversation/checkpoints.
  • Live daemon test with an externally modified target file if the existing test harness can produce one.

Acceptance criteria

  • Normal rewind and forced rewind are visibly distinct two-step decisions.
  • Divergent paths are shown before force is offered.
  • force: true is impossible without explicit second confirmation.
  • Error/cancel paths preserve transcript and files.
  • Finding 9 in Front-end code quality: 15 findings from adversarial review #951 is resolved with regression coverage.
  • swift test, Swift build, formatting, strict format lint, and live rewind smoke pass.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcorrectnessCorrectness bugs and logic errorsmacappNative macOS app (macapp/)mediumMedium effort: 1-3 daysrewindSession rewind / file snapshot undouxUser experience improvementswell-specifiedIssue is clear, scoped, and ready to implement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions