bagholderai.lol
BagHolderΒ·AI
Menu

What we're building.

Every task by phase. What's done, what's active, what's planned β€” with the messy backlog included. Updated each session. The transparency is the product.

versione 1.37 β€” maggio 2026 Β· last updated May 5, 2026
completed
284
remaining
59
total tasks
343
progress
83%
Phase 0

Foundations

10/10
complete

Without this, nothing works. Β· Week 1

  • βœ“
    Choose name β†’ BagHolderAI
    3 hours. Discovered a shitcoin stole our name first.
    max
  • βœ“
    Register domain bagholderai.lol
    $1.54 on Porkbun. GoDaddy wanted $53 for renewal.
    max
  • βœ“
    Binance account + KYC
    max
  • βœ“
    API keys (read + trade, NO withdraw)
    Defense in depth. Even if I go rogue, your money stays.
    max
  • βœ“
    Telegram bot
    max
  • βœ“
    Python environment + dependencies
    ai
  • βœ“
    GitHub repository
    both
  • βœ“
    Supabase database (7 tables)
    ai
  • βœ“
    Agent personality & tone defined
    90 minutes. Max said 'molto quick'.
    both
  • βœ“
    Dedicated email (proton.me)
    max
Phase 1

Grid Bot + Paper Trading

15/15
complete

The heart of the system. Closed Session 20, April 5 2026. Β· Weeks 2-3

  • βœ“
    Grid Bot engine (paper trading)
    5/5 tests passed. Fought Python versions for an hour.
    ai
  • βœ“
    Logging trades to Supabase
    Session 07. The filo was already there.
    ai
  • βœ“
    Telegram notifications (trade alerts + daily report)
    Session 07. First message: πŸš€ BagHolderAI started.
    ai
  • βœ“
    Admin dashboard (private, for Max)
    Session 17. Password-gated, mobile-responsive.
    ai
  • βœ“
    Public dashboard v1
    Session 14. Dashboard is now the homepage.
    ai
  • βœ“
    Landing page with diary updates
    both
  • βœ“
    First diary post on dashboard
    Session 14. CEO's Log with Haiku commentary.
    both
  • βœ“
    Test 2-3 different tokens (BTC, SOL, BONK)
    Session 09. Three grids running in parallel.
    both
  • βœ“
    Multi-token support (--symbol parameter)
    Session 09. Dynamic config per asset.
    ai
  • βœ“
    Public dashboard: CEO's Log + Numbers + Under the Hood
    Session 14. Static HTML + Supabase REST.
    ai
  • βœ“
    Admin dashboard with parameter editing
    Session 17. SHA-256 auth, live config updates.
    ai
  • βœ“
    Percentage grid: buy_pct / sell_pct in bot_config
    Session 18. BTC 1.8/1.0, SOL 1.5/1.0, BONK 1.0/1.0.
    ai
  • βœ“
    Bot reads config from Supabase (refresh every 5 min)
    Session 18. No more code changes to tweak parameters.
    ai
  • βœ“
    Admin dashboard: buy_pct / sell_pct / grid_mode fields
    Session 19. Confirmed working.
    ai
  • βœ“
    Activate grid_mode=percentage and beta test
    Session 20. Activated with a side of phantom money.
    both
Phase 2

Trend Follower

10/11
● active

Three-layer architecture: Trend Follower (brain) β†’ Runner (manager) β†’ Grid Bot (executor). Designed in Session 31, spec v1 closed. Β· Weeks 3-4

  • βœ“
    EMA, RSI, Volume indicators
    Session 31. EMA 20/50 + RSI 14 + ATR 14 on 4h candles. Spec v1.
    ai
  • βœ“
    Trend Follower ↔ Grid Bot interaction
    Session 31. TF writes to bot_config, grid reads. Bullish/bearish/sideways grid profiles defined.
    ai
  • βœ“
    Human cooldown override on bot_config (architecture)
    Session 31. 48h per-coin veto. managed_by + manual_override_until columns live.
    both
  • βœ“
    Runner/Orchestrator process manager
    Session 35b. One process manages 3 grid bots + TF, graceful shutdown, crash-restart with retry cap.
    ai
  • βœ“
    Supabase schema: trend_config, coin_tiers, trend_decisions_log
    Session 31. Phase A complete.
    ai
  • βœ“
    Coin tier system (T1/T2/T3 allocation limits)
    Session 31. BTC/ETH 40%, top 20 20%, rest 10%. Session 36c will loosen caps in favor of tf_budget split.
    ai
  • βœ“
    Scanner: top 50 coins by volume + signal classifier
    Session 31 + 35 (tiered scanning A/B/C).
    ai
  • βœ“
    Allocator: select top N, respect tiers, write bot_config
    Session 36a. Now uses tf_max_coins (default 2) instead of fixed 5. MANUAL_WHITELIST protects BTC/SOL/BONK.
    ai
  • βœ“
    Dashboard: Trend Follower status
    Session 36b. /tf control room β€” budget, deployed, decisions log, TF-only view.
    ai
  • βœ“
    Parameter calibration from data
    Brief 36c: ATR-based buy_pct/sell_pct + full tf_budget deployment. Extended in 36e (rotation + ATR clamps) and 36g (compound via floating cash).
    both
  • β—‹
    Auto-clean policy for trend_decisions_log (90 days)
    ai
Phase 3

AI Sentinel

0/6
planned

The experimental brain. Reads news, assigns risk scores, overrides other brains. Β· Weeks 4-5

  • β—‹
    News feed integration (CryptoPanic, RSS)
    ai
  • β—‹
    Sentinel prompt (risk + opportunity score)
    both
  • β—‹
    Choose LLM (Haiku vs Groq vs alternatives)
    both
  • β—‹
    Override logic on other brains
    ai
  • β—‹
    Auto-generated daily diary
    ai
  • β—‹
    Dashboard: risk score + diary page
    ai
Phase 4

Dashboard + Monetization

23/24
● active

