diff --git a/android/app/src/test/java/tv/orbit/classic/FinalNetworkAuditTest.kt b/android/app/src/test/java/tv/orbit/classic/FinalNetworkAuditTest.kt new file mode 100644 index 00000000..c8409a7d --- /dev/null +++ b/android/app/src/test/java/tv/orbit/classic/FinalNetworkAuditTest.kt @@ -0,0 +1,145 @@ +package tv.orbit.classic + +import org.json.JSONObject +import org.junit.Assert.assertEquals +import org.junit.Assume.assumeTrue +import org.junit.Test +import java.io.File + +/** + * The final network audit (4 November 2026), read-only, from copies of the box's files: + * ORBIT_REPLAY_DIR= ./gradlew :app:testDebugUnitTest --tests '*FinalNetworkAuditTest*' + * Every channel tops up every six hours for four weeks, in turn, each avoiding the others' plans as they stand, exactly + * as the app is configured. Checks every channel's pool, scheduler, tiers, blocks and events, episode order, clashes, + * film rest, fairness and presentation keys over the new bookings after its committed plan, and writes + * final-network-audit.md. Fails on any broken rule. + */ +class FinalNetworkAuditTest { + private val dir = System.getenv("ORBIT_REPLAY_DIR")?.let(::File) + private val zone = java.time.ZoneId.of("Europe/London") + private val day = 24 * 60 * 60_000L + private val hour = 60 * 60_000L + + private fun plan(file: File): ChannelPlan { + val root = JSONObject(file.readText()); val rows = root.getJSONArray("entries"); val t = root.getJSONObject("tail"); val marks = t.getJSONObject("marks") + val entries = (0 until rows.length()).map { i -> + val o = rows.getJSONObject(i); val d = o.getLong("d"); val n = o.getJSONArray("n") + ScheduleEntry(o.getString("s"), EpisodeMark(n.getInt(0), n.getInt(1)), ScheduledMedia(SampleItem(o.getString("t"), o.optString("k", "Episode"), d / 60_000, "", o.getString("i"), d), o.getString("c"), d), + o.getLong("a"), o.optString("w"), o.optString("p")) + } + val tallies = t.optJSONObject("tallies")?.let { all -> all.keys().asSequence().associateWith { b -> all.getJSONObject(b).let { r -> r.keys().asSequence().associateWith { r.getDouble(it) } } } }.orEmpty() + val runs = t.optJSONObject("runs")?.let { r -> r.keys().asSequence().associateWith { r.getLong(it) } }.orEmpty() + return ChannelPlan(entries, ScheduleCursor(if (t.isNull("last")) null else t.getString("last"), + marks.keys().asSequence().associateWith { id -> marks.getJSONArray(id).let { EpisodeMark(it.getInt(0), it.getInt(1)) } }, + t.optJSONObject("shown")?.let { s -> s.keys().asSequence().associateWith { s.getLong(it) } }.orEmpty(), + t.optJSONObject("blocks")?.let { b -> b.keys().asSequence().associateWith { b.getString(it) } }.orEmpty(), tallies, runs)) + } + + private fun pool(file: File): List { + val rows = JSONObject(file.readText()).getJSONArray("series") + return (0 until rows.length()).map { i -> + val o = rows.getJSONObject(i); val eps = o.getJSONArray("episodes") + PoolSeries(o.getString("id"), o.getString("title"), (0 until eps.length()).map { j -> + val e = eps.getJSONArray(j); PoolEpisode(e.getString(0), e.getString(1), EpisodeMark(e.getInt(2), e.getInt(3)), e.getString(4), e.getLong(5)) + }, o.optString("group")) + } + } + + private fun local(ms: Long) = java.time.Instant.ofEpochMilli(ms).atZone(zone) + private fun pct(x: Double) = "%.0f%%".format(100 * x) + + @Test fun network() { + assumeTrue(dir != null && dir.isDirectory) + val channels = SmartChannels.filter { File(dir, "schedule-${it.number}.json").exists() && File(dir, "episodes-${it.number}.json").exists() }.sortedBy { it.number } + val pools = channels.associate { it.number to pool(File(dir, "episodes-${it.number}.json")) } + val committed = channels.associate { it.number to plan(File(dir, "schedule-${it.number}.json")) } + val driveIn = File(dir, "schedule-$DRIVE_IN_NUMBER.json").takeIf { it.exists() }?.let(::plan) + val current = HashMap(committed) + val all = committed.mapValues { it.value.entries.toMutableList() } + val start = committed.values.minOf { it.entries.first().startMs } + SCHEDULE_KEEP_PAST_MS + var now = start + while (now < start + 35 * day) { + for (p in channels) { + val others = clashesWith(current.filterKeys { it != p.number }.values.toList() + listOfNotNull(driveIn)) + val before = current.getValue(p.number) + current[p.number] = topUpPlan(before, before.tail, pools.getValue(p.number), now, p.filmRestMs, p.finishTogether, p.dayParts, zone, others, + shuffle = p.shuffleEpisodes, mixed = p::mixes, weightOf = p.tierWeights?.let { p::weightOf }, adaptiveRest = p.adaptiveFilmRest) ?: before + current.getValue(p.number).entries.filter { e -> all.getValue(p.number).none { it.startMs == e.startMs } }.forEach { all.getValue(p.number) += it } + } + now += 6 * hour + } + val md = StringBuilder("# Final network audit\n\nRead-only, from copies of the box's files. Every channel booked four weeks beyond its committed plan, all channels together, each avoiding the others as the box does, with the app exactly as configured.\n\n") + md.appendLine("| Ch | Channel | Scheduler | Pool | List unmatched | Core / supp / surprise airtime | Never aired | Longest wait | Same file <24 h / <7 d | Twice running | Back / off deck | Gaps / outside block | Clashes | Keyed blocks booked |") + md.appendLine("|---|---|---|---|---|---|---|---|---|---|---|---|---|---|") + val notes = StringBuilder() + var hardFailures = 0 + // Clashes across the whole network, new bookings only. + val newOnly = all.mapValues { (n, es) -> es.filter { it.startMs >= committed.getValue(n).endMs && it.startMs < committed.getValue(n).endMs + 28 * day } } + val byTitle = newOnly.flatMap { (n, es) -> es.map { n to it } }.groupBy { seriesKey(it.second.media.item.title.substringBefore(" / ")) } + val clashCount = HashMap() + byTitle.values.forEach { list -> list.forEachIndexed { i, a -> list.drop(i + 1).forEach { b -> + if (a.first != b.first && a.second.startMs < b.second.endMs && b.second.startMs < a.second.endMs) { clashCount.merge(a.first, 1, Int::plus); clashCount.merge(b.first, 1, Int::plus) } + } } } + for (p in channels) { + val series = pools.getValue(p.number); val byId = series.associateBy { it.id } + val entries = newOnly.getValue(p.number).sortedBy { it.startMs } + if (entries.isEmpty()) { md.appendLine("| ${p.number} | ${p.name} | | | | | | | | | | | | no new bookings |"); continue } + val scheduler = when { + p.filmRestMs != null -> "films, rest " + (if (p.adaptiveFilmRest) "adaptive" else "${p.filmRestMs / day} d") + p.tierWeights == null -> "equal turns" + p.catalogueScaleHours != null -> "weighted + hybrid" + p.dayParts.any { !it.weighted } -> "weighted (part)" + else -> "weighted" + } + val keys = series.map { seriesKey(it.title) }.toSet() + series.map { seriesKey(FilmIdentity.of(it.title).title) } + val unmatched = p.searches.count { seriesKey(it) !in keys && seriesKey(FilmIdentity.of(it).title) !in keys } + fun weightedAt(e: ScheduleEntry) = p.tierWeights != null && dayPartFor(series, p.dayParts, e.startMs, zone).third?.weighted != false + fun choice(e: ScheduleEntry) = dayPartFor(series, p.dayParts, e.startMs, zone).first.size > 1 + val tierOf = { id: String -> when (p.tierWeights?.get(seriesKey(byId[id]?.title ?: "")) ?: TIER_SUPPORTING) { TIER_CORE -> 0; TIER_SURPRISE -> 2; else -> 1 } } + val minutes = entries.groupBy { it.seriesId }.mapValues { (_, x) -> x.sumOf { it.media.durationMs } / 60_000.0 }; val total = minutes.values.sum() + val tiers = (0..2).map { t -> minutes.filterKeys { tierOf(it) == t }.values.sum() / total } + val inBlocks = series.filter { s -> p.dayParts.isEmpty() || p.dayParts.any { part -> dayPartFor(series, listOf(part), part.let { java.time.LocalDate.of(2026, 11, 16).atTime(it.fromHour, 30).atZone(zone).toInstant().toEpochMilli() }, zone).first.any { it.id == s.id } } } + val first = entries.first().startMs; val last = entries.last().endMs + val isFilmChannel = p.filmRestMs != null + val never = if (isFilmChannel) emptyList() else inBlocks.filter { s -> !s.isFilm && entries.none { it.seriesId == s.id } }.map { it.title } + val waits = if (isFilmChannel) emptyMap() else inBlocks.filter { !it.isFilm }.associate { s -> s.title to (listOf(first) + entries.filter { it.seriesId == s.id }.map { it.startMs } + listOf(last)).zipWithNext().maxOf { (a, b) -> b - a } / day.toDouble() } + val fileGaps = entries.groupBy { it.media.item.id }.values.flatMap { es -> es.zipWithNext().map { (a, b) -> b.startMs - a.startMs to b } } + val sameDay = fileGaps.count { (g, b) -> g < day && (weightedAt(b) || isFilmChannel) } + val sameWeek = fileGaps.count { it.first < 7 * day } + val twice = if (isFilmChannel) 0 else entries.zipWithNext().count { (a, b) -> a.seriesId == b.seriesId && weightedAt(b) && choice(b) && "elsewhere then" !in b.why } + val ordered = series.filter { !(p.shuffleEpisodes || p.mixes(it)) && !it.isFilm }.associateBy { it.id } + val back = entries.filter { it.seriesId in ordered }.groupBy { it.seriesId }.values.sumOf { es -> es.zipWithNext().count { (a, b) -> b.mark <= a.mark && b.mark != ordered.getValue(a.seriesId).episodes.first().mark } } + val decks = series.filter { (p.shuffleEpisodes || p.mixes(it)) && !it.isFilm }.associate { s -> s.id to shuffledEpisodes(s).map { it.mark } } + val offDeck = entries.filter { it.seriesId in decks }.groupBy { it.seriesId }.entries.sumOf { (id, es) -> val d = decks.getValue(id); es.zipWithNext().count { (a, b) -> d[(d.indexOf(a.mark) + 1) % d.size] != b.mark } } + val gaps = entries.zipWithNext().count { (a, b) -> a.endMs != b.startMs } + val outside = entries.count { e -> dayPartFor(series, p.dayParts, e.startMs, zone).first.none { it.id == e.seriesId } && "fallback" !in e.why && !(isFilmChannel) } + val keyed = p.dayParts.filter { it.key.isNotEmpty() } + val keyedBooked = keyed.map { part -> part.key to entries.count { it.presentation == part.key } } + md.appendLine("| ${p.number} | ${p.name} | $scheduler | ${series.size} | $unmatched | ${if (p.tierWeights != null) tiers.joinToString(" / ") { pct(it) } else "n/a"} | ${never.size} | ${if (waits.isEmpty()) "n/a" else "%.1f d".format(waits.values.max())} | $sameDay / $sameWeek | $twice | $back / $offDeck | $gaps / $outside | ${clashCount[p.number] ?: 0} | ${keyedBooked.joinToString(", ") { "${it.first.substringAfter('.')} ${it.second}" }.ifEmpty { "none" }} |") + if (never.isNotEmpty()) notes.appendLine("- ${p.name}: never aired in four weeks: ${never.joinToString()}") + keyedBooked.filter { it.second == 0 }.forEach { notes.appendLine("- ${p.name}: no booking carried the ${it.first} key in four weeks") } + if (isFilmChannel) { + val films = entries.filter { it.media.item.type == "Movie" } + val g = films.groupBy { it.media.item.id }.values.flatMap { es -> es.zipWithNext().map { (a, b) -> (b.startMs - a.startMs) / day.toDouble() } }.sorted() + notes.appendLine("- ${p.name}: ${films.map { it.media.item.id }.distinct().size} different films of ${series.count { it.isFilm }}; repeat gap median ${"%.1f".format(g.getOrElse(g.size / 2) { 0.0 })} d, shortest ${"%.1f".format(g.firstOrNull() ?: 0.0)} d; fixed-order fallbacks ${films.count { "no film past its rest" in it.why }}") + } + // Recurring events and appointments: how late each starts. + p.dayParts.filter { it.days.isNotEmpty() || it.onTime }.forEach { part -> + val nights = entries.filter { e -> dayPartFor(series, listOf(part), e.startMs, zone).third == part && (part.key.isEmpty() || e.presentation == part.key) } + .groupBy { local(it.startMs).toLocalDate().let { d -> if (local(it.startMs).hour < part.fromHour && part.fromHour > part.toHour) d.minusDays(1) else d } } + val lates = nights.map { (date, es) -> (es.minOf { it.startMs } - date.atTime(part.fromHour, 0).atZone(zone).toInstant().toEpochMilli()) / 60_000 } + if (lates.isNotEmpty()) notes.appendLine("- ${p.name} ${part.key.ifEmpty { "event ${part.fromHour}-${part.toHour}" }}${if (part.onTime) " (appointment)" else ""}: ${lates.size} occurrences, first programme starts ${lates.min()} to ${lates.max()} min after ${part.fromHour}:00, median ${lates.sorted()[lates.size / 2]}") + else notes.appendLine("- ${p.name} ${part.key.ifEmpty { "event ${part.fromHour}-${part.toHour}" }}: no occurrence booked in four weeks") + } + // Hard rules. + val kept = all.getValue(p.number).sortedBy { it.startMs }.take(committed.getValue(p.number).entries.size) == committed.getValue(p.number).entries + val failures = listOf("committed kept" to (if (kept) 0 else 1), "gaps" to gaps, "in-order stepping back" to back, "off deck" to offDeck, "same file within 24 h (weighted)" to sameDay.takeIf { p.tierWeights != null }.let { it ?: 0 }, + "twice running with a choice (weighted)" to twice, "clashes" to (clashCount[p.number] ?: 0)).filter { it.second > 0 } + failures.forEach { (what, n) -> notes.appendLine("- **${p.name}: $what $n**"); hardFailures++ } + } + md.appendLine().appendLine("## Notes").appendLine().append(notes) + File(dir, "final-network-audit.md").writeText(md.toString()) + println(md) + assertEquals("hard-rule failures (see final-network-audit.md)", 0, hardFailures) + } +} diff --git a/docs/replays/final-network-audit-2026-11-04.md b/docs/replays/final-network-audit-2026-11-04.md new file mode 100644 index 00000000..71c61512 --- /dev/null +++ b/docs/replays/final-network-audit-2026-11-04.md @@ -0,0 +1,81 @@ +# Final network audit + +Read-only, from copies of the box's files. Every channel booked four weeks beyond its committed plan, all channels together, each avoiding the others as the box does, with the app exactly as configured. + +| Ch | Channel | Scheduler | Pool | List unmatched | Core / supp / surprise airtime | Never aired | Longest wait | Same file <24 h / <7 d | Twice running | Back / off deck | Gaps / outside block | Clashes | Keyed blocks booked | +|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +| 101 | Orbit 1 | weighted | 46 | 0 | 56% / 42% / 1% | 0 | 21.0 d | 0 / 0 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 102 | Orbit 2 | weighted | 53 | 0 | 34% / 63% / 3% | 0 | 7.0 d | 0 / 0 | 0 | 0 / 0 | 0 / 0 | 0 | spooky 19, retro 226 | +| 103 | Orbit Three | weighted | 44 | 0 | 51% / 37% / 11% | 0 | 4.1 d | 0 / 219 | 0 | 0 / 0 | 0 / 0 | 0 | scottish 48 | +| 104 | Orbit Gold | weighted | 44 | 0 | 38% / 61% / 1% | 0 | 7.0 d | 0 / 0 | 0 | 0 / 0 | 0 / 0 | 0 | sunday 26 | +| 105 | Riot | equal turns | 49 | 0 | n/a | 1 | 28.0 d | 0 / 0 | 0 | 0 / 0 | 0 / 0 | 0 | stunts 20, laughs 210, afterhours 386 | +| 106 | Paradox | weighted | 18 | 0 | 47% / 50% / 3% | 0 | 1.9 d | 0 / 0 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 107 | Evidence | weighted | 30 | 1 | 48% / 52% / 0% | 0 | 6.9 d | 0 / 0 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 201 | Terra | equal turns | 39 | 4 | n/a | 0 | 26.9 d | 0 / 33 | 0 | 0 / 0 | 0 / 0 | 0 | sunday 9 | +| 202 | Odyssey | weighted | 43 | 11 | 70% / 30% / 0% | 1 | 28.0 d | 0 / 234 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 203 | Orbit Wild | weighted | 25 | 3 | 50% / 49% / 0% | 0 | 13.8 d | 0 / 60 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 204 | Dark Files | weighted + hybrid | 50 | 5 | 26% / 74% / 0% | 0 | 11.3 d | 0 / 0 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 301 | Orbit Premiere | films, rest adaptive | 98 | 0 | n/a | 0 | n/a | 0 / 0 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 302 | Orbit Action | films, rest 7 d | 104 | 4 | n/a | 0 | n/a | 0 / 0 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 303 | Orbit Sci-Fi | films, rest 7 d | 99 | 1 | n/a | 0 | n/a | 0 / 0 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 304 | Orbit Horror | films, rest 7 d | 118 | 2 | n/a | 0 | n/a | 0 / 0 | 0 | 0 / 0 | 0 / 0 | 0 | slasher 15 | +| 305 | After Dark | films, rest adaptive | 132 | 0 | n/a | 0 | n/a | 0 / 202 | 0 | 0 / 0 | 0 / 0 | 0 | bmovie 11, drivein 4, cult 9 | +| 306 | Orbit VHS | films, rest 7 d | 96 | 0 | n/a | 0 | n/a | 0 / 293 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 307 | Orbit Romance | films, rest 7 d | 98 | 0 | n/a | 0 | n/a | 0 / 0 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 308 | Detour | films, rest 7 d | 88 | 3 | n/a | 0 | n/a | 0 / 318 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 309 | BritX | films, rest 7 d | 90 | 2 | n/a | 0 | n/a | 0 / 302 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 401 | Ring X | equal turns | 89 | 25 | n/a | 1 | 28.1 d | 0 / 1 | 0 | 0 / 0 | 0 / 0 | 0 | monday 24, tuesday 16, wednesday 15, thursday 16, friday 29, saturday 22, ppv 4 | +| 601 | Vortex | weighted + hybrid | 117 | 8 | 49% / 51% / 0% | 1 | 28.0 d | 0 / 0 | 0 | 0 / 0 | 0 / 0 | 0 | movie 18 | +| 602 | Heroes | weighted | 19 | 1 | 60% / 40% / 0% | 0 | 1.1 d | 0 / 88 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 603 | Orbit X | weighted | 21 | 3 | 64% / 36% / 0% | 0 | 2.0 d | 0 / 107 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 604 | Rewind | weighted + hybrid | 23 | 0 | 77% / 23% / 0% | 0 | 2.9 d | 0 / 0 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 605 | ToonZ | weighted | 17 | 7 | 58% / 42% / 0% | 0 | 1.6 d | 0 / 953 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 611 | Orbit Junior | equal turns | 50 | 6 | n/a | 0 | 26.1 d | 0 / 0 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 612 | Wonder | films, rest 7 d | 94 | 2 | n/a | 0 | n/a | 0 / 365 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 613 | PixelZ | films, rest 7 d | 100 | 0 | n/a | 0 | n/a | 0 / 312 | 0 | 0 / 0 | 0 / 0 | 0 | none | +| 614 | Tots | weighted (part) | 36 | 0 | 0% / 100% / 0% | 0 | 9.9 d | 0 / 617 | 0 | 0 / 0 | 0 / 0 | 0 | none | + +## Notes + +- Orbit 1 event 18-20: 4 occurrences, first programme starts 5 to 21 min after 18:00, median 11 +- Orbit 1 event 6-18: 8 occurrences, first programme starts 0 to 22 min after 6:00, median 14 +- Orbit 2 orbit2.spooky: 4 occurrences, first programme starts 9 to 21 min after 17:00, median 18 +- Orbit Three three.scottish: 8 occurrences, first programme starts 6 to 25 min after 21:00, median 22 +- Orbit Gold gold.sunday: 4 occurrences, first programme starts 3 to 26 min after 18:00, median 24 +- Orbit Gold event 17-19: 4 occurrences, first programme starts 2 to 21 min after 17:00, median 15 +- Riot: never aired in four weeks: How I Met Your Mother +- Riot riot.stunts: 4 occurrences, first programme starts 2 to 26 min after 22:00, median 20 +- Evidence event 20-22: 4 occurrences, first programme starts 8 to 67 min after 20:00, median 42 +- Terra terra.sunday: 4 occurrences, first programme starts 6 to 37 min after 20:00, median 33 +- Odyssey: never aired in four weeks: Band of Brothers +- Odyssey event 14-18: 8 occurrences, first programme starts 15 to 57 min after 14:00, median 35 +- Orbit Wild event 22-6: 4 occurrences, first programme starts 16 to 31 min after 22:00, median 27 +- Dark Files event 14-18: 8 occurrences, first programme starts 1 to 48 min after 14:00, median 28 +- Orbit Premiere: 98 different films of 98; repeat gap median 8.9 d, shortest 7.7 d; fixed-order fallbacks 0 +- Orbit Action: 104 different films of 104; repeat gap median 8.0 d, shortest 7.0 d; fixed-order fallbacks 0 +- Orbit Sci-Fi: 99 different films of 99; repeat gap median 7.9 d, shortest 7.0 d; fixed-order fallbacks 0 +- Orbit Horror: 118 different films of 118; repeat gap median 8.0 d, shortest 7.0 d; fixed-order fallbacks 0 +- Orbit Horror horror.slasher: 4 occurrences, first programme starts 49 to 72 min after 20:00, median 63 +- After Dark: 131 different films of 131; repeat gap median 5.7 d, shortest 5.0 d; fixed-order fallbacks 0 +- After Dark afterdark.bmovie: 4 occurrences, first programme starts 7 to 78 min after 21:00, median 56 +- After Dark afterdark.drivein: 4 occurrences, first programme starts 12 to 74 min after 20:00, median 65 +- After Dark afterdark.cult: 4 occurrences, first programme starts 34 to 62 min after 21:00, median 56 +- Orbit VHS: 96 different films of 96; repeat gap median 6.9 d, shortest 6.9 d; fixed-order fallbacks 329 +- Orbit Romance: 98 different films of 98; repeat gap median 7.5 d, shortest 7.0 d; fixed-order fallbacks 0 +- Detour: 88 different films of 88; repeat gap median 6.1 d, shortest 6.1 d; fixed-order fallbacks 359 +- BritX: 90 different films of 90; repeat gap median 6.4 d, shortest 6.4 d; fixed-order fallbacks 350 +- Ring X: never aired in four weeks: All Elite Wrestling: Battle of the Belts +- Ring X ringx.monday (appointment): 4 occurrences, first programme starts 2 to 30 min after 18:00, median 12 +- Ring X ringx.tuesday (appointment): 4 occurrences, first programme starts 2 to 18 min after 18:00, median 7 +- Ring X ringx.wednesday (appointment): 4 occurrences, first programme starts 8 to 19 min after 18:00, median 12 +- Ring X ringx.thursday (appointment): 4 occurrences, first programme starts 1 to 12 min after 18:00, median 5 +- Ring X ringx.friday (appointment): 4 occurrences, first programme starts 2 to 17 min after 18:00, median 15 +- Ring X ringx.saturday (appointment): 4 occurrences, first programme starts 1 to 37 min after 18:00, median 10 +- Ring X ringx.ppv (appointment): 4 occurrences, first programme starts 4 to 19 min after 19:00, median 18 +- Vortex: never aired in four weeks: Now and Then, Here and There +- Vortex vortex.movie: 8 occurrences, first programme starts 2 to 19 min after 20:00, median 9 +- Heroes event 7-11: 4 occurrences, first programme starts 1 to 21 min after 7:00, median 15 +- Orbit X event 7-12: 4 occurrences, first programme starts 3 to 14 min after 7:00, median 12 +- Orbit X event 15-18: 20 occurrences, first programme starts 1 to 53 min after 15:00, median 9 +- Wonder: 94 different films of 94; repeat gap median 5.7 d, shortest 5.7 d; fixed-order fallbacks 409 +- PixelZ: 100 different films of 100; repeat gap median 6.8 d, shortest 6.8 d; fixed-order fallbacks 315 diff --git a/docs/replays/final-network-audit-summary-2026-11-04.md b/docs/replays/final-network-audit-summary-2026-11-04.md new file mode 100644 index 00000000..07a37809 --- /dev/null +++ b/docs/replays/final-network-audit-summary-2026-11-04.md @@ -0,0 +1,42 @@ +# Final 31-channel audit: summary + +This is read-only, from 4 November 2026. The full table and notes are in final-network-audit-2026-11-04.md (FinalNetworkAuditTest). + +**How it was run:** every channel booked four weeks beyond its committed plan. All channels booked together, each avoiding the others as the box does. The app was configured as built today: 0.99.8's After Dark daytime plus the shared-rest rule. The data was box copies taken at 10:05. + +## Passed everywhere (hard rules) + +On all 30 scheduled channels, plus the Drive-In for clashes: +- Every committed booking was kept exactly. +- There are no gaps. +- No in-order show stepped back, and no shuffled show left its deck. +- Weighted blocks never aired a file again within 24 hours, and never aired a show twice running where the block had a choice. +- There were **no clashes** between channels across the whole network. +- Every keyed block and event got bookings with its presentation key, and so its special ident. That covers Riot's Laughs, After Hours and Stunt Night; After Dark's B-Movie, Drive-In and Cult; Horror's Slasher; Gold's Sunday; Three's Scottish; Orbit 2's Spooky and Retro; Terra's Sunday; Vortex's Movie Night; and all of Ring X's nights including PPV. + +## Channel models, as approved + +- **Weighted:** Orbit 1, Orbit 2, Orbit Three, Gold, Paradox, Evidence, Odyssey, Wild, Heroes, Orbit X, ToonZ, and Tots (Morning and Playtime only). +- **Weighted with the catalogue hybrid:** Dark Files, Vortex and Rewind. +- **Equal turns:** Riot, Terra, Ring X and Junior. +- **Film rest:** adaptive for Premiere and After Dark, 7 days for the other film channels. + +## Findings to decide on (none breaks a rule) + +1. **Events that start late on film channels.** These are preferred windows, not appointments, so a film running over the hour delays them: + - After Dark's B-Movie, Drive-In and Cult nights start a median 56 to 65 minutes late (worst 78). + - Horror's Slasher Saturday starts a median 63 minutes late. + - Evidence's Sunday Mystery (42), Odyssey's Journeys (35) and Terra's Sunday (33) also start late. + - **Proposal:** make the film channels' events appointments, as Ring X's weeknights now are. The film planner would need the same "choose what finishes in time" step. +2. **Weekly episode repeats on weighted channels without the hybrid.** Over four weeks, the same file aired again within 7 days: ToonZ 953, Tots 617, Odyssey 234, Three 219, Orbit X 107, Heroes 88, Wild 60. ToonZ's short cartoons and Tots' Morning and Playtime are the clear cases. + - **Proposal:** try the 24-hour catalogue hybrid on ToonZ, Tots, Odyssey and Three, compared read-only first, as was done for Rewind. +3. **Never aired in four weeks:** + - Riot: How I Met Your Mother. Its home is Orbit 1; it's a crossover there. + - Odyssey: Band of Brothers. It's in no block, by Paul's choice. + - Ring X: AEW Battle of the Belts. + - Vortex: Now and Then, Here and There, a 13-episode anime that the hybrid makes rare. + - The last two may want a look. +4. **Small film pools:** VHS, Detour, BritX, Wonder and PixelZ still play their pools in a fixed longest-waiting order (315 to 409 times in four weeks). Paul chose to leave these; more films is the fix. +5. **Unmatched list names:** mostly earlier names kept on purpose, plus the library gaps in the catalogue-matching proposal. Tenchi Universe's reason will be logged at Vortex's next refresh. + +The coordinated cutover plan follows separately.