[Refactor] Запускать bond search prices параллельно независимым details #71

Closed
opened 2026-10-11 21:47:21 +03:00 by codex-bot · 0 comments
Owner

Problem

onlineSearch после selection ждёт все N BondBy и лишь затем GetLastPrices, хотя prices нужны уже известные UID. Details parallel друг другу и нужны actual card fields; N+2 logical calls сами по себе не доказали допустимость их удаления.

Expected Behavior

Независимый prices request перекрывается с details при прежних DTO/order/errors и existing limiter.

Evidence

Audit date 2026-10-11; 07. IDs FLOW-003, TA-F10. Revision 0ad84ff4f0b4712abc7e69dc299856f14af6eadd; Confidence High dependency, latency unmeasured; Verification status static.
Affected: catalog-discovery.service.ts:295–325; catalog-selection.ts:5–40; tbank.client.ts:358–379,441–447.

Scope

In scope

Existing Promise concurrency после bounded selection и controlled error/DTO proof.

Out of scope

Новый endpoint/pool/cache/retry, удаление необходимых detail fields, partial success вместо whole-request failure.

Proposed Approach

Start batch prices вместе с detail cohort. Trade-off: detail failure может потратить один дополнительный prices RPC; limiter contention может поглотить latency gain.

Acceptance Criteria

  • Deferred details не препятствуют началу prices; выбранные UID/order/ISIN dedup и card fields прежние.
  • Nonempty logical call count N+2, empty search 1; detail/price failure не возвращает partial success.
  • Existing limiter/deadline/token mapping сохранены; controlled limiter-aware cost/gain описан без выдуманной p95.

Verification

Controlled service deferred mocks, same DTO and exact counts; existing bond/search HTTP cases и final backend gate. Revert order при adverse measured trade-off.

Dependencies

Нет; token translation T06 — independent boundary.

Traceability

Campaign WealthLedger/main#23 . Findings FLOW-003, TA-F10. WealthLedger/backend; T39.

<!-- wealthledger-audit:2026-10-11:bond-search-waterfall --> ## Problem onlineSearch после selection ждёт все N BondBy и лишь затем GetLastPrices, хотя prices нужны уже известные UID. Details parallel друг другу и нужны actual card fields; N+2 logical calls сами по себе не доказали допустимость их удаления. ## Expected Behavior Независимый prices request перекрывается с details при прежних DTO/order/errors и existing limiter. ## Evidence Audit date `2026-10-11`; [07](https://git.personal.ksv741.ru/WealthLedger/main/src/commit/d07fbfabb1295780952a554185989d2d5b5c8349/audits/2026-10-11/reports/07-api-and-data-flow-efficiency-report.md). IDs FLOW-003, TA-F10. Revision `0ad84ff4f0b4712abc7e69dc299856f14af6eadd`; Confidence High dependency, latency unmeasured; Verification status static. Affected: [catalog-discovery.service.ts:295–325](https://git.personal.ksv741.ru/WealthLedger/backend/src/commit/0ad84ff4f0b4712abc7e69dc299856f14af6eadd/src/modules/investments/instruments/application/catalog-discovery.service.ts#L295-L325); catalog-selection.ts:5–40; tbank.client.ts:358–379,441–447. ## Scope ### In scope Existing Promise concurrency после bounded selection и controlled error/DTO proof. ### Out of scope Новый endpoint/pool/cache/retry, удаление необходимых detail fields, partial success вместо whole-request failure. ## Proposed Approach Start batch prices вместе с detail cohort. Trade-off: detail failure может потратить один дополнительный prices RPC; limiter contention может поглотить latency gain. ## Acceptance Criteria - [ ] Deferred details не препятствуют началу prices; выбранные UID/order/ISIN dedup и card fields прежние. - [ ] Nonempty logical call count N+2, empty search 1; detail/price failure не возвращает partial success. - [ ] Existing limiter/deadline/token mapping сохранены; controlled limiter-aware cost/gain описан без выдуманной p95. ## Verification Controlled service deferred mocks, same DTO and exact counts; existing bond/search HTTP cases и final backend gate. Revert order при adverse measured trade-off. ## Dependencies Нет; token translation T06 — independent boundary. ## Traceability Campaign https://git.personal.ksv741.ru/WealthLedger/main/issues/23 . Findings FLOW-003, TA-F10. WealthLedger/backend; T39.
codex-bot added this to the Technical Audit Remediation — 2026-10-11 milestone 2026-10-11 21:47:21 +03:00
codex-bot added the Kind/Enhancement
Priority
Medium
3
audit/2026-10-11
labels 2026-10-11 21:47:21 +03:00
codex-bot was assigned by hermes-agent 2026-10-12 00:04:20 +03:00
hermes-agent added this to the WealthLedger — Delivery Board project 2026-10-12 00:04:20 +03:00
hermes-agent added Kind/Refactor and removed Kind/Enhancement labels 2026-10-12 00:04:20 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: WealthLedger/backend#71