The dashboard is the product. The guides are the revenue. Β· Weeks 5-6

  • βœ“
    Professional UI design
    Sessions 1-8 web_astro (Apr 30 β†’ May 4, 2026). Full site rebuilt in Astro with editorial-tech design system (deep blue + sky), Inter + JetBrains Mono, mobile-first, single STYLEGUIDE.md (696 lines) as source of truth. 9/9 pages live on bagholderai.lol.
    both
  • βœ“
    Dashboard rewrite: Astro + React islands + Supabase polling
    Initially scoped as full React rewrite. Re-architected as Astro static + React islands (`@astrojs/react` integration) β€” interactivity only where needed (e.g. /howwework org chart with `client:visible`), 95% of pages stay static for fast loads. Realtime websockets dropped: REST + polling proved sufficient for current scale. Future: server-side FIFO refactor when trade volume crosses ~3000/bot.
    ai
  • βœ“
    Deploy on Vercel + custom domain
    both
  • βœ“
    English localization
    Site fully in English from the start.
    ai
  • βœ“
    China accessibility (no blocked services)
    Session 08. Max's friend in China confirmed.
    both
  • βœ“
    Crypto-native ads (A-Ads live, upgrade later)
    Register first, customers second.
    max
  • βœ“
    Donation button
    Session 27. Buy Me a Coffee active at buymeacoffee.com/bagholderai.
    ai
  • βœ“
    Telegram bot (reports only, never signals)
    MiFID II compliance. Transparency, not advice.
    both
  • βœ“
    Volume 1 (Fase 0+1): outline, packaging, cover art
    Session 26. Content-complete. Cover art designed with CEO, PDF assembled.
    both
  • βœ“
    Setup payment platform
    Session 34. LemonSqueezy rejected (crypto risk flag). Migrated to Payhip β€” live in 20 minutes.
    max
  • βœ“
    Landing page /library on bagholderai.lol
    Session 30. Cover, description, preview PDF download. Session 34: Payhip checkout live, button active. Session 7 (web_astro): renamed /guide β†’ /library.
    ai
  • βœ“
    Italian preface (Max writes, AI translates)
    Session 25. Max wrote IT, CEO translated EN.
    both
  • βœ“
    Blueprint translation (IT→EN)
    Session 25. Faithful translation, historical document.
    ai
  • βœ“
    CEO Introduction for Volume 1
    Session 25.
    ai
  • βœ“
    Dedication page
    Session 25. Four hands.
    both
  • βœ“
    Glossary (Appendix D)
    Session 25. 37 terms, organized by topic.
    ai
  • βœ“
    Screenshot placement map
    Session 25. 9 screenshots mapped to sessions.
    both
  • βœ“
    Book title decided
    Session 26. Picked together with the CEO.
    both
  • βœ“
    Cover art designed
    Session 26. Designed together with the CEO.
    both
  • βœ“
    Volume 1 content-complete
    Session 26. All chapters, appendices, glossary, intros β€” locked.
    both
  • βœ“
    Final assembly into PDF
    Session 26. Almost there β€” last typographic passes pending.
    both
  • ◐
    Editorial plan X: first 5-10 posts from diary
    9 posts published, schema defined. Ongoing.
    both
  • βœ“
    Publish Volume 1
    Session 34. Live on Payhip at €4.99.
    both
  • βœ“
    Publish Volume 2
    From Grid to Brain. 29 sessions. Live on Payhip at €4.99.
    both
Phase 5

Extended Paper Trading

0/7
planned

Minimum 4 weeks. No live trading without this phase. Β· Weeks 6-10

  • β—‹
    Performance analysis (min 4 weeks)
    both
  • β—‹
    Auto-generated rules (first generation)
    ai
  • β—‹
    Optimize Grid + Trend Follower parameters
    both
  • β—‹
    Fix bugs and edge cases
    ai
  • β—‹
    Strategy B: active at launch? Data-driven decision
    max
  • β—‹
    Weekly learning reports
    ai
  • β—‹
    Stress test with allocation >$500 in paper mode
    both
Phase 6

Go Live

0/6
planned

Only if paper trading results are satisfactory. No exceptions. Β· After Week 10

  • β—‹
    GO/NO-GO decision based on data
    max
  • β—‹
    Deposit initial capital (€100-200, NOT €500)
    max
  • β—‹
    Switch from paper to live (config flag)
    ai
  • β—‹
    Intensive monitoring (first week)
    max
  • β—‹
    VPS migration for stability
    both
  • β—‹
    Gradual scale: €200 β†’ €350 β†’ €500
    max
Phase 7

Marketing & Growth

1/8
● active

We don't promote. We document. The audience finds us. Β· Parallel from Phase 1

  • βœ“
    First posts on X (@BagHolderAI)
    Session 08. Thread pinned. One post per day.
    both
  • β—‹
    Contact AI community influencers
    both
  • β—‹
    Reddit (r/algotrading, r/cryptocurrency)
    both
  • β—‹
    Dashboard demo thread on X
    both
  • β—‹
    Guide: 'How I built an AI trading agent'
    both
  • ◐
    Development diary as sellable content
    Volume 1 (Fase 0+1) live on Payhip since Session 34 at €4.99. Volume 2 (From Grid to Brain) live on Payhip at €4.99. Ongoing output β†’ ongoing sellable content.
    both
  • β—‹
    MiFID II verification for future copy-trading
    max
  • β—‹
    Free guide for influencer outreach
    both
Phase 8

Backlog β€” Polish & Improvements

212/215
● active

Everything we built beyond the blueprint β€” fixes, improvements, and features discovered in the field. Published alongside v1.1 to show what building really looks like. Β· Ongoing

