Optimistic Discover decisions and deck refill #108

Member

Maestro task ea935fbc-4b6c-4f1c-a2ff-03b5cec4a2cf - "Optimistic decisions and deck prefetch" (Feature 13).

Done-condition: accept and decline are TanStack Query mutations applied optimistically when the exit animation finishes (card removed, Quest log count bumped on accept); on API failure the card is restored to the top of the deck, the count reverted and an ErrorBanner with Retry shown; the client refetches the deck when fewer than 3 cards remain locally and shows skeleton cards (not an empty state) while a replenish job is known to be running; Vitest tests with stubbed APIs cover optimistic accept, optimistic decline, rollback on 500, refetch below 3 cards and the skeleton-while-replenishing state; typecheck, test and build pass.

Builds on the merged deck screen, exits and swipe gesture. The Quest log sheet (5ad0b188) remains a later task.

Maestro task `ea935fbc-4b6c-4f1c-a2ff-03b5cec4a2cf` - "Optimistic decisions and deck prefetch" (Feature 13). Done-condition: accept and decline are TanStack Query mutations applied optimistically when the exit animation finishes (card removed, Quest log count bumped on accept); on API failure the card is restored to the top of the deck, the count reverted and an ErrorBanner with Retry shown; the client refetches the deck when fewer than 3 cards remain locally and shows skeleton cards (not an empty state) while a replenish job is known to be running; Vitest tests with stubbed APIs cover optimistic accept, optimistic decline, rollback on 500, refetch below 3 cards and the skeleton-while-replenishing state; typecheck, test and build pass. Builds on the merged deck screen, exits and swipe gesture. The Quest log sheet (5ad0b188) remains a later task.
orchestrator-agent added 1 commit 2026-10-07 02:32:48 -04:00
Apply Discover decisions optimistically and refill the deck
CI / ci (push) Successful in 2m54s
CI / ci (pull_request) Successful in 2m38s
74611da62b
Try it and Pass are applied when the card's exit finishes: the Side
quest leaves the deck and, on Try it, its dinner joins the Quest log
count before the server answers. A refused decision puts the card back
on top of the deck, reverts the count and shows the ErrorBanner with
Retry. A saved decision reads the deck again once fewer than 3 cards are
left, and follows the replenish job it started, showing skeleton cards
rather than "All caught up" while that job runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent requested changes 2026-10-07 02:37:23 -04:00
Dismissed
review_agent left a comment
Member

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.
overseer added 1 commit 2026-10-07 02:43:08 -04:00
Keep decided Side quests off the deck and show refused decisions
CI / ci (push) Successful in 2m56s
CI / ci (pull_request) Successful in 2m38s
6c105416a9
A saved decision now reads the deck again whenever a read started before
the save is still under way, so a late answer can no longer put the
decided Side quest back. Optimistic Try it adds its dinner to the Quest
log only when it is not there yet, and a refusal removes only that
addition. A refused decision's ErrorBanner with Retry now shows whatever
the deck has come to, including when a read emptied it during the exit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent requested changes 2026-10-07 02:48:21 -04:00
Dismissed
review_agent left a comment
Member

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.
overseer added 1 commit 2026-10-07 02:53:12 -04:00
Roll back only the decision's own Quest log entry and send stale-card decisions
CI / ci (push) Failing after 1m55s
CI / ci (pull_request) Successful in 2m43s
0ea1c218ea
A refused Try it now removes the Quest log entry it tagged when it added
it, so a read of the Quest log that landed during the decision is kept,
and reads the Quest log again since the decision may have been saved.

A decision is sent for the card thrown out even when a read of the deck
took it off during the exit, so Retry on that refusal posts the decision
again instead of failing before sending it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent requested changes 2026-10-07 02:57:04 -04:00
Dismissed
review_agent left a comment
Member

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.
overseer added 1 commit 2026-10-07 03:02:08 -04:00
Keep a decided Side quest off the deck after an uncertain decision failure
CI / ci (push) Successful in 2m57s
CI / ci (pull_request) Successful in 2m38s
1c59e5d9d7
A decision now follows the reads of the deck that land while it is in
flight. When it fails, the Side quest is put back on top of the deck only
if no such read has left it out, so a card the server already decided is
not offered again.

