id: 1bbb6237776a4aa2867b98b2a9a59c0b
parent_id: 272f563df9f748ecbd21a1082b3de456
item_type: 1
item_id: df17fb33c80046ee8826ce5ecca785f6
item_updated_time: 1784277452931
title_diff: "[{\"diffs\":[[1,\"Table Selection API\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":19}]"
body_diff: "[{\"diffs\":[[1,\"# Table Selection API\\\n\\\nDesign for a table selection module that interacts with poker platform lobbies to find optimal tables for bot deployment.\\\n\\\n---\\\n\\\n## Overview\\\n\\\nThe table selection module sits between the poker platform and the bot framework:\\\n\\\n```\\\nPoker Platform Lobby ←→ Table Selector ←→ Bot Framework\\\n   (scraping/API)        (scoring)         (strategy bot)\\\n```\\\n\\\n---\\\n\\\n## Selection Criteria\\\n\\\n| Criterion | Source | Weight |\\\n|-----------|--------|--------|\\\n| Average pot size | Lobby stats | High — bigger pots = more profit |\\\n| Player skill level | Observed stats / notes | High — weaker opponents preferred |\\\n| Table fullness | Lobby stats | Medium — avoid nearly-full tables |\\\n| Blind level | Lobby stats | Filter — must match bot config |\\\n| Game type (NL/FL/PL) | Lobby stats | Filter — must match bot strategy |\\\n| Average VPIP of seated players | Tracked statistics | Medium — high VPIP = loose players |\\\n\\\n---\\\n\\\n## Architecture\\\n\\\n```rust\\\nstruct TableSelector {\\\n    platform: Box<dyn PokerPlatformAPI>,\\\n}\\\n\\\ntrait PokerPlatformAPI {\\\n    fn fetch_tables(&self) -> Vec<Table>;\\\n    fn join_table(&self, table_id: &TableId) -> Result<()>;\\\n    fn leave_table(&self, table_id: &TableId) -> Result<()>;\\\n}\\\n\\\nstruct TableCriteria {\\\n    game_type: GameType,          // NL, FL, PL\\\n    table_size: Range<usize>,     // e.g., 6..=10\\\n    blind_range: Range<f64>,      // BB range\\\n    min_avg_pot: Option<f64>,\\\n    max_skill_level: Option<f64>,\\\n}\\\n\\\nstruct Table {\\\n    id: TableId,\\\n    name: String,\\\n    game_type: GameType,\\\n    num_seats: usize,\\\n    num_players: usize,\\\n    big_blind: f64,\\\n    average_pot: f64,\\\n    players: Vec<PlayerInfo>,\\\n}\\\n```\\\n\\\n### Table Scoring\\\n\\\n```rust\\\nimpl TableSelector {\\\n    fn select_table(&self, criteria: &TableCriteria) -> Option<Table> {\\\n        self.platform.fetch_tables()\\\n            .into_iter()\\\n            .filter(|t| self.matches(t, criteria))\\\n            .max_by_key(|t| self.score(t, criteria))\\\n    }\\\n\\\n    fn score(&self, table: &Table, criteria: &TableCriteria) -> f64 {\\\n        let mut score = 0.0;\\\n        score += table.average_pot * 0.4;           // Favor big pots\\\n        score += self.avg_opponent_weakness(table) * 0.4;  // Favor weak opponents\\\n        score += (table.num_seats - table.num_players) as f64 * 0.2; // Favor open seats\\\n        score\\\n    }\\\n}\\\n```\\\n\\\n---\\\n\\\n## Platform Adapters\\\n\\\nEach poker platform gets its own adapter implementing `PokerPlatformAPI`:\\\n\\\n- **Scraping adapter** — reads screen/DOM elements from browser poker client\\\n- **Protocol adapter** — intercepts and parses network protocol messages\\\n- **API adapter** — uses official platform API if available\\\n\\\nThe extension (see \\\"Browser Extension\\\" note) provides the scraping/protocol layer. The table selector consumes it.\\\n\\\n---\\\n\\\n## Integration with Bot Framework\\\n\\\n1. Table selector identifies optimal table via `select_table()`\\\n2. Platform adapter joins the table\\\n3. Bot framework receives `GameInfo` events from the table\\\n4. Strategy bot produces actions\\\n5. Platform adapter executes actions on the table\\\n\\\n---\\\n\\\n## Future Enhancements\\\n\\\n- **Multi-table coordination** — manage multiple tables simultaneously\\\n- **Dynamic table switching** — leave tables when conditions deteriorate\\\n- **Bankroll-aware selection** — avoid tables above sustainable stake level\\\n- **Time-based patterns** — track when fish tend to play (evenings, weekends)\"]],\"start1\":0,\"start2\":0,\"length1\":0,\"length2\":3337}]"
metadata_diff: {"new":{"id":"df17fb33c80046ee8826ce5ecca785f6","parent_id":"2c8da247905946c3aa19eb4936e16323","latitude":"48.20817430","longitude":"16.37381890","altitude":"0.0000","author":"","source_url":"","is_todo":0,"todo_due":0,"todo_completed":0,"source":"joplin-desktop","source_application":"net.cozic.joplin-desktop","application_data":"","order":0,"markup_language":1,"is_shared":0,"share_id":"","conflict_original_id":"","master_key_id":"","user_data":"","deleted_time":1784277452931,"user_updated_time":1780225224257},"deleted":[]}
encryption_cipher_text: 
encryption_applied: 0
updated_time: 2026-08-29T11:01:24.377Z
created_time: 2026-07-17T08:46:47.432Z
is_locked: 0
type_: 13