Fix native progression routes around scenery and narrow depth views
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
param([Parameter(Mandatory)][string]$EvidenceDir,[Parameter(Mandatory)][string]$Fixture,[string]$CommonSource=(Join-Path $PSScriptRoot 'final-common.ps1'),[string]$ProgressionSource=(Join-Path $PSScriptRoot 'exercise-final-progression.ps1'))
|
||||
param([Parameter(Mandatory)][string]$EvidenceDir,[Parameter(Mandatory)][string]$Fixture,[string]$CommonSource=(Join-Path $PSScriptRoot 'final-common.ps1'),[string]$ProgressionSource=(Join-Path $PSScriptRoot 'exercise-final-progression.ps1'),[string]$BlockedFixture,[string]$LiftBefore,[string]$LiftAfter,[string]$FineFixture)
|
||||
$ErrorActionPreference='Stop'
|
||||
New-Item -ItemType Directory -Path $EvidenceDir -Force|Out-Null
|
||||
$checks=[Collections.Generic.List[object]]::new()
|
||||
@@ -22,6 +22,7 @@ function Adb([string[]]$Arguments){return 'Physical size: 1080x2400'}
|
||||
function Step([string]$Name,[string[]]$Arguments=@(),[int]$Delay=500){$commands.Add(@{name=$Name;arguments=$Arguments})}
|
||||
function Save([string]$Name){return $raw}
|
||||
function global:NativeMoveAndHold([string]$Name,$Board,[string]$Id,[int[]]$End){$commands.Add(@{nativeHeldMove=$true;id=$Id;end=$End});return $raw}
|
||||
function global:LiftMergeRoute([int]$Stage,[string]$Name,$Board,[int]$SourceCount=0,[int]$TargetCount=0){return [pscustomobject]@{State=$raw;Before=$Board;SourceId=$Board.balls[0].id}}
|
||||
try{
|
||||
foreach($name in @('BallPoint','WorldSafe','BallClear','Same')){ReadFunction $CommonSource $name}
|
||||
foreach($name in @('Board','Orbit','MergeReal')){ReadFunction $ProgressionSource $name}
|
||||
@@ -44,6 +45,8 @@ try{
|
||||
$script:touches.Clear();$rejected=$false;try{NativeMoveAndHold 'changed-preview' $board 's05-b04' $end|Out-Null}catch{$rejected=$true}
|
||||
Record 'persisted-preview-is-rejected-and-contact-released' ($rejected-and$script:touches.Count-eq3-and$script:touches[-1][3]-eq0) $script:touches.ToArray()
|
||||
ReadFunction $CommonSource 'AssertNativeMerge'
|
||||
$commonAst=[Management.Automation.Language.Parser]::ParseFile($CommonSource,[ref]$null,[ref]$null)
|
||||
if($commonAst.Find({param($n)$n-is[Management.Automation.Language.FunctionDefinitionAst]-and$n.Name-eq'AssertNativeTranslation'},$true)){ReadFunction $CommonSource 'AssertNativeTranslation'}
|
||||
$success=$board|ConvertTo-Json -Depth 20|ConvertFrom-Json
|
||||
$source=@($board.groups|Where-Object {$_.ballIds-contains's05-b04'})[0]
|
||||
$target=@($board.groups|Where-Object {$_.ballIds-notcontains's05-b04'})[0]
|
||||
@@ -81,7 +84,126 @@ try{
|
||||
$rejected=$false;try{AssertNativeMerge "offline-$kind" $board $bad 's05-b01' $targetSize}catch{$rejected=$true}
|
||||
Record 'invalid-group-translation-or-target-size-is-rejected' $rejected $kind
|
||||
}
|
||||
if($BlockedFixture){
|
||||
if(!$LiftBefore-or!$LiftAfter){throw 'Blocked-route controls require actual root-observed lift before/after saves'}
|
||||
$raw=Get-Content -LiteralPath $BlockedFixture -Raw|ConvertFrom-Json
|
||||
$blocked=Board $raw 18
|
||||
if(!$blocked-or$blocked.balls.Count-ne8-or$blocked.groups.Count-ne2){throw 'Requires actual Stage18 failed 7+1 save'}
|
||||
$commands.Clear();$script:routeCalls=0
|
||||
function Save([string]$Name){return $raw}
|
||||
function global:NativeMoveAndHold([string]$Name,$Board,[string]$Id,[int[]]$End){$commands.Add(@{nativeHeldMove=$true;id=$Id;end=$End});return $raw}
|
||||
function global:LiftMergeRoute([int]$Stage,[string]$Name,$Board,[int]$SourceCount=0,[int]$TargetCount=0){$script:routeCalls++;$commands.Add(@{route=$true});return [pscustomobject]@{State=$raw;Before=$Board;SourceId='s18-b04'}}
|
||||
$bound=$false;try{MergeReal 18 'replay-actual-blocked18'|Out-Null}catch{$bound=$_.Exception.Message-match'Native merge bound reached'}
|
||||
$orbits=@($commands|Where-Object {$_.arguments.Count-ge7-and$_.arguments[2]-eq'swipe'})
|
||||
Record 'actual-blocked18-uses-one-detour-with-original-attempt-bound' ($bound-and$script:routeCalls-eq1-and$orbits.Count-eq16-and$commands[0].route) @{boundedFailureRetained=$bound;detours=$script:routeCalls;orbitAttempts=$orbits.Count;routeBeforeFirstOrbit=$commands[0].route}
|
||||
foreach($kind in @('missing-board-wrong-free','missing-board-without-completion','merged-without-contact')){
|
||||
$routeState=$raw|ConvertTo-Json -Depth 20|ConvertFrom-Json
|
||||
if($kind-eq'merged-without-contact'){
|
||||
(Board $routeState 18).groups=@([pscustomobject]@{id='unproven';ballIds=@($blocked.balls.id)})
|
||||
@((Board $routeState 18).balls|Where-Object id -eq 's18-b04')[0].position.y+=.1
|
||||
}
|
||||
else{
|
||||
$routeState.puzzleStates=@($routeState.puzzleStates|Where-Object stageId -ne 18)
|
||||
if($kind-eq'missing-board-wrong-free'){$routeState.completedStageIds+=18}
|
||||
else{$routeState.latestFreePlay=$blocked|ConvertTo-Json -Depth 20|ConvertFrom-Json;$routeState.latestFreePlay|Add-Member sourceStageId 18}
|
||||
}
|
||||
function global:LiftMergeRoute([int]$Stage,[string]$Name,$Board,[int]$SourceCount=0,[int]$TargetCount=0){return [pscustomobject]@{State=$routeState;Before=$Board;SourceId='s18-b04'}}
|
||||
$errorText=$null;try{MergeReal 18 "invalid-caller-route-$kind"|Out-Null}catch{$errorText=$_.Exception.Message}
|
||||
$expectedCheck=if($kind-eq'merged-without-contact'){'real-three-dimensional-contact'}else{'route-completed-stage'}
|
||||
Record 'caller-rejects-unproven-route-completion-or-contact' ($errorText-match$expectedCheck) @{kind=$kind;error=$errorText}
|
||||
}
|
||||
if($FineFixture){
|
||||
function global:LiftMergeRoute {return $null}
|
||||
function Save([string]$Name){return $raw|ConvertTo-Json -Depth 20|ConvertFrom-Json}
|
||||
foreach($mutation in @('none','ball','membership','collection','count','camera-no-op')){
|
||||
$raw=Get-Content -LiteralPath $FineFixture -Raw|ConvertFrom-Json
|
||||
$commands.Clear();$script:fineMoves=0;$script:orbitContacts=[Collections.Generic.List[object]]::new();$script:orbitStart=$null;$script:orbitLast=0;$script:orbitDragged=$false
|
||||
function NativePointer([int[]]$Contacts){
|
||||
$script:orbitContacts.Add(@($Contacts))
|
||||
if($Contacts[3]-eq0){$script:orbitStart=$null;return}
|
||||
if($null-eq$script:orbitStart){$script:orbitStart=$Contacts[0];$script:orbitLast=$Contacts[0];$script:orbitDragged=$false;return}
|
||||
$script:orbitDragged=$script:orbitDragged-or[Math]::Abs($Contacts[0]-$script:orbitStart)-ge14
|
||||
if($script:orbitDragged-and$mutation-ne'camera-no-op'){
|
||||
$b=Board $raw 18
|
||||
$rotation=[Numerics.Quaternion]::new($b.camera.rotation.x,$b.camera.rotation.y,$b.camera.rotation.z,$b.camera.rotation.w)
|
||||
$changed=[Numerics.Quaternion]::CreateFromAxisAngle([Numerics.Vector3]::UnitY,(($Contacts[0]-$script:orbitLast)*.25*[Math]::PI/180))*$rotation
|
||||
$b.camera.rotation=[pscustomobject]@{x=$changed.X;y=$changed.Y;z=$changed.Z;w=$changed.W}
|
||||
}
|
||||
$script:orbitLast=$Contacts[0]
|
||||
}
|
||||
function Step([string]$Name,[string[]]$Arguments=@(),[int]$Delay=500){
|
||||
$commands.Add(@{name=$Name;arguments=$Arguments})
|
||||
$b=Board $raw 18
|
||||
switch($mutation){
|
||||
'ball'{$b.balls[0].position.x+=.1}
|
||||
'membership'{$b.groups[0].ballIds+= 's18-b01'}
|
||||
'collection'{$b.collectedBallIds+= 's18-b04'}
|
||||
'count'{$b.countedBallIds+= 's18-b04'}
|
||||
}
|
||||
}
|
||||
# Counterfactual camera/rigid-contact control derived from the exact failed pose.
|
||||
# This proves the verifier oracle and never represents a native completion.
|
||||
function global:NativeMoveAndHold([string]$Name,$Board,[string]$Id,[int[]]$End){
|
||||
$script:fineMoves++
|
||||
$after=$raw|ConvertTo-Json -Depth 20|ConvertFrom-Json;$b=Board $after 18
|
||||
$source=@($b.groups|Where-Object {$_.ballIds-contains$Id})[0]
|
||||
$s=@($b.balls|Where-Object id -eq $Id)[0].position;$t=@($b.balls|Where-Object id -eq 's18-b04')[0].position
|
||||
$delta=[Numerics.Vector3]::new($t.x+1-$s.x,$t.y-$s.y,$t.z-$s.z)
|
||||
foreach($ball in $b.balls|Where-Object {$source.ballIds-contains$_.id}){$ball.position.x+=$delta.X;$ball.position.y+=$delta.Y;$ball.position.z+=$delta.Z}
|
||||
$b.groups=@([pscustomobject]@{id='offline-contact';ballIds=@($b.balls.id)})
|
||||
return $after
|
||||
}
|
||||
$errorText=$null;$value=$null
|
||||
try{$value=MergeReal 18 "fine-control-$mutation" 7 1}catch{$errorText=$_.Exception.Message}
|
||||
$contacts=$script:orbitContacts.ToArray()
|
||||
$smallYaw=$contacts.Count-eq4-and$contacts[0][3]-eq1024-and$contacts[1][3]-eq1024-and$contacts[2][3]-eq1024-and$contacts[3][3]-eq0-and[Math]::Abs($contacts[1][0]-$contacts[0][0])-eq20-and[Math]::Abs($contacts[2][0]-$contacts[0][0])-eq8-and$contacts[3][0]-eq$contacts[2][0]
|
||||
$passed=if($mutation-eq'none'){$null-eq$errorText-and$script:fineMoves-eq1-and(Board $value 18).groups.Count-eq1}else{$errorText-match'fine-orbit-preserves-board'-and$script:fineMoves-eq0}
|
||||
Record 'fine-yaw-from-actual-near-window-retains-strict-oracle' ($passed-and$smallYaw) @{mutation=$mutation;contacts=$contacts;commands=$commands.ToArray();nativeMockMoves=$script:fineMoves;error=$errorText;scope='Offline counterfactual geometry control with actual 14px drag latch from failed pose'}
|
||||
}
|
||||
function Step([string]$Name,[string[]]$Arguments=@(),[int]$Delay=500){$commands.Add(@{name=$Name;arguments=$Arguments})}
|
||||
}
|
||||
ReadFunction $CommonSource 'AssertNativeTranslation'
|
||||
ReadFunction $ProgressionSource 'LiftMergeRoute'
|
||||
$raw=Get-Content -LiteralPath $LiftBefore -Raw|ConvertFrom-Json
|
||||
$lifted=Get-Content -LiteralPath $LiftAfter -Raw|ConvertFrom-Json
|
||||
$board=Board $raw 18;$script:liftRequests=[Collections.Generic.List[object]]::new()
|
||||
function RevealBall([int]$Stage,[string]$Id,[string]$Name){return $board}
|
||||
function global:NativeMoveAndHold([string]$Name,$Board,[string]$Id,[int[]]$End){$script:liftRequests.Add(@{sourceId=$Id;end=$End});return $lifted}
|
||||
$actual=LiftMergeRoute 18 'replay-actual-observed-lift' $board
|
||||
$point=BallPoint $board 's18-b04'
|
||||
Record 'actual-root-lift-save-pair-passes-rigid-ID-camera-controls' ($script:liftRequests.Count-eq1-and$script:liftRequests[0].sourceId-eq's18-b04'-and$script:liftRequests[0].end[0]-eq$point[0]-and$script:liftRequests[0].end[1]-eq($point[1]-120)-and(Same $actual.State $lifted)-and(Same $actual.Before $board)-and$actual.SourceId-eq's18-b04') 'Uses root actual before/drop saves; no synthetic native success or completion injection'
|
||||
foreach($kind in @('wrong-target-size','foreign-ball-moved','camera-changed','missing-ID','no-op-camera-changed')){
|
||||
$script:liftRequests.Clear();$lifted=Get-Content -LiteralPath $LiftAfter -Raw|ConvertFrom-Json;$targetSize=0
|
||||
switch($kind){
|
||||
'wrong-target-size'{$targetSize=4}
|
||||
'foreign-ball-moved'{(Board $lifted 18).balls[0].position.x+=.1}
|
||||
'camera-changed'{(Board $lifted 18).camera.distance+=.1}
|
||||
'missing-ID'{(Board $lifted 18).balls=@((Board $lifted 18).balls|Where-Object id -ne 's18-b01')}
|
||||
'no-op-camera-changed'{(Board $lifted 18).balls=$board.balls;(Board $lifted 18).camera.distance+=.1}
|
||||
}
|
||||
$rejected=$false;$value=$null;try{$value=LiftMergeRoute 18 "invalid-route-$kind" $board 0 $targetSize}catch{$rejected=$true}
|
||||
$passed=if($kind-eq'wrong-target-size'){$null-eq$value-and$script:liftRequests.Count-eq0}else{$rejected}
|
||||
Record 'invalid-route-result-or-ineligible-target-is-rejected' $passed $kind
|
||||
}
|
||||
$board=Board (Get-Content -LiteralPath $BlockedFixture -Raw|ConvertFrom-Json) 18
|
||||
$point=BallPoint $board 's18-b04'
|
||||
if(WorldSafe @($point[0],($point[1]-120))){throw 'Actual unsafe-endpoint fixture is unexpectedly safe'}
|
||||
foreach($kind in @('unchanged','disappeared','wrong-free','counts-changed','collection-changed','camera-changed')){
|
||||
$raw=Get-Content -LiteralPath $BlockedFixture -Raw|ConvertFrom-Json
|
||||
switch($kind){
|
||||
'disappeared'{$raw.puzzleStates=@($raw.puzzleStates|Where-Object stageId -ne 18)}
|
||||
'wrong-free'{$raw.puzzleStates=@($raw.puzzleStates|Where-Object stageId -ne 18);$raw.completedStageIds+=18}
|
||||
'counts-changed'{(Board $raw 18).countedBallIds+= 's18-b04'}
|
||||
'collection-changed'{(Board $raw 18).collectedBallIds+= 's18-b04'}
|
||||
'camera-changed'{(Board $raw 18).camera.distance+=.1}
|
||||
}
|
||||
$script:liftRequests.Clear();$rejected=$false;$value=$null
|
||||
try{$value=LiftMergeRoute 18 "unsafe-route-$kind" $board}catch{$rejected=$true}
|
||||
$passed=if($kind-eq'unchanged'){!$rejected-and(Same $value.State $raw)}else{$rejected}
|
||||
Record 'unsafe-detour-requires-exact-present-board-without-touch' ($passed-and$script:liftRequests.Count-eq0) $kind
|
||||
}
|
||||
}
|
||||
}catch{Record 'production-function-evaluation' $false $_.Exception.Message}
|
||||
$passed=$checks.Count-gt0-and@($checks|Where-Object passed -ne $true).Count-eq0
|
||||
@{passed=$passed;scope='Offline actual failed save replay and native-input/assertion negative controls; no ADB, no Unity, no native success claim';fixture=$Fixture;fixtureSha256=(Get-FileHash -LiteralPath $Fixture).Hash;commonSource=$CommonSource;commonSha256=(Get-FileHash -LiteralPath $CommonSource).Hash;progressionSource=$ProgressionSource;progressionSha256=(Get-FileHash -LiteralPath $ProgressionSource).Hash;checks=$checks.ToArray()}|ConvertTo-Json -Depth 12|Set-Content -LiteralPath (Join-Path $EvidenceDir 'live-drag-result.json')
|
||||
@{passed=$passed;scope='Offline actual failed save replay and native-input/assertion negative controls; no ADB, no Unity, no native success claim';fixture=$Fixture;fixtureSha256=(Get-FileHash -LiteralPath $Fixture).Hash;routeFixtures=@(@($BlockedFixture,$LiftBefore,$LiftAfter,$FineFixture)|Where-Object {$_}|ForEach-Object {@{path=$_;sha256=(Get-FileHash -LiteralPath $_).Hash}});commonSource=$CommonSource;commonSha256=(Get-FileHash -LiteralPath $CommonSource).Hash;progressionSource=$ProgressionSource;progressionSha256=(Get-FileHash -LiteralPath $ProgressionSource).Hash;checks=$checks.ToArray()}|ConvertTo-Json -Depth 12|Set-Content -LiteralPath (Join-Path $EvidenceDir 'live-drag-result.json')
|
||||
if(!$passed){exit 1};exit 0
|
||||
|
||||
Reference in New Issue
Block a user