Add tip audit logging, CFR alignment tests, and multiway scenarios

Three confidence features for the poker tip system:
- Tip audit table (holdem_tip_audit) logs every tip with full context
  for bulk review after real sessions
- CFR alignment test validates all 32 scenarios against the trained
  5M-iteration policy — rules engine never contradicts the bot's AI
- 8 new multiway test scenarios covering all streets and key decisions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-04-18 14:11:59 -07:00
parent 202056e802
commit 148b8d20f2
6 changed files with 700 additions and 40 deletions

View File

@@ -178,6 +178,17 @@ func RecordCrash(botVersion, plugin, message string) {
)
}
// RecordTipAudit logs a poker tip with full context for bulk review.
func RecordTipAudit(userID, hole, board, street, position string, numActive int, equityPct float64, pot, toCall, stack int64, spr float64, handCat, drawDesc, preflopTier, action, tipText string) {
if globalDB == nil {
return
}
Exec("tip audit",
`INSERT INTO holdem_tip_audit (user_id, hole, board, street, position, num_active, equity_pct, pot, to_call, stack, spr, hand_cat, draw_desc, preflop_tier, action, tip_text) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
userID, hole, board, street, position, numActive, equityPct, pot, toCall, stack, spr, handCat, drawDesc, preflopTier, action, tipText,
)
}
// RecordStartup logs a version startup event.
func RecordStartup(version, commit string) {
Exec("version history",
@@ -1338,6 +1349,30 @@ CREATE TABLE IF NOT EXISTS tax_ledger (
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS holdem_tip_audit (
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id TEXT NOT NULL,
hole TEXT NOT NULL,
board TEXT NOT NULL DEFAULT '',
street TEXT NOT NULL,
position TEXT NOT NULL,
num_active INTEGER NOT NULL,
equity_pct REAL NOT NULL,
pot INTEGER NOT NULL,
to_call INTEGER NOT NULL,
stack INTEGER NOT NULL,
spr REAL NOT NULL,
hand_cat TEXT NOT NULL DEFAULT '',
draw_desc TEXT NOT NULL DEFAULT '',
preflop_tier TEXT NOT NULL DEFAULT '',
action TEXT NOT NULL,
tip_text TEXT NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX IF NOT EXISTS idx_tip_audit_user ON holdem_tip_audit(user_id);
CREATE INDEX IF NOT EXISTS idx_tip_audit_action ON holdem_tip_audit(action, street);
`
// SeedSchedulerDefaults inserts default scheduler jobs if they don't exist.