Add !coop stats — public telemetry for runs, gold flow, betting, gifts

Aggregates that surface community-level patterns:
- Per-tier outcomes table (open/active/won/wiped/cancelled, win%, avg party size)
- Gold flow: rewards distributed vs funding forfeited to wipes
- Betting: bets placed, distinct bettors, total wagered, paid to winners,
  estimated house cut
- Gift activity: basket/mimic sent, open rates by type
- TwinBee helpfulness: last 30 events vs lifetime

Public command (no admin gate) so the community can debate strategy with
shared context.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-04-26 09:14:45 -07:00
parent e8a3b8b35d
commit 9639a86268
2 changed files with 248 additions and 0 deletions

View File

@@ -86,6 +86,8 @@ func (p *AdventurePlugin) handleCoopCmd(ctx MessageContext) error {
return p.handleCoopList(ctx)
case lower == "status":
return p.handleCoopStatus(ctx)
case lower == "stats":
return p.SendDM(ctx.Sender, renderCoopStats())
case strings.HasPrefix(lower, "start "):
return p.handleCoopStart(ctx, strings.TrimSpace(args[6:]))
case strings.HasPrefix(lower, "join"):
@@ -118,6 +120,7 @@ const coopHelpText = `**Co-op Dungeon Commands**
` + "`!coop gift <run_id> <basket|mimic>`" + ` — Send a gift (1 harvest action)
` + "`!coop giftvote <id> <open|leave>`" + ` — Party votes whether to open a gift
` + "`!coop status`" + ` — Show your current run
` + "`!coop stats`" + ` — Aggregate stats: outcomes, gold flow, betting, gifts, TwinBee helpfulness
` + "`!coop cancel`" + ` — Cancel an open invite (leader only, before lock)
**How it runs:**