fix: cap automatic playout refreshes

This commit is contained in:
2026-07-12 19:28:15 +09:00
parent 6e00955f1b
commit df60e09884
16 changed files with 603 additions and 37 deletions

View File

@@ -89,6 +89,7 @@ foreach ($script in $scripts) {
}
$appScript = Get-Content -LiteralPath (Join-Path $repositoryRoot 'Web\app.js') -Raw -Encoding UTF8
$playoutSafetyScript = Get-Content -LiteralPath (Join-Path $repositoryRoot 'Web\playout-safety.js') -Raw -Encoding UTF8
$indexMarkup = Get-Content -LiteralPath (Join-Path $repositoryRoot 'Web\index.html') -Raw -Encoding UTF8
$namedPlaylistScript = Get-Content -LiteralPath (Join-Path $repositoryRoot 'Web\named-playlist-workflow.js') -Raw -Encoding UTF8
$mainWindowScript = Get-Content -LiteralPath (Join-Path $repositoryRoot 'MainWindow.xaml.cs') -Raw -Encoding UTF8
@@ -97,6 +98,26 @@ $pagePlanBridgeScript = Get-Content -LiteralPath (Join-Path $repositoryRoot 'Mai
$legacyWorkflowScript = Get-Content -LiteralPath (Join-Path $repositoryRoot 'src\MBN_STOCK_WEBVIEW.Core\Playout\Scenes\LegacyPlayoutWorkflow.cs') -Raw -Encoding UTF8
$backgroundScript = Get-Content -LiteralPath (Join-Path $repositoryRoot 'MainWindow.Background.cs') -Raw -Encoding UTF8
$playoutMainScript = Get-Content -LiteralPath (Join-Path $repositoryRoot 'MainWindow.Playout.cs') -Raw -Encoding UTF8
$playoutExample = Get-Content -LiteralPath (Join-Path $repositoryRoot 'Config\playout.example.json') -Raw -Encoding UTF8 |
ConvertFrom-Json
if ($playoutExample.PSObject.Properties.Name -notcontains 'maximumAutomaticRefreshesPerTakeIn' -or
$null -ne $playoutExample.maximumAutomaticRefreshesPerTakeIn) {
throw 'The example playout configuration must preserve the unlimited null compatibility default.'
}
if ($playoutMainScript -notmatch 'MaximumAutomaticRefreshesPerTakeIn' -or
$playoutMainScript -notmatch 'scheduler\.HasReachedMaximum' -or
$playoutMainScript -notmatch 'ExecuteRefreshAndTrackSuccessAsync' -or
$playoutMainScript -notmatch 'DrainMaximumCallbackAsync' -or
$playoutMainScript -notmatch 'refreshCompletedCount' -or
$playoutMainScript -notmatch 'refreshMaximumCount' -or
$playoutMainScript -notmatch 'refreshLimitReached') {
throw 'The trusted automatic-refresh ceiling and final callback-drain status are not fully wired.'
}
if ($appScript -notmatch 'normalizeRefreshBudget' -or
$appScript -notmatch 'formatRefreshBudgetState' -or
$playoutSafetyScript -notmatch 'CAPPED') {
throw 'The Web operator surface does not expose the native automatic-refresh ceiling.'
}
$sceneCatalogMatches = [regex]::Matches(
$appScript,
'builderKey:\s*"s[0-9]+"')