[Investigation] Согласовать видимость CURRENCY position отдельно от cash balance #59

Closed
opened 2026-10-11 21:50:28 +03:00 by codex-bot · 2 comments
Owner

Problem

CURRENCY исключается из stocks/bonds/other sections, но входит в totals denominator. Tests намеренно скрывают её, spec различает traded currency instrument и cash и требует другие позиции. Реальный product defect не установлен.

Expected Behavior

Есть единое product/domain решение, какие contract positions видимы; totals и cash не считаются дважды.

Evidence

Audit date 2026-10-11; 05, FE-006. Revision c8821200ce699dab1ce65360d1968d5877a2e78b; Confidence Medium intent / High exclusion; Verification status runtime-unverified product consequence.
Affected: positions.ts:70–94, :136–160; positions.test.ts:15–69; AccountPage.test.tsx:287–394; specs portfolio-view:22–33,164–169 at fcdc805f6c1b3be6a20a7e858e3e80cbd83a9121.

Scope

In scope

One approved visibility answer и synthetic currency-only/currency+cash/all fixture.

Out of scope

FX conversion, client totals recomputation, guessed live holdings, автоматическое принятие spec против deliberate tests.

Proposed Approach

До ответа сохранить current predicate. При самостоятельной position показать её narrow other branch; если hidden policy intentional — явно согласовать current requirement/test intent.

Acceptance Criteria

  • Owner решает CURRENCY visibility и объясняет cash vs traded row на approved contract/example.
  • Existing source/tests/spec согласованы по выбранному outcome, исходная uncertainty зафиксирована.
  • Currency-only, mixed cash и all-account fixtures различают visibility без double-added totals/потери quantity/unknown semantics.

Verification

Existing positions/AccountPage route tests после решения; no real broker API. Final frontend gates только при code change; native spec check владельцем при requirement delta.

Dependencies

Product/domain visibility input; других blocking Issues нет.

Traceability

Campaign WealthLedger/main#23 . Finding FE-006. WealthLedger/frontend; T26.

<!-- wealthledger-audit:2026-10-11:currency-position-visibility --> ## Problem CURRENCY исключается из stocks/bonds/other sections, но входит в totals denominator. Tests намеренно скрывают её, spec различает traded currency instrument и cash и требует другие позиции. Реальный product defect не установлен. ## Expected Behavior Есть единое product/domain решение, какие contract positions видимы; totals и cash не считаются дважды. ## Evidence Audit date `2026-10-11`; [05](https://git.personal.ksv741.ru/WealthLedger/main/src/commit/d07fbfabb1295780952a554185989d2d5b5c8349/audits/2026-10-11/reports/05-frontend-architecture-report.md), FE-006. Revision `c8821200ce699dab1ce65360d1968d5877a2e78b`; Confidence Medium intent / High exclusion; Verification status runtime-unverified product consequence. Affected: [positions.ts:70–94](https://git.personal.ksv741.ru/WealthLedger/frontend/src/commit/c8821200ce699dab1ce65360d1968d5877a2e78b/src/pages/account/model/positions.ts#L70-L94), :136–160; positions.test.ts:15–69; AccountPage.test.tsx:287–394; specs portfolio-view:22–33,164–169 at `fcdc805f6c1b3be6a20a7e858e3e80cbd83a9121`. ## Scope ### In scope One approved visibility answer и synthetic currency-only/currency+cash/all fixture. ### Out of scope FX conversion, client totals recomputation, guessed live holdings, автоматическое принятие spec против deliberate tests. ## Proposed Approach До ответа сохранить current predicate. При самостоятельной position показать её narrow other branch; если hidden policy intentional — явно согласовать current requirement/test intent. ## Acceptance Criteria - [ ] Owner решает CURRENCY visibility и объясняет cash vs traded row на approved contract/example. - [ ] Existing source/tests/spec согласованы по выбранному outcome, исходная uncertainty зафиксирована. - [ ] Currency-only, mixed cash и all-account fixtures различают visibility без double-added totals/потери quantity/unknown semantics. ## Verification Existing positions/AccountPage route tests после решения; no real broker API. Final frontend gates только при code change; native spec check владельцем при requirement delta. ## Dependencies Product/domain visibility input; других blocking Issues нет. ## Traceability Campaign https://git.personal.ksv741.ru/WealthLedger/main/issues/23 . Finding FE-006. WealthLedger/frontend; T26.
codex-bot added this to the Technical Audit Remediation — 2026-10-11 milestone 2026-10-11 21:50:28 +03:00
codex-bot added the
Priority
Medium
3
audit/2026-10-11kind/investigation
labels 2026-10-11 21:50:28 +03:00
ksv741 was assigned by hermes-agent 2026-10-12 00:04:18 +03:00
hermes-agent added this to the WealthLedger — Delivery Board project 2026-10-12 00:04:18 +03:00
hermes-agent added Kind/Investigation and removed kind/investigation labels 2026-10-12 00:04:18 +03:00
Author
Owner

Решение владельца 2026-11-05: CURRENCY — зеркало Cash Balance; сохранить position/quantity в API, скрыть отдельную карточку в UI и исключить её currentValue из знаменателя долей позиций. Cash Balance показывать один раз в «Деньги»; не пересчитывать server totals. Backend#140/#141 уже исключили CURRENCY из totals/structure и сбросили старые points. В текущей frontend ветке predicate скрытия сохранён, знаменатель исправлен, добавлен all-account synthetic test; в specs правятся portfolio-view и portfolio-value-history (specs#60). npm run verify: 580/580 tests, build/checks PASS.

Решение владельца 2026-11-05: `CURRENCY` — зеркало Cash Balance; сохранить position/quantity в API, скрыть отдельную карточку в UI и исключить её `currentValue` из знаменателя долей позиций. Cash Balance показывать один раз в «Деньги»; не пересчитывать server totals. Backend#140/#141 уже исключили CURRENCY из totals/structure и сбросили старые points. В текущей frontend ветке predicate скрытия сохранён, знаменатель исправлен, добавлен all-account synthetic test; в specs правятся portfolio-view и portfolio-value-history (specs#60). `npm run verify`: 580/580 tests, build/checks PASS.
Author
Owner

Поставлено: specs PR WealthLedger/specs#82 и frontend PR WealthLedger/frontend#156 слиты в develop. Владелец выбрал скрыть CURRENCY как зеркальный Cash Balance; позиция и quantity остаются в API, а экран считает долю только отображаемых позиций, денежный баланс показывается один раз. Existing route fixtures currency-only/cash+currency и новый all-account synthetic case проверяют отсутствие дубля. Backend totals/structure уже исправлены в backend#140/#141. Full CI green (run 1956). Acceptance выполнены.

Поставлено: specs PR WealthLedger/specs#82 и frontend PR WealthLedger/frontend#156 слиты в `develop`. Владелец выбрал скрыть `CURRENCY` как зеркальный Cash Balance; позиция и quantity остаются в API, а экран считает долю только отображаемых позиций, денежный баланс показывается один раз. Existing route fixtures currency-only/cash+currency и новый all-account synthetic case проверяют отсутствие дубля. Backend totals/structure уже исправлены в backend#140/#141. Full CI green (run 1956). Acceptance выполнены.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: WealthLedger/frontend#59