Skip to content

feat(review_ui): add per-card retry limit with optional backoff in start_review_flow [post-F82] #40

Description

@ImmortalDemonGod

What

The F82 fix bounds the infinite retry loop by calling manager.skip_card() on submit_review exception, so a persistently-failing card no longer blocks the session. However, the current behaviour silently skips a card on the first failure — no retry is attempted for transient errors (e.g., momentary DB contention). A per-card retry budget (e.g., max N attempts with optional backoff) would allow transient errors to recover while still bounding the loop.

Why deferred

Explicitly classified as nice-to-have / architectural policy decision in both .aiv/plans/c2-f82-plan.md §6 OUT OF SCOPE and the PR completion contract's OUT-OF-SCOPE REMINDERS:

"Retry-with-backoff or per-card retry budget — architectural policy; open a new issue if desired. Not part of this PR."

The F82 correctness fix (bounded loop + failure signal) was the primary deliverable. Retry policy requires separate design decisions (max retries, backoff strategy, error classification: transient vs. permanent) beyond the scope of the infinite-loop fix.

Acceptance criteria

  • start_review_flow respects a configurable per-card retry limit (e.g., via a parameter or project config)
  • Transient errors trigger a retry up to the limit; persistent errors cause the card to be skipped via skip_card after exhausting retries
  • The loop remains bounded: total iterations ≤ len(review_queue) × max_retries + len(review_queue)
  • Tests cover: retry exhaustion (all retries fail → card skipped), success-after-retry (first attempt fails, second succeeds), and zero-retry budget (current single-attempt behaviour)
  • The failure-signal semantics (return False only on total failure) are preserved

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions