Skip to content

Store integrity: budget fail-closed, background-translation dead-end, image versions, honest export - #133

Merged
anantham merged 3 commits into
mainfrom
fix/fable-store-integrity
Jul 28, 2026
Merged

Store integrity: budget fail-closed, background-translation dead-end, image versions, honest export#133
anantham merged 3 commits into
mainfrom
fix/fable-store-integrity

Conversation

@anantham

Copy link
Copy Markdown
Owner

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

anantham and others added 2 commits July 28, 2026 13:11
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
@vercel

vercel Bot commented Jul 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lexicon-forge Ready Ready Preview, Comment Jul 28, 2026 7:48am

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
@anantham

Copy link
Copy Markdown
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.

@anantham
anantham merged commit 38a0ed2 into main Jul 28, 2026
1 of 2 checks passed
@anantham
anantham deleted the fix/fable-store-integrity branch July 28, 2026 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant