Let a streaming break through selection, and only a streaming break - #303
Merged
Merged
Conversation
The break endpoint returned an empty fill for every request, because fitAdFormat refuses streaming formats outright and it is the gate in front of serveAd. That refusal is correct and deliberate: everything past that gate renders HTML and ASCII, and a video creative drawn as a banner is the leak the guard exists to prevent. The endpoint was calling straight into it and getting exactly what the guard promised. Selection is not duplicated to get around it. serveAd is where credits, paper spend, trend matching, the auction and the impression live, and a second copy of that is a second set of numbers — with the one not wired to billing being the one that quietly gives inventory away. Instead the context carries an explicit `streaming` flag, and it opens the gate and closes the renderer in the same move: a streaming request is matched against the slot's own format list with no width negotiation, and the fill's html and text come back empty. So the only path allowed past the refusal is also the one path that cannot render markup, which is what the refusal was protecting. A streaming break negotiates nothing on purpose. There is no width to fit and no smaller unit to fall back to, so the slot must offer the format outright, which keeps the publisher in control of what their break can carry. fitAdFormat's own refusal is now pinned by a test, including for a slot that lists the format, since that is the configuration someone will eventually try. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
ralyodio
force-pushed
the
ads-decision
branch
from
September 24, 2026 21:13
239ba15 to
d8e9497
Compare
ThreatCrush Security Scan48 finding(s) HIGH/CRITICAL: 2 | MEDIUM: 31 | LOW: 15
Snippets are redacted; ThreatCrush never prints matched credential material. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The break endpoint returned an empty fill for every request.
fitAdFormatrefuses streaming formats outright and it is the gate in front ofserveAd— so the endpoint was calling straight into it and getting exactly what the guard promised.That refusal is correct and deliberate: everything past that gate renders HTML and ASCII, and a video creative drawn as a banner is the leak the guard exists to prevent.
Selection is not duplicated to get around it
serveAdis where credits, paper spend, trend matching, the auction and the impression live. A second copy of that is a second set of numbers, and the one not wired to billing is the one that quietly gives inventory away.Instead the context carries an explicit
streamingflag that opens the gate and closes the renderer in the same move:htmlandtextcome back emptySo the only path allowed past the refusal is also the one path that cannot render markup — which is what the refusal was protecting.
A streaming break negotiates nothing on purpose: there's no width to fit and no smaller unit to fall back to, so the slot must offer the format outright. That keeps the publisher in control of what their break can carry.
Verification
fitAdFormat's refusal is now pinned by a test, including for a slot that lists the format — that's the configuration someone will eventually try, and it's the one where a regression would be invisible.2597 passed / 1 failed repo-wide (pre-existing
tracker-geo). Typechecks clean.Live state: nixamp now has an active slot (
7e0ea02c) carryingvideo_preroll_5s, and 182 of 185 video creatives have a published revision — so there is real inventory and real demand waiting on this.