Commit Graph
100 Commits
Author SHA1 Message Date
Celes Renata 96eabf595b ci: retry after adding 192.168.42.1 to woodpecker DNS config 2026-07-10 23:21:18 +00:00
Celes Renata 430554fe0c ci: retry after coredns fix + woodpecker agent restart 2026-07-10 23:18:59 +00:00
Celes Renata 853b85a2af ci: retry after coredns forward fix 2026-07-10 23:14:18 +00:00
Celes Renata 1d104187f4 ci: retry after transient DNS failure 2026-07-10 23:11:32 +00:00
Celes Renata d018c75182 fix: OpsPipeline dashboard — use time-filtered doc stages, add time labels
Document Stages now shows time-filtered counts from /health endpoint
(consistent with Parsing/Extraction/Trends sections) with all-time
totals shown as a subtle subtitle from the SSE stream. Added "(last Xh)"
labels to all sections so the time window context is always visible.
2026-07-10 22:14:56 +00:00
Celes Renata ed474c521a fix: update document status after macro classification
_process_macro_classification never updated document status, leaving
macro_event docs stuck in parsed forever. Now marks them extracted on
success or extraction_failed on error.
2026-07-10 22:09:02 +00:00
Celes Renata e8e348d478 fix: update test — empty ticker now filtered out instead of failing extraction 2026-07-10 20:43:46 +00:00
Celes Renata d9fbd5b660 fix: handle null fields from NuExtract3 in extraction normalization
- Replace setdefault() with explicit None checks in _normalize_extraction_data()
- Coerce null top-level fields (summary, novelty_score, confidence) to defaults
- Coerce null company fields (ticker, impact_score, impact_horizon, etc.) to defaults
- Filter out company entries with empty ticker after normalization
- Prevents schema validation failures when model returns null for required fields
2026-07-10 20:38:50 +00:00
Celes Renata ca712ad4a0 fix: pipeline health — stuck docs, price fallback, sentiment normalization, signal-engine scale, quality gate
- Scheduler: lower stale threshold 240→30 min, batch limit 100→500, TTL 14400→3600
- Prediction snapshot: add 24h market_snapshots time-window fallback
- Aggregation: add normalize_impact_scores() z-score normalization
- Helm: signal-engine replicas → 0 (idle when dual pipeline disabled)
- Quality gate: max_snapshot_age_hours 24→48
- Add backfill script for NULL price_at_prediction snapshots
- Add PBT bug condition and preservation tests (14 tests)
2026-07-10 20:16:01 +00:00
Celes Renata a4f51c00e1 fix: beta broker keys in values-beta.yaml (ArgoCD source of truth) 2026-07-09 14:04:59 +00:00
Celes Renata cf93e2d547 chore: trigger CI rebuild for dashboard fix 2026-07-06 04:06:06 +00:00
Celes Renata 88a6c8f9ee fix: beta broker keys — use prod Alpaca paper account 2026-07-06 02:46:29 +00:00
Celes Renata af7b654fb7 fix: vLLM deployment — Recreate strategy, correct service port, single model name
- Strategy: Recreate (GPU can only be used by one pod at a time)
- nuextract-external targetPort: 8080 (nginx proxy port)
- served-model-name: numind/NuExtract3
- DB ai_agents updated to model=numind/NuExtract3 provider=vllm
2026-07-04 05:34:04 +00:00
Celes Renata a322e00659 feat: vLLM serving numind/NuExtract3 on full GPU, ollama disabled
- Ollama scaled to 0 — vLLM gets entire 16GB GPU
- NuExtract3 (9B) running at 80% GPU utilization
- Both OLLAMA_BASE_URL and VLLM_BASE_URL point to vLLM service
- Fixed gremlin-1 missing default route (no internet access)
- Removed GPU resource limit (time-slicing handles allocation)
- Removed init container (direct download works with internet fix)
2026-07-03 17:57:19 +00:00
Celes Renata ecade0dd52 feat: vLLM in K8s via Harbor mirror, pipelines point to internal svc
- vLLM image mirrored to registry.celestium.life/stonks-oracle/vllm-openai
- Deployment uses Harbor image (Docker Hub IPv6 unreachable from cluster)
- All 3 pipelines use vllm-external.vllm-service.svc.cluster.local:2701
- K8s manifests at infra/kube-vllm/ and synced to ~/sources/kube/vllm
2026-07-03 17:02:31 +00:00
Celes Renata 3a9894cd03 fix: revert VLLM to bare-metal 192.168.42.254:2701
K8s vLLM deployment blocked by Docker Hub IPv6 connectivity issue.
Falling back to NixOS systemd vLLM service on esnixi.
K8s manifests remain in infra/kube-vllm/ for future use.
2026-07-03 11:40:36 +00:00
Celes Renata 4ac10ab4f6 fix: point VLLM_BASE_URL to K8s internal vllm-service
vLLM now runs in vllm-service namespace with metrics proxy,
accessible at vllm-external.vllm-service.svc.cluster.local:2701
2026-07-03 11:38:24 +00:00
Celes Renata 3996ec6ef5 feat: switch models — ollama qwen3.5:4b-fast, vllm numind/NuExtract3
- Ollama: qwen3.5:4b-fast with NUM_PARALLEL=8, num_ctx=16384 (~6GB VRAM)
- vLLM: numind/NuExtract3 at 192.168.42.254:2701, gpu-memory-util=0.45
- All 3 pipelines (beta/paper/live) updated with correct endpoints
- Ollama proxy at 10.1.1.12:2701 (K8s ollama-metrics)
- vLLM proxy at 192.168.42.254:2701 (NixOS nginx)
2026-07-03 11:15:28 +00:00
Celes Renata d1533ed31d chore: test CI after CoreDNS restart 2026-07-03 10:17:38 +00:00
Celes Renata 02eb8e619f chore: trigger CI rebuild 2026-07-03 09:55:37 +00:00
Celes Renata a6aceebe18 fix: dashboards limit exceeds API max (500→200)
Sentiment Heatmap and Prediction Accuracy passed limit=500 but
the trends and recommendations endpoints enforce limit<=200,
causing a 422 validation error that made both panels show blank.
2026-07-03 09:35:55 +00:00
Celes Renata 14a9b4fcc1 fix: ops pipeline — rate limit, validation cycle, snapshots, config query, rejection reason
- Polygon rate limit env-configurable, default 5 (free tier)
- v3_engine_enabled reads from JSONB config column correctly
- Validation cycle (outcome eval + metrics) wired into scheduler hourly
- Daily portfolio/risk snapshots after 16:30 ET with idempotency
- Prediction snapshot price fallback from positions table
- Order rejection_reason + rejected_at persisted on insert
- Lake-publisher scaled to 0 replicas (redundant)
- Test fix: isolate per-type rate limit tests from Polygon global
2026-07-03 08:29:24 +00:00
Celes Renata b70304ad6c fix: correct Alpaca paper trading credentials for beta 2026-06-30 15:24:30 +00:00
Celes Renata fdb54b77ce fix: update Redis password, Ollama URL, and broker keys for new cluster 2026-06-28 22:03:26 +00:00
Celes Renata 106b07c0f0 fix: ruff lint fixes for v3 test files 2026-06-27 12:32:52 +00:00
Celes Renata b4bf0f2361 feat: math core v3 engine upgrade 2026-06-27 12:21:41 +00:00
Celes Renata 5ed9f001b1 docs: add bash exclamation mark pitfall to steering file 2026-05-02 08:33:40 +00:00
Celes Renata 18f857e1a3 feat: add live-math stage with dedicated paper trading account
New ArgoCD stage 'stonks-live-math' running the dual-pipeline signal
engine against a separate Alpaca paper account for production validation.

