Feature 13 integration fix 2: report a failed batch on deck load #112

5 Commits
Author SHA1 Message Date
dev_agentandClaude Opus 5.5 c21d03dec6 Drop a followed batch failure once the deck reports it superseded
CI / ci (push) Successful in 3m3s
CI / ci (pull_request) Successful in 2m46s
After Discover showed failed batch j1, another session could finish a
newer batch. The deck then reported neither an active nor a failed batch,
as the server suppresses a failure a later batch supersedes, but the page
kept following j1 and its error stayed shown (or, before j1's first poll,
"Finding new side quests…" did, and the error arrived later).

Each new read of the deck is now reconciled: one reporting neither batch
stops following a job known to have failed, by its poll or by the deck's
previous read. A followed job that succeeded is still left followed, so
its end is read as before.

The replenish-failure test's stub now reports its failed batch on the
deck, as the server does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 05:41:06 -04:00
dev_agentandClaude Opus 5.5 b611d1bbce Report the latest failed suggestion batch on the deck
CI / ci (push) Successful in 3m3s
CI / ci (pull_request) Successful in 2m45s
The deck reported only a pending or running batch, so a Discover page
opened after a batch failed (or was interrupted by a restart) had no job
to follow and showed "All caught up" or the remaining cards with no
error. GET /api/v1/suggestions/deck now also returns failed_batch: the
newest batch when it failed, read in the same snapshot after orphaned
batches are failed, so at most one of active_batch and failed_batch is
set and a later batch supersedes the failure. The page follows the
failed batch's job like the active one, so its failure shows with the
existing Retry, which asks for a new batch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 05:29:10 -04:00
dev_agent 6d36a7a10c Merge feature head a05d57c into task branch 2026-10-07 05:23:48 -04:00
dev_agentandClaude Opus 5.5 71060515bd Fail orphaned suggestion batches before reporting the deck's active batch
CI / ci (push) Successful in 3m5s
CI / ci (pull_request) Successful in 2m45s
Deck returned a pending or running batch's job id without checking that
the job was still queued or running, so after a restart failed the job
the page polled a dead job as the active batch. Deck and startBatch now
share activeBatch, which runs FailOrphanedSuggestionBatches before
reading the active batch; Deck therefore uses a write transaction.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 05:13:48 -04:00
dev_agentandClaude Opus 5.5 af58caac94 Surface replenish failures, follow the active batch, scope deck keys, keep three deck depths
CI / ci (push) Successful in 3m2s
CI / ci (pull_request) Successful in 2m44s
Fixes the Feature 13 review findings on the Discover deck (Maestro task
4fc551f0-3c11-4c15-b638-f2c08a28eb29):

- F13-01: a batch failure (start, poll or job) is shown with its Retry
  whatever the deck has, so a replenish that fails while cards remain is
  no longer silent until the deck runs out.
- F13-02: GET /api/v1/suggestions/deck reports the batch pending or
  running (active_batch, read in the deck's snapshot), and a decision
  that calls for a replenish returns the job of the batch it started or
  joined. The page follows a newly reported active batch, so a reopened
  page or a second session shows skeleton cards while the batch runs
  instead of "All caught up".
- F13-03: ← / → leave the deck alone while it is inert behind a modal
  (the Quest log sheet or its confirmation).
- F13-04: a one- or two-card deck keeps all three depths: skeleton cards
  stand in for the missing ones while a batch finds more Side quests,
  blank stack-edge cards while none is coming.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 05:04:20 -04:00