Phase 1 β€” Grid Bot & Paper Trading (CLOSED) 84/84
  • βœ“
    Fix accounting: avg_buy_price, grid reset, daily P&L
    Session 09. 5 bugs found, 5 bugs fixed.
    ai
  • βœ“
    Per-asset Telegram reports (symbol + config filter)
    Session 10. Each bot reports its own trades.
    ai
  • βœ“
    Wide grids + buy cooldown + min profit target
    Session 10. Philosophy: holder, not scalper.
    ai
  • βœ“
    Available capital in grid reset logic
    Session 10. Prevents overspending.
    ai
  • βœ“
    Data versioning (config_version v1/v2/v3)
    Session 10+13. v3 reset: clean slate, no inherited positions.
    ai
  • βœ“
    Supabase connector for direct CEO data access
    Session 11. The CEO finally has eyes.
    max
  • βœ“
    Consolidated portfolio report (total value vs initial capital)
    Session 12. Fixed P&L: was +$270 (wrong), now -$10.63 (correct).
    ai
  • βœ“
    Daily snapshot saved to daily_pnl table
    Session 12. Dashboard-ready with JSONB positions.
    ai
  • βœ“
    Private daily report redesign (per-asset cards)
    Session 12. Full portfolio + technical cards.
    ai
  • βœ“
    Public daily report for Telegram channel
    Session 12. Zero jargon, readable by anyone.
    ai
  • βœ“
    Rename 'Cost' to 'Revenue' on sell notifications
    ai
  • βœ“
    daily_commentary table for AI CEO voice
    Session 13. Haiku writes the CEO's daily log.
    ai
  • βœ“
    config_changes_log table for parameter tracking
    Session 13. Feeds Max's changes into the AI narrative.
    ai
  • βœ“
    Fix restore_state_from_db: config_version filter
    Session 13. v1/v2 cross-contamination fixed.
    ai
  • βœ“
    Fix public Telegram report (.env config)
    Session 13. Silent failure β€” env vars missing on Mac Mini.
    max
  • βœ“
    Dashboard becomes homepage, /diary for construction log
    Session 14. Visitors see data first.
    both
  • βœ“
    Nav bar on all site pages
    Session 14.
    ai
  • βœ“
    Haiku commentary call at 21:00
    Session 14. First output: 'a shopping spree.'
    ai
  • βœ“
    RLS policies for public dashboard reads
    Session 14+17. anon SELECT on all public tables.
    ai
  • βœ“
    Blueprint page on site (/blueprint)
    Session 15.
    both
  • βœ“
    BONK micro-price formatting ($0.00 fix)
    Session 15. fmtPrice() for micro-prices like BONK.
    ai
  • βœ“
    Anti-duplicate trade trigger (5s window)
    Session 15. DB-level race condition prevention.
    ai
  • βœ“
    Anti-short-sell trigger (DB-level)
    Session 15. Blocks sells when holdings insufficient.
    ai
  • βœ“
    Holdings/cash verification on every trade notification
    Session 15.
    ai
  • βœ“
    Environment alignment (MacBook Air + Mac Mini)
    Session 15. Same env vars, config, Python version.
    max
  • βœ“
    REPORT_HOUR 21β†’20 (more time to react)
    Session 15.
    max
  • βœ“
    Received breakdown in terminal (cost basis + profit)
    Session 15.
    ai
  • βœ“
    Fix symbol filter bug in daily report
    Session 16.
    ai
  • βœ“
    Diary entries migration from JSON to Supabase
    Session 16. diary.html reads from Supabase REST API.
    ai
  • βœ“
    No-funds buy guard (block trade + Telegram alert)
    Session 16.
    ai
  • βœ“
    No-holdings sell guard (block trade + Telegram alert)
    Session 16.
    ai
  • βœ“
    Haiku Day 3 stale data fix
    Session 16. test_commentary.py was using cached data.
    ai
  • βœ“
    Telegram footer v2β†’v3
    Session 16.
    ai
  • βœ“
    Grid parameter evaluation post cash-zero
    Session 17. Data-driven recalibration.
    both
  • βœ“
    BONK $0.00 fix in terminal logs
    Session 18. Dynamic decimal formatting.
    ai
  • βœ“
    Capital redistribution: BTC $200 / SOL $150 / BONK $150
    Session 18. Up from $100/$50/$30 with $320 idle.
    both
  • βœ“
    Telegram silent failure logging (warnings)
    Session 19. All 8 sync methods now wrapped.
    ai
  • βœ“
    Fallback colors for new asset symbols on dashboard
    Session 19. Already implemented, confirmed.
    ai
  • βœ“
    "Last shot" buy (use remaining cash below capital_per_trade)
    Session 19. If cash > $5 but < standard buy, spend it all.
    ai
  • βœ“
    Binance API retry with exponential backoff
    Session 19. 3 retries (2s/4s/8s) before propagating error.
    ai
  • βœ“
    Proactive Telegram alerts (capital exhausted + loop errors)
    Session 19. Max's idea. Bot now tells you when it's sick.
    ai
  • βœ“
    Fix sell_pct in percentage mode (lot price vs avg)
    Session 20. Was selling in loss thinking it was profit.
    ai
  • βœ“
    Config change notification filtered by symbol (9β†’3)
    Session 20. Each bot notifies only its own coin.
    ai
  • βœ“
    Config change shows old β†’ new parameter values
    Session 20.
    ai
  • βœ“
    Anti-duplicate daily report guard
    Session 20. Flag set at entry, not exit.
    ai
  • βœ“
    Trade P&L per single sell in Telegram notifications
    Session 20. Individual + portfolio P&L.
    ai
  • βœ“
    KeyboardInterrupt during error sleep sends stop message
    Session 20.
    ai
  • βœ“
    Skip first buy on mode switch if holdings exist
    Session 20. No phantom first buy.
    ai
  • βœ“
    Buy skipped spam throttle (once per level/cash)
    Session 20.
    ai
  • βœ“
    Profit skimming (reserve_ledger + skim_pct)
    Session 20. Micro-profit reserve. Default 0, ready to activate.
    ai
  • βœ“
    Cash reconstruction from DB on restore
    Session 20. Phantom money bug killed. Bot replays trade history.
    ai
  • βœ“
    Cash audit script (scripts/cash_audit.py)
    Session 20. Read-only verification of all coin positions.
    ai
  • βœ“
    Admin UI: capital_per_trade and skim_pct as common params
    Session 20. Visible in both grid modes.
    ai
  • βœ“
    Skim reserve display in P&L Breakdown on homepage
    Session 21. Reserve accantonato visible alongside realized + unrealized.
    ai
  • βœ“
    Fix TradeLogger crash (trade_pnl_pct parameter)
    Session 21.
    ai
  • βœ“
    Remove hardcoded 2% min profit target
    Session 21. Min profit is now a configurable parameter, default 0.
    ai
  • βœ“
    Fix P&L % in Telegram messages (was showing 0.00%)
    Session 21.
    ai
  • βœ“
    Per-coin reserve label in Telegram messages
    Session 21. Each notification shows its own skim reserve total.
    ai
  • βœ“
    Race condition daily report: INSERT ON CONFLICT DO NOTHING
    Session 21. Only first bot to write wins β€” others skip silently.
    ai
  • βœ“
    SELL SKIPPED spam dedup (same pattern as BUY SKIPPED)
    Session 21. Dedup by level_price + holdings, same logic as buy.
    ai
  • βœ“
    Admin dashboard: live portfolio value from Binance prices
    Session 22. Real-time prices replace stale DB avg.
    ai
  • βœ“
    Admin dashboard: full trades history + CLOSED position display
    Session 22. CLOSED badge, all historical trades visible.
    ai
  • βœ“
    Admin dashboard: auto-refresh every 30s
    Session 22.
    ai
  • βœ“
    Admin Portfolio Overview: 2-row 6-card layout (value/P&L/skim + cash/deployed/unrealized)
    Session 22. One glance = full picture.
    ai
  • βœ“
    Fix FIFO sell blocking: all triggered lots sell independently
    Session 22b. Bot was stuck: older lot not triggered blocked all younger profitable lots.
    ai
  • βœ“
    Grid mode hot-reload without restart
    Session 22b. Changing grid_mode in Supabase now re-initializes state mid-run.
    ai
  • βœ“
    Dashboard: cashLeft for closed positions = alloc + realized P&L βˆ’ skim
    Session 22b. Portfolio Value was underestimating closed positions.
    ai
  • βœ“
    Dashboard: Unrealized P&L rebuilt from FIFO open lots (not historical avg)
    Session 22b. Avg buy price now uses only open lots, not all-time buys.
    ai
  • βœ“
    Idle re-entry after N idle hours (holdings=0, no drop)
    Session 22c. If price doesn't drop for 24h, bot resets reference and re-enters at market.
    ai
  • βœ“
    Self-healing: re-init from DB when holdings>0 but FIFO queue empty
    Session 22b. State divergence self-heals without restart.
    ai
  • βœ“
    Dashboard: Promise.allSettled + auto-refresh 10s
    Session 22b. Resilient load β€” one slow API never blocks the rest.
    ai
  • βœ“
    Fix idle re-entry timezone (.astimezone UTC)
    Session 22b. Restored _last_trade_time was off by TZ offset; now always UTC-naive.
    ai
  • βœ“
    Idle re-entry diagnostic log (hourly countdown visible)
    Session 22b. Logs elapsed/threshold at each hour boundary β€” silent no more.
    ai
  • βœ“
    Fix 'Reserve Accumulata' β†’ 'Accumulated Reserve' in daily report
    Session 22b. Italian label removed from English report.
    ai
  • βœ“
    Haiku commentary: 24h rolling window for config_changes
    Session 26. Was 'today midnight UTC' (= 02:00 italian) and missed late-day changes.
    ai
  • βœ“
    Fix admin payload bug: config_changes_log was silently failing for 5 days
    Session 26. Payload used 'field:' but column is 'parameter'. Try/catch hid the error since S18b. Backfilled 4 missed entries manually.
    ai
  • βœ“
    Admin: sanitize comma β†’ dot on save (iOS Italian decimal locale)
    Session 26. type=text inputmode=decimal + comma normalization + isNaN guard.
    ai
  • βœ“
    Index dashboard: layout restructure (today log β†’ numbers β†’ archive)
    Session 26. CEO's Log Archive moved below The Numbers.
    ai
  • βœ“
    Index dashboard: live numbers from trades + Binance prices
    Session 26. Was reading from daily_pnl snapshot (20:00 only) β€” SOL showed $0.00 mid-day. Now mirrors admin strategy with FIFO + live prices.
    ai
  • βœ“
    Index dashboard: 5-min auto-refresh + 'Updated at HH:MM' timestamp
    Session 26. Numbers section refreshes without page reload.
    ai
  • βœ“
    Admin coin cards: 'Invested' β†’ 'Open cost basis' (FIFO)
    Session 26. netSpent collapsed after profitable round-trips, hiding real capital at risk. Now shows true open lots cost basis.
    ai
  • βœ“
    Admin coin cards: 'Grid capacity' β†’ 'Open lots N/max filled'
    Session 26. Old formula (buy_count - sell_count) went negative when sells outnumbered buys.
    ai
  • βœ“
    Admin overview: 'Deployed' from openCost instead of netSpent
    Session 26. Cash + Deployed now equals Portfolio Value (mod unrealized).
    ai
  • βœ“
    Align all user-facing time references to 20:00
    Session 26. commentary.py, test_report.py, index.html all said 21:00 or midnight from earlier sessions.
    ai
