Add round-robin posting mode

One story per interval_hours (default 4), cycling through enabled sources
in config order. Empty sources are skipped and the pointer advances to
whichever source actually posted. State persists across restarts.

Duplicate-flagged stories now get a _duplicate sentinel channel so they
stay out of the rotation pool alongside _discarded.
This commit is contained in:
prosolis
2026-05-22 19:58:46 -07:00
parent 69967b25c6
commit 3baec4c8bc
7 changed files with 451 additions and 2 deletions

View File

@@ -44,7 +44,16 @@ type PostingConfig struct {
DedupCooldownHours int `yaml:"dedup_cooldown_hours"`
// DailyCapTotal is the hard global cap on posts across ALL channels in a
// rolling 24-hour window. 0 disables the cap.
DailyCapTotal int `yaml:"daily_cap_total"`
DailyCapTotal int `yaml:"daily_cap_total"`
RoundRobin RoundRobinConfig `yaml:"round_robin"`
}
// RoundRobinConfig switches Pete from immediate-on-classify posting to a
// paced rotation: one story per IntervalHours, picking the next source in
// config order that has a postable story (skip-and-advance, newest-first).
type RoundRobinConfig struct {
Enabled bool `yaml:"enabled"`
IntervalHours int `yaml:"interval_hours"`
}
type StorageConfig struct {
@@ -160,6 +169,9 @@ func (c *Config) applyDefaults() {
if c.Posting.DedupCooldownHours == 0 {
c.Posting.DedupCooldownHours = 48
}
if c.Posting.RoundRobin.IntervalHours == 0 {
c.Posting.RoundRobin.IntervalHours = 4
}
if c.Storage.RecentWindowHours == 0 {
c.Storage.RecentWindowHours = 24
}