chore(backlog): TODO.md orchestration round 3 — API list-shape convention completion + planned-payment fixes - #136
Draft
EraPartner wants to merge 12 commits into
Draft
Conversation
…l} everywhere
Closes the LEFT list of the TODO.md ⏫ finding 'List-response key drift':
market quotes/chart/news, research mappings/provider-keys, ai models,
info banks/supported-adapters, planned due-soon/match-suggestions (counts
moved from meta into the data body), and bare-array admin metrics/requests
all now return {items,total(,…)}. Frontend api clients unwrap to rows at
the boundary; openapi + generated types, MSW handlers, contract tests and
docs aligned.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Scm4dSE1m9618M1ugk86Cj
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scm4dSE1m9618M1ugk86Cj
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
…rection The panel hardcoded 'amount: latestAmount * -1' while the detection service abs()'s every amount, so a detected recurring income (salary, rent received) became a negative planned payment that plannedMatchService could never auto-match. The detection payload already carries direction per pattern (grouped recipient+sign server-side); the panel now recombines magnitude + direction. MSW end-to-end tests pin the POST body sign for both directions. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scm4dSE1m9618M1ugk86Cj
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scm4dSE1m9618M1ugk86Cj
…egenerates applyLoanPatchDefaults only re-derived amount when the client omitted it, so editing loan_principal/rate/term (or converting to a loan via PATCH) with a defined client amount desynced amount from loan_regular_payment_amount. The regeneration branch now sets amount = -|regular_payment_amount| unconditionally, matching POST; a loan PATCH touching no schedule input still honors the client amount. Three new route tests pin all three cases against the real amortization math; the now-false comment in PlannedPaymentForm documenting the stale-amount behavior is updated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scm4dSE1m9618M1ugk86Cj
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scm4dSE1m9618M1ugk86Cj
The form was keyed editing?.id ?? 'new', so back-to-back creates never remounted and all useState initializers survived — name, amount, and most visibly the direction toggle. A counter bumped on each New open now keys fresh creates. Integration test pins the reset (direction back to Expense, name empty on reopen). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scm4dSE1m9618M1ugk86Cj
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scm4dSE1m9618M1ugk86Cj
…dexes concurrently The account_id backfill UPDATE now runs in 50k id-range batches inside an autocommit block (short locks, spread WAL, resumable via the account_id IS NULL guard), and the two transactions indexes are built AFTER the backfill with CREATE INDEX CONCURRENTLY, with an invalid-leftover drop-then-recreate guard for interrupted builds. Semantics of the backfill are unchanged (same WHERE, same join). env.py already runs transaction_per_migration, so the change is scoped entirely inside 0050. Verified on a fresh DB (bun run test:db: migrate to head + 3112 tests pass) and by the implementing agent on a populated pre-0050 DB (120k rows, sparse ids: upgrade, idempotent re-run, downgrade, invalid-index recovery). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scm4dSE1m9618M1ugk86Cj
…lur half needs look sign-off) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scm4dSE1m9618M1ugk86Cj
…files clean Annotates the remaining 17 repository files (335 errors → 0) with pg-accurate JSDoc, adds 8 row typedefs to src/types/rows.js (verified against the Alembic migrations; NUMERIC/BIGINT stay strings, DATE stays Date, CHECK-constraint literal unions), and collapses the ratchet list to the directory prefixes src/types/ + src/repositories/ so new repository files are ratcheted from birth. Annotation-only: the diff contains no runtime changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scm4dSE1m9618M1ugk86Cj
…le two bugs noticed en route Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Scm4dSE1m9618M1ugk86Cj
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
Continues working the TODO.md backlog queue (round 3). Landed so far:
{items, total(, limit, offset)}data body: market quotes/chart/news, research mappings/provider-keys, ai models, info banks/supported-adapters, planned due-soon/match-suggestions (counts moved frommetainto the data body), and the bare-array adminmetrics/requests. Frontend api clients unwrap to rows at the boundary; openapi + generated types, MSW handlers, contract tests, anddocs/api/pages aligned. (b60cf41)bddb115)Further backlog items (planned-payment sign/amount fixes) land on this branch as they are verified.
Type of change
refactor— no behavior change (wire-shape convention; clients updated in lockstep)chore/ci/test— backlog bookkeeping (TODO.md stamps)fix— bug fix (planned-payment findings, as they land)Checklist
bun run typecheckclean in both apps)type(scope): subject)console.log/ debug codedocs/pages updated (docs/api/{marketLookup,ai,info,admin,research,plannedTransactions}.md,docs/reference/api-client-methods.md)Architecture & data
{items,total}wire convention)openapi.yaml+ generated types updatedVerification
backup-roundtripfailures were missing sandbox deps; green afterbun installinpackaging/electron)..quotes/.articles/.points/.mappings/.providers/.models/.banks/.adapters/total_count) confirm no stragglers.Residual risk & follow-ups
GET /api/market/searchandGET /api/splits/owedreturn{items}withouttotal— noted in the backlog, out of this finding's scope./api/research/chart|news|quote) keep domain keys by design under the provenance-meta contract.GET /api/plannedhas no backend counterpart — candidate for deletion in a later pass.LIVE_API_BASE).🤖 Generated with Claude Code
https://claude.ai/code/session_01Scm4dSE1m9618M1ugk86Cj
Generated by Claude Code