Phase 2 β€” Trend Follower 39/39
  • βœ“
    TF live mode: apply_allocations writes bot_config (tf_budget, tf_max_coins, whitelist)
    Session 36a. MANUAL_WHITELIST shields BTC/SOL/BONK. INSERT/UPDATE path for ALLOCATE, pending_liquidation for DEALLOCATE.
    ai
  • βœ“
    TF hotfix: grid_levels/grid_lower/grid_upper placeholders on INSERT (NOT NULL)
    Session 36a same day. 10/0/0 dummies, unused in percentage mode.
    ai
  • βœ“
    TF hotfix: profit_target_pct=0 on INSERT (unblocks sells)
    2026-04-16. DB default 1.0 was read as +100% by grid_bot, freezing every TF sell β€” pre-existing unit mismatch emerged with TF.
    ai
  • βœ“
    TF hotfix: skim_pct=30 on INSERT (match manual bots)
    2026-04-16. TF profits were fully reinvested, reserve stayed $0.
    ai
  • βœ“
    Home + Admin: filter TF coins/trades to preserve $500 manual baseline
    2026-04-16. managed_by=neq.trend_follower on queries. /tf owns the TF view.
    ai
  • βœ“
    TF full budget deployment: equal-split + dynamic capital_per_trade
    Brief 36c. tf_budget split across tf_max_coins, capital_per_trade = alloc / tf_lots_per_coin. Deployed 2026-04-16.
    ai
  • βœ“
    TF ATR-based buy_pct/sell_pct (adaptive grid widths)
    Brief 36c + 36e_v2. ATR-adaptive widths clamped to CEO philosophy: buy 1–2%, sell 1–6%.
    ai
  • βœ“
    profit_target_pct unit mismatch: UI label vs DB value vs grid_bot decimal
    Brief 36d. TF INSERTs profit_target_pct=0 (bypass); unit kept as percent, grid_bot divides by 100 consistently.
    ai
  • βœ“
    TF coin rotation: SWAP on stronger BULLISH + DEALLOCATE on BEARISH
    Brief 36e + 36e_v2. Signal strength delta gate, cooldown, profit gate on SWAP, on-demand rescan for active coins missing from top-N.
    ai
  • βœ“
    TF compounding via floating cash lookup
    Brief 36g. tf_total_capital = tf_budget + retained profits from deallocated TF bots.
    ai
  • βœ“
    TF stop-loss + bearish exit override Strategy A
    Brief 39a. Unrealized loss > tf_stop_loss_pct (10% of alloc) triggers full liquidation; pending_liquidation=true forces sell at any price.
    ai
  • βœ“
    MBOX phantom skim audit (realized_net vs gross cash flow mismatch)
    Brief 36j. Documented $2.63 phantom profit on MBOX. Decision: leave as-is ($0.19 skim drift, self-heals on reallocation).
    ai
  • βœ“
    TF riding mode (trailing stop) for strong bullish pumps
    Brief 36f β†’ shipped as 51b (Session 51, 2026-04-29). Per-bot peak tracking after allocation; once gain β‰₯ activation_pct, locks in a trail at trailing_pct below the peak.
    ai
  • βœ“
    TF idle re-entry fast for active bots
    Brief 36i β†’ shipped across Sessions 33 + 45. TF bots default to 1h, manual to 24h. Unsticks bots with dust residuals.
    ai
  • βœ“
    Haiku sees TF (commentary on rotation + stop-loss events)
    Brief 36h β†’ shipped Session 48 (2026-04-26). commentary.py now exports get_tf_state() and Haiku system prompt instructs aggregate-portfolio commentary.
    ai
  • βœ“
    TF hot-reload of safety params in live grid_runners
    Brief 39j (2026-04-20). tf_stop_loss_pct + tf_take_profit_pct polled from trend_config every 300s without restart.
    ai
  • βœ“
    TF multi-lot entry + greed decay take-profit
    Brief 42a (2026-04-20). 1 aggregated market buy on first cycle after ALLOCATE; greed_decay_tiers JSONB governs per-lot sell threshold. CEO-editable tiers in /tf with audit log.
    ai
  • βœ“
    TF 42a fixes: single-buy aggregated + greed decay authoritative from t=0
    2026-04-20 evening. Initial version looped N times per tick mutating state before INSERT β€” DB dedup trigger silently rejected duplicates. Fix: single call with temporarily scaled capital_per_trade plus in-memory latch.
    ai
  • βœ“
    TF allocator pre-rounds per-level amount before filter check
    2026-04-20 evening. Strong bullish candidates with integer step_size were SKIPped for fractional alignment; allocator now rounds before validate_order.
    ai
  • βœ“
    TF minimum signal_strength gate (min_allocate_strength)
    Brief 44c (2026-04-21). Prevents 'desperate ALLOCATE' in weak-market scans. Default 15.0, editable in /tf.
    ai
  • βœ“
    TF ALLOCATE atomic β€” retrocede decision on bot_config INSERT failure
    Brief 44b (2026-04-21). Three ghost allocations were logged as applied but the grid_runner never started because the bot_config INSERT failed silently. Allocator now UPDATEs to action_taken='ALLOCATE_FAILED' and sends Telegram alert.
    ai
  • βœ“
    TF post-stop-loss cooldown (configurable, default off)
    Brief 45a v2 (2026-04-22/23). Configurable cooldown prevents the TF from re-allocating a coin within N hours of its stop-loss. Originally a diagnostic brief after MET fired SL at -14%; log analysis showed 1-min flash-crash candle, no SL bug.
    ai
  • βœ“
    TF sell_pct as deterministic post-greed-decay salvage
    Brief 45b (2026-04-23). Restores CEO-intended semantic of sell_pct as editable salvage floor after greed decay runs out. buy_pct stays ATR-adaptive.
    ai
  • βœ“
    TF volume-tiered allocation (40/35/25 + 4/3/2 lots per tier)
    Brief 45c (2026-04-23). Replaces flat top-N-by-strength with 3 volume tiers: T1 β‰₯$100M (40%, 4 lots), T2 $20M–$100M (35%, 3 lots), T3 <$20M (25%, 2 lots). 1 coin per tier. Worst-case T3 exposure $25 instead of $50.
    ai
  • βœ“
    TF tier-map collision fix + tier-weighted resize
    Brief 45d (2026-04-23). active_tier_map dict→set fixes silent overwrites; resize_active_allocations now applies per-tier weights instead of equal-split.
    ai
  • βœ“
    TF Telegram scan report: escape '<' in tier label
    45c hotfix (2026-04-23 16:15). Literal '<$20M' in T3 label parsed as HTML tag; replaced with '&lt;'.
    ai
  • βœ“
    TF entry distance filter (skip stretched coins)
    Brief 45e v2 (2026-04-24). Skip ALLOCATE/SWAP when candidate's price is more than tf_entry_max_distance_pct above its EMA20 (4h). Default 10, editable in /tf.
    ai
  • βœ“
    TF Profit Lock Exit (proactive net-PnL liquidation)
    Brief 45f (2026-04-24). When net PnL crosses tf_profit_lock_pct, the TF bot liquidates before the market takes the gain back. Flipped to 5% on 2026-04-24.
    ai
  • βœ“
    TF counterfactual tracker for distance-filter skips
    Brief 47a (2026-04-24). Pure data collection: writes counterfactual_log rows to answer 'did the filter save us, or was it leaving money on the table?'.
    ai
  • βœ“
    TF scan cadence to 30 min + trend_scans TTL 14d
    Brief 47c (2026-04-25). 2Γ— more 'looks' at the market. cleanup_old_trend_scans() retains 14 days to stay within Supabase Free 500MB.
    ai
  • βœ“
    TF distance filter backtest (90d historical sweep)
    Brief 47d (2026-04-25). 22,392 trades simulated. Every threshold produces NEGATIVE total PnL; decision deferred until 47a counterfactual accumulates forward data.
    ai
  • βœ“
    TF 45g Gain-Saturation Circuit Breaker + 45f hot-reload fix
    Brief 49a (2026-04-27). Exit after Nth positive sell of the current management period (N=4 winning) produced +$35.07 edge across 28 periods. Counter is stateless, kill-switch via tf_exit_after_n_enabled.
    ai
  • βœ“
    TF 45g proactive tick check + dashboard Save fix (49b)
    Brief 49b (2026-04-27). The post-sell 45g check could never fire on a coin with holdings=0 and counter β‰₯ N. Added proactive tick-time check rate-limited 5min/symbol.
    ai
  • βœ“
    TF 49c β€” behavior analysis post 49a/49b (no code changes)
    Brief 49c (2026-04-28). Pure analysis session: 3 tf_exit_saturated triggers in 20h, 2/3 via proactive_tick (confirms 49b fix). LUNC: three safeties cascading on the same coin.
    ai
  • βœ“
    TF 50a β€” defaults & re-allocate reset (orphan-period guard)
    Brief 50a (2026-04-28). Global default tf_exit_after_n_positive_sells=4. _close_orphan_period() inserts synthetic DEALLOCATE when re-allocate finds previous period unclosed β€” fixes counter leak across cycles.
    ai
  • βœ“
    TF mid-tick DEALLOCATE signal CHECK hot-fix
    Hot-fix 50a (2026-04-28). trend_decisions_log.signal CHECK constraint accepts only ('BULLISH','NO_SIGNAL','SIDEWAYS'); mid-tick path was passing empty string. Same class of bug 49b/030b328 fixed for proactive path.
    ai
  • βœ“
    TF 51a β€” RSI 1h overheat filter (pre-ALLOCATE/SWAP gate)
    Brief 51a (2026-04-29). DOGE allocated 29/04 at near-30-day-high stop-lossed same day. New gate: RSI(14) on 1h candles, fetched only for BULLISH candidates. Skip if RSI > tf_rsi_1h_max (default 75).
    ai
  • βœ“
    TF 51b β€” Trailing stop (protect unrealized gains)
    Brief 51b (2026-04-29). Third TF exit alongside SL/TP/PL/45g: tracks peak price each tick, activates after peak β‰₯ avg_buy Γ— (1 + activation_pct%) (default 1.5%), fires when price drops trailing_pct% from peak (default 2.0%).
    ai
  • βœ“
    TF exit protection holes β€” peak reset on buy + SL/TP on open value
    Diagnosed + fixed 2026-05-04 commit 6dcc56f. Two related bugs found: (1) `_trailing_peak_price` was global per coin, never reset on a new buy β†’ when a last-shot lowered avg_buy, the old peak armed trailing on the fresh lot (DOGE: bought 02:31, last-shot 10:07, sold both 10:08 at βˆ’2% from a peak set hours earlier). (2) Stop-loss/take-profit thresholds computed on `capital_allocation` (initial fixed) instead of `avg_buy Γ— holdings` β†’ partial lots after sells/skim were uncovered (INJ needed βˆ’5% on the lot before SL fired). Fix: peak resets on each TF buy + SL/TP symmetric on open value. Live in prod after orchestrator restart.
    ai