- Namespace: stonks-live-math
- Database: stonks_live_math (Redis DB 3)
- Broker: PK64RS7NH24XPBI3IDEU3BB72Y (paper-api.alpaca.markets)
- Ingress: stonks-math-*.celestium.life
- Deploys alongside existing live stage (same image tag)
2026-05-02 08:19:47 +00:00
Celes Renata 61bcb5aa57 ci: add signal-engine image build to Woodpecker pipeline 2026-05-02 07:43:59 +00:00
Celes Renata f468e30af0 feat: implement dual-pipeline signal engine service
New service at services/signal_engine/ implementing concurrent heuristic
(deterministic scoring) and probabilistic (Bayesian inference) pipelines
that evaluate technical signals across 6 timeframes (M30-M) and produce
independent BUY/WATCH/SKIP verdicts per ticker per evaluation tick.

Components:
- Input Normalizer: multi-source data assembly with sentinel fallbacks
- Signal Library: Fibonacci, MA Stack, RSI, Cup & Handle, Elliott Wave
- Multi-Timeframe Confluence Engine: weighted scoring with D/W/M anchors
- Hard Filter Engine: macro_bias, valuation, earnings proximity gating
- Heuristic Pipeline: S_total scoring with confidence-gated verdicts
- Probabilistic Pipeline: Bayesian log-odds with regime priors, entropy
  gating, EV_R calculation, and signal correlation penalty
