mirror of
https://github.com/prosolis/gogobee.git
synced 2026-07-16 08:52:42 +00:00
Long expeditions D4-a: autopilot DM bundling + EoD digest
Suppress per-tick auto-walk DMs in compact mode. tryAutoRun now only surfaces for fork / death / run-complete / boss-safety camp / Night-camp pitch. A Night-camp pitch flushes the day as an EoD digest (counts of walk/harvest/interrupt plus threat/milestone/narrative bullets, built from dnd_expedition_log) followed by the camp block. Each successful background walk writes a `walk` log entry so the digest can count rooms without persisting raw stream narration. maybeAutoCamp and pitchBossSafetyCamp now return the autoCampDecision so callers can branch on dec.Night.
This commit is contained in:
@@ -442,6 +442,34 @@ func appendExpeditionLog(expID string, day int, entryType, summary, flavor strin
|
||||
return err
|
||||
}
|
||||
|
||||
// dayExpeditionLog returns every log entry recorded against the given
|
||||
// (expedition, day) pair, oldest first. Used by the D4-a end-of-day
|
||||
// digest to bundle a single rollup DM at night-camp pitch.
|
||||
func dayExpeditionLog(expID string, day int) ([]ExpeditionEntry, error) {
|
||||
rows, err := db.Get().Query(`
|
||||
SELECT entry_id, expedition_id, day, timestamp, entry_type, summary, flavor
|
||||
FROM dnd_expedition_log
|
||||
WHERE expedition_id = ?
|
||||
AND day = ?
|
||||
ORDER BY entry_id`, expID, day)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer rows.Close()
|
||||
var out []ExpeditionEntry
|
||||
for rows.Next() {
|
||||
var e ExpeditionEntry
|
||||
if err := rows.Scan(
|
||||
&e.EntryID, &e.ExpeditionID, &e.Day, &e.Timestamp,
|
||||
&e.Type, &e.Summary, &e.Flavor,
|
||||
); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out = append(out, e)
|
||||
}
|
||||
return out, rows.Err()
|
||||
}
|
||||
|
||||
// recentExpeditionLog returns the last `limit` entries, newest first.
|
||||
func recentExpeditionLog(expID string, limit int) ([]ExpeditionEntry, error) {
|
||||
if limit <= 0 {
|
||||
|
||||
Reference in New Issue
Block a user