[Refactor] Оставить одну whitelist projection publicInstrument #69

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

Problem

Две publicInstrument функции поддерживают одинаковую detail allowlist и nested brand.logoName policy. Текущего drift нет; один instruments boundary owner требует двух правок при изменении fields.

Expected Behavior

Одна stateless module-local projection обслуживает online и saved/enrichment callers без объединения execution models.

Evidence

Audit date 2026-10-11; 03. IDs DRY-002, TA-F15. Revision 0ad84ff4f0b4712abc7e69dc299856f14af6eadd; Confidence High; Verification status static.
Affected: catalog-discovery.service.ts:499–531; catalog-enrichment.service.ts:646–678.

Scope

In scope

Одна pure projection у existing instruments owner, два local imports.

Out of scope

Nest mapper provider, generic/cross-repo mapper, whole catalog/enrichment merger, удаление privacy allowlist.

Proposed Approach

Reuse одинаковые types/semantics; skinny discovery stored shape имеет другую роль и не включается.

Acceptance Criteria

  • Обе paths дают одинаковую approved share/bond projection при unknown/optional/null fields.
  • Extra private fields и extra brand properties отсутствуют; UID guard/fetchedAt/CAS прежние.
  • Нет нового DI/module/public API слоя; declaration одна.

Verification

Existing instrument selection/whitelist HTTP/source cases, локальный semantic review; minimal targeted projection check только для observable trust boundary. Backend final gates.

Dependencies

Нет; legacy producer deletion не требует сохранять его ради DRY.

Traceability

Campaign WealthLedger/main#23 . Findings DRY-002, TA-F15. WealthLedger/backend; T18.

<!-- wealthledger-audit:2026-10-11:instrument-projection --> ## Problem Две publicInstrument функции поддерживают одинаковую detail allowlist и nested brand.logoName policy. Текущего drift нет; один instruments boundary owner требует двух правок при изменении fields. ## Expected Behavior Одна stateless module-local projection обслуживает online и saved/enrichment callers без объединения execution models. ## Evidence Audit date `2026-10-11`; [03](https://git.personal.ksv741.ru/WealthLedger/main/src/commit/d07fbfabb1295780952a554185989d2d5b5c8349/audits/2026-10-11/reports/03-duplication-and-reusability-report.md). IDs DRY-002, TA-F15. Revision `0ad84ff4f0b4712abc7e69dc299856f14af6eadd`; Confidence High; Verification status static. Affected: [catalog-discovery.service.ts:499–531](https://git.personal.ksv741.ru/WealthLedger/backend/src/commit/0ad84ff4f0b4712abc7e69dc299856f14af6eadd/src/modules/investments/instruments/application/catalog-discovery.service.ts#L499-L531); catalog-enrichment.service.ts:646–678. ## Scope ### In scope Одна pure projection у existing instruments owner, два local imports. ### Out of scope Nest mapper provider, generic/cross-repo mapper, whole catalog/enrichment merger, удаление privacy allowlist. ## Proposed Approach Reuse одинаковые types/semantics; skinny discovery stored shape имеет другую роль и не включается. ## Acceptance Criteria - [ ] Обе paths дают одинаковую approved share/bond projection при unknown/optional/null fields. - [ ] Extra private fields и extra brand properties отсутствуют; UID guard/fetchedAt/CAS прежние. - [ ] Нет нового DI/module/public API слоя; declaration одна. ## Verification Existing instrument selection/whitelist HTTP/source cases, локальный semantic review; minimal targeted projection check только для observable trust boundary. Backend final gates. ## Dependencies Нет; legacy producer deletion не требует сохранять его ради DRY. ## Traceability Campaign https://git.personal.ksv741.ru/WealthLedger/main/issues/23 . Findings DRY-002, TA-F15. WealthLedger/backend; T18.
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
Low
4
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:21 +03:00
hermes-agent added this to the WealthLedger — Delivery Board project 2026-10-12 00:04:21 +03:00
hermes-agent added Kind/Refactor and removed Kind/Enhancement labels 2026-10-12 00:04:21 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: WealthLedger/backend#69