From 3946d650538033efd51c0b3faf9d08fb534ec2ae Mon Sep 17 00:00:00 2001 From: Peter Stone Date: Fri, 30 Oct 2026 08:42:51 +0000 Subject: Decide publishing every time, not only when the candidates moved The re-derive pass skipped an episode whose advertising had not changed since last time, which is sensible for rewriting the file and wrong for everything else: what is *fit to act on* is a separate judgement from what was found, and it changes on its own -- it just did, when publishing was added. So the eighteen episodes that had been measured for days published nothing, because their candidates were already correct. Found by looking at the state file after deploying rather than by assuming the deploy had worked. The readout now says how many episodes publish how many breaks, every start, so "nothing changed" and "nothing is published" can no longer look alike. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_018AwnALZL6bD4VBtATDVv3B --- server/cmd/listend/main.go | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/server/cmd/listend/main.go b/server/cmd/listend/main.go index 6a76f08..a98e01f 100644 --- a/server/cmd/listend/main.go +++ b/server/cmd/listend/main.go @@ -566,6 +566,10 @@ func (w *worker) rederiveAds() { continue } found := w.adsIn(e, held.Cues) + // Publishing is decided every time, even when the candidates have not moved: what + // is fit to act on is a separate judgement from what was found, and it changes on + // its own. Only the file is left alone when nothing moved. + w.publishWordBreaks(e, found) if sameCandidates(found, held.Ads) { continue } @@ -574,13 +578,20 @@ func (w *worker) rederiveAds() { log.Printf("re-deriving %q: %v", e.Title, err) continue } - w.publishWordBreaks(e, found) changed++ } } - if changed > 0 { - log.Printf("re-derived the advertising in %d stored transcript(s)", changed) + published, breaks := 0, 0 + for _, show := range w.state.Shows() { + for _, e := range show.Episodes { + if len(e.WordBreaks) > 0 { + published++ + breaks += len(e.WordBreaks) + } + } } + log.Printf("re-derived the advertising in %d stored transcript(s); "+ + "%d episode(s) publish %d break(s) found in their words", changed, published, breaks) } func sameCandidates(left, right []transcript.Candidate) bool { -- cgit v1.2.3