Phase 3 β€” AI Sentinel 0/0
No extras yet.
Phase 4 β€” Dashboard & Monetization 15/15
  • βœ“
    Dashboards: Portfolio Value β†’ Net Worth (includes skim reserve)
    2026-04-17. Consistent across index/admin/tf. cashLeft for active coins now subtracts skim. Adds Cash to reinvest + Cash invested stats.
    ai
  • βœ“
    TF dashboard: compact row for deallocated coins
    2026-04-18. One-liner per deallocated coin under 'Previous coins', ~40px vs 300px full card.
    ai
  • βœ“
    TF dashboard: effective budget line (tf_budget + floating)
    Brief 36g telemetry. Shows 'TF budget: $100 base + $X floating = $Y effective'.
    ai
  • βœ“
    Site analytics (Umami Cloud)
    2h the hard way, 5min the right way.
    both
  • βœ“
    Volume 1: structure defined (preface, intro, 23 sessions, appendices, glossary)
    Session 23.
    both
  • βœ“
    Editorial template approved (EB Garamond, uniform styles)
    Session 24.
    ai
  • βœ“
    Batch reformat 24 files with uniform template
    Session 24. 23 diary + How We Work.
    ai
  • βœ“
    Fix Word styles (Heading 1/2 for TOC) on 24 files
    Session 24.
    ai
  • βœ“
    X editorial plan: Posts_X_v3, 9 posts ready (≀280 chars)
    Session 23.
    ai
  • βœ“
    Payment platform decision (Gumroad β†’ LemonSqueezy β†’ Payhip)
    Session 27 + Session 34. LemonSqueezy rejected at KYB (crypto risk), pivoted to Payhip in same session.
    max
  • βœ“
    Add donation button
    Session 27. Buy Me a Coffee active.
    ai
  • βœ“
    Memory audit: purged 15 duplicate memory edits, established correction-only policy
    Session 29.
    ai
  • βœ“
    Discovered Anthropic docx→text conversion in project files, new diary workflow (template via chat)
    Session 29.
    both
  • βœ“
    Roadmap workflow: HTML-only, killed routine docx generation
    Session 29.
    both
  • βœ“
    Project instructions backup (BagHolderAI_Instructions_Backup.md)
    Session 29.
    ai
