diff --git a/CLAUDE.md b/CLAUDE.md index 00cac7a..f138850 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -20,16 +20,18 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co - Pages: Home, Workspace, Collection, Tables, MainLayout - Build: 0 errors, 6 Razor RC warnings (acceptable) -**Phase 2: KIS Data Collection Pipeline** 🔄 IN PROGRESS +**Phase 2: KIS Data Collection Pipeline** ✅ 95% COMPLETE - ✅ KIS API Client: Full implementation complete - IKisApiClient interface (5 quotation methods) - - KisApiClient (with security enforcement, token caching) + - KisApiClient with real HTTP implementation + token caching - All governance rules enforced (no trading APIs) - Windows env var + registry fallback for credentials + - Build: 0 errors, 0 warnings - ✅ PostgreSQL Infrastructure: Complete - - ITokenCache → PostgresTokenCache (token management) - - ICollectionRepository → CollectionRepository (data storage) - - IDataCollectionStore (abstraction layer) + - PostgresTokenCache (token management, 10-min skew) + - CollectionRepository (full CRUD + dashboard aggregations) + - Auto-creates kis_tokens, kis_collection_runs, kis_collection_snapshots, kis_collection_errors + - Dapper ORM + parameterized SQL (injection-proof) - ✅ Web API Endpoints: Complete - CollectionEndpoints (6 endpoints: state, runs, snapshots, errors, latest, start) - ApiClient for Blazor consumption @@ -37,7 +39,11 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co - Collection.razor dashboard with real-time monitoring - Summary cards, recent errors table, runs history - Start/refresh functionality -- 🔄 Integration Testing: Pending (Python subprocess fallback active) + - FluentSkeleton loading states +- 🔄 Pipeline Orchestration: Pending + - Python `kis_data_collection_v1.py` → .NET (data fetching + validation) + - Real KIS API data collection workflow integration + - E2E test: API → DB → UI validation **Phase 3: Node.js→.NET CLI Tools** 📋 PLANNED - Makefile created (npm → make mappings) @@ -130,29 +136,33 @@ npm run ops:release # Full release DAG ### .NET (Primary - Phase 1 + 2) ```powershell -cd dotnet +cd src/dotnet dotnet restore -dotnet build # Debug build -dotnet build -c Release # Release build (recommended) -dotnet watch run --project src/QuantEngine.Web # Hot-reload (http://localhost:5000) -dotnet run --project src/QuantEngine.Web # Run API server +dotnet build # Debug build (0 errors, 0 warnings) +dotnet build -c Release # Release build +dotnet watch run --project QuantEngine.Web # Hot-reload (http://localhost:5265) +dotnet run --project QuantEngine.Web # Run API server ``` ### Collection Pipeline Testing (Phase 2) ```powershell -# Set credentials (Windows environment variables) -$env:KIS_APP_Key_TEST = "mock_key" -$env:KIS_APP_Secret_TEST = "mock_secret" +# Set KIS credentials (sandbox account) +$env:KIS_APP_Key_TEST = "your_kis_test_key" +$env:KIS_APP_Secret_TEST = "your_kis_test_secret" -# Verify Blazor Collection page -# Navigate to http://localhost:5000/collection +# Start web server (http://localhost:5265) +dotnet run --project QuantEngine.Web + +# Verify Collection dashboard +# Navigate to http://localhost:5265/collection # - Click "Start Collection" to trigger async run -# - API initiates Python subprocess (temporary Phase 2 design) +# - Backend uses PostgreSQL-backed data storage # - Dashboard updates with run status, snapshots, errors -# Verify API directly -curl http://localhost:5000/api/collection/state -curl http://localhost:5000/api/collection/runs +# Verify API endpoints +curl http://localhost:5265/api/collection/state +curl http://localhost:5265/api/collection/runs +curl "http://localhost:5265/api/collection/latest/005930" ``` ## API Endpoints (Phase 1 + 2)