@@ -54,6 +54,45 @@ describe('Eval type inference', () => {
5454 compileOnly ;
5555 } ) ;
5656
57+ it ( 'keeps structured task input inference anchored to data when scorers only use output' , ( ) => {
58+ const queueMatchScorer = Scorer (
59+ 'queue-match' ,
60+ ( { expected, output } : { expected : { queue : string } ; output : { queue : string } } ) =>
61+ expected . queue === output . queue ,
62+ ) ;
63+
64+ const compileOnly = ( ) =>
65+ Eval ( 'route-support-ticket' , {
66+ capability : 'support-routing' ,
67+ data : [
68+ {
69+ input : {
70+ ticketId : 'ticket-123' ,
71+ message : 'Need help with a refund' ,
72+ customer : {
73+ tier : 'enterprise' as const ,
74+ } ,
75+ } ,
76+ expected : {
77+ queue : 'billing' as const ,
78+ } ,
79+ } ,
80+ ] ,
81+ task : ( { input, expected } ) => {
82+ expectTypeOf ( input . ticketId ) . toEqualTypeOf < string > ( ) ;
83+ expectTypeOf ( input . customer . tier ) . toEqualTypeOf < 'enterprise' > ( ) ;
84+ expectTypeOf ( expected . queue ) . toEqualTypeOf < 'billing' > ( ) ;
85+
86+ return {
87+ queue : input . customer . tier === 'enterprise' ? 'billing' : 'general' ,
88+ } ;
89+ } ,
90+ scorers : [ queueMatchScorer ] ,
91+ } ) ;
92+
93+ compileOnly ;
94+ } ) ;
95+
5796 it ( 'rejects task input that conflicts with the data source' , ( ) => {
5897 const OutputOnlyScorer = Scorer (
5998 'output-only' ,
0 commit comments