From 72deedd098bbf25965eab96bb62268cc724739c5 Mon Sep 17 00:00:00 2001 From: Jumpstile Date: Tue, 17 Nov 2026 11:16:14 -0500 Subject: [PATCH] Add a read-only preflight report for the output, cache and backup folders (#53) Get-ChannelForgePreflightReport (preflight-report/v1) checks, for OutputRoot, CacheRoot and an optional BackupRoot: exists, inside the project, not a link, writable (one tiny file in a .preflight subfolder, removed again) and free space. It also checks that staging and final share a volume and that the published M3U and XMLTV match their manifest. A check that cannot run is Unknown, never Pass. It never changes accepted state or published output. Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01NzHAcjThVoUGWWfXrYWsNh --- src/ChannelForge/ChannelForge.psd1 | 1 + .../Get-ChannelForgePreflightFinding.ps1 | 141 ++++++++++++++++++ .../Get-ChannelForgePreflightReport.ps1 | 48 ++++++ tests/unit/PreflightReport.Tests.ps1 | 110 ++++++++++++++ 4 files changed, 300 insertions(+) create mode 100644 src/ChannelForge/Private/Get-ChannelForgePreflightFinding.ps1 create mode 100644 src/ChannelForge/Public/Get-ChannelForgePreflightReport.ps1 create mode 100644 tests/unit/PreflightReport.Tests.ps1 diff --git a/src/ChannelForge/ChannelForge.psd1 b/src/ChannelForge/ChannelForge.psd1 index f3883bd..33f14b6 100644 --- a/src/ChannelForge/ChannelForge.psd1 +++ b/src/ChannelForge/ChannelForge.psd1 @@ -125,6 +125,7 @@ FunctionsToExport = @( 'Set-ChannelForgeEventChannel' 'Get-ChannelForgeGuideReadiness' 'Get-ChannelForgeGuideQualityReport' + 'Get-ChannelForgePreflightReport' 'Get-ChannelForgeOneGuide' 'Get-ChannelForgeWebStatus' 'Read-ChannelForgeEpgSource' diff --git a/src/ChannelForge/Private/Get-ChannelForgePreflightFinding.ps1 b/src/ChannelForge/Private/Get-ChannelForgePreflightFinding.ps1 new file mode 100644 index 0000000..6ccd9ce --- /dev/null +++ b/src/ChannelForge/Private/Get-ChannelForgePreflightFinding.ps1 @@ -0,0 +1,141 @@ +function New-ChannelForgePreflightFinding { + param( + [Parameter(Mandatory)][string]$Check, + [Parameter(Mandatory)][string]$Root, + [Parameter(Mandatory)][ValidateSet('Pass', 'Fail', 'Unknown')][string]$Status, + [Parameter(Mandatory)][string]$Observed, + [Parameter(Mandatory)][string]$Expected, + [string]$NotTested = 'Nothing else.', + [string]$NextStep = 'No action needed.' + ) + $severity = switch ($Status) { 'Fail' { 'Error' } 'Unknown' { 'Warning' } default { 'Info' } } + [pscustomobject][ordered]@{ + Check = $Check; Root = $Root; Status = $Status; Severity = $severity + Observed = $Observed; Expected = $Expected; NotTested = $NotTested; NextStep = $NextStep + } +} + +function Get-ChannelForgePreflightDisplayRoot { + param([Parameter(Mandatory)][string]$Path, [Parameter(Mandatory)][string]$RepositoryRoot) + if (-not (Test-ChannelForgeWritePath -Path $Path -AllowedRoot $RepositoryRoot)) { return '[outside the project]' } + $relative = [IO.Path]::GetRelativePath([IO.Path]::GetFullPath($RepositoryRoot), [IO.Path]::GetFullPath($Path)) + return $relative -replace '\\', '/' +} + +function Test-ChannelForgePreflightCanary { + # Writes one tiny file in /.preflight, reads it back, then removes only what it made. + param([Parameter(Mandatory)][string]$Path) + $folder = Join-Path $Path '.preflight' + if ([IO.Directory]::Exists($folder) -or [IO.File]::Exists($folder)) { + return [pscustomobject]@{ Ok = $false; Detail = 'A ".preflight" item already exists, so no test file was written.' } + } + $file = Join-Path $folder ('canary-' + [guid]::NewGuid().ToString('N') + '.txt') + $ok = $false; $detail = '' + try { + [void][IO.Directory]::CreateDirectory($folder) + [IO.File]::WriteAllText($file, 'channelforge-preflight') + $ok = [IO.File]::ReadAllText($file) -ceq 'channelforge-preflight' + if (-not $ok) { $detail = 'The test file did not read back the same.' } + } + catch { $detail = 'The folder could not be written.' } + finally { + try { if ([IO.File]::Exists($file)) { [IO.File]::Delete($file) } } catch { $null = $_ } + try { if ([IO.Directory]::Exists($folder)) { [IO.Directory]::Delete($folder, $false) } } catch { $null = $_ } + } + if ([IO.Directory]::Exists($folder)) { return [pscustomobject]@{ Ok = $false; Detail = 'The test file or its ".preflight" folder could not be removed.' } } + return [pscustomobject]@{ Ok = $ok; Detail = $detail } +} + +function Get-ChannelForgePreflightRootFinding { + param( + [Parameter(Mandatory)][string]$Name, + [Parameter(Mandatory)][string]$Path, + [Parameter(Mandatory)][string]$RepositoryRoot, + [Parameter(Mandatory)][long]$MinimumFreeBytes + ) + $display = Get-ChannelForgePreflightDisplayRoot -Path $Path -RepositoryRoot $RepositoryRoot + $rest = 'Reparse point, write test, free space.' + $new = { param($check, $status, $observed, $expected, $notTested, $next) + New-ChannelForgePreflightFinding -Check "$Name $check" -Root $display -Status $status -Observed $observed -Expected $expected -NotTested $notTested -NextStep $next } + + if (-not [IO.Directory]::Exists($Path)) { + return & $new 'exists' 'Fail' 'The folder is missing.' 'The folder exists.' $rest 'Create this folder, then run the check again.' + } + if (-not (Test-ChannelForgeWritePath -Path $Path -AllowedRoot $RepositoryRoot)) { + return & $new 'inside project' 'Fail' 'The folder is outside the project.' 'The folder is inside the project.' $rest 'Choose a folder inside the project folder.' + } + try { Assert-ChannelForgeGenerationSafePath -RepositoryRoot $RepositoryRoot -Path $Path | Out-Null } + catch { + return & $new 'no link' 'Fail' 'The folder or a parent is a link or is not safe to use.' 'A normal folder, not a symlink or junction.' 'Write test, free space.' 'Use a real folder instead of a link.' + } + $canary = Test-ChannelForgePreflightCanary -Path $Path + $writable = if ($canary.Ok) { + & $new 'writable' 'Pass' 'A test file was written, read back and removed.' 'The folder is writable and cleanup works.' 'Permissions on files that already exist.' 'No action needed.' + } + else { + & $new 'writable' 'Fail' $canary.Detail 'The folder is writable and cleanup works.' 'Free space.' 'Check that you can create and delete files in this folder, and remove any leftover ".preflight" folder by hand.' + } + $floorMb = [long]($MinimumFreeBytes / 1MB) + try { + $free = ([IO.DriveInfo]::new([IO.Path]::GetPathRoot([IO.Path]::GetFullPath($Path)))).AvailableFreeSpace + $space = if ($free -ge $MinimumFreeBytes) { + & $new 'free space' 'Pass' ('{0} MB free.' -f [long]($free / 1MB)) "At least $floorMb MB free." 'Space needed by one specific build.' 'No action needed.' + } + else { + & $new 'free space' 'Fail' ('{0} MB free.' -f [long]($free / 1MB)) "At least $floorMb MB free." 'Space needed by one specific build.' 'Free up disk space on this drive.' + } + } + catch { + $space = & $new 'free space' 'Unknown' 'Free space could not be read.' "At least $floorMb MB free." 'Free space.' 'Check the free space on this drive by hand.' + } + return @( + (& $new 'exists' 'Pass' 'The folder exists.' 'The folder exists.' 'Nothing else.' 'No action needed.'), + (& $new 'inside project' 'Pass' 'The folder is inside the project.' 'The folder is inside the project.' 'Nothing else.' 'No action needed.'), + (& $new 'no link' 'Pass' 'The folder is a normal folder.' 'A normal folder, not a symlink or junction.' 'Nothing else.' 'No action needed.'), + $writable, + $space + ) +} + +function Get-ChannelForgePreflightVolumeFinding { + param([Parameter(Mandatory)][string]$RepositoryRoot) + $paths = Get-ChannelForgeGenerationPaths -RepositoryRoot $RepositoryRoot + $make = { param($status, $observed, $next) + New-ChannelForgePreflightFinding -Check 'staging and final on one volume' -Root 'state' -Status $status -Observed $observed -Expected 'Staging and final folders are on the same volume.' -NotTested 'Whether the file system supports atomic replace.' -NextStep $next } + try { + $null = Initialize-ChannelForgeGenerationStore + Assert-ChannelForgeGenerationSameVolume -RepositoryRoot $paths.Staging -Paths @($paths.Generations) + return & $make 'Pass' 'Staging and final folders are on the same volume.' 'No action needed.' + } + catch { + if ($_.Exception.Message -like '*another volume*') { + return & $make 'Fail' 'Staging and final folders are on different volumes.' 'Move the state folder so staging and final output share one drive.' + } + return & $make 'Unknown' 'The volumes could not be compared.' 'Check by hand that the state folder is on one drive.' + } +} + +function Get-ChannelForgePreflightPublishedFinding { + # Reuses the accepted-state reader, which re-hashes the published files against their manifest. + param([Parameter(Mandatory)][string]$RepositoryRoot) + $paths = Get-ChannelForgeGenerationPaths -RepositoryRoot $RepositoryRoot + $make = { param($name, $status, $observed, $next) + New-ChannelForgePreflightFinding -Check "published $name matches manifest" -Root 'state' -Status $status -Observed $observed -Expected 'The file hash equals the manifest hash.' -NotTested 'Playlist content, guide binding.' -NextStep $next } + $unknown = 'No published output was found yet.' + $snapshot = $null; $problem = $null + if ([IO.File]::Exists($paths.Current)) { + try { $snapshot = Get-ChannelForgeGenerationCurrentSnapshot -RepositoryRoot $RepositoryRoot -Paths $paths } + catch { $problem = [string]$_.Exception.Message } + } + $rebuild = 'Rebuild and accept the lineup again; do not edit published files by hand.' + if ($null -ne $problem) { + $m3u = if ($problem -like '*M3U hash mismatch*') { & $make 'M3U' 'Fail' 'The published file changed after it was accepted.' $rebuild } else { & $make 'M3U' 'Unknown' 'The published files could not be verified.' 'Run the accepted-state recovery check.' } + $xml = if ($problem -like '*XMLTV hash mismatch*') { & $make 'XMLTV' 'Fail' 'The published file changed after it was accepted.' $rebuild } else { & $make 'XMLTV' 'Unknown' 'The published files could not be verified.' 'Run the accepted-state recovery check.' } + return @($m3u, $xml) + } + if ($null -eq $snapshot) { + return @((& $make 'M3U' 'Unknown' $unknown 'Accept a lineup first.'), (& $make 'XMLTV' 'Unknown' $unknown 'Accept a lineup first.')) + } + $xmlFinding = if ($null -eq $snapshot.XMLTV) { & $make 'XMLTV' 'Unknown' 'The accepted lineup has no guide file.' 'Accept a lineup with a guide if you need one.' } else { & $make 'XMLTV' 'Pass' 'The file matches.' 'No action needed.' } + return @((& $make 'M3U' 'Pass' 'The file matches.' 'No action needed.'), $xmlFinding) +} diff --git a/src/ChannelForge/Public/Get-ChannelForgePreflightReport.ps1 b/src/ChannelForge/Public/Get-ChannelForgePreflightReport.ps1 new file mode 100644 index 0000000..29ce843 --- /dev/null +++ b/src/ChannelForge/Public/Get-ChannelForgePreflightReport.ps1 @@ -0,0 +1,48 @@ +function Get-ChannelForgePreflightReport { + <# + .SYNOPSIS + Checks, read-only, that the folders ChannelForge writes to are ready. + + .DESCRIPTION + Report contract preflight-report/v1. For OutputRoot, CacheRoot and an optional BackupRoot it checks: exists, inside + the project, not a link, writable (one tiny file in a ".preflight" subfolder, removed again) and free space. + It also checks that the staging and final folders share one volume and that the published M3U and XMLTV match + their manifest. A check that cannot run is Unknown, never Pass. It never changes accepted state or published output. + #> + [CmdletBinding()] + param( + [ValidateNotNullOrEmpty()] + [string]$RepositoryRoot = (Get-ChannelForgeWebRepositoryRoot), + [string]$OutputRoot, + [string]$CacheRoot, + [string]$BackupRoot, + [ValidateRange(0, [long]::MaxValue)] + [long]$MinimumFreeSpaceMB = 100 + ) + + $repo = [IO.Path]::GetFullPath($RepositoryRoot) + if ([string]::IsNullOrWhiteSpace($OutputRoot)) { $OutputRoot = Join-Path $repo 'output/reports' } + if ([string]::IsNullOrWhiteSpace($CacheRoot)) { $CacheRoot = Join-Path $repo 'output/cache' } + $roots = [ordered]@{ OutputRoot = $OutputRoot; CacheRoot = $CacheRoot } + if (-not [string]::IsNullOrWhiteSpace($BackupRoot)) { $roots['BackupRoot'] = $BackupRoot } + + $floor = [long]([Math]::Min([decimal]$MinimumFreeSpaceMB * 1MB, [decimal][long]::MaxValue)) + $findings = [System.Collections.Generic.List[object]]::new() + foreach ($name in $roots.Keys) { + $path = [IO.Path]::GetFullPath([string]$roots[$name]) + foreach ($f in @(Get-ChannelForgePreflightRootFinding -Name $name -Path $path -RepositoryRoot $repo -MinimumFreeBytes $floor)) { $findings.Add($f) } + } + $findings.Add((Get-ChannelForgePreflightVolumeFinding -RepositoryRoot $repo)) + foreach ($f in @(Get-ChannelForgePreflightPublishedFinding -RepositoryRoot $repo)) { $findings.Add($f) } + + $count = { param($s) @($findings | Where-Object { $_.Status -eq $s }).Count } + $failed = & $count 'Fail'; $unknown = & $count 'Unknown' + return [pscustomobject][ordered]@{ + Version = 'preflight-report/v1' + Findings = @($findings) + Summary = [pscustomobject][ordered]@{ + Pass = & $count 'Pass'; Fail = $failed; Unknown = $unknown + Overall = if ($failed -gt 0) { 'Fail' } elseif ($unknown -gt 0) { 'Unknown' } else { 'Pass' } + } + } +} diff --git a/tests/unit/PreflightReport.Tests.ps1 b/tests/unit/PreflightReport.Tests.ps1 new file mode 100644 index 0000000..694c027 --- /dev/null +++ b/tests/unit/PreflightReport.Tests.ps1 @@ -0,0 +1,110 @@ +BeforeAll { + $repoRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) + Import-Module (Join-Path $repoRoot 'src/ChannelForge/ChannelForge.psd1') -Force + + function New-Project { $p = Join-Path $TestDrive ('p-' + [guid]::NewGuid().ToString('N')); New-Item -ItemType Directory -Force -Path (Join-Path $p 'output/reports'), (Join-Path $p 'output/cache') | Out-Null; $p } + function Get-Snapshot([string]$Root) { @(Get-ChildItem -LiteralPath $Root -Recurse -Force | Sort-Object FullName | ForEach-Object { '{0}|{1}' -f $_.FullName, $(if ($_.PSIsContainer) { 'dir' } else { (Get-FileHash -LiteralPath $_.FullName).Hash }) }) } + function Get-Finding($Report, [string]$Check) { @($Report.Findings | Where-Object { $_.Check -eq $Check }) } + function New-Issue103Fixture { + param([Parameter(Mandatory)][string]$GenerationId,[switch]$Generated,[AllowNull()][object]$PreviousStateHash,[AllowNull()][object]$PreviousOutputManifestHash) + & (Get-Module ChannelForge) { + param($GenerationId,$Generated,$PreviousStateHash,$PreviousOutputManifestHash) + $a='a'*64; $b='b'*64; $c='c'*64 + $m3uDecision=New-ChannelForgeDecisionM3U -CandidateManifestHash $a -BuildIdentity $b -AcceptedParentGenerationManifestHash $null -IncludedCandidateEntryIds @($a) -ExcludedCandidateEntryIds @($b) -DecisionIds @($c) + $xmlDecision=if ($Generated) { New-ChannelForgeDecisionXMLTV -CandidateManifestHash $a -BuildIdentity $b -AcceptedParentGenerationManifestHash $null -AcceptedXMLTVStatus Generated -IncludedCandidateEntryIds @($a) -ExcludedCandidateEntryIds @($b) -DecisionIds @($c) } else { $null } + $status=if ($Generated) {'Generated'} else {'NotGenerated'} + $decision=New-ChannelForgeDecisionManifest -CandidateManifestHash $a -BuildIdentity $b -M3UDecision $m3uDecision -XMLTVDecision $xmlDecision -XMLTVDecisionStatus $status + $m3u=[Text.Encoding]::UTF8.GetBytes("#EXTM3U`n#EXTINF:-1,Channel $GenerationId`nhttps://example.invalid/$GenerationId`n") + $m3uHash=Get-ChannelForgeDomainHash -Domain 'active-m3u/v2' -Bytes $m3u + $xml=if ($Generated) { [Text.Encoding]::UTF8.GetBytes('') } else { $null } + $xmlHash=if ($Generated) { Get-ChannelForgeDomainHash -Domain 'active-xmltv/v2' -Bytes $xml } else { $null } + $output=[ordered]@{Version='blocker-2-contract/v8-acceptance';GenerationId=$GenerationId;ActiveM3UHash=$m3uHash;ActiveXMLTVStatus=$status;ActiveXMLTVHash=$xmlHash;AcceptedStateHash=$b;OutputManifestHash=$null} + $output.OutputManifestHash=Get-ChannelForgeAcceptanceHash -Domain 'previous-output-manifest/v2' -Projection $output -HashProperty OutputManifestHash -Omit @('GenerationId','AcceptedStateHash') + $state=[ordered]@{Version='blocker-2-contract/v8-acceptance';GenerationId=$GenerationId;BuildIdentity=$b;CandidateManifestHash=$a;DecisionManifestHash=$decision.DecisionManifestHash;AcceptedOutputManifestHash=$output.OutputManifestHash;PreviousStateHash=$PreviousStateHash;IncludedCandidateEntryIds=@($a);ExcludedCandidateEntryIds=@($b);AcceptedBindingIds=@($c);AcceptedXMLTVStatus=$status;AcceptedAtUtc='2026-08-29T00:00:00Z';AcceptedStateHash=$null} + $state.AcceptedStateHash=Get-ChannelForgeAcceptanceHash -Domain 'accepted-state/v2' -Projection $state -HashProperty AcceptedStateHash -Omit @('GenerationId','AcceptedAtUtc') + $output.AcceptedStateHash=$state.AcceptedStateHash + $manifest=[ordered]@{Version='blocker-2-contract/v8-acceptance';GenerationId=$GenerationId;BuildIdentity=$b;CandidateManifestHash=$a;DecisionManifestHash=$decision.DecisionManifestHash;AcceptedStateHash=$state.AcceptedStateHash;AcceptedOutputManifestHash=$output.OutputManifestHash;ActiveM3UHash=$output.ActiveM3UHash;ActiveXMLTVHash=$output.ActiveXMLTVHash;PreviousOutputManifestHash=$PreviousOutputManifestHash;GenerationManifestHash=$null} + $manifest.GenerationManifestHash=Get-ChannelForgeAcceptanceHash -Domain 'generation-manifest/v2' -Projection $manifest -HashProperty GenerationManifestHash -Omit @('GenerationId') + [pscustomobject]@{GenerationManifest=[pscustomobject]$manifest;AcceptedState=[pscustomobject]$state;AcceptedOutputManifest=[pscustomobject]$output;DecisionManifest=$decision;M3UBytes=$m3u;XMLTVBytes=$xml} + } $GenerationId ([bool]$Generated) $PreviousStateHash $PreviousOutputManifestHash + } + function Publish-Fixture([string]$Root) { + $f = New-Issue103Fixture -GenerationId '0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef' -Generated + Publish-ChannelForgeAcceptedGeneration -RepositoryRoot $Root -GenerationManifest $f.GenerationManifest -AcceptedState $f.AcceptedState -AcceptedOutputManifest $f.AcceptedOutputManifest -DecisionManifest $f.DecisionManifest -M3UBytes $f.M3UBytes -XMLTVBytes $f.XMLTVBytes | Out-Null + Join-Path $Root 'state/generations/0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef' + } +} + +Describe 'Get-ChannelForgePreflightReport' { + It 'passes a healthy project and leaves the roots exactly as they were' { + $p = New-Project + Set-Content -LiteralPath (Join-Path $p 'output/reports/keep.txt') -Value 'keep' + $before = Get-Snapshot $p + $r = Get-ChannelForgePreflightReport -RepositoryRoot $p + $r.Version | Should -Be 'preflight-report/v1' + @($r.Findings | Where-Object { $_.Status -eq 'Fail' }).Count | Should -Be 0 + (Get-Finding $r 'OutputRoot writable').Status | Should -Be 'Pass' + Get-Snapshot $p | Should -Be $before + Test-Path -LiteralPath (Join-Path $p 'output/reports/.preflight') | Should -BeFalse + } + + It 'fails a missing root with a next step and does not create it' { + $p = New-Project + $r = Get-ChannelForgePreflightReport -RepositoryRoot $p -BackupRoot (Join-Path $p 'backups') + $f = Get-Finding $r 'BackupRoot exists' + $f.Status | Should -Be 'Fail' + $f.NextStep | Should -Not -BeNullOrEmpty + $r.Summary.Overall | Should -Be 'Fail' + Test-Path -LiteralPath (Join-Path $p 'backups') | Should -BeFalse + } + + It 'fails a root outside the project' { + $p = New-Project + $other = Join-Path $TestDrive 'elsewhere'; New-Item -ItemType Directory -Path $other | Out-Null + (Get-Finding (Get-ChannelForgePreflightReport -RepositoryRoot $p -OutputRoot $other) 'OutputRoot inside project').Status | Should -Be 'Fail' + } + + It 'fails an unwritable root and removes nothing of the user''s' { + $p = New-Project + New-Item -ItemType File -Path (Join-Path $p 'output/reports/.preflight') | Out-Null + $f = Get-Finding (Get-ChannelForgePreflightReport -RepositoryRoot $p) 'OutputRoot writable' + $f.Status | Should -Be 'Fail' + $f.NextStep | Should -Not -BeNullOrEmpty + Test-Path -LiteralPath (Join-Path $p 'output/reports/.preflight') | Should -BeTrue + } + + It 'fails when the free-space floor is larger than the drive' { + $p = New-Project + $r = Get-ChannelForgePreflightReport -RepositoryRoot $p -MinimumFreeSpaceMB 1000000000 + (Get-Finding $r 'OutputRoot free space').Status | Should -Be 'Fail' + } + + It 'fails a root that is a junction' { + $p = New-Project + $target = Join-Path $TestDrive 'target'; New-Item -ItemType Directory -Path $target | Out-Null + $link = Join-Path $p 'linked' + try { New-Item -ItemType Junction -Path $link -Target $target -ErrorAction Stop | Out-Null } catch { Set-ItResult -Skipped -Because 'this process cannot create a junction'; return } + (Get-Finding (Get-ChannelForgePreflightReport -RepositoryRoot $p -OutputRoot $link) 'OutputRoot no link').Status | Should -Be 'Fail' + } + + It 'reports Unknown, not Pass, when nothing is published yet' { + $r = Get-ChannelForgePreflightReport -RepositoryRoot (New-Project) + (Get-Finding $r 'published M3U matches manifest').Status | Should -Be 'Unknown' + (Get-Finding $r 'published XMLTV matches manifest').Status | Should -Be 'Unknown' + $r.Summary.Overall | Should -Be 'Unknown' + } + + It 'passes matching published files and fails a changed byte' { + $p = New-Project + $generation = Publish-Fixture $p + $r = Get-ChannelForgePreflightReport -RepositoryRoot $p + (Get-Finding $r 'published M3U matches manifest').Status | Should -Be 'Pass' + (Get-Finding $r 'published XMLTV matches manifest').Status | Should -Be 'Pass' + $m3u = Join-Path $generation 'merged.m3u' + Set-ItemProperty -LiteralPath $m3u -Name IsReadOnly -Value $false + [IO.File]::AppendAllText($m3u, 'x') + $r = Get-ChannelForgePreflightReport -RepositoryRoot $p + (Get-Finding $r 'published M3U matches manifest').Status | Should -Be 'Fail' + $r.Summary.Overall | Should -Be 'Fail' + } +}