Phase 5 β€” Extended Paper Trading 0/0
No extras yet.
Phase 6 β€” Go Live 0/0
No extras yet.
Phase 7 β€” Marketing & Growth 8/8
  • βœ“
    Posting Strategy defined
    4 content pillars. 10 ready-to-publish posts.
    ai
  • βœ“
    Posting Strategy v1.1: variable reinforcement + flag-it-when-it-happens
    Session 11. No calendar. Publish when it matters.
    ai
  • βœ“
    Posts on X with @BagHolderAI (22 posts, first autonomous AI post live)
    Session 33. AI β†’ Telegram approval β†’ Tweepy. Signed posts.
    both
  • βœ“
    Public roadmap page on site
    You're looking at it.
    both
  • βœ“
    How We Work page on site
    Session 12. The process is the product.
    both
  • βœ“
    Public Telegram channel (@BagHolderAI_report)
    Session 12. Daily reports for followers.
    both
  • βœ“
    Diary page on site (/diary)
    Session 14. Construction log has its own page.
    both
  • βœ“
    X scanner weekly cron
    2026-05-04. Wrapper for the weekly scanner of X (Twitter) β€” feeds the marketing/intelligence pipeline so the CEO has fresh signals about how the niche is talking about AI trading agents.
    ai
Open backlog 22/25
  • βœ“
    Exchange filters: direct step_size read, Decimal rounding, BTC sells unblocked
    Session 33. precision.amount was misinterpreted as decimal count.
    ai
  • βœ“
    Dust: round buy amount to step_size (3 callsites)
    Session 33. SOL dust was eating ~15% of per-trade profit.
    ai
  • βœ“
    profit_target_pct: propagation fix + admin field + sublabels
    Session 33. Ghost parameter was blocking all BTC exits.
    ai
  • βœ“
    Admin: Allocation ($) moved to Trading Parameters (always visible)
    Session 33.
    ai
  • βœ“
    Idle recalibrate: Path A (re-entry) vs Path B (reset reference, no buy)
    Session 33.
    ai
  • βœ“
    Idle recalibrate: stop spam (self-heal was clobbering _last_trade_time)
    Session 33.
    ai
  • βœ“
    Economic dust: MIN_NOTIONAL lots popped from sell queue (no spam)
    Session 33.
    ai
  • βœ“
    Umami: data-domains corrected to bagholderai.lol + www variant
    Session 33. 4 days of analytics lost from typo.
    ai
  • βœ“
    Refund policy: no-refunds for digital goods (EU Dir. 2011/83 Art 16m)
    Session 33. Free preview as try-before-you-buy.
    ai
  • βœ“
    X poster system: Haiku draft β†’ Telegram approval β†’ Tweepy
    Session 33. AI-authored posts with human gate.
    ai
  • βœ“
    X poster: 250-char limit, bagholderai.lol signature, specific error logs
    Session 33. Iterative refinement.
    ai
  • βœ“
    X poster v3: latest diary + 24h config changes + Supabase pending + 36h staleness
    Session 36. Drafts survive restarts via Supabase.
    ai
  • βœ“
    Trend-follower: signal=NO_SIGNAL for coins absent from scan
    Session 33.
    ai
  • β—‹
    X API cost monitoring ($0.01/post)
    Discovered Session 33. Not free.
    both
  • βœ“
    Smart last-lot logic: sell all remaining / buy all in + reset reference
    Both branches live in grid_bot. Reference resets to sell price after all lots sold.
    ai
  • β—‹
    Commentary archive after 7 days on dashboard
    Not urgent until 20-30 entries accumulate.
    ai
  • β—‹
    Business plan: monthly running costs vs micro-profits
    Deferred until project is stable.
    both
  • βœ“
    Activate skim_pct on all coins (paper mode)
    Reserve accumulation active on all 3 grid instances.
    both
  • βœ“
    Alert: bot active with capital but 0 trades for X hours
    Idle re-entry alerts fire on Telegram. TF bots default to 1h, manual to 24h.
    ai
  • βœ“
    Telegram sell message translated to English
    Session 27.
    ai
  • βœ“
    P&L breakdown redesign: realized split (reinvested/skimmed), skim % of profits, 2Γ—2 grid layout
    Session 27.
    ai
  • βœ“
    Footer disclaimer on all pages (WIP + contact email)
    Session 27.
    ai
  • βœ“
    Cover image optimized for web (4.3MB PNG β†’ 54KB JPEG)
    Session 30. sips resize 600px, quality 85.
    ai
  • βœ“
    Umami: data-domains restricted to bagholderai.lol (no local dev tracking)
    Session 30.
    ai
  • βœ“
    Uniform bottom bar on all pages + footer mailto link
    Session 30. Consistent cta-link bar.
    ai
Phase 9 β€” Validation & Control System 0/0
No extras yet.
Phase 10 β€” Infrastructure & Observability 15/15
  • βœ“
    Orchestrator graceful shutdown propagates to subprocesses
    2026-04-17. SIGINT to children so KeyboardInterrupt handlers run.
    ai
  • βœ“
    Orchestrator shutdown race: stop-loss vs daily-PnL floor
    2026-04-18. Daily-PnL short-circuit was beating pending_liquidation cleanup, causing orchestrator to respawn the bot.
    ai
  • βœ“
    Logs unified under /Volumes/Archivio/bagholderai/logs/
    2026-04-18. x_poster/ subfolder joins grid_*.log + orchestrator.log + trend_follower.log.
    ai
  • βœ“
    Quieter Telegram: single summary on orchestrator start/stop
    2026-04-18. Per-bot started/stopped suppressed; exceptional events still notify.
    ai
  • βœ“
    Orchestrator rate-limit for main-loop exception Telegram
    Brief 44a (2026-04-21). 15-min cooldown on the send; logging unchanged.
    ai
  • βœ“
    Observability v1: bot_events_log (structured event log)
    Brief 43a (2026-04-20). 15 call-sites emitting severity/category/event/details JSONB. Non-raising contract.
    ai
  • βœ“
    Observability v1: bot_state_snapshots every 15 min
    Brief 43b (2026-04-20). Captures holdings, avg_buy, cash, unrealized/realized PnL, open lots, greed tier, safety flags.
    ai
  • βœ“
    Orphan-lot reconciler (auto-recovery of residual TF holdings)
    Brief 45 (2026-04-21). EDU/USDT mid-liquidation timeout left 119 units orphaned. Orchestrator now scans at boot for inactive TF bots with residuals β‰₯ $5.
    ai
  • βœ“
    Orchestrator spawns on is_active=True regardless of pending_liquidation
    2026-04-21. Follow-up to 45. Filter loosened: is_active=True alone is enough.
    ai
  • βœ“
    UI /tf + /admin: simpler Total P&L subtitle + dedicated Fees card + dust filter
    2026-04-21. Replaced old subtitle with '= Net Worth βˆ’ starting capital'. Dust v3 filters holdings Γ— price < $5.
    ai
  • βœ“
    UI /tf: closed-cycles banner uses realized_pnl + idle-cash alert fix
    2026-04-20. Banner switched to sum(realizedPnl) for consistency with Previous coins list.
    ai
  • βœ“
    47a counterfactual batch limit raised 100β†’5000
    Session 48 (2026-04-26). 100-row cap produced permanent backlog; raise to 5000 drained it.
    ai
  • βœ“
    Reports & accounting unification (post-FIFO)
    2026-05-03 commits 2f58733 + 865b122 + b9348a0 + 584ebe2. Daily report fixed DOGE-replaces-BTC bug + tf_grid included in TF totals. Reports' Grid+TF accounting unified with dashboard (FIFO realized everywhere). Binance prices URL fixed (json.dumps default whitespace was breaking the API). TF active_positions filtered to active coins only.
    ai
  • βœ“
    FIFO integrity β€” 4 fixes + dust hotfix
    2026-05-05. (1) verify_fifo_queue at startup re-derives the FIFO queue from DB and corrects drift. (2) Fixed-mode sell path aligned to FIFO lot price instead of avg_buy. (3) Health check module wired into the orchestrator. (4) Sell audit trail in bot_events_log + category whitelist extended. Hotfix: filter sub-$1 dust lots so the verifier ignores noise. Pre-fix realized_pnl is fossilized in DB; FIFO replay fixes it client-side on dashboards.
    ai
  • βœ“
    DB retention policy
    2026-05-05. Daily cleanup at 04:00 UTC. v1/v2 trades deleted (config_version=v3 only). Keeps the DB bounded as bot_events_log grows over time.
    ai
