Adv 2.0 Phase L3: delete co-op dungeons; refund in-flight runs on startup

Drop the coop_dungeon system per migration plan §5. 11 coop_*.go files
removed; cleanup_l3.go added with an idempotent per-run status-guarded
UPDATE that cancels any open/active runs and refunds member contributions
plus unsettled bets via EuroPlugin.Credit. Tables retained for now;
schema purge deferred to a future GOGOBEE_COOP_PURGE pass.

adventure.go drops !coop dispatch, coopTicker, the startup combat-lock
hook, and the !coop help line. adventure_scheduler.go loses the
activeCoopMemberSet skip branch and the post-reset combat-lock call.
adventure_render.go drops the teaser plus the in-coop status block;
replaced with a one-week morning-DM closure announcement
(TODO: remove after 2026-05-16). TestPickCoopTeaserCandidate_SkipsLeader
removed.

go vet ./... and go test ./... clean.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
prosolis
2026-05-09 09:17:10 -07:00
parent 3b4dfa44d3
commit d300008812
17 changed files with 133 additions and 4916 deletions

View File

@@ -355,30 +355,8 @@ func (p *AdventurePlugin) midnightReset() error {
today := time.Now().UTC().Format("2006-01-02")
yesterday := time.Now().UTC().Add(-24 * time.Hour).Format("2006-01-02")
coopMembers, err := activeCoopMemberSet()
if err != nil {
slog.Error("adventure: failed to load active coop members", "err", err)
coopMembers = map[string]bool{}
}
dmsSent := 0
for _, char := range chars {
// Active co-op members can't take manual actions (combat is locked
// to the coop run, harvest is optional). Their participation
// auto-resolves daily, so credit them with a streak day and skip
// idle/babysit logic — otherwise the lockCoopCombatActions sentinel
// (combat_actions_used = 99) trips HasActedToday and falls through
// to the streak-reset branch.
if coopMembers[string(char.UserID)] {
char.CurrentStreak++
if char.CurrentStreak > char.BestStreak {
char.BestStreak = char.CurrentStreak
}
char.LastActionDate = today
_ = saveAdvCharacter(&char)
continue
}
if !char.HasActedToday() {
// If the player died today or yesterday, they couldn't act — no shame,
// no streak reset. This covers both currently-dead players and players
@@ -434,13 +412,6 @@ func (p *AdventurePlugin) midnightReset() error {
slog.Warn("adventure: daily action reset failed, retrying", "attempt", attempt+1, "err", resetErr)
time.Sleep(time.Duration(attempt+1) * 2 * time.Second)
}
if resetErr == nil {
// Re-lock combat for active co-op participants after the universal
// reset would otherwise have given them a fresh combat action.
if err := lockCoopCombatActions(); err != nil {
slog.Error("adventure: post-reset coop combat lock failed", "err", err)
}
}
if resetErr != nil {
return fmt.Errorf("reset daily actions after 3 attempts: %w", resetErr)
}