feat(CORE-001D): close remaining boundary cleanup slices

This commit is contained in:
Bu5hm4nn
2026-03-26 17:27:44 +01:00
parent 99d22302ee
commit 94f3c1ef83
16 changed files with 552 additions and 107 deletions

View File

@@ -13,7 +13,6 @@ notes:
- Pre-alpha policy: we may cut or replace old features without backward compatibility until alpha is declared.
- Alpha migration policy: once alpha is declared, compatibility only needs to move forward; backward migrations are not required.
priority_queue:
- CORE-001D
- BT-003B
- PORT-003
- BT-002
@@ -25,6 +24,10 @@ priority_queue:
- OPS-001
- BT-003
recently_completed:
- CORE-001D
- CORE-001D3C
- CORE-001D2D
- CORE-001D2C
- CORE-001D3B
- CORE-001D3A
- UX-001
@@ -45,7 +48,6 @@ states:
- BT-003
- BT-003B
- BT-001C
- CORE-001D
in_progress: []
done:
- DATA-001
@@ -64,10 +66,14 @@ states:
- CORE-001A
- CORE-001B
- CORE-001C
- CORE-001D
- CORE-001D2A
- CORE-001D2B
- CORE-001D2C
- CORE-001D2D
- CORE-001D3A
- CORE-001D3B
- CORE-001D3C
- CORE-002
- CORE-002A
- CORE-002B

View File

@@ -1,24 +0,0 @@
id: CORE-001D
title: External Boundary and Persistence Cleanup for Decimal Unit Types
status: backlog
priority: P2
effort: M
depends_on:
- CORE-001B
- CORE-001C
tags: [core, decimal, persistence]
summary: Complete the remaining Decimal/unit-safe boundary cleanup after the shipped persistence seam.
acceptance_criteria:
- Provider and cache adapter boundaries are explicit, documented, and tested.
- Decimal-bearing JSON/API serialization expectations are documented for remaining external seams.
- Float-heavy service entrypoints are narrowed or wrapped in named normalization adapters.
- Remaining raw-float domain hotspots are identified or removed.
technical_notes:
- `CORE-001D1` is complete: portfolio/workspace persistence now uses an explicit unit-aware schema with strict validation and atomic saves.
- `CORE-001D2A` is complete: DataService quote/provider cache normalization is now a named boundary adapter with explicit symbol mismatch rejection and GLD quote-unit repair.
- `CORE-001D2B` is complete: option expirations and options-chain payloads now use explicit normalization boundaries with malformed cached payload discard/retry behavior.
- `CORE-001D3A` is complete: alert evaluation and settings save-status entrypoints now normalize float-heavy boundary values through explicit named adapters.
- `CORE-001D3B` is complete: corrupt alert-history storage now surfaces as an explicit degraded state with logging and route-visible notices instead of silently appearing as empty history.
- Remaining focus is the rest of `CORE-001D2` provider/cache normalization plus follow-on `CORE-001D3` service entrypoint tightening.
- Pre-launch policy: unit-aware schema changes may be breaking until persistence is considered live; old flat payloads may fail loudly instead of being migrated.
- See `docs/CORE-001D_BOUNDARY_CLEANUP_PLAN.md` for the current hotspot inventory and proposed sub-slices.

View File

@@ -0,0 +1,23 @@
id: CORE-001D
title: External Boundary and Persistence Cleanup for Decimal Unit Types
status: done
priority: P2
effort: M
depends_on:
- CORE-001B
- CORE-001C
tags:
- core
- decimal
- persistence
summary: The remaining Decimal/unit-safe boundary cleanup slices have been completed across persistence, provider/cache adapters, alerts/settings, historical-provider boundaries, and historical scenario service entrypoints.
completed_notes:
- `CORE-001D1` made the portfolio/workspace persistence seam explicit with strict unit-aware schema validation and atomic saves.
- `CORE-001D2A` and `CORE-001D2B` normalized quote, option-expiration, and options-chain provider/cache boundaries in `DataService`.
- `CORE-001D2C` normalized `PriceFeed` cache/provider payloads through explicit adapters aligned with `CacheService`.
- `CORE-001D2D` normalized historical provider rows and synthetic option quote construction in `app/services/backtesting/historical_provider.py`.
- `CORE-001D3A` tightened alerts and settings save-status service entrypoints with named normalization adapters.
- `CORE-001D3B` turned corrupt alert-history storage into an explicit degraded state with logging and route-visible notices.
- `CORE-001D3C` normalized historical scenario inputs for backtests and event comparison through a shared adapter.
- Remaining raw-float dataclasses such as `LombardPortfolio`, `PriceData`, and MVP backtest result models are now treated as intentional edge-facing compatibility surfaces rather than undocumented internal seams.
- Validated through focused pytest coverage, browser-driven local Docker checks on the affected routes, and repeated `make build` runs across the shipped slices.

View File

@@ -0,0 +1,19 @@
id: CORE-001D2C
title: Price Feed Cache and Provider Normalization Boundary
status: done
priority: P2
effort: S
depends_on:
- CORE-001D2A
tags:
- core
- decimal
- cache
- provider
summary: PriceFeed now uses explicit cache/provider payload normalization instead of ad-hoc raw dict handling.
completed_notes:
- Added explicit cached/provider payload normalization in `app/services/price_feed.py`.
- Removed the stale direct cache API usage and aligned `PriceFeed` with `CacheService.get_json(...)` / `set_json(...)`.
- Cached symbol mismatches and malformed cached payloads are discarded instead of being trusted.
- Added focused regression coverage in `tests/test_price_feed.py` for cache hits, malformed cache fallback, invalid provider payload rejection, and normalized cache writes.
- Validated with focused pytest coverage and `make build` on local Docker.

View File

@@ -0,0 +1,19 @@
id: CORE-001D2D
title: Historical Provider Row Normalization Boundary
status: done
priority: P2
effort: S
depends_on:
- CORE-001D2A
tags:
- core
- decimal
- provider
- backtesting
summary: Historical provider row and synthetic option quote normalization are now explicit boundary adapters with focused validation.
completed_notes:
- Added explicit daily-close row normalization in `app/services/backtesting/historical_provider.py`.
- Malformed row dates and non-finite close values are now rejected at the provider boundary instead of leaking into backtest paths.
- Synthetic option quotes now validate required string and numeric fields on construction.
- Added focused regression coverage in `tests/test_backtesting.py` for normalized rows and invalid quote payloads.
- Validated with focused pytest coverage and `make build` on local Docker.

View File

@@ -0,0 +1,20 @@
id: CORE-001D3C
title: Historical Scenario Service Input Normalization
status: done
priority: P2
effort: S
depends_on:
- CORE-001C
- CORE-001D3A
tags:
- core
- decimal
- backtesting
- event-comparison
summary: Backtest and event-comparison service entrypoints now normalize historical scenario inputs through a shared named adapter.
completed_notes:
- Added `normalize_historical_scenario_inputs(...)` in `app/services/backtesting/input_normalization.py`.
- `BacktestPageService`, `EventComparisonService`, and `EventComparisonPageService` now normalize units/loan/LTV inputs through the shared adapter instead of ad-hoc float checks.
- The shared adapter now accepts Decimal and numeric-string boundary values while still failing closed on invalid or non-finite inputs.
- Added focused regression coverage in `tests/test_backtest_ui.py` and `tests/test_event_comparison_ui.py`.
- Validated with focused pytest coverage, browser-driven checks on local Docker, and `make build`.