[Bug] Ограничить Income/Ledger GET разрешённой локальной read boundary #57
Closed
opened 2026-10-11 21:43:36 +03:00 by codex-bot
·
2 comments
No Branch/Tag Specified
Labels
Clear labels
Kind/Dependencies
Kind/Investigation
Kind/Process
Kind/Refactor
audit/2026-10-11
kind/investigation
Compat/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Dependency update or dependency-management work
Research or decision required before implementation
Developer workflow, CI/CD, tooling, or process improvement
Internal code or configuration restructuring without new product behavior
Technical Audit Remediation — 2026-10-11
Нужна проверка evidence до решения; runtime-дефект не утверждается
Breaking change that won't be backward compatible
Something is not working
Documentation changes
Improve existing functionality
New functionality
This is security issue
Issue or pull request related to testing
Priority
Critical
1
The priority is critical
Priority
High
2
The priority is high
Priority
Medium
3
The priority is medium
Priority
Low
4
The priority is low
Reviewed
Confirmed
1
Issue has been confirmed
Reviewed
Duplicate
2
This issue or pull request already exists
Reviewed
Invalid
3
Invalid issue
Reviewed
Won't Fix
3
This issue won't be fixed
Status
Blocked
1
Something is blocking this issue or pull request
Status
Need More Info
2
Feedback is required to reproduce issue or to continue work
Status
Abandoned
3
Somebody has started to work on this but abandoned work
Milestone
No items
No Milestone
Technical Audit Remediation — 2026-10-11
Projects
Clear projects
No projects
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: WealthLedger/backend#57
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
Обычный collectRanges запускает membership и readPlan(history=true). Ledger также добавляет missing lifetime history вне target. Date→screen planner→interval round-trip скрывает уже вычисленный range. Это конкурирующий initiator, не проблема отсутствующих слоёв.
Expected Behavior
Income GET читает local operations; Ledger впервые получает только missing requested intervals. Неполная история не выдаётся за zero/full Income.
Evidence
Audit date:
2026-10-11. 01, 02, 07. IDs: ARCH-002, CPLX-002, CPLX-006, BE-004, FLOW-001, TA-F06. Revision:0ad84ff4f0b4712abc7e69dc299856f14af6eadd; Confidence High; Verification status static.Affected code: brokerage-operations.service.ts:120–151, :391–435; brokerage-operations-sync.service.ts:46–126; income-analytics.controller.ts:24–79.
Scope
In scope
Оба production readPlan callers, cold historical Income decision, existing operationIntervals reuse.
Out of scope
Удаление coverage/staging/cursor/auth fences, hourly mutable-tail refresh, новый IncomeSyncService или скрытый full-history replacement.
Proposed Approach
Убрать membership/scheduling из ordinary Income; shared read planner не расширяет targets на accountHistory. Использовать уже вычисленный [from,to) и existing normalizer. Перед удалением cold-load пути явно согласовать recovery/UX: разрешённый Ledger owner либо approved narrow exception, без собственной догадки.
Acceptance Criteria
Verification
Existing tbank-ledger-local/tbank-income-local SQLite HTTP suites; assertions actual requested intervals, default GET, cursor prevalidation и confirmed local reuse. Backend verify конечного diff.
Dependencies
Нет обязательных Issues; cold-history решение — named blocker внутри задачи. P1 fixes могут выполняться параллельно.
Traceability
Campaign WealthLedger/main#23 . Findings: ARCH-002, CPLX-002, CPLX-006, BE-004, FLOW-001, TA-F06. Repository WealthLedger/backend; T05.
Решение владельца по cold historical Income: узкое исключение — Income может импортировать только недостающий запрошенный интервал (без membership и без lifetime history аккаунта). Публичный контракт API не меняется.
Сделано в #147 (squash в develop).
По AC:
data: null/incomplete, а не ноль.from >= to→ 200 без RPC.accountHistory,ledgerRange), удалён только неиспользуемыйplanInvestmentScreen.historyStateу большинства аккаунтов остаётсяpartial. Плашка UI исправлена в WealthLedger/frontend#124 (PR frontend#125, слит первым).