Implements docs/read-markets-compliance-changes.md as flag-gated changes (no deletions) so paused features stay in the tree for future re-enable. All four flags default False so a fresh deploy is compliance-safe. - New env flags: PORTFOLIO_AI_ENABLED, PORTFOLIO_SYNC_ENABLED, TICKER_UNIVERSE_AGGREGATE_ENABLED, SUBSCRIPTIONS_ENABLED. - Gates: /api/analyze, /api/portfolio/sync*, /api/stripe/*, /pricing, ticker_universe writes, portfolio_analysis.analyse(). is_paid_active() returns True for any auth'd user when subscriptions are paused. - Prompts (PROMPT_VERSION 10): universal _COMPLIANCE_RIDER prepended to every system prompt; watch list removed; price-target / close-above-below / trigger / forward-state-as-description rules added; SPECULATIVE pivoted to regime-only scenarios; daily + weekly digests tightened. - Reviewer: deterministic regex/lexicon pre-check fail-closed under the Haiku call; portfolio rider gated by PORTFOLIO_AI_ENABLED; base prompt sharpened for forward-state and MAR forward-opinion patterns; ReviewerVerdict audit table; generate_with_review retry helper. - Migration 0026: purge portfolio_sync + ticker_universe; create reviewer_verdicts. - Copy: MAR cite fixed to Art 3(1)(35) + Art 20 + Del Reg 2016/958; portfolio reframed as browser-only viewer in disclaimer / privacy / terms / about / pricing / landing (en + it). TODO(legal) marker for lawyer sign-off on disclaimer. - Tests: 13 lexicon + 6 reviewer compliance regressions; conftest enables all flags so existing 402 tests still cover their code paths. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
35 lines
1.7 KiB
Text
35 lines
1.7 KiB
Text
# Cassandra environment — copy to .env and fill in.
|
|
# .env is mounted read-only into the containers; never commit real secrets.
|
|
|
|
# --- Database (MariaDB) ---
|
|
MARIADB_ROOT_PASSWORD=changeme-root
|
|
MARIADB_DATABASE=cassandra
|
|
MARIADB_USER=cassandra
|
|
MARIADB_PASSWORD=changeme
|
|
|
|
# --- API keys (mirror of the prototype .env) ---
|
|
API_KEY= # Trading 212 API key
|
|
SECRET_KEY= # Trading 212 secret
|
|
FRED_API_KEY= # FRED economic data
|
|
OPENROUTER_API_KEY= # OpenRouter (AI log generation)
|
|
|
|
# --- App ---
|
|
CASSANDRA_TOKEN= # Bearer token required if set; LAN-only no-auth if empty
|
|
CASSANDRA_PORT=8000
|
|
CASSANDRA_BASE_CURRENCY=GBP
|
|
CASSANDRA_ANCHOR_DATE=2026-03-04 # YYYY-MM-DD; used by market_pulse anchor column
|
|
CASSANDRA_MOCK=0 # 1 = serve canned fixtures, skip live APIs
|
|
|
|
# --- AI log ---
|
|
OPENROUTER_MODEL=deepseek/deepseek-v4-flash # cheap & fast; swap to anthropic/claude-sonnet-4.6 or anthropic/claude-opus-4.7 for higher quality
|
|
OPENROUTER_MONTHLY_CAP_USD=20
|
|
CASSANDRA_TONE=INTERMEDIATE # NOVICE | INTERMEDIATE | PRO
|
|
CASSANDRA_ANALYSIS=SPECULATIVE # DRY | SPECULATIVE
|
|
|
|
# --- Compliance feature flags (default false = compliance-safe) ---
|
|
# See docs/read-markets-compliance-changes.md. Code paths stay in the tree;
|
|
# flip a flag to reactivate.
|
|
PORTFOLIO_AI_ENABLED=false # /api/analyze + dashboard AI read + reviewer portfolio rider
|
|
PORTFOLIO_SYNC_ENABLED=false # /api/portfolio/sync* + cloud-sync UI + PortfolioSync writes
|
|
TICKER_UNIVERSE_AGGREGATE_ENABLED=false # ticker_universe buffer/flush/upsert writes (server-learns-nothing)
|
|
SUBSCRIPTIONS_ENABLED=false # Stripe checkout/webhook/portal + /pricing + paid-tier gating
|