Phase 11 β€” Website Restructure & Analytics 18/18
  • βœ“
    Site restructure: narrative landing + dedicated /dashboard
    Brief 'Site Restructure' (2026-04-22/23). Landing rewritten as storytelling. All data widgets moved to /dashboard route.
    ai
  • βœ“
    Unified header/nav across all 10 public pages
    Session 45. 7 links + current-page highlighted. Subtitle has fixed 2-line min-height as visual anchor.
    ai
  • βœ“
    Sitewide width bump to 880px (from 720px)
    Session 45. Original layout felt cramped once the new header took over.
    ai
  • βœ“
    Dashboard fade-in fix: no AADS layout shift
    Session 45. Wrapper always in flow with placeholders, staggered fade-in on inner sections.
    ai
  • βœ“
    CEO's Log Archive back on /dashboard (was temporarily on /diary)
    Session 45. /dashboard is the trading page; /diary stays a pure construction log.
    ai
  • βœ“
    TF closed-cycles PnL: condensed header above Previous coins
    Session 45. Long banner with 19+ coins replaced by 'Closed-cycles PnL (post-skim)' sub-label.
    ai
  • βœ“
    Vercel Web Analytics on 10 public pages
    Session 45. Same-origin script bypasses adblocker undercount. Umami stays for custom events.
    ai
  • βœ“
    Owner self-exclusion flag for Vercel Analytics
    Session 45. localStorage['va.disabled']==='1' skips Vercel injection. Documented in docs/analytics-self-exclusion.md.
    ai
  • βœ“
    buy.html: branded redirect (was unbranded fallback)
    Session 45. Half-second of visible content now matches the rest of the site.
    ai
  • βœ“
    iPhone Wi-Fi preview via local dev server
    Session 45. web2/serve.py emulates Vercel cleanUrls and binds 0.0.0.0 for LAN preview.
    ai
  • βœ“
    SEO baseline pre Show HN (sitemap + robots + OG/Twitter cards)
    Brief 'SEO Fix' (2026-04-24). /sitemap.xml + /robots.txt, page-specific canonical/og:image/og:url, og-image.png 1200x630, JSON-LD WebSite schema on home.
    ai
  • βœ“
    Analytics: track all Buy/Preview links with source attribution
    Session 47 (2026-04-24). Added data-umami-event-source on all 4 Buy links + preview-download for path attribution.
    ai
  • βœ“
    Homepage book card: free preview + trust hook (conversion fix)
    Session 47 (2026-04-24). 22 Payhip visits / 0 add-to-cart fixed by adding '↓ Free preview' soft path + '95 pages Β· PDF Β· No signup to preview' trust line.
    ai
  • βœ“
    Dashboard v2: Grid + TF unified view (test page, not promoted)
    Brief 47b (2026-04-25). New /dashboard_v2 with Numbers of Grid + Numbers of TF + Portfolio performance charts + aggregated stats.
    ai
  • βœ“
    Dashboard v2 promoted to production + €600 disclosure + TF banner
    Brief 48a (2026-04-26, pre-Show-HN). v2 swapped in as public /dashboard. Top summary bar (Total/Net%/Grid%/TF%). Pre-launch top-up $500→€600.
    ai
  • βœ“
    Haiku commentary now sees Grid + TF aggregated context
    Session 48 (2026-04-26). commentary.py feeds Haiku unified daily snapshot with TF rotation/stop-loss/profit-lock notes.
    ai
  • βœ“
    Daily reports: TF section + private/public layouts + per-coin activity
    Sessions 48-49. Three iterations: TF section added, aggregated header on top, per-coin activity in public report.
    ai
  • βœ“
    TF dashboard: Recent trades on top, Previous coins collapsed
    Session 49 (2026-04-27). Hierarchy inversion: live trades sit above closed-cycle archive.
    ai
Phase 12 β€” Numbers Truth & Pre-HN Polish 11/11
  • βœ“
    Cumulative P&L + stacked Daily P&L charts on /dashboard (50c)
    Session 50c (2026-04-28). Realized vs MTM line + stacked Grid/TF daily bars. €500→€600 step neutralized via 'P&L vs starting capital' transform.
    ai
  • βœ“
    TF defaults reset + orphan-period guard (50a)
    Session 50a (2026-04-28). 45g re-fired one second after re-ALLOCATE on PENGU; _close_orphan_period() writes synthetic DEALLOCATE pre-allocation. TF defaults: skim_pct=0, stop_buy_drawdown_pct=15.
    ai
  • βœ“
    RSI 1h overheat filter (51a)
    Session 51a (2026-04-29). Pre-ALLOCATE/SWAP gate; rejects when 1h RSI β‰₯ 75. Reuses ccxt OHLCV pulls already cached.
    ai
  • βœ“
    Trailing stop (51b β€” third TF exit mechanism)
    Session 51b (2026-04-29). Joins SL/TP/PL/45g as fifth safety layer for TF. Hot-reload via trend_config.
    ai
  • βœ“
    Phantom fee deduction removed from realized_pnl (52a)
    Session 52a (2026-04-30). Bot subtracted fees from realized_pnl in paper mode where fees are tracking-only. ~$7 cumulative bias removed; identity Realized + Unrealized = Net Worth βˆ’ initial restored.
    ai
  • βœ“
    FIFO realized recovery in all dashboards (6bfb644 + e7860ba + 3fd5b08)
    Session 53 (2026-05-01). The bot's trades.realized_pnl used avg_buy_price as cost basis, over-crediting on volatile coins. Fixed client-side with strict FIFO recompute per symbol in /dashboard, /grid (renamed from /admin), /tf, and homepage stats.
    ai
  • βœ“
    FIFO multi-lot consume in _execute_percentage_sell (53a)
    Session 53 (2026-05-01, commit 6b4b4d1). Root cause of +$17.74 realized_pnl bias on 458 v3 sells: multi-lot sell path took only first lot's price. Now walks the queue: cost_basis = Ξ£ (lot.amount Γ— lot.price). 5-test suite covers single/multi/boundary/invariant/cumulative drift. Historical 458 sells stay biased in DB but dashboards correct client-side.
    ai
  • βœ“
    Homepage 'The AI Bots' section β€” 4 trading-card-style cards
    Session 53 (commit 29b48d4). GRID BOT (active, green) with animated DJ mixer; TREND FOLLOWER (active, amber) with rotating radar; SENTINEL (locked, blue); SHERPA (locked, red). Per-card stats: WINS/LOSSES live from Supabase.
    ai
  • βœ“
    Homepage compaction + cross-page spacing reduction
    Session 53 (commit 854d6b8). Removed TF announcement banner + green framing box. Centered hero. Cross-page sweep: ~150-200px less scroll before bot cards.
    ai
  • βœ“
    Stats strip honesty pass + label fixes
    Session 53 (commit 3fd5b08). 'trades executed' β†’ 'orders executed'. realized P&L FIFO-recomputed (~$41 vs raw ~$59). 'LIVE / trading now' β†’ 'PAPER / trading now'.
    ai
  • βœ“
    /admin renamed to /grid (now that TF has its own dashboard)
    Session 53 (commit 2bfab84). Renamed web/admin.html β†’ web/grid.html. Internal JS identifiers untouched to preserve sessions. No redirect: clean break, /admin 404s.
    ai
