test(streaming): enforce slice E physical evidence

Record route-lifetime streaming overruns and maximum operation costs, require canonical reveal/resource convergence at every connected checkpoint, and keep recenter semantics independent of the production wall-clock budget.

Co-authored-by: Erik Nilsson <erikn@users.noreply.github.com>
This commit is contained in:
Erik 2026-07-24 19:46:17 +02:00
parent 2ff8f844b0
commit 621f70eab6
6 changed files with 215 additions and 4 deletions

View file

@ -336,6 +336,42 @@ function Add-CanonicalCheckpointFailures([Diagnostics.Process]$Client) {
$failures.Add("canonical checkpoint '$expectedName' came from process $($checkpoint.processId), expected $($Client.Id)")
}
if ($null -eq $checkpoint.reveal) {
$failures.Add("canonical checkpoint '$expectedName' is missing reveal data")
}
else {
foreach ($field in @(
'materialized',
'completed',
'worldViewportObserved')) {
$property = $checkpoint.reveal.PSObject.Properties[$field]
if ($null -eq $property -or -not [bool]$property.Value) {
$failures.Add("canonical checkpoint '$expectedName' has reveal.$field=false or missing")
}
}
$cancelled =
$checkpoint.reveal.PSObject.Properties['cancelled']
if ($null -eq $cancelled -or [bool]$cancelled.Value) {
$failures.Add("canonical checkpoint '$expectedName' has reveal.cancelled=true or missing")
}
$invariants =
$checkpoint.reveal.PSObject.Properties['invariantFailureCount']
if ($null -eq $invariants -or [long]$invariants.Value -ne 0) {
$failures.Add("canonical checkpoint '$expectedName' has reveal invariant failure(s)")
}
$readiness =
$checkpoint.reveal.PSObject.Properties['readiness']
$isReady = if ($null -ne $readiness) {
$readiness.Value.PSObject.Properties['isReady']
}
if ($null -eq $isReady -or -not [bool]$isReady.Value) {
$failures.Add("canonical checkpoint '$expectedName' has incomplete reveal readiness")
}
}
if ($null -eq $checkpoint.render -or $null -eq $checkpoint.resources) {
$failures.Add("canonical checkpoint '$expectedName' is missing render/resources data")
continue
@ -403,6 +439,45 @@ function Add-CanonicalCheckpointFailures([Diagnostics.Process]$Client) {
$failures.Add("canonical checkpoint '$expectedName' has resources.$field=$($property.Value), expected zero")
}
}
$streamingWork =
$checkpoint.resources.PSObject.Properties['streamingWork']
if ($null -eq $streamingWork) {
$failures.Add("canonical checkpoint '$expectedName' is missing resources.streamingWork")
}
else {
foreach ($field in @(
'lifetimeFrameOverrunCount',
'lifetimeOversizedProgressCount',
'maximumFrameMilliseconds',
'maximumFrameStage',
'maximumOperationMilliseconds',
'maximumOperationStage')) {
if ($null -eq $streamingWork.Value.PSObject.Properties[$field]) {
$failures.Add("canonical checkpoint '$expectedName' is missing resources.streamingWork.$field")
}
}
foreach ($field in @(
'deferredCompletions',
'deferredAdoptedCpuBytes',
'pendingPublications',
'pendingRetirements',
'workerCompletionBacklog',
'destinationBacklog',
'controlBacklog',
'unloadBacklog',
'nearBacklog',
'farBacklog')) {
$property = $streamingWork.Value.PSObject.Properties[$field]
if ($null -eq $property) {
$failures.Add("canonical checkpoint '$expectedName' is missing resources.streamingWork.$field")
}
elseif ([long]$property.Value -ne 0) {
$failures.Add("canonical checkpoint '$expectedName' has resources.streamingWork.$field=$($property.Value), expected zero")
}
}
}
}
if ($DenseTown) {