[DEBT]: Migrate repositories to durable transaction kernel#110
Merged
Conversation
Context: Settings, Feedback, Prompt Templates, and Chapter repositories maintained divergent request-success transaction paths after the shared kernel was introduced. Changes: Delegate repository transactions to runTransaction, consolidate Chapter stableId lookup, preserve legacy index fallbacks, and add table-driven commit-abort coverage. Impact: Public repository interfaces and IndexedDB request counts are unchanged; write success now means terminal commit and typed errors retain repository context. Tests: 35 focused transaction/repository tests; 62 DB tests; 8,797 full-suite tests passed with 356 skipped; production build passed. Docs: Update WORKLOG and tech-debt inbox with metrics and the Node 26 test-environment receipt. ADR: DB-002 repository migration implementation notes.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Context: The required completion WORKLOG entry was written before the stacked PR had a number. Changes: Record PR #110 and update the next-step state. Impact: Documentation only. Tests: git diff --cached --check. ADR: DB-002 unchanged.
anantham
marked this pull request as ready for review
July 16, 2026 06:23
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.
Summary
Migrate Settings, Feedback, Prompt Templates, and Chapter repository transactions onto the durable terminal-event kernel introduced by PR #109. This removes divergent request-success lifecycles, consolidates Chapter stable-ID lookup, and preserves injected database/public repository contracts.
This PR is intentionally stacked on
debt/codex-db-transaction-kernel; review only the delta above #109.Root Cause
The repositories opened IndexedDB transactions independently and several resolved their public promises from request success. A request can succeed in memory and still be rolled back by a terminal transaction abort, so callers could observe false success. Chapter also duplicated its stable-ID index/cursor fallback between read and update paths.
Changes
SettingsRepository.ts: delegate reads/writes torunTransactionandpromisifyRequestFeedbackRepository.ts: migrate CRUD, normalize helper naming, remove two legacyanycastsPromptTemplatesRepository.ts: migrate CRUD while preserving numeric default-index and legacy scan behaviorChapterRepository.ts: migrate all paths and share one stable-ID lookup helperRepositoryDurability.test.ts: post-request quota-abort contract for every migrated repositoryRefactoring Metrics
anycasts removed; noanyadded; interfaces unchangedTesting
tsc --noEmitis globally clean (unchanged repository baseline errors remain; no modified file is named)Node 26 requires
NODE_OPTIONS=--no-experimental-webstoragefor the full suite because its experimental global Web Storage accessor shadows jsdomlocalStorage; the isolated diagnosis and debt receipt are in the commit.Review Checklist
External Review
The attempted Grok review was denied by the approval layer because it would transmit private repository context to xAI. No Grok output was obtained and no external-review claim is made.