refactor!: simplify runtime coordination #7 #43

Merged
ksv741 merged 2 commits from codex/simplify-complexity into develop 2026-10-03 21:32:26 +03:00
Owner

Цель

Уменьшить случайную сложность, сохранив ownership, security и financial integrity.

Изменения

  • Status читает только состояние работы: удалены пересборка ресурсов, stateVersion, публичный progress и невыдаваемый queued.
  • Удалены full-history candle prefetch, special metadata retry/admission, старые методы и лишние API barrels.
  • Request context и HTTP completion используют native Pino; safe field filtering и correlation сохранены.
  • Неуспешный refresh не меняет cookie; CAS и logout сохранены.
  • Упрощены pending bookkeeping и forecast freshness без удаления conditional publication.

Breaking contract

Удалены investment stateVersion, queued и tbank-sync status progress/resources. Frontend должен наблюдать ресурсы через sync=observe. Поставлять согласованно с frontend веткой codex/simplify-complexity.

Сохранённые инварианты

User/connection isolation, атомарная публикация истории, coverage/staging, банковская идемпотентность и версии, точные денежные расчёты.

Проверки

  • npm run verify: 229 unit tests, lint, app/test typecheck, build — passed.
  • Все 21 HTTP/SQLite suites: 268 tests — passed; тяжёлый read baseline проверен отдельно после общего shell timeout.
  • OpenAPI generator/runtime parity — passed.
  • git diff --check — passed.

Refs #7: выполнена связанная часть complexity cleanup; остальные условные пункты issue этим PR не закрываются.

## Цель Уменьшить случайную сложность, сохранив ownership, security и financial integrity. ## Изменения - Status читает только состояние работы: удалены пересборка ресурсов, stateVersion, публичный progress и невыдаваемый queued. - Удалены full-history candle prefetch, special metadata retry/admission, старые методы и лишние API barrels. - Request context и HTTP completion используют native Pino; safe field filtering и correlation сохранены. - Неуспешный refresh не меняет cookie; CAS и logout сохранены. - Упрощены pending bookkeeping и forecast freshness без удаления conditional publication. ## Breaking contract Удалены investment stateVersion, queued и tbank-sync status progress/resources. Frontend должен наблюдать ресурсы через sync=observe. Поставлять согласованно с frontend веткой codex/simplify-complexity. ## Сохранённые инварианты User/connection isolation, атомарная публикация истории, coverage/staging, банковская идемпотентность и версии, точные денежные расчёты. ## Проверки - npm run verify: 229 unit tests, lint, app/test typecheck, build — passed. - Все 21 HTTP/SQLite suites: 268 tests — passed; тяжёлый read baseline проверен отдельно после общего shell timeout. - OpenAPI generator/runtime parity — passed. - git diff --check — passed. Refs #7: выполнена связанная часть complexity cleanup; остальные условные пункты issue этим PR не закрываются.
codex-bot added 1 commit 2026-10-03 17:48:53 +03:00
refactor!: simplify runtime coordination #7
Backend verify / commits (pull_request) Successful in 29s
Backend verify / security (pull_request) Successful in 8s
Backend verify / verify (pull_request) Failing after 9m36s
d698ed9425
Keep financial ownership, atomic publication and refresh CAS.
Failed refresh leaves cookies untouched; logout still clears them.

Remove full-history candle prefetch and special metadata retries.
Use native Pino request context instead of parallel middleware.

BREAKING CHANGE: remove investment stateVersion, queued sync state,
and tbank-sync status progress/resources. Consumers must observe
resources through sync=observe with the updated frontend contract.
ksv741 added 1 commit 2026-10-03 19:44:43 +03:00
perf(income): compute Moscow dates once
Backend verify / commits (pull_request) Successful in 30s
Backend verify / security (pull_request) Successful in 12s
Backend verify / verify (pull_request) Successful in 9m53s
Backend verify / commits (push) Skipped
Backend verify / security (push) Successful in 9s
Backend verify / verify (push) Failing after 10m3s
a7619d5c8f
Author
Owner

CI follow-up — a7619d5

Причина performance failure: повторное преобразование даты каждой операции в Europe/Moscow внутри каждого bucket. Дата теперь вычисляется один раз на запись; DTO, точная signed арифметика и пустые buckets сохранены.

  • npm ci + npm run verify: 230 unit tests, lint/typecheck/build — passed.
  • LOG_LEVEL=error node test/sqlite.cjs tbank-read-baseline.e2e-spec.ts — passed: локальный all-account income p95 122.45 мс при прежнем gate 500 мс; upstream RPC 0. Linux CI проверяется отдельно.
  • Добавлен regression test на Moscow midnight, отрицательные выплаты и пустой день.

Актуальная связанная поставка: frontend #46, docs #27, specs #20, deploy #3.

## CI follow-up — a7619d5 Причина performance failure: повторное преобразование даты каждой операции в Europe/Moscow внутри каждого bucket. Дата теперь вычисляется один раз на запись; DTO, точная signed арифметика и пустые buckets сохранены. - npm ci + npm run verify: 230 unit tests, lint/typecheck/build — passed. - LOG_LEVEL=error node test/sqlite.cjs tbank-read-baseline.e2e-spec.ts — passed: локальный all-account income p95 122.45 мс при прежнем gate 500 мс; upstream RPC 0. Linux CI проверяется отдельно. - Добавлен regression test на Moscow midnight, отрицательные выплаты и пустой день. Актуальная связанная поставка: [frontend #46](https://git.personal.ksv741.ru/WealthLedger/frontend/pulls/46), [docs #27](https://git.personal.ksv741.ru/WealthLedger/docs/pulls/27), [specs #20](https://git.personal.ksv741.ru/WealthLedger/specs/pulls/20), [deploy #3](https://git.personal.ksv741.ru/WealthLedger/deploy/pulls/3).
Author
Owner

Linux CI подтверждён: run 825 — commits, security, полный verify и все isolated SQLite/runtime OpenAPI suites passed на a7619d5. Performance gate 500 мс сохранён и прошёл.

Linux CI подтверждён: [run 825](https://git.personal.ksv741.ru/WealthLedger/backend/actions/runs/825) — commits, security, полный verify и все isolated SQLite/runtime OpenAPI suites passed на a7619d5. Performance gate 500 мс сохранён и прошёл.
ksv741 merged commit a7619d5c8f into develop 2026-10-03 21:32:26 +03:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: WealthLedger/backend#43