@@ -432,6 +432,43 @@ test('snapshot accepts only structured healthy empty scope results', async () =>
432432 } ) ;
433433} ) ;
434434
435+ test ( 'scoped modal capture admits complete unscoped evidence without inventing a verdict' , async ( ) => {
436+ const note = { code : 'regular-geometry-clipped' , clippedNodeCount : 1 , droppedNodeCount : 1 } ;
437+ const qualityPayload = {
438+ nodes : [
439+ { index : 0 , type : 'Alert' , label : 'Tracking' , rect : { x : 0 , y : 0 , width : 320 , height : 240 } } ,
440+ ] ,
441+ truncated : false ,
442+ } ;
443+ const capture = ( wire : Record < string , unknown > ) =>
444+ createAppleInteractor ( IOS_SIMULATOR , { } , createLiveTestHostEnvironment ( ) , {
445+ hasLiveSession : ( ) => true ,
446+ runCommand : async ( ) => wire ,
447+ } ) ;
448+ const wire = {
449+ nodes : [ ] ,
450+ presentedSurface : 'presented' ,
451+ qualityPayload,
452+ snapshotQualityNotes : [ note ] ,
453+ } ;
454+ const scoped = presentedSnapshot ( await capture ( wire ) . snapshot ( { scope : 'missing' } ) ) ;
455+ assert . deepEqual ( scoped . nodes , [ ] ) ;
456+ assert . equal ( scoped . quality , undefined ) ;
457+ assert . deepEqual ( scoped . qualityNotes , [ note ] ) ;
458+ for ( const rejected of [
459+ { ...wire , qualityPayload : undefined } ,
460+ { ...wire , qualityPayload : { ...qualityPayload , nodes : [ ] } } ,
461+ { ...wire , qualityPayload : { ...qualityPayload , truncated : true } } ,
462+ { ...wire , snapshotQuality : { state : 'sparse' , backend : 'tree' } } ,
463+ { ...wire , presentedSurface : undefined } ,
464+ ] ) {
465+ await assert . rejects ( capture ( rejected ) . snapshot ( { scope : 'missing' } ) , {
466+ code : 'COMMAND_FAILED' ,
467+ } ) ;
468+ }
469+ await assert . rejects ( capture ( wire ) . snapshot ( ) , { code : 'COMMAND_FAILED' } ) ;
470+ } ) ;
471+
435472// #1634 P2: the backend pin must actually reach the wire — the daemon test
436473// stops at the dispatch context and the Swift test starts at the parsed
437474// command, so this is the assertion that fails if the interactor stops
0 commit comments