feat: productionize local service — fix signal pipeline, lower thresholds, add company-name ticker extraction

- Point Ollama to local instance via host.docker.internal, use gemma3 model
- Remove Docker Ollama service (using host's Ollama instead)
- Add company-name-to-ticker mapping (Apple→AAPL, Tesla→TSLA, etc.) for RSS articles
- Lower signal thresholds for faster feedback with paper trading:
  - FinBERT confidence: 0.6→0.4, signal strength: 0.3→0.15
  - News strategy: article_count 2→1, confidence 0.5→0.3, score ±0.3→±0.15
- Fix market data BarSet access bug (BarSet.__contains__ returns False incorrectly)
- Fix market data SIP feed error by switching to IEX feed for free Alpaca accounts
- Fix nginx proxy routing for /api/auth/* to api-gateway /auth/*
- Add seed_sample_data script
- Update tests for new thresholds and alpaca mock modules
This commit is contained in:
Viktor Barzin 2026-02-22 22:17:26 +00:00
parent 67e64fab18
commit d36ae40df1
No known key found for this signature in database
GPG key ID: 0EB088298288D958
18 changed files with 749 additions and 185 deletions

View file

@ -167,9 +167,12 @@ async def register_complete(
user_id_str = stored["user_id"]
display_name = stored["display_name"]
# The frontend sends the WebAuthn response under "attestation" or "credential"
credential_data = body.get("credential") or body.get("attestation") or body
try:
verification = verify_registration_response(
credential=body.get("credential", body),
credential=credential_data,
expected_challenge=expected_challenge,
expected_rp_id=config.rp_id,
expected_origin=config.rp_origin,
@ -319,11 +322,14 @@ async def login_complete(
expected_challenge = base64.urlsafe_b64decode(stored["challenge"])
user_id_str = stored["user_id"]
# The frontend sends the WebAuthn response under "assertion" or "credential"
credential_data = body.get("credential") or body.get("assertion") or body
# Look up the credential used
from sqlalchemy import select
from shared.models.auth import UserCredential
credential_id_b64 = body.get("credential", body).get("id", "")
credential_id_b64 = credential_data.get("id", "")
db_session = request.app.state.db_session_factory
async with db_session() as session:
@ -343,7 +349,7 @@ async def login_complete(
try:
verification = verify_authentication_response(
credential=body.get("credential", body),
credential=credential_data,
expected_challenge=expected_challenge,
expected_rp_id=config.rp_id,
expected_origin=config.rp_origin,