Repository navigation
feature(ai): A01 — Python Ortamı, Süreç Sınırları ve Pydantic Sözleşme Modelleri - #45
Merged
Merged
Conversation
…elerini ve birim testlerini eklendi
… formatina donustur
…mmit-level gemini appsec review
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📌 Özet
Bu PR, CryptoLab AI katmanının (
ai/) temel paket yapısını,servingvetrainingbağımlılık/süreç izolasyonunu, Backend (B01/B09) ile birebir uyumlu katı Pydantic v2 veri sözleşmelerini (app/contracts/model.py), port protokollerini (DatasetReader,Registry) ve iç model API iskeletini (app/api/model_api.py) devreye alır.🛠️ Yapılan Değişiklikler
requirements-serving.in,requirements-training.in):model-api) ile ağır eğitim/PDF ayrıştırma (training-worker/pypdf) bağımlılıkları birbirinden ayrıldı.app/features/pipeline.py):frozen=Trueile değişmez (immutable)Candleveri modeli,Decimalfiyat temsili veclose_time/available_atzaman ayrımı oluşturuldu.app/contracts/model.py):StrictModel(extra='forbid',allow_inf_nan=False) taban sınıfı tanımlandı.PredictionRequestüzerinde izinli ufuklar (60, 900, 3600, 86400, 604800) ve zorunlu UTC zaman damgası (UTC_REQUIRED) doğrulaması eklendi.PredictionResultüzerindequality == 'READY'iken skorların dolu, diğer durumlardaNoneolmasını zorunlu kılan (READY_REQUIRES_SCORES/NON_READY_REQUIRES_NULL) model doğrulayıcısı yazıldı.ActiveModelBundle,ExplanationRequest(BUNDLE_MISMATCHkorumalı) veExplanationResultşemaları eklendi.app/infrastructure/ports.py,app/api/model_api.py):DatasetReaderveRegistryProtocolarayüzleri tanımlandı.X-Service-Secret),X-Request-IdveX-Deadlinekontrollerini uygulayancreate_appfactory yapısı kuruldu.tests/test_core.py,tests/test_api.py):NaN/Infengeli, yetkisiz/süresi geçmiş istek (401/400) ve serving import izolasyonu testleri eklendi.🧪 Test ve Doğrulama Kanıtları
.\.venv\Scripts\python.exe -m pytest tests -q-> Tüm sözleşme, validasyon ve API sınır testleri başarıyla geçti.venv-serving)from app.api.model_api import create_appçağrısının PDF/OCR (pypdf) paketlerine ihtiyaç duymadan çalıştığı doğrulandı.contracts/fixtures/prediction-result.jsonortak fixture dosyasının Pydantic modelleriyle kayıpsız doğrulandığı teyit edildi.Bu PR AI katmanının sözleşme modellerini, süreç sınırlarını ve iç API iskeletini kapsar. Piyasa veri kümesi okuma ve çoklu zaman dilimi (multi-timeframe) feature mühendisliği bir sonraki görevde (
A02) ele alınacaktır.