- Exit Engine: stop-loss, targets, trailing ATR-based stops
- Delta Analyzer: pipeline agreement tracking with rolling Redis metrics
- Output Formatter: SignalOutput contract + Recommendation schema mapping
- Worker orchestrator: concurrent pipelines with failure isolation
- Main entry point: queue polling with fail-safe config loading

Infrastructure:
- Migration 039: signal_engine_outputs table with 3 indexes
- Helm chart: signalEngine service entry (processing tier)
- Redis key: QUEUE_SIGNAL_ENGINE constant

Tests: 390 tests (unit + property-based) covering all components
Config: dual_pipeline_enabled=false by default (safe rollout)
2026-05-02 07:32:26 +00:00
Celes Renata 7e2343ec2c feat: add Reports page and detail view to frontend
- Reports list page with type filter (daily/weekly)
- Report detail page with all sections: P&L, recommendation accuracy,
  position performance table, risk metrics, model quality windows
- Executive summary card, validation warnings display
- Nav item under Trading group
- Routes: /reports and /reports/:id
2026-05-02 00:27:34 +00:00
Celes Renata 3a8c6f6c80 fix: add CACHE_BUST ARG to Dockerfile + build args to force fresh COPY layers per commit 2026-05-01 23:23:49 +00:00
Celes Renata 139fbd6342 fix: add no_cache to all Woodpecker service builds to prevent stale COPY layers 2026-05-01 23:11:21 +00:00
Celes Renata 63b62c5e9f chore: RUN echo cache-bust to force buildx layer invalidation 2026-05-01 22:57:29 +00:00
Celes Renata 3acfdfd11f chore: move cache-bust before COPY to invalidate buildx layer cache 2026-05-01 22:48:12 +00:00
Celes Renata ab212db8be chore: bust Docker buildx cache for services/ layer 2026-05-01 22:39:38 +00:00
Celes Renata 7102358f51 chore: retrigger CI (bust Docker buildx cache for services/ layer) 2026-05-01 22:32:23 +00:00
Celes Renata bc077bfcc8 feat: trading feedback engine — periodic performance reports with AI summarization
- Migration 038: trading_reports table + report-summarizer agent seed
- 6 reporting modules: models, collector, sections, validator, summarizer, generator
- API endpoints: GET /api/reports (paginated, filterable), GET /api/reports/{id}
- Frontend hooks: useReports, useReport with TanStack Query
- Scheduler: daily (after 16:30 ET) and weekly (Saturday) report triggers
- Redis queue consumer for async report generation with retry/dedup
- 5 property-based tests (chunking, serialization, validation, accuracy, deltas)
- 109 unit/integration tests across all modules
- 6 frontend hook tests with MSW mocks
2026-05-01 22:13:09 +00:00
Celes Renata 376fcb4bb4 feat: add 12 integrity check saved queries for SQL Explorer (migration 037)
Prefixed with ⚕ for easy identification. Checks: duplicate snapshots,
orphaned links, evidence count mismatches, contribution score sums,
canonical key consistency, out-of-range values, unmatched snapshots,
zero evidence rate, duplicate count mismatches, missing prices,
outcome integrity, and pipeline health summary.
2026-05-01 19:20:56 +00:00
Celes Renata cc21fd9e8f feat: add 15 validation saved queries for SQL Explorer (migration 036)
Prediction overview, confidence distribution, evidence dedup quality,
source/catalyst breakdown, win rate by ticker/horizon, model quality
timeline, quality gate status, high-duplicate predictions, excess vs SPY.
2026-05-01 19:15:54 +00:00
Celes Renata affb65d7f4 fix: point VLLM_BASE_URL to Ollama (10.1.1.12:2701) and update model name
vLLM service on 192.168.42.254:8000 was down causing extraction failures.
Also updated ai_agents table to use ollama provider directly.
2026-05-01 18:56:55 +00:00
Celes Renata 32535540fe feat: add no-premature-simplification rule to steering docs 2026-05-01 04:32:05 +00:00
Celes Renata 751cce0509 feat: add documentation maintenance rules to steering, update migration number to 036 2026-05-01 04:29:52 +00:00
Celes Renata 0732894414 fix: widen horizon/mode columns in prediction_snapshots to VARCHAR(50)
time_horizon values like 'position_30d_90d (proj:30d)' exceed VARCHAR(20)
2026-05-01 04:27:19 +00:00
Celes Renata d9110d03a6 fix: use di.document_id instead of dir.document_id in evidence query
document_impact_records has intelligence_id, not document_id.
The document_id lives on document_intelligence.
2026-05-01 04:06:55 +00:00
Celes Renata 76f6bd5677 fix: quote reserved keyword 'window' in prediction_snapshots SQL 2026-05-01 03:40:48 +00:00
Celes Renata 32d290bea7 fix: ruff lint — sort imports, remove unused GateThresholdResult import 2026-05-01 03:08:21 +00:00
Celes Renata 7fcc8a6c07 feat: model validation, calibration, and signal quality layer
- Migration 035: prediction_snapshots, prediction_outcomes, signal_evidence_links, model_metric_snapshots tables + SQL views
- Prediction snapshot writer with canonical evidence keys, duplicate detection, contribution scores
- Outcome evaluator across 5 horizons (1h, 6h, 1d, 7d, 30d)
- Metrics engine: ECE, Brier score, IC, Rank IC, benchmark comparison
- Attribution engine: per-source, per-catalyst, per-layer performance
- Calibration engine: Bayesian shrinkage source reliability
- Quality gate for live trading eligibility with configurable thresholds
- 7 new /api/validation/* endpoints
- Upgraded OpsModel dashboard with validation tab
- Enhanced recommendation display with calibration context
- Backtest replay validation mode
- 86 Python tests (unit + property-based), 179 frontend tests passing
2026-05-01 03:04:58 +00:00
Celes Renata 5d2ffd9163 fix: vertical market markers need yAxisId + move legend below date labels
- Add yAxisId='left' to vertical ReferenceLine (required by Recharts)
- Increase bottom margin from 40 to 70 for date label + legend space
- Legend uses verticalAlign='bottom' with 24px top padding
2026-04-30 23:31:55 +00:00
Celes Renata 6169efdc89 fix: copy scripts/ into Docker image + graceful backfill fallback
- Dockerfile now copies scripts/ directory into /app/scripts/
- Init container uses sh -c with fallback so missing script
  doesn't crash the pod (graceful degradation until image rebuilds)
2026-04-30 23:18:43 +00:00
Celes Renata c42f2223d8 fix: move backfill logic to standalone script (fixes YAML parse error)
Inline Python with f-strings and colons broke Helm YAML parsing.
Moved to scripts/backfill_market_data.py and call it directly
from the init container command.
2026-04-30 23:01:20 +00:00
Celes Renata 1f08820f11 feat: fullscreen chart expand + market open/close vertical markers
- Click 'Expand' button to view the trend chart fullscreen
- Press Escape or click outside to close
- Fullscreen uses full viewport height for better readability
- Green dashed vertical lines at 9:30 AM ET (market open)
- Red dashed vertical lines at 4:00 PM ET (market close)
- Markers only shown on intraday and 1d windows (hidden on 7d+)
- Chart content extracted into shared function to avoid duplication
2026-04-30 22:44:00 +00:00
Celes Renata 2f2ea65fb4 fix: keep Alpaca price as primary (includes after-hours), add polygon_price field
Alpaca's current_price reflects extended hours trading which is more
current than Polygon's regular session close. Keep it as the display
price. Add polygon_price as a reference field in the API response.
2026-04-30 22:35:22 +00:00
Celes Renata 9a60ce127b fix: overlay Polygon prices on positions instead of stale Alpaca prices
Alpaca paper trading returns inaccurate current_price values.
The positions endpoint now uses the latest Polygon close from
market_snapshots and recomputes unrealized P&L from that.
2026-04-30 22:32:21 +00:00
Celes Renata 414f476620 fix: auto-backfill market data on startup + fix trading dedup bug
1. Add backfill-market-data init container to scheduler deployment.
   On vanilla start (< 50 bars in market_snapshots), fetches 90 days
   of daily OHLCV from Polygon directly via asyncpg + httpx.

2. Fix trading engine dedup key placement. Previously the Redis dedup
   key was set BEFORE evaluate_recommendation(), so recs skipped as
   outside_trading_window were permanently deduped and never retried
   when the market opened. Now the dedup key is only set AFTER the
   decision for non-retryable outcomes (act, confidence_too_low, etc).
   outside_trading_window skips are retryable.
2026-04-30 14:08:54 +00:00
Celes Renata a5f2bcde55 fix: set MARKET_DATA_BASE_URL to polygon in base values.yaml 2026-04-30 07:20:13 +00:00
Celes Renata 34ffdad00c fix: wait for scheduler migrations after factory reset scale-up
After scale_up, restart the scheduler and wait for it to be ready
before other services start. The scheduler's init containers run
migrations, so this ensures tables exist before ingestion/extractor
pods try to query them.
2026-04-30 07:01:01 +00:00
Celes Renata 601b85764b fix: mount stonks-market-secrets on query-api for backfill endpoint 2026-04-30 06:33:26 +00:00
Celes Renata 51b6f3d34a ci: trigger rebuild 2026-04-30 06:24:05 +00:00
Celes Renata bddaf44ffc feat: 90-day price range Y-axis scaling with breakthrough annotations
Backend:
- GET /api/market/prices/{ticker} now returns { bars, range_90d }
  with 90-day low/high computed from market_snapshots
- POST /api/market/backfill/{ticker} fetches 90 days of daily bars
  from Polygon and inserts missing bars into market_snapshots
- POST /api/market/backfill-all does the same for all active tickers

Frontend:
- Right Y-axis domain scaled to 90-day min/max (with 3% padding)
- Green dashed reference line at 90-day high
- Red dashed reference line at 90-day low
- Labels show exact price on each reference line
- Default limit bumped to 200 bars
2026-04-30 06:09:05 +00:00
Celes Renata 5209cc522e feat: enhanced paper trading reset with capital and reserve controls
- Add initial capital input (toggle between broker balance or custom amount)
- Add reserve/active pool split slider (0-50%, default 20%)
- Backend accepts reserve_pct in reset request body
- Note in UI that Alpaca balance reset requires Alpaca dashboard
- Confirmation dialog shows exact capital and split being applied
2026-04-30 05:49:38 +00:00
Celes Renata fa18b1a7c2 fix: populate broker and market API secrets in base values.yaml
ArgoCD was syncing empty secrets back over manual patches.
Credentials now match stonks-paper (same Alpaca paper + Polygon keys).
2026-04-30 05:05:43 +00:00
Celes Renata 4b254adad2 fix: scale ingestion and extractor to 1 replica in prod 2026-04-30 05:04:20 +00:00
Celes Renata af2e554edd fix: switch ai_agents seed from vllm to ollama qwen3.5:9b-fast
Live DB already updated via direct SQL. This ensures future
DB rebuilds and new deployments use ollama as the default provider.
2026-04-30 04:46:04 +00:00
Celes Renata facce5dbb5 fix: add TTL and backoffLimit to market-hours-check jobs
Prevents accumulation of completed/failed verification jobs.
- ttlSecondsAfterFinished: 3600 (auto-cleanup after 1h)
- backoffLimit: 0 (no retries on intentional market-hours failure)
2026-04-30 04:33:50 +00:00
Celes Renata 2f2c0d24f6 fix: remove unused columns constant (TS6133) 2026-04-30 03:21:32 +00:00
Celes Renata 861423c1e3 feat: make ticker clickable on positions page — links to company detail
Ticker column now links to /companies/{id} using a ticker→company ID
lookup. Falls back to plain text if company not found.
2026-04-30 03:15:22 +00:00
Celes Renata 13f863ef30 feat: fetch 15-minute bars instead of hourly for intraday prices
Changed intraday_bars default from 1-hour bars to 15-minute bars.
This gives ~26 price points per trading day per ticker (6.5h market
× 4 bars/hour) instead of ~7 hourly bars. Limit raised to 100 to
accommodate the higher bar count.
2026-04-29 23:01:11 +00:00
Celes Renata 2538da3f1e fix: switch market data sources from prev_bars to intraday_bars
The market_api sources were configured with endpoint='prev_bars' which
only fetches a single previous-day bar per ticker. Changed to
'intraday_bars' which fetches hourly bars for today from Polygon's
/v2/aggs/ticker/{ticker}/range/1/hour/{today}/{today} endpoint.

Updated: seed script, beta DB (50 sources), production DB (50 sources).
This gives ~7-8 hourly price bars per trading day per ticker instead
of 1 daily bar.
2026-04-29 22:07:47 +00:00
Celes Renata fa4ad6b15a fix: widen price matching tolerance for sparse market data
Only ~9 price bars per ticker (Polygon returns daily bars, not
intraday). Widened gap tolerance to 6h for intraday, 12h for 1d,
etc. Also skip time-range filtering when price data is sparse
(≤20 bars) to avoid showing no prices at all.
2026-04-29 22:02:23 +00:00
Celes Renata 5109c85a3e fix: remove unused 'hour' variable (TS6133) 2026-04-29 21:48:18 +00:00
Celes Renata 9975c2098b fix: limit X-axis to 8 ticks with date bold + time at angle
Was showing every data point timestamp. Now:
- Recharts generates max 8 evenly-spaced ticks
- Each tick shows 'Apr 29' in bold white + '2 PM' in gray
- All labels at -35° angle to avoid overlap
- Simplified tick component (no hour-boundary filtering needed)
2026-04-29 21:43:44 +00:00
Celes Renata e976363259 ci: retrigger build 2026-04-29 21:34:34 +00:00
Celes Renata b6e2718007 feat: proper time-based X-axis with angled hour labels and bold dates
Replaced string-based X-axis with numeric timestamp axis:
- Custom ChartXTick component renders hour marks at -35° angle
- New day boundaries shown in bold (e.g., 'Apr 29')
- Hour marks shown as '9:00 AM', '10:00 AM' etc.
- Tooltip shows full date+time on hover
- Direction timeline uses formatted timestamps
- Bottom margin increased to accommodate angled labels
2026-04-29 21:26:11 +00:00
Celes Renata cb3eb230d6 fix: fetch trend history per-window and run aggregation 24/7
Two fixes for missing intraday data:

1. Frontend: lifted selectedWindow state to page level so useTrendHistory
   passes window param to the API. Previously fetched all windows with
   limit=500 which exhausted the limit before reaching recent intraday
   data. Now fetches only the selected window's data.

2. Scheduler: removed market-hours-only restriction from periodic
   aggregation. Runs every 15 minutes 24/7 so intraday data is always
   populated for backtesting regardless of market state.
2026-04-29 21:11:46 +00:00
Celes Renata 963a5c462c feat: syntax-highlight decision trace JSON on order detail page
Add lightweight JSON highlighter for the decision trace panel:
- Keys: cyan
- Strings: green
- Numbers: yellow
- Booleans: purple
- Null: red
- Structural chars: gray

SQL explorer already uses Monaco with SQL highlighting — no changes needed there.
2026-04-29 19:33:24 +00:00
Celes Renata 82892b7a3e feat: multi-distro support in deploy-docker.sh
Step 0 now detects the OS and package manager, supporting:
- Debian/Ubuntu (apt)
- RHEL/Rocky/Fedora/CentOS (dnf/yum)
- Arch Linux (pacman)
- openSUSE (zypper)
- WSL (uses host Windows NVIDIA driver, skips driver install)

Handles Docker CE install, NVIDIA driver, NVIDIA Container Toolkit,
and firewall (firewalld + ufw) across all supported distros.
2026-04-29 18:59:40 +00:00
Celes Renata 6f54fd07fa feat: periodic aggregation every 15 minutes during market hours
The aggregation engine only ran when new documents were ingested,
leaving intraday trend data stale for long periods. Now the scheduler
enqueues all 50 tickers for re-aggregation every ~15 minutes during
US market hours (Mon-Fri, 6:30 AM - 1:30 PM PT). This ensures
continuous intraday trend updates based on existing signals and
market price changes.
2026-04-29 18:27:49 +00:00
Celes Renata 99b7dcee98 fix: widen chart time windows for intraday (24h) and 1d (48h)
Intraday was showing only 12h of data (9 sparse points). Widened to
24h to show a full day of intraday trend history. Also widened 1d
from 24h to 48h for better context.
2026-04-29 18:15:54 +00:00
Celes Renata 4f7358f4e3 feat: show current position on company detail trends tab
Displays an 'Open Position' card above the trend charts when we hold
a position in that ticker. Shows shares, avg entry price, current
price, market value, and unrealized P&L with green/red coloring.
Card is hidden when no position exists for the ticker.
2026-04-29 18:06:37 +00:00
Celes Renata 0665cef7e3 fix: set TZ=America/Los_Angeles in Helm config for all pods
Containers default to UTC. The host is PDT but pods don't inherit
the host timezone. Adding TZ to the ConfigMap ensures all services
log and compute timestamps in Pacific time.
2026-04-29 17:53:38 +00:00
Celes Renata 48eca672a9 docs: add TZ environment variable to Helm and Docker docs
Document the TZ config option in both docker-deployment.md and
helm-reference.md. Default is America/Los_Angeles. Frontend uses
the browser's local timezone for display.
2026-04-29 17:50:59 +00:00
Celes Renata f159b20c87 feat: show document title and link in competitive signals panel
Replace raw UUID with a linked document title in both the collapsed
row (using the empty space on the right) and the expanded detail view.
Uses useDocument hook to fetch the title, falls back to truncated UUID
while loading. Clicking the link navigates to the document detail page.
2026-04-29 17:29:26 +00:00
Celes Renata 97fe2249fe fix: extract competitive_signals array from API response wrapper
The /api/patterns/{ticker}/competitive-signals endpoint returns
{competitive_signals: [...], count: N} but the hook was typed as
returning a raw array. The component called .map() on the object,
causing 'e.map is not a function'. Now extracts the array from the
response wrapper.
2026-04-29 17:20:03 +00:00
Celes Renata 951b733ac3 fix: move cutoffTs declaration before its use in filtered
Variable was used before declaration (temporal dead zone error).
Moved windowHours/hoursBack/cutoffTs above the filtered const that
references cutoffTs.
2026-04-29 17:08:36 +00:00
Celes Renata 531e33b0ce fix: company charts X-axis now adjusts to selected window time range
The trend history chart was showing all historical data regardless of
which window was selected — only filtering by window name but not by
time range. Now filters both trend data and price data to the time
range matching the selected window (e.g., 7d shows last 7 days only,
30d shows last 30 days).
2026-04-29 16:59:23 +00:00
Celes Renata 24c753f6e6 fix: debounce ticker search on Trends page to preserve input focus
The TickerFilter triggered a query on every keystroke, causing re-renders
that stole focus from the input. Now uses a local input state with a
300ms debounce before updating the query, keeping focus on the text box
while typing.
2026-04-29 16:54:19 +00:00
Celes Renata 6880f11c26 fix: add /no_think inline tag to disable Qwen3 thinking mode
chat_template_kwargs isn't being respected by the vLLM deployment.
Qwen3 models support /no_think as an inline suffix in the user message
to disable thinking mode. This is the most reliable method across all
serving backends (vLLM, Ollama, SGLang).
2026-04-29 16:11:44 +00:00
Celes Renata eead4f1381 fix: disable thinking mode on vLLM path with chat_template_kwargs
The thesis rewriter uses vLLM (not Ollama) in production. The previous
fix only added think=False to the Ollama payload. For vLLM's
OpenAI-compatible API with Qwen3 models, thinking mode is disabled via
chat_template_kwargs: {enable_thinking: false} in the request body.
2026-04-29 16:04:04 +00:00
Celes Renata 007189c0a5 fix: handle plain-text thinking blocks and disable think mode
The model outputs 'Thinking Process:' as plain text (not in <think> tags).
Updated _strip_thinking_block to handle both XML tags and plain-text
reasoning patterns. Also:
- Added rule 7 to system prompt: 'Do NOT show your thinking process'
- Set think=False in Ollama payload to disable Qwen3 thinking mode
- Added fallback regex to extract thesis from after thinking blocks
2026-04-29 15:50:49 +00:00
Celes Renata f9ee1532dc fix: strip <think> reasoning blocks from thesis LLM output
Qwen3.5 in thinking mode emits <think>...</think> chain-of-thought
before the actual response. The thesis rewriter was returning the raw
output including the entire reasoning block. Now strips thinking tags
from both Ollama and vLLM response paths.
2026-04-29 15:25:04 +00:00
Celes Renata ac29e62033 docs: update equations.md with probabilistic pipeline formulas
Add sections 1B, 2B, 3B, 4B, 5B, 7B covering all new probabilistic
formulas: sigmoid gate, info gain, adaptive decay, regime multiplier,
source accuracy, Bayesian posterior, entropy direction, weighted
disagreement entropy, multiplicative macro exposure, conditional macro
integration, graph-distance attenuation, EW momentum, and EV gate.
Updated constants summary with all new parameters.
2026-04-29 15:12:47 +00:00
Celes Renata 7eecd71a0d ci: retry build (proxy timeout on previous run) 2026-04-29 12:08:15 +00:00
Celes Renata bb40a3cb8e fix: position sync now reconciles — removes positions broker no longer holds
The sync_positions loop only upserted positions from Alpaca but never
deleted DB rows for positions that were closed/liquidated on the broker
side. After a paper reset, the next sync would not remove the stale
positions because they simply weren't in Alpaca's response anymore.

Now performs full reconciliation: after upserting what Alpaca reports,
deletes any DB positions for the account that Alpaca no longer holds.
2026-04-29 12:02:57 +00:00
Celes Renata 4e010bc048 feat: signal math upgrade — probabilistic, regime-aware scoring pipeline
Implement full probabilistic signal processing pipeline gated behind
probabilistic_scoring_enabled feature flag in risk_configs:

- Bayesian log-likelihood accumulator with Beta posterior and entropy
- Regime detector (trend-following, panic, mean-reversion, uncertainty)
- Source accuracy tracker with per-source historical prediction accuracy
- Sigmoid confidence gate replacing binary gate
- Information gain surprise weighting for rare events
- Adaptive recency decay with event-specific half-lives
- Regime multiplier replacing market context multiplier
- Weighted disagreement entropy for contradiction detection
- Multiplicative macro exposure with conditional integration
- Graph-distance attenuated competitive signal propagation
- Exponentially weighted momentum with volatility scaling
- Expected value recommendation gate

All changes backward-compatible: flag=false preserves exact current behavior.
New outputs stored in existing JSONB columns (no schema changes except
source_accuracy table via migration 034).

Tests: 26 property-based tests (14 correctness properties), 99 unit tests,
1789 total tests passing with zero regressions.
2026-04-29 11:41:48 +00:00
Celes Renata 8c3c1aab43 fix: pipeline stop now halts all workers and flushes queues
Workers (ingestion, parser, extractor, aggregation, recommendation,
broker, lake-publisher) now check the pipeline:enabled Redis flag on
each loop iteration and sleep when disabled.

The toggle endpoint flushes all pipeline queues on disable so queued
jobs don't resume when workers eventually check. Broker/trading queues
are excluded from flush to avoid dropping in-flight orders.
2026-04-29 07:59:35 +00:00
Celes Renata cfcfd655e7 fix: reduce max_tokens to 2048 to fit 8192 context window 2026-04-29 06:18:26 +00:00
Celes Renata aaf8cee927 feat: scale extractor to 8 replicas 2026-04-29 05:54:00 +00:00
Celes Renata f264e924f0 fix: thesis rewriter now routes to vLLM when provider is vllm
- thesis_llm.py: add _call_vllm_thesis() using /v1/chat/completions
- thesis_llm.py: check resolved model_provider and route accordingly
- values.yaml: set OLLAMA_BASE_URL to http://10.1.1.12:2701
2026-04-29 05:42:10 +00:00
Celes Renata a36702e5f3 fix: restore REDIS_PASSWORD and MINIO credentials 2026-04-28 22:02:50 -07:00