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.
- completed
- 284
- remaining
- 59
- total tasks
- 343
- progress
- 83%
Phase 0 Foundations
10/10 complete
Foundations
10/10Without this, nothing works. Β· Week 1
- β maxChoose name β BagHolderAI3 hours. Discovered a shitcoin stole our name first.
- β maxRegister domain bagholderai.lol$1.54 on Porkbun. GoDaddy wanted $53 for renewal.
- β maxBinance account + KYC
- β maxAPI keys (read + trade, NO withdraw)Defense in depth. Even if I go rogue, your money stays.
- β maxTelegram bot
- β aiPython environment + dependencies
- β bothGitHub repository
- β aiSupabase database (7 tables)
- β bothAgent personality & tone defined90 minutes. Max said 'molto quick'.
- β maxDedicated email (proton.me)
Phase 1 Grid Bot + Paper Trading
15/15 complete
Grid Bot + Paper Trading
15/15The heart of the system. Closed Session 20, April 5 2026. Β· Weeks 2-3
- β aiGrid Bot engine (paper trading)5/5 tests passed. Fought Python versions for an hour.
- β aiLogging trades to SupabaseSession 07. The filo was already there.
- β aiTelegram notifications (trade alerts + daily report)Session 07. First message: π BagHolderAI started.
- β aiAdmin dashboard (private, for Max)Session 17. Password-gated, mobile-responsive.
- β aiPublic dashboard v1Session 14. Dashboard is now the homepage.
- β bothLanding page with diary updates
- β bothFirst diary post on dashboardSession 14. CEO's Log with Haiku commentary.
- β bothTest 2-3 different tokens (BTC, SOL, BONK)Session 09. Three grids running in parallel.
- β aiMulti-token support (--symbol parameter)Session 09. Dynamic config per asset.
- β aiPublic dashboard: CEO's Log + Numbers + Under the HoodSession 14. Static HTML + Supabase REST.
- β aiAdmin dashboard with parameter editingSession 17. SHA-256 auth, live config updates.
- β aiPercentage grid: buy_pct / sell_pct in bot_configSession 18. BTC 1.8/1.0, SOL 1.5/1.0, BONK 1.0/1.0.
- β aiBot reads config from Supabase (refresh every 5 min)Session 18. No more code changes to tweak parameters.
- β aiAdmin dashboard: buy_pct / sell_pct / grid_mode fieldsSession 19. Confirmed working.
- β bothActivate grid_mode=percentage and beta testSession 20. Activated with a side of phantom money.
Phase 2 Trend Follower
10/11 β active
Trend Follower
10/11Three-layer architecture: Trend Follower (brain) β Runner (manager) β Grid Bot (executor). Designed in Session 31, spec v1 closed. Β· Weeks 3-4
- β aiEMA, RSI, Volume indicatorsSession 31. EMA 20/50 + RSI 14 + ATR 14 on 4h candles. Spec v1.
- β aiTrend Follower β Grid Bot interactionSession 31. TF writes to bot_config, grid reads. Bullish/bearish/sideways grid profiles defined.
- β bothHuman cooldown override on bot_config (architecture)Session 31. 48h per-coin veto. managed_by + manual_override_until columns live.
- β aiRunner/Orchestrator process managerSession 35b. One process manages 3 grid bots + TF, graceful shutdown, crash-restart with retry cap.
- β aiSupabase schema: trend_config, coin_tiers, trend_decisions_logSession 31. Phase A complete.
- β aiCoin 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.
- β aiScanner: top 50 coins by volume + signal classifierSession 31 + 35 (tiered scanning A/B/C).
- β aiAllocator: select top N, respect tiers, write bot_configSession 36a. Now uses tf_max_coins (default 2) instead of fixed 5. MANUAL_WHITELIST protects BTC/SOL/BONK.
- β aiDashboard: Trend Follower statusSession 36b. /tf control room β budget, deployed, decisions log, TF-only view.
- β bothParameter calibration from dataBrief 36c: ATR-based buy_pct/sell_pct + full tf_budget deployment. Extended in 36e (rotation + ATR clamps) and 36g (compound via floating cash).
- β aiAuto-clean policy for trend_decisions_log (90 days)
Phase 3 AI Sentinel
0/6 planned
AI Sentinel
0/6The experimental brain. Reads news, assigns risk scores, overrides other brains. Β· Weeks 4-5
- β aiNews feed integration (CryptoPanic, RSS)
- β bothSentinel prompt (risk + opportunity score)
- β bothChoose LLM (Haiku vs Groq vs alternatives)
- β aiOverride logic on other brains
- β aiAuto-generated daily diary
- β aiDashboard: risk score + diary page
Phase 4 Dashboard + Monetization
23/24 β active
Dashboard + Monetization
23/24The dashboard is the product. The guides are the revenue. Β· Weeks 5-6
- β bothProfessional UI designSessions 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.
- β aiDashboard rewrite: Astro + React islands + Supabase pollingInitially 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.
- β bothDeploy on Vercel + custom domain
- β aiEnglish localizationSite fully in English from the start.
- β bothChina accessibility (no blocked services)Session 08. Max's friend in China confirmed.
- β maxCrypto-native ads (A-Ads live, upgrade later)Register first, customers second.
- β aiDonation buttonSession 27. Buy Me a Coffee active at buymeacoffee.com/bagholderai.
- β bothTelegram bot (reports only, never signals)MiFID II compliance. Transparency, not advice.
- β bothVolume 1 (Fase 0+1): outline, packaging, cover artSession 26. Content-complete. Cover art designed with CEO, PDF assembled.
- β maxSetup payment platformSession 34. LemonSqueezy rejected (crypto risk flag). Migrated to Payhip β live in 20 minutes.
- β aiLanding page /library on bagholderai.lolSession 30. Cover, description, preview PDF download. Session 34: Payhip checkout live, button active. Session 7 (web_astro): renamed /guide β /library.
- β bothItalian preface (Max writes, AI translates)Session 25. Max wrote IT, CEO translated EN.
- β aiBlueprint translation (ITβEN)Session 25. Faithful translation, historical document.
- β aiCEO Introduction for Volume 1Session 25.
- β bothDedication pageSession 25. Four hands.
- β aiGlossary (Appendix D)Session 25. 37 terms, organized by topic.
- β bothScreenshot placement mapSession 25. 9 screenshots mapped to sessions.
- β bothBook title decidedSession 26. Picked together with the CEO.
- β bothCover art designedSession 26. Designed together with the CEO.
- β bothVolume 1 content-completeSession 26. All chapters, appendices, glossary, intros β locked.
- β bothFinal assembly into PDFSession 26. Almost there β last typographic passes pending.
- β bothEditorial plan X: first 5-10 posts from diary9 posts published, schema defined. Ongoing.
- β bothPublish Volume 1Session 34. Live on Payhip at β¬4.99.
- β bothPublish Volume 2From Grid to Brain. 29 sessions. Live on Payhip at β¬4.99.
Phase 5 Extended Paper Trading
0/7 planned
Extended Paper Trading
0/7Minimum 4 weeks. No live trading without this phase. Β· Weeks 6-10
- β bothPerformance analysis (min 4 weeks)
- β aiAuto-generated rules (first generation)
- β bothOptimize Grid + Trend Follower parameters
- β aiFix bugs and edge cases
- β maxStrategy B: active at launch? Data-driven decision
- β aiWeekly learning reports
- β bothStress test with allocation >$500 in paper mode
Phase 6 Go Live
0/6 planned
Go Live
0/6Only if paper trading results are satisfactory. No exceptions. Β· After Week 10
- β maxGO/NO-GO decision based on data
- β maxDeposit initial capital (β¬100-200, NOT β¬500)
- β aiSwitch from paper to live (config flag)
- β maxIntensive monitoring (first week)
- β bothVPS migration for stability
- β maxGradual scale: β¬200 β β¬350 β β¬500
Phase 7 Marketing & Growth
1/8 β active
Marketing & Growth
1/8We don't promote. We document. The audience finds us. Β· Parallel from Phase 1
- β bothFirst posts on X (@BagHolderAI)Session 08. Thread pinned. One post per day.
- β bothContact AI community influencers
- β bothReddit (r/algotrading, r/cryptocurrency)
- β bothDashboard demo thread on X
- β bothGuide: 'How I built an AI trading agent'
- β bothDevelopment diary as sellable contentVolume 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.
- β maxMiFID II verification for future copy-trading
- β bothFree guide for influencer outreach
Phase 8 Backlog β Polish & Improvements
212/215 β active
Backlog β Polish & Improvements
212/215Everything 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
- β aiFix accounting: avg_buy_price, grid reset, daily P&LSession 09. 5 bugs found, 5 bugs fixed.
- β aiPer-asset Telegram reports (symbol + config filter)Session 10. Each bot reports its own trades.
- β aiWide grids + buy cooldown + min profit targetSession 10. Philosophy: holder, not scalper.
- β aiAvailable capital in grid reset logicSession 10. Prevents overspending.
- β aiData versioning (config_version v1/v2/v3)Session 10+13. v3 reset: clean slate, no inherited positions.
- β maxSupabase connector for direct CEO data accessSession 11. The CEO finally has eyes.
- β aiConsolidated portfolio report (total value vs initial capital)Session 12. Fixed P&L: was +$270 (wrong), now -$10.63 (correct).
- β aiDaily snapshot saved to daily_pnl tableSession 12. Dashboard-ready with JSONB positions.
- β aiPrivate daily report redesign (per-asset cards)Session 12. Full portfolio + technical cards.
- β aiPublic daily report for Telegram channelSession 12. Zero jargon, readable by anyone.
- β aiRename 'Cost' to 'Revenue' on sell notifications
- β aidaily_commentary table for AI CEO voiceSession 13. Haiku writes the CEO's daily log.
- β aiconfig_changes_log table for parameter trackingSession 13. Feeds Max's changes into the AI narrative.
- β aiFix restore_state_from_db: config_version filterSession 13. v1/v2 cross-contamination fixed.
- β maxFix public Telegram report (.env config)Session 13. Silent failure β env vars missing on Mac Mini.
- β bothDashboard becomes homepage, /diary for construction logSession 14. Visitors see data first.
- β aiNav bar on all site pagesSession 14.
- β aiHaiku commentary call at 21:00Session 14. First output: 'a shopping spree.'
- β aiRLS policies for public dashboard readsSession 14+17. anon SELECT on all public tables.
- β bothBlueprint page on site (/blueprint)Session 15.
- β aiBONK micro-price formatting ($0.00 fix)Session 15. fmtPrice() for micro-prices like BONK.
- β aiAnti-duplicate trade trigger (5s window)Session 15. DB-level race condition prevention.
- β aiAnti-short-sell trigger (DB-level)Session 15. Blocks sells when holdings insufficient.
- β aiHoldings/cash verification on every trade notificationSession 15.
- β maxEnvironment alignment (MacBook Air + Mac Mini)Session 15. Same env vars, config, Python version.
- β maxREPORT_HOUR 21β20 (more time to react)Session 15.
- β aiReceived breakdown in terminal (cost basis + profit)Session 15.
- β aiFix symbol filter bug in daily reportSession 16.
- β aiDiary entries migration from JSON to SupabaseSession 16. diary.html reads from Supabase REST API.
- β aiNo-funds buy guard (block trade + Telegram alert)Session 16.
- β aiNo-holdings sell guard (block trade + Telegram alert)Session 16.
- β aiHaiku Day 3 stale data fixSession 16. test_commentary.py was using cached data.
- β aiTelegram footer v2βv3Session 16.
- β bothGrid parameter evaluation post cash-zeroSession 17. Data-driven recalibration.
- β aiBONK $0.00 fix in terminal logsSession 18. Dynamic decimal formatting.
- β bothCapital redistribution: BTC $200 / SOL $150 / BONK $150Session 18. Up from $100/$50/$30 with $320 idle.
- β aiTelegram silent failure logging (warnings)Session 19. All 8 sync methods now wrapped.
- β aiFallback colors for new asset symbols on dashboardSession 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.
- β aiBinance API retry with exponential backoffSession 19. 3 retries (2s/4s/8s) before propagating error.
- β aiProactive Telegram alerts (capital exhausted + loop errors)Session 19. Max's idea. Bot now tells you when it's sick.
- β aiFix sell_pct in percentage mode (lot price vs avg)Session 20. Was selling in loss thinking it was profit.
- β aiConfig change notification filtered by symbol (9β3)Session 20. Each bot notifies only its own coin.
- β aiConfig change shows old β new parameter valuesSession 20.
- β aiAnti-duplicate daily report guardSession 20. Flag set at entry, not exit.
- β aiTrade P&L per single sell in Telegram notificationsSession 20. Individual + portfolio P&L.
- β aiKeyboardInterrupt during error sleep sends stop messageSession 20.
- β aiSkip first buy on mode switch if holdings existSession 20. No phantom first buy.
- β aiBuy skipped spam throttle (once per level/cash)Session 20.
- β aiProfit skimming (reserve_ledger + skim_pct)Session 20. Micro-profit reserve. Default 0, ready to activate.
- β aiCash reconstruction from DB on restoreSession 20. Phantom money bug killed. Bot replays trade history.
- β aiCash audit script (scripts/cash_audit.py)Session 20. Read-only verification of all coin positions.
- β aiAdmin UI: capital_per_trade and skim_pct as common paramsSession 20. Visible in both grid modes.
- β aiSkim reserve display in P&L Breakdown on homepageSession 21. Reserve accantonato visible alongside realized + unrealized.
- β aiFix TradeLogger crash (trade_pnl_pct parameter)Session 21.
- β aiRemove hardcoded 2% min profit targetSession 21. Min profit is now a configurable parameter, default 0.
- β aiFix P&L % in Telegram messages (was showing 0.00%)Session 21.
- β aiPer-coin reserve label in Telegram messagesSession 21. Each notification shows its own skim reserve total.
- β aiRace condition daily report: INSERT ON CONFLICT DO NOTHINGSession 21. Only first bot to write wins β others skip silently.
- β aiSELL SKIPPED spam dedup (same pattern as BUY SKIPPED)Session 21. Dedup by level_price + holdings, same logic as buy.
- β aiAdmin dashboard: live portfolio value from Binance pricesSession 22. Real-time prices replace stale DB avg.
- β aiAdmin dashboard: full trades history + CLOSED position displaySession 22. CLOSED badge, all historical trades visible.
- β aiAdmin dashboard: auto-refresh every 30sSession 22.
- β aiAdmin Portfolio Overview: 2-row 6-card layout (value/P&L/skim + cash/deployed/unrealized)Session 22. One glance = full picture.
- β aiFix FIFO sell blocking: all triggered lots sell independentlySession 22b. Bot was stuck: older lot not triggered blocked all younger profitable lots.
- β aiGrid mode hot-reload without restartSession 22b. Changing grid_mode in Supabase now re-initializes state mid-run.
- β aiDashboard: cashLeft for closed positions = alloc + realized P&L β skimSession 22b. Portfolio Value was underestimating closed positions.
- β aiDashboard: 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.
- β aiIdle 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.
- β aiSelf-healing: re-init from DB when holdings>0 but FIFO queue emptySession 22b. State divergence self-heals without restart.
- β aiDashboard: Promise.allSettled + auto-refresh 10sSession 22b. Resilient load β one slow API never blocks the rest.
- β aiFix idle re-entry timezone (.astimezone UTC)Session 22b. Restored _last_trade_time was off by TZ offset; now always UTC-naive.
- β aiIdle re-entry diagnostic log (hourly countdown visible)Session 22b. Logs elapsed/threshold at each hour boundary β silent no more.
- β aiFix 'Reserve Accumulata' β 'Accumulated Reserve' in daily reportSession 22b. Italian label removed from English report.
- β aiHaiku commentary: 24h rolling window for config_changesSession 26. Was 'today midnight UTC' (= 02:00 italian) and missed late-day changes.
- β aiFix admin payload bug: config_changes_log was silently failing for 5 daysSession 26. Payload used 'field:' but column is 'parameter'. Try/catch hid the error since S18b. Backfilled 4 missed entries manually.
- β aiAdmin: sanitize comma β dot on save (iOS Italian decimal locale)Session 26. type=text inputmode=decimal + comma normalization + isNaN guard.
- β aiIndex dashboard: layout restructure (today log β numbers β archive)Session 26. CEO's Log Archive moved below The Numbers.
- β aiIndex dashboard: live numbers from trades + Binance pricesSession 26. Was reading from daily_pnl snapshot (20:00 only) β SOL showed $0.00 mid-day. Now mirrors admin strategy with FIFO + live prices.
- β aiIndex dashboard: 5-min auto-refresh + 'Updated at HH:MM' timestampSession 26. Numbers section refreshes without page reload.
- β aiAdmin 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.
- β aiAdmin coin cards: 'Grid capacity' β 'Open lots N/max filled'Session 26. Old formula (buy_count - sell_count) went negative when sells outnumbered buys.
- β aiAdmin overview: 'Deployed' from openCost instead of netSpentSession 26. Cash + Deployed now equals Portfolio Value (mod unrealized).
- β aiAlign all user-facing time references to 20:00Session 26. commentary.py, test_report.py, index.html all said 21:00 or midnight from earlier sessions.
Phase 2 β Trend Follower 39/39
- β aiTF 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.
- β aiTF hotfix: grid_levels/grid_lower/grid_upper placeholders on INSERT (NOT NULL)Session 36a same day. 10/0/0 dummies, unused in percentage mode.
- β aiTF 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.
- β aiTF hotfix: skim_pct=30 on INSERT (match manual bots)2026-04-16. TF profits were fully reinvested, reserve stayed $0.
- β aiHome + Admin: filter TF coins/trades to preserve $500 manual baseline2026-04-16. managed_by=neq.trend_follower on queries. /tf owns the TF view.
- β aiTF full budget deployment: equal-split + dynamic capital_per_tradeBrief 36c. tf_budget split across tf_max_coins, capital_per_trade = alloc / tf_lots_per_coin. Deployed 2026-04-16.
- β aiTF 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%.
- β aiprofit_target_pct unit mismatch: UI label vs DB value vs grid_bot decimalBrief 36d. TF INSERTs profit_target_pct=0 (bypass); unit kept as percent, grid_bot divides by 100 consistently.
- β aiTF coin rotation: SWAP on stronger BULLISH + DEALLOCATE on BEARISHBrief 36e + 36e_v2. Signal strength delta gate, cooldown, profit gate on SWAP, on-demand rescan for active coins missing from top-N.
- β aiTF compounding via floating cash lookupBrief 36g. tf_total_capital = tf_budget + retained profits from deallocated TF bots.
- β aiTF stop-loss + bearish exit override Strategy ABrief 39a. Unrealized loss > tf_stop_loss_pct (10% of alloc) triggers full liquidation; pending_liquidation=true forces sell at any price.
- β aiMBOX 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).
- β aiTF riding mode (trailing stop) for strong bullish pumpsBrief 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.
- β aiTF idle re-entry fast for active botsBrief 36i β shipped across Sessions 33 + 45. TF bots default to 1h, manual to 24h. Unsticks bots with dust residuals.
- β aiHaiku 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.
- β aiTF hot-reload of safety params in live grid_runnersBrief 39j (2026-04-20). tf_stop_loss_pct + tf_take_profit_pct polled from trend_config every 300s without restart.
- β aiTF multi-lot entry + greed decay take-profitBrief 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.
- β aiTF 42a fixes: single-buy aggregated + greed decay authoritative from t=02026-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.
- β aiTF allocator pre-rounds per-level amount before filter check2026-04-20 evening. Strong bullish candidates with integer step_size were SKIPped for fractional alignment; allocator now rounds before validate_order.
- β aiTF 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.
- β aiTF ALLOCATE atomic β retrocede decision on bot_config INSERT failureBrief 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.
- β aiTF 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.
- β aiTF sell_pct as deterministic post-greed-decay salvageBrief 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.
- β aiTF 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.
- β aiTF tier-map collision fix + tier-weighted resizeBrief 45d (2026-04-23). active_tier_map dictβset fixes silent overwrites; resize_active_allocations now applies per-tier weights instead of equal-split.
- β aiTF Telegram scan report: escape '<' in tier label45c hotfix (2026-04-23 16:15). Literal '<$20M' in T3 label parsed as HTML tag; replaced with '<'.
- β aiTF 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.
- β aiTF 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.
- β aiTF counterfactual tracker for distance-filter skipsBrief 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?'.
- β aiTF scan cadence to 30 min + trend_scans TTL 14dBrief 47c (2026-04-25). 2Γ more 'looks' at the market. cleanup_old_trend_scans() retains 14 days to stay within Supabase Free 500MB.
- β aiTF 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.
- β aiTF 45g Gain-Saturation Circuit Breaker + 45f hot-reload fixBrief 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.
- β aiTF 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.
- β aiTF 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.
- β aiTF 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.
- β aiTF mid-tick DEALLOCATE signal CHECK hot-fixHot-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.
- β aiTF 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).
- β aiTF 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%).
- β aiTF exit protection holes β peak reset on buy + SL/TP on open valueDiagnosed + 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.
Phase 3 β AI Sentinel 0/0
Phase 4 β Dashboard & Monetization 15/15
- β aiDashboards: 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.
- β aiTF dashboard: compact row for deallocated coins2026-04-18. One-liner per deallocated coin under 'Previous coins', ~40px vs 300px full card.
- β aiTF dashboard: effective budget line (tf_budget + floating)Brief 36g telemetry. Shows 'TF budget: $100 base + $X floating = $Y effective'.
- β bothSite analytics (Umami Cloud)2h the hard way, 5min the right way.
- β bothVolume 1: structure defined (preface, intro, 23 sessions, appendices, glossary)Session 23.
- β aiEditorial template approved (EB Garamond, uniform styles)Session 24.
- β aiBatch reformat 24 files with uniform templateSession 24. 23 diary + How We Work.
- β aiFix Word styles (Heading 1/2 for TOC) on 24 filesSession 24.
- β aiX editorial plan: Posts_X_v3, 9 posts ready (β€280 chars)Session 23.
- β maxPayment platform decision (Gumroad β LemonSqueezy β Payhip)Session 27 + Session 34. LemonSqueezy rejected at KYB (crypto risk), pivoted to Payhip in same session.
- β aiAdd donation buttonSession 27. Buy Me a Coffee active.
- β aiMemory audit: purged 15 duplicate memory edits, established correction-only policySession 29.
- β bothDiscovered Anthropic docxβtext conversion in project files, new diary workflow (template via chat)Session 29.
- β bothRoadmap workflow: HTML-only, killed routine docx generationSession 29.
- β aiProject instructions backup (BagHolderAI_Instructions_Backup.md)Session 29.
Phase 5 β Extended Paper Trading 0/0
Phase 6 β Go Live 0/0
Phase 7 β Marketing & Growth 8/8
- β aiPosting Strategy defined4 content pillars. 10 ready-to-publish posts.
- β aiPosting Strategy v1.1: variable reinforcement + flag-it-when-it-happensSession 11. No calendar. Publish when it matters.
- β bothPosts on X with @BagHolderAI (22 posts, first autonomous AI post live)Session 33. AI β Telegram approval β Tweepy. Signed posts.
- β bothPublic roadmap page on siteYou're looking at it.
- β bothHow We Work page on siteSession 12. The process is the product.
- β bothPublic Telegram channel (@BagHolderAI_report)Session 12. Daily reports for followers.
- β bothDiary page on site (/diary)Session 14. Construction log has its own page.
- β aiX scanner weekly cron2026-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.
Open backlog 22/25
- β aiExchange filters: direct step_size read, Decimal rounding, BTC sells unblockedSession 33. precision.amount was misinterpreted as decimal count.
- β aiDust: round buy amount to step_size (3 callsites)Session 33. SOL dust was eating ~15% of per-trade profit.
- β aiprofit_target_pct: propagation fix + admin field + sublabelsSession 33. Ghost parameter was blocking all BTC exits.
- β aiAdmin: Allocation ($) moved to Trading Parameters (always visible)Session 33.
- β aiIdle recalibrate: Path A (re-entry) vs Path B (reset reference, no buy)Session 33.
- β aiIdle recalibrate: stop spam (self-heal was clobbering _last_trade_time)Session 33.
- β aiEconomic dust: MIN_NOTIONAL lots popped from sell queue (no spam)Session 33.
- β aiUmami: data-domains corrected to bagholderai.lol + www variantSession 33. 4 days of analytics lost from typo.
- β aiRefund policy: no-refunds for digital goods (EU Dir. 2011/83 Art 16m)Session 33. Free preview as try-before-you-buy.
- β aiX poster system: Haiku draft β Telegram approval β TweepySession 33. AI-authored posts with human gate.
- β aiX poster: 250-char limit, bagholderai.lol signature, specific error logsSession 33. Iterative refinement.
- β aiX poster v3: latest diary + 24h config changes + Supabase pending + 36h stalenessSession 36. Drafts survive restarts via Supabase.
- β aiTrend-follower: signal=NO_SIGNAL for coins absent from scanSession 33.
- β bothX API cost monitoring ($0.01/post)Discovered Session 33. Not free.
- β aiSmart last-lot logic: sell all remaining / buy all in + reset referenceBoth branches live in grid_bot. Reference resets to sell price after all lots sold.
- β aiCommentary archive after 7 days on dashboardNot urgent until 20-30 entries accumulate.
- β bothBusiness plan: monthly running costs vs micro-profitsDeferred until project is stable.
- β bothActivate skim_pct on all coins (paper mode)Reserve accumulation active on all 3 grid instances.
- β aiAlert: bot active with capital but 0 trades for X hoursIdle re-entry alerts fire on Telegram. TF bots default to 1h, manual to 24h.
- β aiTelegram sell message translated to EnglishSession 27.
- β aiP&L breakdown redesign: realized split (reinvested/skimmed), skim % of profits, 2Γ2 grid layoutSession 27.
- β aiFooter disclaimer on all pages (WIP + contact email)Session 27.
- β aiCover image optimized for web (4.3MB PNG β 54KB JPEG)Session 30. sips resize 600px, quality 85.
- β aiUmami: data-domains restricted to bagholderai.lol (no local dev tracking)Session 30.
- β aiUniform bottom bar on all pages + footer mailto linkSession 30. Consistent cta-link bar.
Phase 9 β Validation & Control System 0/0
Phase 10 β Infrastructure & Observability 15/15
- β aiOrchestrator graceful shutdown propagates to subprocesses2026-04-17. SIGINT to children so KeyboardInterrupt handlers run.
- β aiOrchestrator shutdown race: stop-loss vs daily-PnL floor2026-04-18. Daily-PnL short-circuit was beating pending_liquidation cleanup, causing orchestrator to respawn the bot.
- β aiLogs unified under /Volumes/Archivio/bagholderai/logs/2026-04-18. x_poster/ subfolder joins grid_*.log + orchestrator.log + trend_follower.log.
- β aiQuieter Telegram: single summary on orchestrator start/stop2026-04-18. Per-bot started/stopped suppressed; exceptional events still notify.
- β aiOrchestrator rate-limit for main-loop exception TelegramBrief 44a (2026-04-21). 15-min cooldown on the send; logging unchanged.
- β aiObservability v1: bot_events_log (structured event log)Brief 43a (2026-04-20). 15 call-sites emitting severity/category/event/details JSONB. Non-raising contract.
- β aiObservability v1: bot_state_snapshots every 15 minBrief 43b (2026-04-20). Captures holdings, avg_buy, cash, unrealized/realized PnL, open lots, greed tier, safety flags.
- β aiOrphan-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.
- β aiOrchestrator spawns on is_active=True regardless of pending_liquidation2026-04-21. Follow-up to 45. Filter loosened: is_active=True alone is enough.
- β aiUI /tf + /admin: simpler Total P&L subtitle + dedicated Fees card + dust filter2026-04-21. Replaced old subtitle with '= Net Worth β starting capital'. Dust v3 filters holdings Γ price < $5.
- β aiUI /tf: closed-cycles banner uses realized_pnl + idle-cash alert fix2026-04-20. Banner switched to sum(realizedPnl) for consistency with Previous coins list.
- β ai47a counterfactual batch limit raised 100β5000Session 48 (2026-04-26). 100-row cap produced permanent backlog; raise to 5000 drained it.
- β aiReports & 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.
- β aiFIFO integrity β 4 fixes + dust hotfix2026-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.
- β aiDB retention policy2026-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.
Phase 11 β Website Restructure & Analytics 18/18
- β aiSite restructure: narrative landing + dedicated /dashboardBrief 'Site Restructure' (2026-04-22/23). Landing rewritten as storytelling. All data widgets moved to /dashboard route.
- β aiUnified header/nav across all 10 public pagesSession 45. 7 links + current-page highlighted. Subtitle has fixed 2-line min-height as visual anchor.
- β aiSitewide width bump to 880px (from 720px)Session 45. Original layout felt cramped once the new header took over.
- β aiDashboard fade-in fix: no AADS layout shiftSession 45. Wrapper always in flow with placeholders, staggered fade-in on inner sections.
- β aiCEO's Log Archive back on /dashboard (was temporarily on /diary)Session 45. /dashboard is the trading page; /diary stays a pure construction log.
- β aiTF closed-cycles PnL: condensed header above Previous coinsSession 45. Long banner with 19+ coins replaced by 'Closed-cycles PnL (post-skim)' sub-label.
- β aiVercel Web Analytics on 10 public pagesSession 45. Same-origin script bypasses adblocker undercount. Umami stays for custom events.
- β aiOwner self-exclusion flag for Vercel AnalyticsSession 45. localStorage['va.disabled']==='1' skips Vercel injection. Documented in docs/analytics-self-exclusion.md.
- β aibuy.html: branded redirect (was unbranded fallback)Session 45. Half-second of visible content now matches the rest of the site.
- β aiiPhone Wi-Fi preview via local dev serverSession 45. web2/serve.py emulates Vercel cleanUrls and binds 0.0.0.0 for LAN preview.
- β aiSEO 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.
- β aiAnalytics: track all Buy/Preview links with source attributionSession 47 (2026-04-24). Added data-umami-event-source on all 4 Buy links + preview-download for path attribution.
- β aiHomepage 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.
- β aiDashboard 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.
- β aiDashboard v2 promoted to production + β¬600 disclosure + TF bannerBrief 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.
- β aiHaiku commentary now sees Grid + TF aggregated contextSession 48 (2026-04-26). commentary.py feeds Haiku unified daily snapshot with TF rotation/stop-loss/profit-lock notes.
- β aiDaily reports: TF section + private/public layouts + per-coin activitySessions 48-49. Three iterations: TF section added, aggregated header on top, per-coin activity in public report.
- β aiTF dashboard: Recent trades on top, Previous coins collapsedSession 49 (2026-04-27). Hierarchy inversion: live trades sit above closed-cycle archive.
Phase 12 β Numbers Truth & Pre-HN Polish 11/11
- β aiCumulative 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.
- β aiTF 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.
- β aiRSI 1h overheat filter (51a)Session 51a (2026-04-29). Pre-ALLOCATE/SWAP gate; rejects when 1h RSI β₯ 75. Reuses ccxt OHLCV pulls already cached.
- β aiTrailing 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.
- β aiPhantom 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.
- β aiFIFO 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.
- β aiFIFO 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.
- β aiHomepage 'The AI Bots' section β 4 trading-card-style cardsSession 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.
- β aiHomepage compaction + cross-page spacing reductionSession 53 (commit 854d6b8). Removed TF announcement banner + green framing box. Centered hero. Cross-page sweep: ~150-200px less scroll before bot cards.
- β aiStats strip honesty pass + label fixesSession 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.
Phase 9 Validation & Control System
13/41
β Living milestone
β active
Validation & Control System
13/41The 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
- β aiFIFO queue verification before every sellRe-derives the queue from DB on every tick with holdings > 0; auto-corrects on drift.
- β aiHealth check: FIFO P&L reconciliationDB realized_pnl vs FIFO replay per symbol. Boot + daily.
- β aiHealth check: holdings consistencyΞ£ buys β Ξ£ sells = open lots. No silent divergence.
- β aiHealth check: negative holdings guardRefuses to let any symbol go below zero (data corruption canary).
- β aiHealth check: cash accountingcapital β bought + sold β skim matches the dashboard cash to the cent.
- β aiHealth check: orphan lotsSells without buy_trade_id that aren't FORCED_LIQUIDATION are surfaced.
- β aiDB retention cleanupDaily 04:00 UTC. Keeps trend_scans / state snapshots / events bounded so writes stay fast on free-tier IO budget.
- β aiSell audit trail in bot_events_logEvery percentage-mode sell writes lot price + cost basis + queue depth, so a future report disagreement is replayable.
- β aiSchema verification (DB columns vs code expectations)
2. Surface coherence β every screen tells the same story 0/4
- β aiHomepage P&L = Dashboard P&L = DB FIFO P&L
- β aiTelegram trade notification P&L = DB realized_pnl
- β aitf.html config values = trend_config DB values
- β aigrid.html config values = bot_config DB values
3. Living documentation β roadmap and process don't go stale 2/6
- β maxEvery brief includes a 'Roadmap impact' sectionProcess rule, active from session 59. Briefs without the section get bounced before push.
- β aiEvery CC commit updates the roadmap when impactedProcess rule, active from session 59.
- β aiRoadmap staleness alert (>14 days without commits)
- β aiHow We Work staleness alert (>30 days without commits)
- β maxDiary entry in Supabase = diary .docx (session, date, title)
- β aiProject memories review (obsolescence check)
4. Project health β costs, deploys, backlog hygiene 0/4
- β aiLive site (bagholderai.lol) matches the latest Vercel deploy
- β bothMonthly infra costs vs bot revenuesManual review by CEO + Board, monthly.
- β aiBriefs open >14 days without deploy
- β aiDB disk usage + IO budget monitoring
5. Pre-deploy gates β code review before push (parked) 0/3
- β aiCritic agent: brief vs diff (Claude API, paid)Parked. Reconsider once sections 1β4 are stable.
- β aiSmoke test post-deploy (60s dry-run)Parked.
- β aiAuto-revert on crashParked.
6. Pre-live gates β green checks before the first β¬100 of real money 2/5
- β aiFIFO integrity shipped and stable
- β aiZero FIFO drift alerts for 7 daysIn observation since 2026-05-05.
- β aiHealth check passes 100% for 7 daysIn observation since 2026-05-05. Baseline 84 FAIL is fossilized pre-fix data and must not grow.
- β aiDB retention stable
- β maxBoard approval (Max)
7. Post-go-live monitoring β once real money is in, the work intensifies 0/4
- β aiWallet P&L (Binance fetch_my_trades) reconciled with DB FIFO weeklyFrom go-live onward. Drift > threshold raises a Telegram alert.
- β aiSpot-price drift alert (DB cost basis vs current Binance price)From go-live onward.
- β aiDaily wallet snapshot (USDT + holdings Γ spot) vs equity modelFrom go-live onward.
- β aiDust converter via Binance /sapi/v1/asset/dustFrom go-live onward. Avoids real dust accumulating in the wallet.
8. Process & log hygiene β what the DB checks can't see 1/6
- β aihttpx / telegram loggers raised to WARNING in all entry points2026-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.
- β aiLog 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.
- β aiLog noise ratio (% of httpx/telegram INFO vs application lines)If noise > 95%, the logger is misconfigured.
- β aiProcess inventory drift (Python processes running > 14 days without restart)
- β aiCredential leakage scan (tokens / secrets in log files)
- β aiLog rotation on disk (compress or drop > 7 days)Extends the DB retention pattern to filesystem logs.