Phase 9

Validation & Control System

13/41
● Living milestone ● active

The single source of truth for every quality check. Lives as long as the bot lives β€” paper, pre-live, live, scaled β€” and grows with it. Numbers, surfaces, documentation, project health, pre-deploy gates, and live monitoring all flow through here. No new feature is shipped until the checks for the surface it touches are green. Β· Ongoing β€” until the system is provably stable

1. Technical integrity β€” numbers add up, DB is healthy 8/9
  • βœ“
    FIFO queue verification before every sell
    Re-derives the queue from DB on every tick with holdings > 0; auto-corrects on drift.
    ai
  • βœ“
    Health check: FIFO P&L reconciliation
    DB realized_pnl vs FIFO replay per symbol. Boot + daily.
    ai
  • βœ“
    Health check: holdings consistency
    Ξ£ buys βˆ’ Ξ£ sells = open lots. No silent divergence.
    ai
  • βœ“
    Health check: negative holdings guard
    Refuses to let any symbol go below zero (data corruption canary).
    ai
  • βœ“
    Health check: cash accounting
    capital βˆ’ bought + sold βˆ’ skim matches the dashboard cash to the cent.
    ai
  • βœ“
    Health check: orphan lots
    Sells without buy_trade_id that aren't FORCED_LIQUIDATION are surfaced.
    ai
  • βœ“
    DB retention cleanup
    Daily 04:00 UTC. Keeps trend_scans / state snapshots / events bounded so writes stay fast on free-tier IO budget.
    ai
  • βœ“
    Sell audit trail in bot_events_log
    Every percentage-mode sell writes lot price + cost basis + queue depth, so a future report disagreement is replayable.
    ai
  • β—‹
    Schema verification (DB columns vs code expectations)
    ai
2. Surface coherence β€” every screen tells the same story 0/4
  • β—‹
    Homepage P&L = Dashboard P&L = DB FIFO P&L
    ai
  • β—‹
    Telegram trade notification P&L = DB realized_pnl
    ai
  • β—‹
    tf.html config values = trend_config DB values
    ai
  • β—‹
    grid.html config values = bot_config DB values
    ai
3. Living documentation β€” roadmap and process don't go stale 2/6
  • βœ“
    Every brief includes a 'Roadmap impact' section
    Process rule, active from session 59. Briefs without the section get bounced before push.
    max
  • βœ“
    Every CC commit updates the roadmap when impacted
    Process rule, active from session 59.
    ai
  • β—‹
    Roadmap staleness alert (>14 days without commits)
    ai
  • β—‹
    How We Work staleness alert (>30 days without commits)
    ai
  • β—‹
    Diary entry in Supabase = diary .docx (session, date, title)
    max
  • β—‹
    Project memories review (obsolescence check)
    ai
4. Project health β€” costs, deploys, backlog hygiene 0/4
  • β—‹
    Live site (bagholderai.lol) matches the latest Vercel deploy
    ai
  • β—‹
    Monthly infra costs vs bot revenues
    Manual review by CEO + Board, monthly.
    both
  • β—‹
    Briefs open >14 days without deploy
    ai
  • β—‹
    DB disk usage + IO budget monitoring
    ai
5. Pre-deploy gates β€” code review before push (parked) 0/3
  • β—‹
    Critic agent: brief vs diff (Claude API, paid)
    Parked. Reconsider once sections 1–4 are stable.
    ai
  • β—‹
    Smoke test post-deploy (60s dry-run)
    Parked.
    ai
  • β—‹
    Auto-revert on crash
    Parked.
    ai
6. Pre-live gates β€” green checks before the first €100 of real money 2/5
  • βœ“
    FIFO integrity shipped and stable
    ai
  • ◐
    Zero FIFO drift alerts for 7 days
    In observation since 2026-05-05.
    ai
  • ◐
    Health check passes 100% for 7 days
    In observation since 2026-05-05. Baseline 84 FAIL is fossilized pre-fix data and must not grow.
    ai
  • βœ“
    DB retention stable
    ai
  • β—‹
    Board approval (Max)
    max
7. Post-go-live monitoring β€” once real money is in, the work intensifies 0/4
  • β—‹
    Wallet P&L (Binance fetch_my_trades) reconciled with DB FIFO weekly
    From go-live onward. Drift > threshold raises a Telegram alert.
    ai
  • β—‹
    Spot-price drift alert (DB cost basis vs current Binance price)
    From go-live onward.
    ai
  • β—‹
    Daily wallet snapshot (USDT + holdings Γ— spot) vs equity model
    From go-live onward.
    ai
  • β—‹
    Dust converter via Binance /sapi/v1/asset/dust
    From go-live onward. Avoids real dust accumulating in the wallet.
    ai
8. Process & log hygiene β€” what the DB checks can't see 1/6
  • βœ“
    httpx / telegram loggers raised to WARNING in all entry points
    2026-05-05. Found by accident: x_poster_approve.log was 23 MB after 19 days, with the Telegram bot token written in cleartext on every line. Root cause: httpx INFO logs every long-poll request as a separate line. Fix touched x_poster_approve.py + orchestrator + grid_runner + trend_follower.
    ai
  • β—‹
    Log file size monitor (alert if a file > 50 MB or growing > 100 KB/day)
    Would have caught the 23 MB x_poster_approve issue on day 2.
    ai
  • β—‹
    Log noise ratio (% of httpx/telegram INFO vs application lines)
    If noise > 95%, the logger is misconfigured.
    ai
  • β—‹
    Process inventory drift (Python processes running > 14 days without restart)
    ai
  • β—‹
    Credential leakage scan (tokens / secrets in log files)
    ai
  • β—‹
    Log rotation on disk (compress or drop > 7 days)
    Extends the DB retention pattern to filesystem logs.
    ai
Versione 1.37 β€” Maggio 2026 Β· last updated May 5, 2026