{
  "exported_at": "2026-06-28T22:25:14.248970+00:00",
  "tables": {
    "dashboard_notes": [
      {
        "id": 1,
        "page": "v5",
        "category": "engine",
        "title": "ENGINE V5 — STANDARD",
        "content": "Mean-reversion, RSI<35, hard-stop -9%. FERMATO.",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 2,
        "page": "v5",
        "category": "engine",
        "title": "ENGINE V5 — MOMENTUM",
        "content": "Breakout, trailing 3%/2%, hard-stop -7%. Equity flat 4 giorni. FERMATO.",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 3,
        "page": "v5",
        "category": "engine",
        "title": "ENGINE V5 — ORACLE",
        "content": "Claude AI dynamic. FERMATO per costi API (lezione -> AGENT AI v6 rule-based).",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 4,
        "page": "v5",
        "category": "engine",
        "title": "ENGINE V5 — HUNTER",
        "content": "DEX, liquidita'>15K. FERMATO dopo 80 EUR di loss in 2 giorni.",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 5,
        "page": "v5",
        "category": "file",
        "title": "File V5",
        "content": "/home/hydra/hydra_v5/ (1.6 GB con backup). v5.db 1.4 GB (trades, positions, fingerprint). universe.yaml (212 token), universe_test.yaml (425 token).",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 6,
        "page": "v5",
        "category": "v4",
        "title": "DB V4 attivi",
        "content": "/home/hydra/hydra_v4/data/market_data.db (8.5 GB, scritto attivamente). Servizi: hydra-ws-collector, hydra-candle-aggregator, hydra-fingerprint. Da fermare quando DATA SOURCE v6 sara' pronto.",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 7,
        "page": "v5",
        "category": "research",
        "title": "Research apr-giu 2026",
        "content": "23 strategie tecniche: tutte fallite walk-forward. 4 driver candidati: 3 falliti, solo Funding Q90 sopravvissuto (Finding #11).",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 8,
        "page": "v5",
        "category": "migration",
        "title": "Migrato in v6",
        "content": "candles_1m 44.3M, candles_15m 6.5M, candles_1h 1.6M, candles_4h 568K, candles_1d 94K, token_metadata 420; driver_per_asset 21K, driver_global 1074. Storico: 10 major ~197gg, restanti 429 asset ~78gg.",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 9,
        "page": "v5",
        "category": "status",
        "title": "V5 fermato",
        "content": "V5 fermato il 14/06/2026.",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      }
    ],
    "dashboard_decisions": [
      {
        "id": 1,
        "service": "data_source",
        "decision_title": "Sorgenti esterne, nessuna persistenza propria",
        "decision_text": "Binance WS+REST, FRED, DefiLlama, Alternative.me, Coingecko. Il servizio normalizza e inoltra; la persistenza e' delegata a SERVER LOG (PostgreSQL).",
        "rationale": "Separazione netta ingest/storage; evita duplicazione dati.",
        "status": "active",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 2,
        "service": "server_log",
        "decision_title": "PostgreSQL append-only, retention 180gg",
        "decision_text": "DB hydra_v6 append-only come audit trail. 17 tabelle gia' create. Retention 180gg a regime.",
        "rationale": "Tracciabilita' completa e riproducibilita' delle decisioni.",
        "status": "active",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 3,
        "service": "live_scanner",
        "decision_title": "5 detector @1min su 200+ asset",
        "decision_text": "Detector: pump, dump, volume_spike, funding_extreme, liquidity_drop. Frequenza 1 minuto su tutti i 200+ asset. Output in live_events.",
        "rationale": "Copertura ampia e reattiva su eventi di mercato.",
        "status": "active",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 4,
        "service": "server_stat",
        "decision_title": "30 indicatori Tier 1+2+3",
        "decision_text": "RSI, EMA 9/21/50/200, Returns, ATR, Vol, Volume, Momentum, Bollinger, VWAP, Beta, Funding+z21, Funding slope, OI. Timeframes 1h/4h/1d. Skip MACD/Stochastic/Ichimoku/Fibonacci.",
        "rationale": "Indicatori con edge potenziale; esclusi quelli ridondanti/ritardati.",
        "status": "active",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 5,
        "service": "server_analyz",
        "decision_title": "15 moduli, score 0-1, auto-validazione pesi mensile",
        "decision_text": "Cat A Edge (peso 3.0): Funding Q90 Defensive. Cat B Candidati (1.0): Funding x Regime, DXY in Bear, Volatility filtering. Cat C Classici (0.3): Momentum 30d, Mean reversion RSI, Trend EMA. Cat D Contesto: Regime detector, Vol regime, Drawdown. Cat E ML (0.5-1.5): TimesFM, Chronos, HMM, Hurst, LSTM. Freq 1h.",
        "rationale": "Pesi proporzionali alla forza dell'edge; auto-validazione mensile.",
        "status": "active",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 6,
        "service": "server_analyz",
        "decision_title": "Edge validato — Finding #11 (Funding Rate z21 >= Q90)",
        "decision_text": "Funding Rate z21 >= Q90 -> return medio -4.59% a 7 giorni. Walk-forward 10/10 asset robusti. Unico driver sopravvissuto su 4 candidati.",
        "rationale": "Edge statisticamente robusto, base della Cat A peso 3.0.",
        "status": "active",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 7,
        "service": "agent_ai",
        "decision_title": "Pure Rule-Based (no Claude API)",
        "decision_text": "Decisore deterministico rule-based. Execution interno separato. Universe 200+ token v5. Filtri: vol_24h>1M, eta'>30gg, storia>60gg, spread<0.5%, blacklist RNDR/FET.",
        "rationale": "Determinismo e zero costi API ricorrenti (lezione ORACLE v5).",
        "status": "active",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 8,
        "service": "server_quality",
        "decision_title": "Auditor investigativo, nessuna notifica",
        "decision_text": "Health check 5min. Analisi perdite per-trade. Opportunita' giornaliera. Feedback solo via report, NESSUNA notifica push.",
        "rationale": "Strumento di analisi, non di alerting; evita rumore operativo.",
        "status": "active",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 9,
        "service": "emergency",
        "decision_title": "Container Docker isolato, 8 trigger, market sell",
        "decision_text": "Container Docker isolato. 8 trigger: heartbeat 5min, drawdown 20%, daily loss 7%, position max 10%, orders/min, flash crash BTC -5%/10min, exchange error, QUALITY critical. Azione: market sell. Restart manuale.",
        "rationale": "Isolamento per resilienza; kill-switch indipendente dal core.",
        "status": "active",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 10,
        "service": "agent_ai",
        "decision_title": "Regole entry/exit, holding period, position sizing",
        "decision_text": "Da definire: condizioni precise di entry/exit, holding period massimo, logica di position sizing.",
        "rationale": null,
        "status": "pending",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 11,
        "service": "server_quality",
        "decision_title": "Benchmark di confronto",
        "decision_text": "Da definire il benchmark contro cui valutare le performance.",
        "rationale": null,
        "status": "pending",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 12,
        "service": "emergency",
        "decision_title": "Affinamento soglie esatte",
        "decision_text": "Le 8 soglie trigger vanno affinate con dati reali.",
        "rationale": null,
        "status": "pending",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 13,
        "service": "live_scanner",
        "decision_title": "Asset universe filtrato",
        "decision_text": "Definire il sottoinsieme di asset su cui far girare i detector.",
        "rationale": null,
        "status": "pending",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 14,
        "service": "real_money",
        "decision_title": "Real money: capitale Step 1, futures/spot, tax reporting",
        "decision_text": "Da decidere: capitale dello Step 1, se operare futures o spot, gestione tax reporting.",
        "rationale": null,
        "status": "pending",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      }
    ],
    "dashboard_ideas": [
      {
        "id": 1,
        "title": "Collector v6 + dismissione servizi v4",
        "description": "Implementare il collector v6 e poi fermare i servizi v4 (hydra-ws-collector, hydra-candle-aggregator, hydra-fingerprint).",
        "category": "data_source",
        "priority": 2,
        "status": "pending",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 2,
        "title": "Job retention 180gg",
        "description": "Definire e schedulare il job di retention append-only a 180 giorni.",
        "category": "server_log",
        "priority": 3,
        "status": "pending",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 3,
        "title": "Definire asset universe detector",
        "description": "Filtrare lo universe di asset su cui far girare i 5 detector del LIVE SCANNER.",
        "category": "live_scanner",
        "priority": 2,
        "status": "pending",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 4,
        "title": "Implementare i 30 indicatori (Fase 2)",
        "description": "Implementare SERVER STAT: 30 indicatori Tier 1+2+3 su 1h/4h/1d.",
        "category": "server_stat",
        "priority": 1,
        "status": "pending",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 5,
        "title": "Modulo 1 Funding Q90 (Fase 3)",
        "description": "Implementare il primo modulo analyzer (edge Cat A), poi i moduli 2-15 (Fase 4).",
        "category": "server_analyz",
        "priority": 1,
        "status": "pending",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 6,
        "title": "Regole AGENT AI + paper mode (Fase 6)",
        "description": "Definire entry/exit, holding period, position sizing; portare in paper mode.",
        "category": "agent_ai",
        "priority": 2,
        "status": "pending",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 7,
        "title": "Definire benchmark QUALITY",
        "description": "Scegliere il benchmark di confronto per valutare le performance.",
        "category": "server_quality",
        "priority": 3,
        "status": "pending",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 8,
        "title": "Containerizzare EMERGENCY (Fase 7)",
        "description": "Docker isolato + affinamento delle 8 soglie trigger.",
        "category": "emergency",
        "priority": 2,
        "status": "pending",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 9,
        "title": "Tax reporting real money",
        "description": "Predisporre il tax reporting per la fase real money.",
        "category": "backlog",
        "priority": 4,
        "status": "pending",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 10,
        "title": "Decisione futures vs spot",
        "description": "Decidere se lo Step 1 real money opera futures o spot.",
        "category": "backlog",
        "priority": 3,
        "status": "pending",
        "created_at": "2026-06-28T18:10:51.552788+00:00",
        "updated_at": "2026-06-28T18:10:51.552788+00:00"
      },
      {
        "id": 15,
        "title": "auto analisi ",
        "description": "Vorrei creare un sistema faccia automaticamente analisi di mercato, provi arogoritmi predittivi, formule economica, indicatori di mercato, le integri con le news e che proponga dei canditati con queste analisi",
        "category": "backlog",
        "priority": 3,
        "status": "in_progress",
        "created_at": "2026-06-28T19:33:37.900765+00:00",
        "updated_at": "2026-06-28T19:33:55.571070+00:00"
      }
    ],
    "dashboard_roadmap": [
      {
        "phase_num": 0.0,
        "phase_name": "Pulizia ambiente + PostgreSQL",
        "status": "completed",
        "estimated_days": "1g",
        "started_at": "2026-06-25T00:00:00+00:00",
        "completed_at": "2026-06-25T00:00:00+00:00",
        "git_tag": null,
        "description": "Setup ambiente v6 e installazione PostgreSQL."
      },
      {
        "phase_num": 1.0,
        "phase_name": "Schema + migrazione 52.6M righe",
        "status": "completed",
        "estimated_days": "1g",
        "started_at": "2026-06-25T00:00:00+00:00",
        "completed_at": "2026-06-25T00:00:00+00:00",
        "git_tag": "fase-1-migration-v2",
        "description": "Schema completo (17 tabelle) e migrazione dati da SQLite (52.6M righe candele + driver)."
      },
      {
        "phase_num": 1.5,
        "phase_name": "Dashboard documentazione",
        "status": "in_progress",
        "estimated_days": "1g",
        "started_at": "2026-06-28T00:00:00+00:00",
        "completed_at": null,
        "git_tag": null,
        "description": "Dashboard web di documentazione completa su docu.spocci.ch (questa)."
      },
      {
        "phase_num": 2.0,
        "phase_name": "SERVER STAT",
        "status": "pending",
        "estimated_days": "3-4g",
        "started_at": null,
        "completed_at": null,
        "git_tag": null,
        "description": "Implementazione dei 30 indicatori Tier 1+2+3."
      },
      {
        "phase_num": 3.0,
        "phase_name": "ANALYZ Modulo 1 Funding Q90",
        "status": "pending",
        "estimated_days": "2-3g",
        "started_at": null,
        "completed_at": null,
        "git_tag": null,
        "description": "Primo modulo analyzer: edge Funding Q90 Defensive (Cat A)."
      },
      {
        "phase_num": 4.0,
        "phase_name": "ANALYZ moduli 2-15",
        "status": "pending",
        "estimated_days": "5-7g",
        "started_at": null,
        "completed_at": null,
        "git_tag": null,
        "description": "Restanti 14 moduli analyzer (Cat B-E)."
      },
      {
        "phase_num": 5.0,
        "phase_name": "LIVE SCANNER",
        "status": "pending",
        "estimated_days": "2-3g",
        "started_at": null,
        "completed_at": null,
        "git_tag": null,
        "description": "5 detector @1min su 200+ asset."
      },
      {
        "phase_num": 6.0,
        "phase_name": "AGENT AI paper mode",
        "status": "pending",
        "estimated_days": "4-5g",
        "started_at": null,
        "completed_at": null,
        "git_tag": null,
        "description": "Decisore rule-based + execution in paper mode."
      },
      {
        "phase_num": 7.0,
        "phase_name": "EMERGENCY Docker",
        "status": "pending",
        "estimated_days": "3-4g",
        "started_at": null,
        "completed_at": null,
        "git_tag": null,
        "description": "Kill-switch in container Docker isolato, 8 trigger."
      },
      {
        "phase_num": 8.0,
        "phase_name": "SERVER QUALITY",
        "status": "pending",
        "estimated_days": "3-4g",
        "started_at": null,
        "completed_at": null,
        "git_tag": null,
        "description": "Auditor investigativo, analisi perdite, report."
      },
      {
        "phase_num": 9.0,
        "phase_name": "Validazione paper end-to-end",
        "status": "pending",
        "estimated_days": "30g",
        "started_at": null,
        "completed_at": null,
        "git_tag": null,
        "description": "1 mese di paper trading per validazione completa."
      },
      {
        "phase_num": 10.0,
        "phase_name": "Real money 300 EUR/mese",
        "status": "pending",
        "estimated_days": "-",
        "started_at": null,
        "completed_at": null,
        "git_tag": null,
        "description": "Produzione: 300 EUR mensili reali, no leverage, no scaling aggressivo."
      }
    ],
    "dashboard_backups_log": [
      {
        "id": 1,
        "backup_file": "dashboard_backup_20260628_185542.sql",
        "backup_type": "auto",
        "size_bytes": 20136,
        "created_at": "2026-06-28T18:55:42.383464+00:00"
      },
      {
        "id": 2,
        "backup_file": "dashboard_backup_20260628_185610.sql",
        "backup_type": "manual",
        "size_bytes": 20215,
        "created_at": "2026-06-28T18:56:10.548708+00:00"
      }
    ],
    "dashboard_service_logic": [
      {
        "id": 1,
        "service": "data_source",
        "section": "INPUT",
        "content": "Binance WebSocket (kline/trade streams) + REST (klines, funding rate, open interest, long/short ratio). FRED (DXY, tassi). DefiLlama (stablecoin supply, TVL). Alternative.me (Fear & Greed). Coingecko (market cap, metadata token).",
        "ordering": 1,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 2,
        "service": "data_source",
        "section": "LOGIC",
        "content": "WebSocket persistente per i prezzi real-time; poller REST schedulati per i driver. Normalizza payload eterogenei in un formato canonico (symbol, timestamp_ms, value). Nessuna persistenza propria: inoltra i batch a SERVER LOG. Backfill storico via REST quando mancano candele.",
        "ordering": 2,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 3,
        "service": "data_source",
        "section": "OUTPUT",
        "content": "Via SERVER LOG -> candles_1m/15m/1h/4h/1d, driver_per_asset (funding/OI/long_short), driver_global (fear_greed/btc_dominance/stablecoin/macro), token_metadata.",
        "ordering": 3,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 4,
        "service": "data_source",
        "section": "PSEUDOCODE",
        "content": "async for msg in binance_ws.stream(klines_universe):     # real-time\n    queue.put(normalize_kline(msg))\n\nevery 60s:                                               # REST pollers\n    for src in [funding, open_interest, long_short]:\n        for r in fetch(src): queue.put(normalize(r))\nevery 300s:\n    for src in [fear_greed, dxy, stablecoin_supply]:\n        for r in fetch(src): queue.put(normalize(r))\n\nwhile batch := queue.drain(max=500):\n    server_log.upsert(batch)        # delega la persistenza",
        "ordering": 4,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 5,
        "service": "data_source",
        "section": "KEY PARAMETERS",
        "content": "ws_streams: kline_1m sull'universe (~200 simboli). rest_poll: 60s (funding/OI/LS), 300s (macro/F&G). batch_size: 500. universe: 200+ token (universe_test.yaml).",
        "ordering": 5,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 6,
        "service": "data_source",
        "section": "DEPENDENCIES",
        "content": "Nessuna a monte (e' la sorgente). Scrive esclusivamente tramite SERVER LOG.",
        "ordering": 6,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 7,
        "service": "data_source",
        "section": "RESOURCES",
        "content": "CPU bassa (~1 core). RAM ~300-500MB (buffer WS). Storage 0 (delegato a SERVER LOG). Banda di rete continua per gli stream WS.",
        "ordering": 7,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 8,
        "service": "server_log",
        "section": "INPUT",
        "content": "Stream normalizzati da DATA SOURCE (candele, driver, metadata). Heartbeat ed eventi operativi da tutti i servizi v6.",
        "ordering": 1,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 9,
        "service": "server_log",
        "section": "LOGIC",
        "content": "PostgreSQL append-only come audit trail. UPSERT idempotente sulle PK (es. candele su (symbol, open_time)). Batch insert con execute_values/COPY per throughput. Job di retention a 180 giorni.",
        "ordering": 2,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 10,
        "service": "server_log",
        "section": "OUTPUT",
        "content": "Le 17 tabelle hydra_v6 (9 dati: candles_*, driver_*, token_*; + operative: live_events, analyz_signals, decisions, paper_positions, heartbeats, quality_reports, emergency_actions).",
        "ordering": 3,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 11,
        "service": "server_log",
        "section": "PSEUDOCODE",
        "content": "def upsert(batch):\n    for table, rows in partition_by_table(batch).items():\n        execute_values(\n            f\"INSERT INTO {table} (...) VALUES %s \"\n            \"ON CONFLICT (pk) DO UPDATE SET ...\", rows, page_size=1000)\n\ndaily 04:00:                              # retention 180gg\n    for t in candle_tables:\n        DELETE FROM t WHERE open_time < now_ms() - days(180)",
        "ordering": 4,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 12,
        "service": "server_log",
        "section": "KEY PARAMETERS",
        "content": "retention_days: 180. batch page_size: 1000. conflict policy: DO UPDATE (idempotente). append-only (no UPDATE distruttivi sui dati storici).",
        "ordering": 5,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 13,
        "service": "server_log",
        "section": "DEPENDENCIES",
        "content": "DATA SOURCE (produttore principale). Riceve scritture da tutti gli altri servizi (eventi/heartbeat).",
        "ordering": 6,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 14,
        "service": "server_log",
        "section": "RESOURCES",
        "content": "CPU media in burst di insert. RAM ~0.5-1GB (shared_buffers PostgreSQL). Storage grande: ~7GB la sola candles_1m, in crescita, con cap a 180gg.",
        "ordering": 7,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 15,
        "service": "live_scanner",
        "section": "INPUT",
        "content": "candles_1m e candles_15m (da hydra_v6), driver_per_asset (funding, OI).",
        "ordering": 1,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 16,
        "service": "live_scanner",
        "section": "LOGIC",
        "content": "5 detector eseguiti ogni minuto su tutti i 200+ asset: pump (ritorno% breve oltre soglia), dump (ritorno negativo), volume_spike (z-score volume), funding_extreme (funding z21 oltre quantile), liquidity_drop (caduta quote_volume/liquidita').",
        "ordering": 2,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 17,
        "service": "live_scanner",
        "section": "OUTPUT",
        "content": "live_events (event_type, symbol, severity, payload, timestamp_ms).",
        "ordering": 3,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 18,
        "service": "live_scanner",
        "section": "PSEUDOCODE",
        "content": "every 60s:\n    for sym in universe:                       # 200+ asset\n        c = candles_1m.last_n(sym, 60)\n        if ret(c, 5m) >  PUMP_PCT:     emit(\"pump\", sym, sev=\"warning\")\n        if ret(c, 5m) < -DUMP_PCT:     emit(\"dump\", sym, sev=\"warning\")\n        if zscore(c.volume, 60) > VOL_Z: emit(\"volume_spike\", sym)\n        if funding_z21(sym) >= FUND_Q:   emit(\"funding_extreme\", sym)\n        if liquidity_drop(sym) > LIQ_PCT: emit(\"liquidity_drop\", sym)",
        "ordering": 4,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 19,
        "service": "live_scanner",
        "section": "KEY PARAMETERS",
        "content": "freq: 60s. pump/dump: +/- soglia% su 5m (da affinare). volume z-score: ~3.0. funding quantile: Q90. liquidity_drop: % su finestra. universe: 200+ (da filtrare).",
        "ordering": 5,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 20,
        "service": "live_scanner",
        "section": "DEPENDENCIES",
        "content": "DATA SOURCE / SERVER LOG (candele e driver).",
        "ordering": 6,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 21,
        "service": "live_scanner",
        "section": "RESOURCES",
        "content": "CPU media (200 asset x 5 detector al minuto). RAM ~200MB. Storage modesto (solo eventi).",
        "ordering": 7,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 22,
        "service": "server_stat",
        "section": "INPUT",
        "content": "candles_1h, candles_4h, candles_1d. driver_per_asset (funding, OI) per gli indicatori Tier 3.",
        "ordering": 1,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 23,
        "service": "server_stat",
        "section": "LOGIC",
        "content": "Calcola 30 indicatori per asset e timeframe. Tier1: RSI, EMA 9/21/50/200, Returns, ATR. Tier2: Vol, Volume, Momentum, Bollinger, VWAP. Tier3: Beta, Funding+z21, Funding slope, OI. Esclude MACD/Stochastic/Ichimoku/Fibonacci (ridondanti o ritardati).",
        "ordering": 2,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 24,
        "service": "server_stat",
        "section": "OUTPUT",
        "content": "Feature store di indicatori per (symbol, timeframe), consumato da SERVER ANALYZ (payload JSONB).",
        "ordering": 3,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 25,
        "service": "server_stat",
        "section": "PSEUDOCODE",
        "content": "every 1h:\n    for sym in universe:\n        for tf in [1h, 4h, 1d]:\n            c = candles[tf].last_n(sym, 250)\n            feats = {\n              \"rsi14\": rsi(c,14), \"ema\": ema(c,[9,21,50,200]),\n              \"atr14\": atr(c,14), \"ret\": returns(c),\n              \"boll\": bollinger(c,20,2), \"vwap\": vwap(c),\n              \"beta\": beta(c, btc), \"funding_z21\": z(funding(sym),21),\n              \"funding_slope\": slope(funding(sym)), \"oi\": oi(sym),\n            }\n            feature_store.put(sym, tf, feats)",
        "ordering": 4,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 26,
        "service": "server_stat",
        "section": "KEY PARAMETERS",
        "content": "freq: 1h. timeframes: 1h/4h/1d. EMA: 9/21/50/200. RSI: 14. ATR: 14. Bollinger: 20/2. z-window: 21. lookback: 250 candele.",
        "ordering": 5,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 27,
        "service": "server_stat",
        "section": "DEPENDENCIES",
        "content": "SERVER LOG (candele), DATA SOURCE (funding/OI).",
        "ordering": 6,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 28,
        "service": "server_stat",
        "section": "RESOURCES",
        "content": "CPU media-alta ogni ora (200 asset x 3 tf x 30 indicatori). RAM ~500MB (numpy/pandas). Storage feature store modesto.",
        "ordering": 7,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 29,
        "service": "server_analyz",
        "section": "INPUT",
        "content": "Feature store di SERVER STAT, candele, driver_per_asset/global, output dei modelli ML (Cat E).",
        "ordering": 1,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 30,
        "service": "server_analyz",
        "section": "LOGIC",
        "content": "15 moduli (Cat A-E) producono ciascuno uno score 0-1; combinati in uno score aggregato pesato per categoria. Frequenza 1h. Auto-validazione mensile dei pesi via walk-forward.",
        "ordering": 2,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 31,
        "service": "server_analyz",
        "section": "MODULES",
        "content": "| Cat | Modulo | Peso | Logica | Finding |\n| A | Funding Q90 Defensive | 3.0 | Funding z21 >= Q90 -> posizione defensive/short ~7gg | #11: ret medio -4.59% a 7gg, walk-forward 10/10 |\n| B | Funding x Regime | 1.0 | Funding condizionato al regime di mercato | candidato (da validare) |\n| B | DXY in Bear | 1.0 | Forza del DXY come filtro nei regimi bear | candidato (da validare) |\n| B | Volatility filtering | 1.0 | Filtra/scala i segnali per regime di volatilita' | candidato (da validare) |\n| C | Momentum 30d | 0.3 | Momentum classico a 30 giorni | classico, edge debole |\n| C | Mean reversion RSI | 0.3 | RSI < 35 -> reversione attesa | classico, edge debole |\n| C | Trend EMA | 0.3 | Cross / pendenza delle EMA | classico, edge debole |\n| D | Regime detector | contesto | Classifica bull / bear / range | feature di contesto |\n| D | Volatility regime | contesto | Classifica volatilita' alta / bassa | feature di contesto |\n| D | Drawdown current | contesto | Drawdown corrente dell'asset | feature di contesto |\n| E | TimesFM | 0.5-1.5 | Foundation model di forecasting time-series | ML |\n| E | Chronos | 0.5-1.5 | Foundation model di forecasting time-series | ML |\n| E | HMM | 0.5-1.5 | Hidden Markov Model per regime | ML |\n| E | Hurst | 0.5-1.5 | Esponente di Hurst (persistenza/mean-reversion) | ML |\n| E | LSTM | 0.5-1.5 | Rete ricorrente per forecasting | ML |",
        "ordering": 3,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 32,
        "service": "server_analyz",
        "section": "OUTPUT",
        "content": "analyz_signals (symbol, signal_type, direction long/short, score 0-1, payload con i sotto-score).",
        "ordering": 4,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 33,
        "service": "server_analyz",
        "section": "PSEUDOCODE",
        "content": "every 1h:\n    for sym in universe:\n        scores = {m.name: m.evaluate(sym, features[sym]) for m in MODULES}  # 15 moduli\n        agg = sum(scores[m.name]*WEIGHT[m.cat] for m in MODULES) / sum_weights\n        direction = \"short\" if defensive_edge(sym) else \"long\"   # edge Funding Q90\n        analyz_signals.insert(sym, signal_type=top(scores),\n                              direction=direction, score=agg, payload=scores)\n\nmonthly:\n    WEIGHT = walk_forward_revalidate(history)   # auto-validazione pesi",
        "ordering": 5,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 34,
        "service": "server_analyz",
        "section": "KEY PARAMETERS",
        "content": "freq: 1h. pesi: A=3.0, B=1.0, C=0.3, D=contesto, E=0.5-1.5. score: 0-1 continuo. revalidation: mensile (walk-forward).",
        "ordering": 6,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 35,
        "service": "server_analyz",
        "section": "DEPENDENCIES",
        "content": "SERVER STAT (feature), SERVER LOG (candele/driver), modelli ML per la Cat E.",
        "ordering": 7,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 36,
        "service": "server_analyz",
        "section": "RESOURCES",
        "content": "CPU alta (ML: TimesFM/Chronos/LSTM). RAM 2-4GB (modelli in memoria). Storage modelli ~1GB.",
        "ordering": 8,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 37,
        "service": "agent_ai",
        "section": "INPUT",
        "content": "analyz_signals (segnali), paper_positions (stato posizioni), token_metadata (filtri), prezzi correnti.",
        "ordering": 1,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 38,
        "service": "agent_ai",
        "section": "LOGIC",
        "content": "Decisore Pure Rule-Based deterministico (NO Claude API). Filtra l'universe; applica regole di entry/exit sugli score di ANALYZ (da definire); execution interno separato. Genera decisioni e gestisce le posizioni paper.",
        "ordering": 2,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 39,
        "service": "agent_ai",
        "section": "OUTPUT",
        "content": "decisions (action buy/sell/hold/close, confidence, reason, signal_id) e paper_positions (open/close, exit_reason esplicito).",
        "ordering": 3,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 40,
        "service": "agent_ai",
        "section": "PSEUDOCODE",
        "content": "on new analyz_signals:\n    for sig in analyz_signals.fresh():\n        if not passes_filters(sig.symbol): continue   # universe filter\n        if sig.score >= ENTRY_TH and not open(sig.symbol):\n            size = position_size(equity, RISK_PCT)\n            decisions.insert(\"buy\", sig); paper_open(sig.symbol, size)\n\n    for pos in paper_positions.open():\n        if exit_rule(pos):              # TP / SL / holding max / decay score\n            decisions.insert(\"close\", pos, reason=exit_reason(pos))\n            paper_close(pos)",
        "ordering": 4,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 41,
        "service": "agent_ai",
        "section": "KEY PARAMETERS",
        "content": "entry_threshold: DA DEFINIRE. holding_period_max: DA DEFINIRE. position_sizing: DA DEFINIRE (risk per trade). filtri: vol_24h>1M, eta'>30gg, storia>60gg, spread<0.5%. blacklist: RNDR, FET.",
        "ordering": 5,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 42,
        "service": "agent_ai",
        "section": "DEPENDENCIES",
        "content": "SERVER ANALYZ (segnali), SERVER LOG (stato), DATA SOURCE (prezzi).",
        "ordering": 6,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 43,
        "service": "agent_ai",
        "section": "RESOURCES",
        "content": "CPU bassa. RAM ~200MB. Storage modesto (decisioni e posizioni).",
        "ordering": 7,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 44,
        "service": "server_quality",
        "section": "INPUT",
        "content": "paper_positions, decisions, analyz_signals, heartbeats, candele (per benchmark).",
        "ordering": 1,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 45,
        "service": "server_quality",
        "section": "LOGIC",
        "content": "Auditor investigativo. Health check ogni 5 minuti. Analisi perdite per-trade (attribuzione: timing di entry, exit_reason, slippage). Scansione opportunita' giornaliera (cosa si e' perso). Nessuna notifica: solo report.",
        "ordering": 2,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 46,
        "service": "server_quality",
        "section": "OUTPUT",
        "content": "quality_reports (report_type: health/loss_analysis/opportunity, scope, status, details JSONB).",
        "ordering": 3,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 47,
        "service": "server_quality",
        "section": "PSEUDOCODE",
        "content": "every 5min:                              # health\n    h = collect_heartbeats()\n    if stale(h): quality_reports.insert(\"health\", status=\"critical\", details=h)\n\ndaily:\n    for trade in closed_trades(yesterday):\n        attr = attribute_pnl(trade)          # perche' ha perso/guadagnato\n        quality_reports.insert(\"loss_analysis\", scope=trade.id, details=attr)\n    missed = scan_missed_opportunities()\n    quality_reports.insert(\"opportunity\", details=missed)",
        "ordering": 4,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 48,
        "service": "server_quality",
        "section": "KEY PARAMETERS",
        "content": "health_interval: 5min. loss analysis: per-trade giornaliera. benchmark: DA DEFINIRE. notifiche: NESSUNA (solo report).",
        "ordering": 5,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 49,
        "service": "server_quality",
        "section": "DEPENDENCIES",
        "content": "AGENT AI (trade/decisioni), SERVER LOG, SERVER ANALYZ.",
        "ordering": 6,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 50,
        "service": "server_quality",
        "section": "RESOURCES",
        "content": "CPU bassa. RAM ~200MB. Storage report modesto.",
        "ordering": 7,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 51,
        "service": "emergency",
        "section": "INPUT",
        "content": "heartbeats, paper_positions (equity/drawdown), prezzo BTC, stato exchange, quality_reports (critical).",
        "ordering": 1,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 52,
        "service": "emergency",
        "section": "LOGIC",
        "content": "Container Docker isolato, indipendente dal core. Monitora 8 trigger; al primo che scatta esegue market sell di tutte le posizioni. NON si riavvia da solo: restart manuale.",
        "ordering": 2,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 53,
        "service": "emergency",
        "section": "OUTPUT",
        "content": "emergency_actions (action_type, reason, triggered_by, details JSONB).",
        "ordering": 3,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 54,
        "service": "emergency",
        "section": "PSEUDOCODE",
        "content": "loop:                                  # container isolato\n    if now - last_heartbeat > 5min:    trip(\"heartbeat\")\n    if drawdown()       >= 0.20:       trip(\"drawdown_20\")\n    if daily_loss()     >= 0.07:       trip(\"daily_loss_7\")\n    if max_position_pct() >= 0.10:     trip(\"position_10\")\n    if orders_per_min() >  LIMIT:      trip(\"order_rate\")\n    if btc_move_10min() <= -0.05:      trip(\"flash_crash_btc\")\n    if exchange_error():               trip(\"exchange_error\")\n    if quality_critical():             trip(\"quality_critical\")\n\ndef trip(reason):\n    market_sell_all(); emergency_actions.insert(reason); halt()  # restart MANUALE",
        "ordering": 4,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 55,
        "service": "emergency",
        "section": "KEY PARAMETERS",
        "content": "heartbeat_timeout: 5min. drawdown_max: 20%. daily_loss_max: 7%. position_max: 10%. flash_crash_btc: -5% in 10min. order rate limit. restart: MANUALE.",
        "ordering": 5,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 56,
        "service": "emergency",
        "section": "DEPENDENCIES",
        "content": "SERVER LOG (stato), SERVER QUALITY (segnale critical), AGENT AI (posizioni da liquidare).",
        "ordering": 6,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      },
      {
        "id": 57,
        "service": "emergency",
        "section": "RESOURCES",
        "content": "CPU minima. RAM ~128MB (container isolato). Storage minimo.",
        "ordering": 7,
        "created_at": "2026-06-28T19:16:12.692604+00:00",
        "updated_at": "2026-06-28T19:16:12.692604+00:00"
      }
    ],
    "dashboard_table_metadata": [
      {
        "table_name": "analyz_signals",
        "written_by": "SERVER ANALYZ",
        "read_by": "AGENT AI, SERVER QUALITY",
        "data_flow_in": "15 moduli (Cat A-E) su feature SERVER STAT",
        "data_flow_out": "Decisioni di trading (AGENT AI)",
        "notes": "Score 0-1 continuo per simbolo.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "candles_15m",
        "written_by": "DATA SOURCE / aggregazione (via SERVER LOG)",
        "read_by": "LIVE SCANNER, SERVER STAT",
        "data_flow_in": "Aggregazione da candles_1m",
        "data_flow_out": "Detector LIVE SCANNER, feature SERVER STAT",
        "notes": "Timeframe derivato.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "candles_1d",
        "written_by": "DATA SOURCE / aggregazione (via SERVER LOG)",
        "read_by": "SERVER STAT, SERVER ANALYZ",
        "data_flow_in": "Aggregazione da candles_1m",
        "data_flow_out": "Indicatori daily, beta, regime",
        "notes": "Timeframe derivato.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "candles_1h",
        "written_by": "DATA SOURCE / aggregazione (via SERVER LOG)",
        "read_by": "SERVER STAT, SERVER ANALYZ",
        "data_flow_in": "Aggregazione da candles_1m",
        "data_flow_out": "Indicatori Tier 1-3 (SERVER STAT)",
        "notes": "Timeframe principale per gli indicatori.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "candles_1m",
        "written_by": "DATA SOURCE (via SERVER LOG)",
        "read_by": "LIVE SCANNER, SERVER STAT, SERVER ANALYZ, SERVER QUALITY",
        "data_flow_in": "Binance WS (kline_1m) -> normalizzazione -> SERVER LOG",
        "data_flow_out": "Aggregata in 15m/1h/4h/1d; alimenta detector e indicatori",
        "notes": "OHLCV base 1 minuto, append-only.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "candles_4h",
        "written_by": "DATA SOURCE / aggregazione (via SERVER LOG)",
        "read_by": "SERVER STAT, SERVER ANALYZ",
        "data_flow_in": "Aggregazione da candles_1m",
        "data_flow_out": "Indicatori multi-timeframe",
        "notes": "Timeframe derivato.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "dashboard_backups_log",
        "written_by": "Backup (auto/manuale)",
        "read_by": "Dashboard (/backup)",
        "data_flow_in": "dashboard_backup.sh / API backup",
        "data_flow_out": "Elenco backup disponibili",
        "notes": "Registro dei backup.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "dashboard_decisions",
        "written_by": "Dashboard web (utente)",
        "read_by": "Dashboard (/servizi, /roadmap)",
        "data_flow_in": "Form web",
        "data_flow_out": "Pagine servizi e decisioni pendenti",
        "notes": "Decisioni di design, backuppate.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "dashboard_ideas",
        "written_by": "Dashboard web (utente)",
        "read_by": "Dashboard (/servizi, /roadmap)",
        "data_flow_in": "Form web",
        "data_flow_out": "Backlog e task per servizio",
        "notes": "Idee/task, backuppate.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "dashboard_notes",
        "written_by": "Dashboard web (utente)",
        "read_by": "Dashboard (/v5 e altre pagine)",
        "data_flow_in": "Form web",
        "data_flow_out": "Rendering note",
        "notes": "Contenuto editoriale, backuppato.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "dashboard_roadmap",
        "written_by": "Dashboard web (utente)",
        "read_by": "Dashboard (/home, /roadmap)",
        "data_flow_in": "Form web + seed iniziale",
        "data_flow_out": "Timeline fasi, % completamento",
        "notes": "Stato fasi 0-10, backuppato.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "dashboard_service_logic",
        "written_by": "Seed (Task 1)",
        "read_by": "Dashboard (/servizi)",
        "data_flow_in": "scripts/05_service_logic_seed.py",
        "data_flow_out": "Sezione LOGICA per servizio",
        "notes": "Doc tecnica per servizio.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "dashboard_table_metadata",
        "written_by": "Seed (Task 2)",
        "read_by": "Dashboard (/sistema)",
        "data_flow_in": "scripts/06_table_metadata_seed.py",
        "data_flow_out": "Data flow per tabella su /sistema",
        "notes": "Questa tabella.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "decisions",
        "written_by": "AGENT AI",
        "read_by": "SERVER QUALITY, EMERGENCY",
        "data_flow_in": "Regole su analyz_signals + filtri",
        "data_flow_out": "Esecuzione paper, audit qualita'",
        "notes": "Output del decisore rule-based.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "driver_global",
        "written_by": "DATA SOURCE (via SERVER LOG)",
        "read_by": "SERVER ANALYZ",
        "data_flow_in": "Alternative.me (F&G), FRED (DXY/macro), DefiLlama (stablecoin)",
        "data_flow_out": "Moduli di contesto/regime (Cat D)",
        "notes": "Driver di mercato globali.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "driver_per_asset",
        "written_by": "DATA SOURCE (via SERVER LOG)",
        "read_by": "LIVE SCANNER, SERVER STAT, SERVER ANALYZ",
        "data_flow_in": "Binance REST (funding, OI, long/short)",
        "data_flow_out": "Edge Funding Q90, detector funding_extreme",
        "notes": "Driver per simbolo (10 major piu' densi).",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "emergency_actions",
        "written_by": "EMERGENCY",
        "read_by": "SERVER QUALITY, operatore",
        "data_flow_in": "Scatto di uno degli 8 trigger",
        "data_flow_out": "Market sell + halt; audit post-mortem",
        "notes": "Kill-switch, restart manuale.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "heartbeats",
        "written_by": "TUTTI i servizi v6",
        "read_by": "SERVER QUALITY, EMERGENCY",
        "data_flow_in": "Ping periodico di ogni componente",
        "data_flow_out": "Health check 5min, trigger heartbeat EMERGENCY",
        "notes": "Liveness dei componenti.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "live_events",
        "written_by": "LIVE SCANNER",
        "read_by": "SERVER ANALYZ, SERVER QUALITY, AGENT AI",
        "data_flow_in": "5 detector @1min su candele/driver",
        "data_flow_out": "Contesto per ANALYZ, audit eventi",
        "notes": "Eventi grezzi del mercato.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "paper_positions",
        "written_by": "AGENT AI",
        "read_by": "SERVER QUALITY, EMERGENCY",
        "data_flow_in": "Apertura/chiusura da decisions",
        "data_flow_out": "Analisi perdite (QUALITY), liquidazione (EMERGENCY)",
        "notes": "exit_reason esplicito (no mislabel manual_sell).",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "quality_reports",
        "written_by": "SERVER QUALITY",
        "read_by": "EMERGENCY (critical), operatore",
        "data_flow_in": "Audit su trade/decisioni/heartbeat",
        "data_flow_out": "Trigger quality_critical di EMERGENCY",
        "notes": "Report investigativi, nessuna notifica.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "schema_info",
        "written_by": "Migrazioni / DDL",
        "read_by": "Operatore / dashboard",
        "data_flow_in": "Script di migrazione (scripts/)",
        "data_flow_out": "Versioning schema",
        "notes": "Tracking versioni schema.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "token_fingerprint_history",
        "written_by": "DATA SOURCE / fingerprint (legacy v4/v5)",
        "read_by": "SERVER QUALITY, AGENT AI",
        "data_flow_in": "Snapshot periodici volume/mcap/liquidita'",
        "data_flow_out": "Filtri liquidita' e analisi qualita'",
        "notes": "Storico fingerprint per simbolo.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      },
      {
        "table_name": "token_metadata",
        "written_by": "DATA SOURCE",
        "read_by": "AGENT AI (filtri universe), LIVE SCANNER",
        "data_flow_in": "Coingecko / listing Binance",
        "data_flow_out": "Filtri AGENT AI (vol/eta'/spread/blacklist)",
        "notes": "Un record per simbolo.",
        "updated_at": "2026-06-28T19:18:41.125950+00:00"
      }
    ],
    "dashboard_events": [
      {
        "id": 1,
        "event_date": "2026-06-25",
        "event_type": "fase",
        "title": "Fase 0 completata — Pulizia ambiente + PostgreSQL",
        "description": "Setup ambiente v6 e installazione PostgreSQL.",
        "related_service": null,
        "related_phase": "0",
        "metadata": null,
        "created_at": "2026-06-28T19:21:34.249287+00:00"
      },
      {
        "id": 2,
        "event_date": "2026-06-25",
        "event_type": "fase",
        "title": "Fase 1 — Schema completo DB (16+ tabelle + indici)",
        "description": "Creazione schema hydra_v6 (commit cb7c4b0, tag fase-1-schema).",
        "related_service": "server_log",
        "related_phase": "1",
        "metadata": null,
        "created_at": "2026-06-28T19:21:34.249287+00:00"
      },
      {
        "id": 3,
        "event_date": "2026-06-25",
        "event_type": "fase",
        "title": "Fase 1 — Migrazione dati completata",
        "description": "Migrazione 52.6M righe da SQLite a PostgreSQL (commit c0164fd, tag fase-1-migration).",
        "related_service": "server_log",
        "related_phase": "1",
        "metadata": null,
        "created_at": "2026-06-28T19:21:34.249287+00:00"
      },
      {
        "id": 4,
        "event_date": "2026-06-25",
        "event_type": "fase",
        "title": "Fase 1 — Aggiunta candles_4h",
        "description": "Tabella candles_4h aggiunta in fase-1-migration-v2 (commit fd00c90).",
        "related_service": "server_log",
        "related_phase": "1",
        "metadata": null,
        "created_at": "2026-06-28T19:21:34.249287+00:00"
      },
      {
        "id": 5,
        "event_date": "2026-06-28",
        "event_type": "fase",
        "title": "Fase 1.5 — Dashboard documentazione live",
        "description": "Dashboard FastAPI su https://docu.spocci.ch (tag fase-1.5-dashboard-complete).",
        "related_service": null,
        "related_phase": "1.5",
        "metadata": null,
        "created_at": "2026-06-28T19:21:34.249287+00:00"
      },
      {
        "id": 6,
        "event_date": "2026-06-28",
        "event_type": "fase",
        "title": "Fix timeout pagina /sistema",
        "description": "Stime reltuples, timeout 2s per query, asyncio.gather, cache 5min (tag fase-1.5-dashboard-fix1).",
        "related_service": null,
        "related_phase": "1.5",
        "metadata": null,
        "created_at": "2026-06-28T19:21:34.249287+00:00"
      },
      {
        "id": 7,
        "event_date": "2026-06-28",
        "event_type": "decisione",
        "title": "Reverse proxy: nginx + certbot (non Caddy)",
        "description": "Caddy in stato failed (nginx occupa 80/443). Scelto nginx+certbot per docu.spocci.ch.",
        "related_service": null,
        "related_phase": "1.5",
        "metadata": null,
        "created_at": "2026-06-28T19:21:34.249287+00:00"
      },
      {
        "id": 8,
        "event_date": "2026-06-28",
        "event_type": "fase",
        "title": "Fase 1.5 — Arricchimento dashboard (LOGICA, data flow, cronologia/audit)",
        "description": "Task 1 logica servizi, Task 2 sample row + data flow, Task 3 cronologia + audit.",
        "related_service": null,
        "related_phase": "1.5",
        "metadata": null,
        "created_at": "2026-06-28T19:21:34.249287+00:00"
      }
    ],
    "dashboard_audit_log": [
      {
        "id": 1,
        "table_name": "dashboard_ideas",
        "action": "INSERT",
        "record_id": "15",
        "old_data": null,
        "new_data": {
          "id": 15,
          "title": "auto analisi ",
          "status": "pending",
          "category": "backlog",
          "priority": 3,
          "created_at": "2026-06-28T19:33:37.900765+00:00",
          "updated_at": "2026-06-28T19:33:37.900765+00:00",
          "description": "Vorrei creare un sistema faccia automaticamente analisi di mercato, provi arogoritmi predittivi, formule economica, indicatori di mercato, le integri con le news e che proponga dei canditati con queste analisi"
        },
        "changed_at": "2026-06-28T19:33:37.900765+00:00"
      },
      {
        "id": 2,
        "table_name": "dashboard_ideas",
        "action": "UPDATE",
        "record_id": "15",
        "old_data": {
          "id": 15,
          "title": "auto analisi ",
          "status": "pending",
          "category": "backlog",
          "priority": 3,
          "created_at": "2026-06-28T19:33:37.900765+00:00",
          "updated_at": "2026-06-28T19:33:37.900765+00:00",
          "description": "Vorrei creare un sistema faccia automaticamente analisi di mercato, provi arogoritmi predittivi, formule economica, indicatori di mercato, le integri con le news e che proponga dei canditati con queste analisi"
        },
        "new_data": {
          "id": 15,
          "title": "auto analisi ",
          "status": "in_progress",
          "category": "backlog",
          "priority": 3,
          "created_at": "2026-06-28T19:33:37.900765+00:00",
          "updated_at": "2026-06-28T19:33:55.57107+00:00",
          "description": "Vorrei creare un sistema faccia automaticamente analisi di mercato, provi arogoritmi predittivi, formule economica, indicatori di mercato, le integri con le news e che proponga dei canditati con queste analisi"
        },
        "changed_at": "2026-06-28T19:33:55.571070+00:00"
      }
    ]
  }
}