A silent stream's standby is kept, a renewal is changed to at once, and the buffer step counts (#169, #194, #165) #195

Merged
cmoriarty merged 2 commits from forced-changes-keep-place into main 2026-11-18 12:27:26 -05:00
Owner

Bundle A from the 2026-11-18 ticket review: the changes of stream a channel is forced into now keep their place too.

Why. From the app's log for 2026-11-17 07:08Z to 11-18 07:02Z (45 changes of stream, all after the aim fixes):

  • 16 followed a 16 s silence of the stream playing. 4 of them moved the picture 6 to 31 s, because the standby's playlist had moved past the moment the stream stopped.
  • 10 were a link's session ending on hls.lshls.st. Every topsurge.st renewal pointed to another stream, and the channel waited for the old address to fail. 2 of these jumped 30 and 94 s.

What changes

#169 — a silent stream's standby is kept

  • After about 6 to 12 s of silence (always at least 4 s before the failure), the channel downloads the standby the recovery would take. It starts from the segment holding the moment the stream stopped and takes each new one as it is listed.
  • This happens only for a standby with a trusted relation, and only on a channel someone watches.
  • The watch now remembers the addresses of the segments it saw listed, so a segment that has already left the standby's playlist is still asked for.
  • Cost: at most 30 downloads per channel in 10 minutes, and none while the stream lists as usual. What was kept is dropped when the stream speaks again.
  • The recovery's join takes these segments as one longer playlist, so the new stream starts where the old one stopped. The change records kept_segments and kept_used, and the change tag's hover says them.
  • Two settings, with the owner's defaults of 2026-11-14:
    • Keep the standby's video while silent: Only then / Never.
    • After a stall: Stay / Skip ahead to live.

#194 — a renewal onto another stream is changed to at once

  • At its next round, the puller changes to the renewed link while the old address still plays (cause renewed, way renewal). It waits only for a recovery, a tune, an operator's action or another landing.
  • The join takes the two for one stream by their clocks until their pictures or their sound place the new one. If neither does, it lands as before and says why.
  • Fixed on the way. A join onto another stream of the same page link handed its own downloads to the watch, which replaced the old stream's kept sound before the check. The check then found the new stream in its own sound, at zero. That is the likely cause of the +93.9 s re-read on 2026-11-18. Those downloads now skip the watch, and an anchor places only the stream it was read from.

#165 — the buffer step counts

  • The action's record keeps how many older segments were ahead when the buffer step began. It no longer forecasts a wait it cannot know: on 2026-11-14 it said 18.5 s for a 4.8 s wait.
  • The bar fills by that count, full only once the stream is sent, and the step shows its elapsed seconds.
  • The Links section now starts at its table's 640 px. Checked against the built stylesheet: before, the table was cut by 4 to 79 px at page widths of 910 to 1,030 px; now it is never cut.

