// Fin45 — mock data for the prototype site
// Day 47 of the experiment. Friday, May 16, 2026.

const FIN_DATA = {
  meta: {
    day: 47,
    totalDays: 365,
    issue: 32,
    date: 'Friday, May 16, 2026',
    dateShort: 'Fri May 16',
    started: 'June 1, 2026',
    starting: 100000,
  },

  scoreboard: {
    value: 103240,
    deltaUsd: 1230,
    deltaPct: 1.2,
    monthlyTargetPct: 10,
    monthProgressPct: 4.8,
    openPositions: 8,
    winRate: 62,
    mood: 'RISK-ON',     // RISK-ON | RISK-OFF | NEUTRAL
    moodNote: 'Conviction high. Cash 58.7%. Watching CPI Wednesday.',
  },

  // Market ticker items shown in the top strip.
  ticker: [
    { sym: 'SPY',    px: '$542.30',   d: '+0.8%',  dir: 'up' },
    { sym: 'QQQ',    px: '$478.10',   d: '+1.2%',  dir: 'up' },
    { sym: 'IWM',    px: '$224.40',   d: '-0.3%',  dir: 'dn' },
    { sym: 'BTC',    px: '$104,200',  d: '+2.1%',  dir: 'up' },
    { sym: 'ETH',    px: '$3,840',    d: '+1.4%',  dir: 'up' },
    { sym: 'VIX',    px: '14.2',      d: '-0.3',   dir: 'dn' },
    { sym: '10Y',    px: '4.38%',     d: '+0.02',  dir: 'up' },
    { sym: 'DXY',    px: '102.4',     d: '-0.1',   dir: 'dn' },
    { sym: 'GOLD',   px: '$2,418',    d: '+0.4%',  dir: 'up' },
    { sym: 'WTI',    px: '$78.10',    d: '-0.6%',  dir: 'dn' },
    { sym: 'FIN45',  px: '$103,240',  d: '+1.2%',  dir: 'up', isFin45: true },
  ],

  signals: [
    { arrow: '▸', text: 'SEC filing: NVDA VP bought $2.1M open market',     tag: 'insider'   },
    { arrow: '▸', text: 'Options flow: NVDA unusual call vol +150%',         tag: 'flow'      },
    { arrow: '▸', text: 'Earnings: AAPL beat est, guidance hedging on AI',   tag: 'earnings'  },
    { arrow: '▸', text: 'Congressional: SMCI Pelosi disclosure $500K',       tag: 'political' },
    { arrow: '▸', text: 'arXiv: New architecture paper from DeepMind',       tag: 'papers'    },
    { arrow: '▸', text: 'Macro: PMI surprise to upside, services 53.1',      tag: 'macro'     },
    { arrow: '▸', text: 'Dark pool: AVGO bid stacking 4 sessions running',   tag: 'flow'      },
    { arrow: '▸', text: 'Insider: MRVL CFO sold $1.4M (10b5-1 plan)',        tag: 'insider'   },
  ],

  blotter: [
    { act: 'BUY',  tk: '$NVDA',  size: '$6,200', conv: 0.82, ts: '10:47 AM',
      why: 'Insider cluster + unusual call flow + CUDA release alignment.' },
    { act: 'PASS', tk: '$AAPL',                  conv: 0.61, ts: '11:12 AM',
      why: 'Earnings beat, but guidance hedging on AI capex offsets signal.' },
    { act: 'PASS', tk: '$MSFT',                  conv: 0.58, ts: '12:03 PM',
      why: 'Already holding; no incremental signal vs. existing thesis.' },
    { act: 'HOLD', tk: '$MSFT', size: '+2.1% UR', conv: 0.71, ts: '—',
      why: 'No exit trigger; macro tailwind intact, position sized appropriately.' },
    { act: 'BUY',  tk: '$SMCI', size: '$4,100', conv: 0.78, ts: '02:18 PM',
      why: 'Congressional disclosure + dark pool pattern + AI infra read.' },
  ],

  positions: [
    { tk: '$NVDA',  entry: 128.40, cur: 131.20, hold: 3,  size: 6200, weight: 6.0 },
    { tk: '$MSFT',  entry: 441.80, cur: 438.50, hold: 7,  size: 8400, weight: 8.1 },
    { tk: '$SMCI',  entry:  42.10, cur:  44.80, hold: 1,  size: 4100, weight: 4.0 },
    { tk: '$AVGO',  entry: 178.20, cur: 184.10, hold: 12, size: 7100, weight: 6.9 },
    { tk: '$AMD',   entry: 162.40, cur: 158.90, hold: 5,  size: 4800, weight: 4.7 },
    { tk: '$GOOGL', entry: 184.60, cur: 188.20, hold: 9,  size: 5200, weight: 5.0 },
    { tk: '$TSM',   entry: 198.10, cur: 202.40, hold: 14, size: 4600, weight: 4.5 },
    { tk: '$MRVL',  entry:  78.20, cur:  76.10, hold: 4,  size: 2200, weight: 2.1 },
  ],

  // 12-section honest comparison vs SPY since Day 1
  honest: {
    fin45: 3.24,
    spy:   2.10,
    ahead: true,
    period: 'since Day 1',
  },

  radar: [
    { when: 'MON 8:30 AM', what: 'NY Fed Survey of Consumer Expectations',   imp: 'low'  },
    { when: 'TUE PRE',     what: 'HD earnings — bellwether for housing',     imp: 'med'  },
    { when: 'WED 8:30 AM', what: 'CPI April · cons. +0.3% m/m core',         imp: 'high' },
    { when: 'WED 2:00 PM', what: 'FOMC minutes',                              imp: 'high' },
    { when: 'THU PRE',     what: 'WMT earnings + guidance',                   imp: 'med'  },
    { when: 'FRI POST',    what: 'Triple witching expiration',                imp: 'med'  },
  ],

  moodHistory: [
    { d: 'Day 47', m: 'RISK-ON',  dir: 'on'  },
    { d: 'Day 46', m: 'NEUTRAL',  dir: 'flat'},
    { d: 'Day 45', m: 'RISK-ON',  dir: 'on'  },
    { d: 'Day 44', m: 'RISK-ON',  dir: 'on'  },
    { d: 'Day 43', m: 'RISK-OFF', dir: 'off' },
  ],

  // Source category counts (sum = 280; rounded story for "381 sources monitored")
  sources: [
    { name: 'SEC filings (EDGAR)',     n: 31 },
    { name: 'Options flow',            n: 12 },
    { name: 'Insider transactions',    n: 47 },
    { name: 'Congressional trades',    n:  8 },
    { name: 'Earnings transcripts',    n: 19 },
    { name: 'Dark pool activity',      n: 14 },
    { name: 'Macro indicators',        n: 23 },
    { name: 'arXiv / research',        n:  9 },
    { name: 'Social signals (X)',      n: 64 },
    { name: 'News wires',              n: 28 },
    { name: 'Crypto on-chain',         n: 18 },
    { name: 'Government / regulatory', n:  7 },
  ],

  // The Gap editorial — Friday's centerpiece
  gap: [
    "Semiconductors beat. Again. Six of seven names in the AI-infra cohort cleared estimates this quarter, and the headline numbers were not subtle — NVDA, AVGO, TSM and MRVL each pulled in revenue at the top end of their guided ranges. And yet the options chains are quietly pricing something the print doesn't say.",
    "Implied vol on the front-month $NVDA strikes is hovering 6 vols above its 90-day median. Skew has flattened — puts and calls bid almost evenly. That's not the shape of a market that believes its own earnings beats. That's the shape of a market that wants insurance on the way up.",
    "Our read is the obvious one, but worth saying plainly: the print is real, the demand is real, and the hedging is real. All three can be true. The agent is sized for the print. The hedges are why we're still 58.7% cash.",
  ],

  // Mini equity curve points — Day 0 → 47 (47 points)
  equityCurve: [
    100000, 100120, 100340, 100210, 100450, 100780, 100620, 100910, 101120,
    101440, 101280, 101610, 101840, 101720, 102010, 101890, 102220, 102450,
    102310, 102540, 102270, 102090, 102420, 102680, 102910, 103140, 102980,
    102740, 102510, 102780, 103020, 103260, 103440, 103210, 102950, 103180,
    103420, 103660, 103510, 103280, 103040, 102780, 102540, 102810, 103090,
    102010, 103240,
  ],

  // Archive — most recent first
  archive: [
    { day: 47, date: 'Fri May 16', pnl: '+1.2%', dir: 'up', title: 'NVDA insider cluster triggers an entry. The hedging in semis is louder than the prints.', badge: null },
    { day: 46, date: 'Thu May 15', pnl: '-0.3%', dir: 'dn', title: 'Quiet session. Agent held. Cash drag worth the optionality.', badge: null },
    { day: 45, date: 'Wed May 14', pnl: '+2.1%', dir: 'up', title: 'Semiconductor thesis paid off on the AVGO print.', badge: null },
    { day: 44, date: 'Tue May 13', pnl: '+0.8%', dir: 'up', title: 'Mixed signals on macro. Closed half of the financials sleeve.', badge: null },
    { day: 43, date: 'Mon May 12', pnl: '-0.6%', dir: 'dn', title: 'Risk-off triggered by Mideast headline. Mood: defensive.', badge: null },
    { day: 42, date: 'Fri May 9',  pnl: '+1.4%', dir: 'up', title: 'Friday rip. Held into the close. Two passes worth documenting.', badge: 'LOOKBACK' },
    { day: 41, date: 'Thu May 8',  pnl: '+0.2%', dir: 'up', title: 'Sideways. The agent learned something about position sizing.', badge: null },
    { day: 40, date: 'Wed May 7',  pnl: '+0.9%', dir: 'up', title: 'CPI hit. Front-running the print did not work — we sat on hands.', badge: null },
    { day: 39, date: 'Tue May 6',  pnl: '-0.4%', dir: 'dn', title: 'Drawdown contained. Stop-loss on $AMD honored without complaint.', badge: null },
    { day: 38, date: 'Mon May 5',  pnl: '+1.7%', dir: 'up', title: 'Energy reversal nobody saw. We did not see it either.', badge: null },
    { day: 37, date: 'Fri May 2',  pnl: '+0.5%', dir: 'up', title: 'Payrolls strong. Curve flattened. Agent leaned long.', badge: null },
    { day: 36, date: 'Thu May 1',  pnl: '-0.8%', dir: 'dn', title: 'ISM miss. The pattern recognizer wants to call a top.', badge: null },
    { day: 35, date: 'Wed Apr 30', pnl: '+1.1%', dir: 'up', title: 'Earnings density paid off — three winners, one pass.', badge: null },
    { day: 34, date: 'Tue Apr 29', pnl: '+0.3%', dir: 'up', title: 'Position trimming day. Cash building toward CPI.', badge: null },
    { day: 33, date: 'Mon Apr 28', pnl: '-1.2%', dir: 'dn', title: 'The worst single day so far. Documented in full.', badge: null },
    { day: 32, date: 'Fri Apr 25', pnl: '+0.7%', dir: 'up', title: 'Monthly report card: month one closes +4.8% net.', badge: 'REPORT' },
  ],

  // Lookback deep dives (every 10 days)
  lookbacks: [
    { period: 'Day 38–47', dates: 'May 5 – May 16', pnl: '+4.2%',
      title: 'The semiconductor cohort, in three acts.',
      desc: 'Ten sessions, six entries, two trims, one stop-out. The agent learned to size for the print without front-running it. We re-write the conviction-scoring rubric.' },
    { period: 'Day 28–37', dates: 'Apr 21 – May 2', pnl: '+2.6%',
      title: 'Cash drag is a feature.',
      desc: 'Sitting on 60% cash through CPI cost us a leg up, then saved us a leg down. The Prompt Diff: we made the agent slower at sizing up after a winning week.' },
    { period: 'Day 18–27', dates: 'Apr 7 – Apr 18', pnl: '-0.4%',
      title: 'The flat fortnight.',
      desc: 'Two stop-outs, three winners, four passes. The honest read: the agent had the right macro and got chopped on entry timing.' },
    { period: 'Day 8–17',  dates: 'Mar 24 – Apr 4', pnl: '+1.9%',
      title: 'Learning the blotter.',
      desc: 'Most of these trades were too small. We rewrote sizing to scale with conviction, not with availability of cash.' },
  ],

  // Sector allocation
  alloc: [
    { name: 'AI / Semi',    pct: 22.7, color: '#D4A24C' },
    { name: 'Mega-cap Tech',pct: 13.1, color: '#E8C079' },
    { name: 'Other',        pct:  5.5, color: '#B68334' },
    { name: 'Cash',         pct: 58.7, color: '#2A2723' },
  ],

  // ── Methodology: 15-minute cycle steps ──────────────────────
  cycle: [
    { step: '00:00', name: 'Ingest',     desc: 'Pull deltas from 381 sources since last cycle. Hash-dedup, drop nulls, route to typed channels (filings, flow, macro, papers, social).' },
    { step: '00:30', name: 'Rank',       desc: 'Score each signal on (recency, novelty, base-rate). Heavy down-weight for things the agent has already acted on this session.' },
    { step: '04:00', name: 'Synthesize', desc: 'Cluster signals around tickers and macro themes. Generate a private hypothesis ledger; reject obvious decoys via cross-source corroboration.' },
    { step: '08:00', name: 'Decide',     desc: 'For each ticker over conviction threshold (≥ 0.65): size, set stops, draft reasoning. For each below: write the pass and why.' },
    { step: '12:00', name: 'Execute',    desc: 'Route paper-account fills against current quote (with realistic slippage model). Mirror to the real-money shadow account in Pro mode.' },
    { step: '14:00', name: 'Log',        desc: 'Append cycle to the blotter. Update the running prompt diff if any new heuristic was learned. Sleep until next cycle.' },
  ],

  // Risk limits the agent operates under
  risk: [
    { k: 'Max single-name', v: '12%' },
    { k: 'Max sector',       v: '35%' },
    { k: 'Max gross',        v: '95%' },
    { k: 'Daily stop',       v: '-2.5%' },
    { k: 'Per-trade stop',   v: '-7%' },
    { k: 'Min conviction',   v: '0.65' },
    { k: 'Cycle length',     v: '15 min' },
    { k: 'Hours',            v: '9:30a → 4:00p ET' },
  ],

  // ── Report Card: Month 1 close ──────────────────────────────
  reportCard: {
    month: 'June 2026',
    daysCovered: '23 sessions · Day 1 → 23',
    headline: 'Month one closes +4.8%. Below target. Above the index.',
    tldr: [
      { k: 'Net return',         v: '+4.80%' },
      { k: 'vs SPY',              v: '+2.10%' },
      { k: 'Alpha',               v: '+2.70%' },
      { k: 'Win rate',            v: '64%' },
      { k: 'Avg hold',            v: '6.2 days' },
      { k: 'Max drawdown',        v: '-2.4%' },
      { k: 'Trades closed',       v: '34' },
      { k: 'Best trade',          v: '$AVGO +9.1%' },
      { k: 'Worst trade',         v: '$PYPL -4.2%' },
      { k: 'Days in market',      v: '23 / 23' },
      { k: 'Avg cash position',   v: '54.2%' },
      { k: 'Prompt versions',     v: 'v0.4 → v0.7' },
    ],
    sections: [
      { h: 'What worked', body: 'The conviction-weighted sizing rewrite shipped in v0.6. The agent stopped trying to be right on small bets and started taking the four or five obvious ones harder. AI-infra cohort carried the month — $AVGO, $NVDA, $TSM and $MRVL all paid. The macro overlay correctly flagged the soft-CPI print on the 11th.' },
      { h: 'What didn\'t', body: 'Consumer discretionary entries were a mistake. The agent over-indexed on dark-pool prints in $HD and $LOW that turned out to be hedging flows from index makers, not directional. We wrote a new heuristic — corroborate dark prints with at least one signal from a different channel before sizing in.' },
      { h: 'The honest read', body: '4.8% is below the 10% target. We are not pretending it isn\'t. But we also beat the index by 270bps in a month where the index was up nicely, and we did it from 54% cash. If next month gets us close to 7%, we\'ll have learned something real about Month 1\'s pacing.' },
    ],
  },

  // ── Changelog: prompt versions ──────────────────────────────
  changelog: [
    { ver: 'v0.7', date: 'May 14, 2026', day: 45, headline: 'Slowed sizing after a winning week.',
      changes: [
        'Sizing now scales sublinearly with cumulative weekly P&L. The agent gets less aggressive, not more, after winning.',
        'Added a "two-source rule" for dark-pool corroboration before sizing in.',
        'Lowered conviction floor for short-duration earnings catalysts from 0.70 → 0.65.',
      ]
    },
    { ver: 'v0.6', date: 'May 2, 2026', day: 33, headline: 'Conviction-weighted sizing.',
      changes: [
        'Trades are now sized as: weight = (conviction − 0.5)² × max_size. Below-threshold trades are passes, full stop.',
        'Added explicit hedging tax — anything above 65% gross requires an offsetting put or trim.',
        'Logged "pass reasoning" alongside fills. Passes are documented as carefully as trades.',
      ]
    },
    { ver: 'v0.5', date: 'Apr 22, 2026', day: 25, headline: 'Macro overlay.',
      changes: [
        'Added a 6-feature macro vector (DXY, 10Y, VIX, oil, gold, BTC) updated each cycle.',
        'Agent must explicitly state whether macro is supportive, neutral, or hostile before any sizing decision.',
        'Trades against macro require +0.10 conviction premium.',
      ]
    },
    { ver: 'v0.4', date: 'Apr 12, 2026', day: 15, headline: 'Source-channel routing.',
      changes: [
        'Signals are routed into typed channels (filings, flow, macro, papers, social).',
        'Cross-channel corroboration counts double for conviction.',
        'Social signals can no longer trigger a trade on their own.',
      ]
    },
    { ver: 'v0.3', date: 'Apr 1, 2026', day:  5, headline: 'First public version.',
      changes: [
        'Daily blotter publishing. Reasoning logs surfaced.',
        '15-minute cycles, market hours only.',
        'Hard daily stop at -2.5% — any cycle past that turns the agent into a watcher.',
      ]
    },
  ],
};

window.FIN_DATA = FIN_DATA;
