Store integrity: budget fail-closed, background-translation dead-end, image versions, honest export - #133
Merged
Merged
Conversation
Integrity scan (store/components slice), all fixes red-proven (18 behavioral tests failing against pre-fix code): - P1: background-translation dead-end — the comment said the error "sits in translationProgress until the user navigates back, at which point the inline error UI (already wired) renders it". NOTHING read translationProgress. A failed auto_visit translation after navigating away left: no error shown, retry disabled, auto-retry suppressed — permanent. ChapterView now derives failure state from the per-chapter progress; the stale pending entry from the abort path is cleaned. - P1: the budget cap silently voided itself whenever activeNovelId was null (reading outside a library novel): autos now FAIL CLOSED with a loud warn + telemetry; manual proceeds with a disclosed unscoped-spend warn; getChaptersByNovelAndVersion can no longer run the unbounded index.getAll(null) that summed every other novel's spend while the chapters actually being billed weren't counted (999-chapter lookahead against a cap that could never trip). - P1: image version deletion — memory renumbered contiguously, the DB didn't, and the stale in-memory map (still containing the deleted version) was persisted back. Deletion now adopts the DB's non-renumbering state end-to-end; the stale write-back is gone. - P1: EPUB embedded the wrong image version after a reload (session- memory maps only; the persisted choice was read but used for captions). Version resolution: memory (fresher mid-session) → persisted (survives reload) → 1, documented and tested. - P2: fetchTranslationVersions no longer converts infra errors into "no versions" (the masquerade the same file's own comment outlaws) — the three consumers now: preload worker refuses to translate on unverifiable state; deleteTranslationVersion aborts instead of clearing a translation that still exists; SessionInfo shows a load-error row. - P2: three in-place state mutations in imageSlice rewritten copy-on-write (one made resetAdvancedControls a no-op for subscribers). - P2: full-session export no longer silently drops feedback/templates/ amendment logs on read failure — telemetry + metadata completeness flags, mirroring the images pattern. tsc clean; full suite 8,587 / 0 failed in this worktree pre-merge. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117Ksuo6oeSBw4iTq3yzfYi
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Non-renumbering deletion creates gaps ({1,3}); the ± navigation still
assumed 1..latest contiguous, so next-from-v1 selected the deleted v2 and
cache-missed. Navigation now steps through the persisted surviving
version numbers (numeric ±1 stays as the legacy fallback when no version
map exists). Test red-proven against the pre-fix slice.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0117Ksuo6oeSBw4iTq3yzfYi
Owner
Author
|
Codex P1 adjudicated — real consequence-bug of the non-renumbering fix: navigation walked 1..latest numerically through gaps. It now steps through the persisted surviving set (legacy numeric fallback kept); red-proven. Full suite green. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Store/components-slice integrity fixes, 18 behavioral tests red-proven against pre-fix code: the budget cap that silently voided itself outside library novels (with an unbounded getAll(null) summing other novels' spend), the background-translation dead-end (no error, retry disabled, auto-retry suppressed), image-version deletion corrupting persisted state, EPUB embedding the wrong image version after reload, the error→[] masquerade on version reads, in-place zustand mutations, and silent feedback drops from backups. Full suite green post-merge with main.
🤖 Generated with Claude Code
https://claude.ai/code/session_0117Ksuo6oeSBw4iTq3yzfYi