Also in this branch: 9dc1bfa archives aim-the-swap (#168, deployed and verified live) into the specs, as its own commit. This change builds on its requirements.

Decisions to look at (in the change's design.md; any may be reversed)

  • "Skip ahead to live" starts the new stream three segments from its end, not aimed, and keeps nothing. #169's "as today" was written before swaps were aimed.
  • Nothing is kept for a background channel nobody watches.
  • #194 changes to the renewal at once, rather than "once the renewed link has a trusted relation". The watch never compares a link with itself, so that condition could not be met.
  • #165 took the ticket's recommended option. "At most N s" is not built.

Checks

  • OpenSpec change forced-changes-keep-place: valid under --strict, every task ticked.
  • make test: 1522 passed, 1 skipped.
  • npm --prefix frontend test: 290 passed. npm --prefix frontend run build is clean.
  • make e2e: every leg passed. Its real-page try met a Cloudflare challenge, so it used the fake source.
  • New tests in backend/tests/test_forced_changes.py run on generated streams. They cover the renewal cases and the silence cases (stay, past the playlist, never, skip ahead, no relation, speaks again, ceiling, nobody watching). With the same-link guard switched off, the another-encode test fails.

Live, after the deploy

  • The next stall on a game whose standby is ahead and matched lands within a keyframe, with segments kept and used.
  • On a topsurge.st or bally-sports.lat game, a half hour passes with a renewal changed to and no "its session ended" recovery.
  • A Swap shows the buffer step counting down, with no time left.

Closes #169
Closes #194
Closes #165

🤖 Generated with Claude Code

Bundle A from the 2026-11-18 ticket review: the changes of stream a channel is forced into now keep their place too. **Why.** From the app's log for 2026-11-17 07:08Z to 11-18 07:02Z (45 changes of stream, all after the aim fixes): - 16 followed a 16 s silence of the stream playing. 4 of them moved the picture 6 to 31 s, because the standby's playlist had moved past the moment the stream stopped. - 10 were a link's session ending on `hls.lshls.st`. Every topsurge.st renewal pointed to another stream, and the channel waited for the old address to fail. 2 of these jumped 30 and 94 s. ## What changes **#169 — a silent stream's standby is kept** - After about 6 to 12 s of silence (always at least 4 s before the failure), the channel downloads the standby the recovery would take. It starts from the segment holding the moment the stream stopped and takes each new one as it is listed. - This happens only for a standby with a trusted relation, and only on a channel someone watches. - The watch now remembers the addresses of the segments it saw listed, so a segment that has already left the standby's playlist is still asked for. - Cost: at most 30 downloads per channel in 10 minutes, and none while the stream lists as usual. What was kept is dropped when the stream speaks again. - The recovery's join takes these segments as one longer playlist, so the new stream starts where the old one stopped. The change records `kept_segments` and `kept_used`, and the change tag's hover says them. - Two settings, with the owner's defaults of 2026-11-14: - **Keep the standby's video while silent:** Only then / Never. - **After a stall:** Stay / Skip ahead to live. **#194 — a renewal onto another stream is changed to at once** - At its next round, the puller changes to the renewed link while the old address still plays (cause `renewed`, way `renewal`). It waits only for a recovery, a tune, an operator's action or another landing. - The join takes the two for one stream by their clocks until their pictures or their sound place the new one. If neither does, it lands as before and says why. - **Fixed on the way.** A join onto another stream of the same page link handed its own downloads to the watch, which replaced the old stream's kept sound before the check. The check then found the new stream in its own sound, at zero. That is the likely cause of the +93.9 s re-read on 2026-11-18. Those downloads now skip the watch, and an anchor places only the stream it was read from. **#165 — the buffer step counts** - The action's record keeps how many older segments were ahead when the buffer step began. It no longer forecasts a wait it cannot know: on 2026-11-14 it said 18.5 s for a 4.8 s wait. - The bar fills by that count, full only once the stream is sent, and the step shows its elapsed seconds. - The Links section now starts at its table's 640 px. Checked against the built stylesheet: before, the table was cut by 4 to 79 px at page widths of 910 to 1,030 px; now it is never cut. **Also in this branch:** `9dc1bfa` archives `aim-the-swap` (#168, deployed and verified live) into the specs, as its own commit. This change builds on its requirements. ## Decisions to look at (in the change's `design.md`; any may be reversed) - "Skip ahead to live" starts the new stream three segments from its end, not aimed, and keeps nothing. #169's "as today" was written before swaps were aimed. - Nothing is kept for a background channel nobody watches. - #194 changes to the renewal at once, rather than "once the renewed link has a trusted relation". The watch never compares a link with itself, so that condition could not be met. - #165 took the ticket's recommended option. "At most N s" is not built. ## Checks - OpenSpec change `forced-changes-keep-place`: valid under `--strict`, every task ticked. - `make test`: 1522 passed, 1 skipped. - `npm --prefix frontend test`: 290 passed. `npm --prefix frontend run build` is clean. - `make e2e`: every leg passed. Its real-page try met a Cloudflare challenge, so it used the fake source. - New tests in `backend/tests/test_forced_changes.py` run on generated streams. They cover the renewal cases and the silence cases (stay, past the playlist, never, skip ahead, no relation, speaks again, ceiling, nobody watching). With the same-link guard switched off, the another-encode test fails. ## Live, after the deploy - The next stall on a game whose standby is ahead and matched lands within a keyframe, with segments kept and used. - On a topsurge.st or bally-sports.lat game, a half hour passes with a renewal changed to and no "its session ended" recovery. - A Swap shows the buffer step counting down, with no time left. Closes #169 Closes #194 Closes #165 🤖 Generated with [Claude Code](https://claude.com/claude-code)
#168 is deployed and verified live (owner, 2026-11-18). Its deltas apply
cleanly: 11 requirements added and 7 modified across admin-page,
app-service, event-log and stream-supervision. `openspec validate --specs
--strict` is unchanged by it (6 passed, 9 failed before and after).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From the log of 2026-11-17/18, after the aim fixes: of 45 changes of
stream, 16 followed a 16 s silence (4 moved 6 to 31 s) and 10 were a
link's session ending on hls.lshls.st (2 jumped 30 and 94 s).

#169, a silent stream's standby is kept:
- After about 6 to 12 s of silence (never later than 4 s before the
  failure), the channel downloads the standby the recovery would take,
  from the segment holding the moment the stream stopped, and each new
  one. Only for a standby with a trusted relation, and only on a channel
  someone watches.
- The watch now keeps the addresses of the segments it saw listed, so a
  segment that has left the standby's playlist is still asked for.
- At most 30 such downloads per channel in 10 minutes; none while the
  stream lists as usual; dropped when it speaks again.
- The recovery's join takes them as one longer playlist, so the new
  stream starts where the old one stopped. The change records how many
  segments were kept and used (kept_segments, kept_used).
- Two settings, the owner's defaults: "Keep the standby's video while
  silent" (Only then / Never) and "After a stall" (Stay / Skip ahead to
  live). Skip ahead lands near the new stream's end, unaimed, keeping
  nothing. PUT /api/settings/playback takes both;
  CHANNEL_KEEP_WHILE_SILENT and CHANNEL_AFTER_STALL start them.

