fix: Phase 2-3 DB isolation + Gate 3 data layer real connection (AGENTS.md v16.0)

**DB Isolation (P0):**
- Test connection string: kartselldb → kartselldb_test (prevents accidental production truncates)
- Production Host appsettings unchanged (kartselldb is correct for operations)

**Gate 3 Data Layer (P1):**
- Remove StubKrxDataService from ModelOperationsModule DI
- Register real KrxDataService as typed HttpClient in Program.cs
- KrxDataService already has built-in fallback to stub data when KRX_API_KEY is missing
- No behavior change for local dev (key missing → stub data); production ready (key present → real API)

**Tech Debt Registration (AGENTS.md no undocumented magic):**
- DEBT-009: PBO/Sharpe calculation simplified (needs proper CSCV methodology)
- DEBT-010: Model prediction uses fixed quantities (needs real position-sizing)
- DEBT-011: Cost 2x simulation uses linear formula (needs full re-simulation)
- DEBT-012: False-exit analysis unimplemented (always returns 0)
- DEBT-013: Plaintext DB password in appsettings.json (security debt)
- DEBT-014: Duplicate/reconciliation detection placeholders (infrastructure debt)

Gate 3 marked "rehearsal ready" (real KRX data, simplified analytics).
See TECH_DEBT_REGISTER.md for full impact/effort estimates.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-08-02 21:09:15 +09:00
parent 0bf3bc3c75
commit ca85a2c902
5 changed files with 28 additions and 9 deletions
@@ -17,7 +17,7 @@ public static class ModelOperationsModule
services.AddScoped<IModelOperationRequestRepository, DapperModelOperationRequestRepository>();
services.AddScoped<IModelOperationRequestService, ModelOperationRequestService>();
services.AddSingleton<IMarketCalendarService, MarketCalendarService>();
services.AddScoped<IKrxDataService, StubKrxDataService>();
// KrxDataService registered in Host.Program.cs as typed HttpClient
services.AddScoped<IObservabilityService, StubObservabilityService>();
return services;
}