[Bug] Передать durable hourly attempt в Accounts/Income resource meta #58

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

Problem

Accounts meta factory получает work=null без lastAttempt, хотя top-level sync уже содержит hourly state. Income meta смешивает source work и hourly outcome: timestamps null, completed work становится none, operation failure может называться membership.

Expected Behavior

Стандартное meta.lastAttempt отражает current connection и relevant account/operations hourly state, отдельно от source freshness.

Evidence

Audit date 2026-10-11; 06. Finding BE-008. Revision 0ad84ff4f0b4712abc7e69dc299856f14af6eadd; Confidence High; Verification status static.
Affected code: brokerage-accounts.service.ts:38–76; operations/application/brokerage-operations.service.ts:438–445,489–540; income/income-analytics.service.ts:45–70,114–135; investment-resource.mapper.ts:60–61,91–103. Корректный пример portfolio.service.ts:223–229.

Scope

In scope

Accounts и все Income meta levels, existing hourlyAttempt helper/repository, account/section relevance.

Out of scope

Новый status registry, fake source timestamps, скрытая personal work из metadata read, удаление top-level sync compatibility.

Proposed Approach

Reuse existing durable projection; global partial issue не выдавать за unrelated account failure.

Acceptance Criteria

  • Seeded none/running/succeeded/partial/failed hourly rows дают правильные state/time/problem scope в Accounts/Income.
  • Source payload, lastSuccessfulAt/freshness неизменны; ordinary metadata read не создаёт RPC/work.
  • Replacement/logout/foreign account не раскрывает old-generation attempt.
  • Top-level Accounts sync и стандартное meta не противоречат друг другу.

Verification

Existing local-read/income/portfolio SQLite HTTP suites с meaningful hourly fixtures; assert envelope values, не только schema presence. Backend verify конечного diff.

Dependencies

Нет технического blocker: fixtures могут подготовить durable outcome независимо от T01; actual default Income side-effect fix координируется с T05.

Traceability

Campaign WealthLedger/main#23 . Finding BE-008. Repository WealthLedger/backend; T07.

<!-- wealthledger-audit:2026-10-11:hourly-resource-metadata --> ## Problem Accounts meta factory получает work=null без lastAttempt, хотя top-level sync уже содержит hourly state. Income meta смешивает source work и hourly outcome: timestamps null, completed work становится none, operation failure может называться membership. ## Expected Behavior Стандартное meta.lastAttempt отражает current connection и relevant account/operations hourly state, отдельно от source freshness. ## Evidence Audit date `2026-10-11`; [06](https://git.personal.ksv741.ru/WealthLedger/main/src/commit/d07fbfabb1295780952a554185989d2d5b5c8349/audits/2026-10-11/reports/06-backend-architecture-report.md). Finding BE-008. Revision `0ad84ff4f0b4712abc7e69dc299856f14af6eadd`; Confidence High; Verification status static. Affected code: [brokerage-accounts.service.ts:38–76](https://git.personal.ksv741.ru/WealthLedger/backend/src/commit/0ad84ff4f0b4712abc7e69dc299856f14af6eadd/src/modules/investments/brokerage-accounts/brokerage-accounts.service.ts#L38-L76); operations/application/brokerage-operations.service.ts:438–445,489–540; income/income-analytics.service.ts:45–70,114–135; investment-resource.mapper.ts:60–61,91–103. Корректный пример portfolio.service.ts:223–229. ## Scope ### In scope Accounts и все Income meta levels, existing hourlyAttempt helper/repository, account/section relevance. ### Out of scope Новый status registry, fake source timestamps, скрытая personal work из metadata read, удаление top-level sync compatibility. ## Proposed Approach Reuse existing durable projection; global partial issue не выдавать за unrelated account failure. ## Acceptance Criteria - [ ] Seeded none/running/succeeded/partial/failed hourly rows дают правильные state/time/problem scope в Accounts/Income. - [ ] Source payload, lastSuccessfulAt/freshness неизменны; ordinary metadata read не создаёт RPC/work. - [ ] Replacement/logout/foreign account не раскрывает old-generation attempt. - [ ] Top-level Accounts sync и стандартное meta не противоречат друг другу. ## Verification Existing local-read/income/portfolio SQLite HTTP suites с meaningful hourly fixtures; assert envelope values, не только schema presence. Backend verify конечного diff. ## Dependencies Нет технического blocker: fixtures могут подготовить durable outcome независимо от T01; actual default Income side-effect fix координируется с T05. ## Traceability Campaign https://git.personal.ksv741.ru/WealthLedger/main/issues/23 . Finding BE-008. Repository WealthLedger/backend; T07.
codex-bot added this to the Technical Audit Remediation — 2026-10-11 milestone 2026-10-11 21:43:36 +03:00
codex-bot added the Kind/Bug
Priority
Medium
3
audit/2026-10-11
labels 2026-10-11 21:43:36 +03:00
codex-bot was assigned by hermes-agent 2026-10-12 00:04:24 +03:00
hermes-agent added this to the WealthLedger — Delivery Board project 2026-10-12 00:04:24 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: WealthLedger/backend#58