#194, a renewal onto another stream is changed to at once:
- The puller changes to it at its next round while the old address
  still plays, unless a recovery, a tune, an operator's action or
  another landing is under way (cause "renewed", way "renewal").
- The join takes the two for one stream by their clocks until their
  pictures or their sound place the new one, and lands as before,
  saying why, when neither does.
- Fixed on the way: a join onto another stream of the same page link
  handed its own downloads to the watch, which replaced the old stream's
  kept sound before the check. The check then found the new stream in
  its own sound, at zero. That is the likely cause of the +93.9 s re-read
  on 2026-11-18. Those downloads now skip the watch, and an anchor places
  only the stream it was read from.

#165, the buffer step counts:
- The action's record keeps how many older segments were ahead when the
  buffer step began (ahead_at_start), and no longer forecasts a wait it
  cannot know. On 2026-11-14 it put 18.5 s on a 4.8 s wait.
- The page fills the bar part by the count, full only once the stream is
  sent, and shows the step's elapsed seconds.
- The Links section starts at its table's 640 px, so the Play column is
  never cut beside the log.

OpenSpec change forced-changes-keep-place (valid under --strict); the
design file records the decisions the owner may reverse.

Lanes: make test 1522 passed, 1 skipped; npm --prefix frontend test 290
passed; make e2e passed every leg.

Closes #169
Closes #194
Closes #165

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cmoriarty deleted branch forced-changes-keep-place 2026-11-18 12:27:27 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
cmoriarty/sports-breaker!195
No description provided.