A failure that is not an API error answer, such as a lost response, may
have come after the server saved the decision, so the deck is read again
to reconcile it. An API error answer still puts the card back on top.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent requested changes 2026-10-07 03:06:33 -04:00
Dismissed
review_agent left a comment
Member

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.
overseer added 1 commit 2026-10-07 03:10:42 -04:00
Reconcile the deck after a decision failure that may not leave the card pending
CI / ci (push) Successful in 2m55s
CI / ci (pull_request) Successful in 2m39s
3319434bd1
Only an API error that refuses the request itself (a 4xx other than 404
or 409) puts a failed Side quest back on top of the deck. A 409 (decided
by another session or no longer suggested), a 404, a 5xx or a failure
without an answer now reads the deck again instead, keeping the card off
it until that read answers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent requested changes 2026-10-07 03:14:41 -04:00
Dismissed
review_agent left a comment
Member

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.
overseer added 1 commit 2026-10-07 03:21:58 -04:00
Reconcile every Discover decision from the server before the next
CI / ci (push) Successful in 2m54s
CI / ci (pull_request) Successful in 2m38s
f26cfd5129
Replace the hand-maintained optimistic bookkeeping in useDecide with one
rule: a decision takes its card off the deck (and, on Try it, adds its
dinner to the Quest log) when the exit finishes; however it settles, the
deck and the Quest log are read again and the decision stays pending
until those reads land, so the input lock keeps the next decision out.
No decision cancels a read.

A failed decision whose Side quest the reconciled deck still has goes
back on top with a Retry; otherwise the banner says it was decided
already, with no Retry. ErrorBanner's Retry is now optional.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent requested changes 2026-10-07 03:27:22 -04:00
Dismissed
review_agent left a comment
Member

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.
overseer added 1 commit 2026-10-07 03:36:21 -04:00
Settle a failed Discover decision on the deck read it makes itself
CI / ci (push) Successful in 2m58s
CI / ci (pull_request) Successful in 2m39s
8b18399710
A failed decision now reads the deck as its own fetch and waits for it,
and that read's answer travels on the DecisionError: still pending puts
the Side quest back on top with a Retry, decided shows the informational
banner, and a failed read shows the error without Retry. The page no
longer classifies from whatever the deck cache holds.

A batch poll's deck read no longer cancels a read already out (which may
be a decision's): it waits for it, then reads again, as that read may
predate what the batch reported.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent requested changes 2026-10-07 03:41:10 -04:00
Dismissed
review_agent left a comment
Member

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.
overseer added 1 commit 2026-10-07 03:45:55 -04:00
Settle a failed Discover decision on the deck's newest read
CI / ci (push) Successful in 2m56s
CI / ci (pull_request) Successful in 2m38s
701021d327
A failed decision still waits for the deck read it makes itself, but no
longer carries that read's answer on its error. Whether its Side quest is
still pending is now asked of the deck query's newest successful read
(stillPending), both when the decision settles and when the page offers
Retry. A read that lands later and has the Side quest decided keeps it off
the deck and withdraws the Retry; a deck whose latest read failed offers no
Retry.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent requested changes 2026-10-07 03:50:31 -04:00
Dismissed
review_agent left a comment
Member

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.

Independent Codex gpt-6-sol review: CHANGES_REQUIRED for this exact commit.
overseer added 1 commit 2026-10-07 03:57:56 -04:00
Keep a Side quest off the shown deck while its decision is pending
CI / ci (push) Successful in 2m55s
CI / ci (pull_request) Successful in 2m37s
6fd607f125
The deck shown is now the deck's newest read less the Side quests whose
decisions are in flight, taken from the pending decide mutations, instead
of removing the card from the deck cache in onMutate. A read of the deck
landing before the decision is answered can no longer bring the exited
card back; settlement still reconciles from the server read as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
review_agent left a comment
Member

Independent Codex gpt-6-sol review: APPROVED for this exact commit.

Independent Codex gpt-6-sol review: APPROVED for this exact commit.
approver_agent merged commit a866dfad06 into feature/e3a8e4ea-8dcb-49e8-878f-552a6af109cb-discover-side-quest-suggestions 2026-10-07 04:03:49 -04:00
Sign in to join this conversation.
No Reviewers
No labels
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Maniacs_Mansion/MealQuest#108