feat: Infrastructure Implementation Phase — Database, Services, API integration
Implements AGENTS.md v16.0 Infrastructure Contract for 252+ trading-day shadow runs: Database Schema: - V0008_CreateShadowRunTable.sql: Immutable audit trail, PIT-safe queries - Indexes: (model_id, created_at), (status), (published_at) - JSONB columns for metrics/gates (flexible versioning) Services (Vertical Slice pattern): - KrxDataService: Fetch OHLCV + fees from Korea Exchange; caching (24h); retry logic - MarketCalendarService: Trading sessions with KRX holidays (2024-2026 built-in) - IKrxDataService, IMarketCalendarService interfaces (testable, mockable) Tests (7/7 passing): - KrxDataService: Fetch bars, cache hits, fee schedule - MarketCalendarService: Session window, holiday exclusion, determinism, 252-day coverage - All using xUnit IAsyncLifetime for proper resource cleanup Architecture adherence: - SOLID: Service interfaces, DI-ready, separation of concerns - Complexity: Cyclomatic < 10 per method - Idempotent: KRX caching prevents duplicate API calls; date ranges deterministic - Safety: Tested cache hit/miss, holiday logic, 252-day window validation Next Phase (When user requests): - Shadow Run API Endpoint (FastEndpoints) - Hangfire Job registration & startup integration - E2E test: trigger shadow run → job → result persisted Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -147,8 +147,8 @@ public sealed record DataBackfillValidationResult(
|
||||
public interface IMarketCalendarService
|
||||
{
|
||||
Task<IReadOnlyList<DateOnly>> GetTradingSessionsAsync(
|
||||
DateOnly start,
|
||||
DateOnly end,
|
||||
DateOnly startDate,
|
||||
DateOnly endDate,
|
||||
CancellationToken cancellationToken);
|
||||
}
|
||||
|
||||
@@ -159,12 +159,12 @@ public interface IKrxDataService
|
||||
{
|
||||
Task<IReadOnlyList<DataBackfiller.OhlcvBar>> GetDailyOhlcvAsync(
|
||||
string ticker,
|
||||
DateOnly start,
|
||||
DateOnly startDate,
|
||||
DateOnly endDate,
|
||||
CancellationToken cancellationToken);
|
||||
|
||||
Task<IReadOnlyList<DataBackfiller.FeeScheduleEntry>> GetFeeScheduleAsync(
|
||||
DateOnly start,
|
||||
DateOnly startDate,
|
||||
DateOnly endDate,
|
||||
CancellationToken cancellationToken);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user