Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/engineering/ENGINEERING_PRINCIPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,13 @@ entry points, safety boundary, evidence, and disposition in the
[Product Intent-Fit Audit](INTENT_FIT_AUDIT.md) format. Hold mismatches and
record material `PASS_WITH_GAPS` remediation instead of passing the uncertainty
to a tester.

## Volatile event facts

Volatile event facts are stats, records, results, standings, rosters and
live or final state. They must carry source, fetched-at and season context, or
be omitted (issue #147). No current ChannelForge code writes them into guide
programme text: an event guide carries only the title, time and channel from the user's own guide.
Programme text in a merged guide is the guide author's data, passed through
unchanged. A change that makes ChannelForge write such text must add those
safeguards first.
15 changes: 15 additions & 0 deletions tests/unit/EventGuidePlan.Tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,19 @@ Describe 'Event guide for high channels' {
$out = Invoke-Plan -Xmltv (New-Xmltv $tba) -Entry @((New-Entry 'PPV 1' 1 'ppv1'), (New-Entry 'News' 2 'news'))
@($out.Rows[$out.Plan.Channel[0].Id] | ForEach-Object { $_.Title } | Select-Object -Unique) | Should -Be @('PPV 1')
}

It 'writes only a title for each event programme and none of the provider description, sub-title or category text' {
$stat = 'Team A is 12-0 this season'
$body = "<programme start=`"$($script:Day)180000 +0000`" stop=`"$($script:Day)210000 +0000`" channel=`"ppv1`"><title>Big Fight Night</title><sub-title>$stat</sub-title><desc>$stat</desc><category>$stat</category></programme>"
$xmltv = [Text.Encoding]::UTF8.GetBytes("<?xml version=`"1.0`"?><tv>$body</tv>")
$bytes = InModuleScope ChannelForge -Parameters @{ X = $xmltv; E = @((New-Entry 'PPV 1' 1 'ppv1')) } {
$plan = Get-ChannelForgeEventGuidePlan -XmltvBytes $X -Entry $E
[byte[]](Add-ChannelForgePlaceholderGuide -XmltvBytes $X -Channel $plan.Channel -TimeZone ([TimeZoneInfo]::Utc) | Select-Object -Last 1)
}
$doc = [xml][Text.Encoding]::UTF8.GetString($bytes)
$own = @($doc.tv.programme | Where-Object { $_.channel -like 'ChannelForge-*' })
$own.Count | Should -BeGreaterThan 0
foreach ($programme in $own) { @($programme.ChildNodes | ForEach-Object { $_.Name }) | Should -Be @('title') }
($own | ForEach-Object { $_.OuterXml }) -join '' | Should -Not -BeLike "*$stat*"
}
}
Loading