0.99.5: catalogue-size hybrid for Rewind, Dark Files and Vortex (code from 0f7ce59), verified on real pools
pauljd/davidson-ci: Davidson CI / quality (push) Failing after 2m7s
pauljd/davidson-ci: Davidson CI / ai-review (push) Failing after 1m28s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-11-04 09:18:21 +00:00
co-authored by Claude Opus 5.5
parent 0f7ce59166
commit 99ed169955
7 changed files with 209 additions and 7 deletions
@@ -73,7 +73,7 @@ class WeightedRolloutReplayTest {
private fun report(label: String, entries: List<ScheduleEntry>, series: List<PoolSeries>, programming: ChannelProgramming, weightOf: (PoolSeries) -> Double, others: ProgrammeClash, out: StringBuilder): Map<String, Int> {
val byId = series.associateBy { it.id }
fun tier(id: String) = when (weightOf(byId.getValue(id))) { TIER_CORE -> "core"; TIER_SURPRISE -> "surprise"; else -> "supporting" }
fun tier(id: String) = when (programming.tierWeights?.get(seriesKey(byId.getValue(id).title)) ?: weightOf(byId.getValue(id))) { TIER_CORE -> "core"; TIER_SURPRISE -> "surprise"; else -> "supporting" }
fun minutes(es: List<ScheduleEntry>) = es.groupBy { it.seriesId }.mapValues { (_, x) -> x.sumOf { it.media.durationMs } / 60_000.0 }
val m = minutes(entries); val total = m.values.sum()
val inBlocks = series.filter { s -> programming.dayParts.any { p -> p.titles.any { seriesKey(it) == seriesKey(s.title) } } }
@@ -129,7 +129,7 @@ class WeightedRolloutReplayTest {
val weightOf = programming::weightOf
val others = clashesWith(baseline.filterKeys { it != number }.values.map { ChannelPlan(it, ScheduleCursor()) })
out.appendLine("== ${programming.name} ($number), committed plan ends ${java.time.Instant.ofEpochMilli(committed.endMs).atZone(zone).toLocalDateTime().withNano(0)}")
out.appendLine(" in the pool: ${series.size} shows; core ${series.count { weightOf(it) == TIER_CORE }}, supporting ${series.count { weightOf(it) == TIER_SUPPORTING }}, surprise ${series.count { weightOf(it) == TIER_SURPRISE }}" +
out.appendLine(" in the pool: ${series.size} shows; core ${series.count { programming.tierWeights?.get(seriesKey(it.title)) == TIER_CORE }}, surprise ${series.count { programming.tierWeights?.get(seriesKey(it.title)) == TIER_SURPRISE }}, scaled down for a short catalogue ${series.count { weightOf(it) < (programming.tierWeights?.get(seriesKey(it.title)) ?: TIER_SUPPORTING) }}" +
programming.dayParts.filter { !it.weighted }.joinToString("") { "; ${it.fromHour}-${it.toHour} stays on equal turns" } +
programming.dayParts.filter { it.weights.isNotEmpty() }.joinToString("") { p -> "; ${p.fromHour}-${p.toHour} weights ${p.weights.size} shows ${p.weights.values.first()}" })
val today = replay(committed, series, programming, null, others)
@@ -181,7 +181,7 @@ class WeightedRolloutReplayTest {
val weightOf = programming::weightOf
val others = clashesWith(baseline.filterKeys { it != number }.values.map { ChannelPlan(it, ScheduleCursor()) })
out.appendLine("== ${programming.name} ($number)" + if (tiers.isEmpty()) ": no tiers in the brief, tried with every show equal" else "")
out.appendLine(" in the pool: ${series.size} shows; core ${series.count { weightOf(it) == TIER_CORE }}, supporting ${series.count { weightOf(it) == TIER_SUPPORTING }}, surprise ${series.count { weightOf(it) == TIER_SURPRISE }}")
out.appendLine(" in the pool: ${series.size} shows; core ${series.count { programming.tierWeights?.get(seriesKey(it.title)) == TIER_CORE }}, surprise ${series.count { programming.tierWeights?.get(seriesKey(it.title)) == TIER_SURPRISE }}, scaled down for a short catalogue ${series.count { weightOf(it) < (programming.tierWeights?.get(seriesKey(it.title)) ?: TIER_SUPPORTING) }}")
report("Today", replay(committed, series, programming, null, others), series, programming, weightOf, others, out)
report("Weighted", replay(committed, series, programming, weightOf, others), series, programming, weightOf, others, out)
out.appendLine()