@@ -641,17 +641,21 @@ describe("runtime output contract", () => {
641641 canonical ,
642642 { outputMode } ,
643643 ) . value as Record < string , unknown > ;
644- assert . deepEqual ( Object . keys ( minimal ) , [
645- "status" ,
646- "incompleteCapture" ,
647- "handlingError" ,
648- ] ) ;
644+ assert . deepEqual ( Object . keys ( minimal ) , persistOutput
645+ ? [
646+ "status" ,
647+ "incompleteCapture" ,
648+ "handlingError" ,
649+ "artifactHandle" ,
650+ "nextAction" ,
651+ ]
652+ : [ "status" , "incompleteCapture" , "handlingError" ] ) ;
649653 assert . equal ( "preview" in minimal , false ) ;
650- assert . equal ( "artifactHandle" in minimal , false ) ;
651- assert . equal ( "nextAction" in minimal , false ) ;
654+ assert . equal ( "artifactHandle" in minimal , persistOutput ) ;
655+ assert . equal ( "nextAction" in minimal , persistOutput ) ;
652656 assert . equal (
653657 JSON . stringify ( minimal ) . includes ( "runtime.queryOutput" ) ,
654- false ,
658+ persistOutput ,
655659 ) ;
656660 assert . deepEqual ( minimal . incompleteCapture , {
657661 stdoutTruncated : true ,
@@ -664,16 +668,20 @@ describe("runtime output contract", () => {
664668 canonical ,
665669 { outputMode : "summary" } ,
666670 ) . value as Record < string , unknown > ;
667- assert . deepEqual ( Object . keys ( projected ) , [
668- "status" ,
669- "preview" ,
670- "incompleteCapture" ,
671- "handlingError" ,
672- ] ) ;
671+ assert . deepEqual ( Object . keys ( projected ) , persistOutput
672+ ? [
673+ "status" ,
674+ "preview" ,
675+ "incompleteCapture" ,
676+ "handlingError" ,
677+ "artifactHandle" ,
678+ "nextAction" ,
679+ ]
680+ : [ "status" , "preview" , "incompleteCapture" , "handlingError" ] ) ;
673681 assert . match ( JSON . stringify ( projected . preview ) , / x { 16 } / ) ;
674682 assert . equal (
675683 JSON . stringify ( projected ) . includes ( "runtime.queryOutput" ) ,
676- false ,
684+ persistOutput ,
677685 ) ;
678686 assert . deepEqual ( projected . incompleteCapture , {
679687 stdoutTruncated : true ,
@@ -686,8 +694,8 @@ describe("runtime output contract", () => {
686694 "Runtime output exceeded capture limits; discarded bytes are not recoverable." ,
687695 retryable : false ,
688696 } ) ;
689- assert . equal ( "artifactHandle" in projected , false ) ;
690- assert . equal ( "nextAction" in projected , false ) ;
697+ assert . equal ( "artifactHandle" in projected , persistOutput ) ;
698+ assert . equal ( "nextAction" in projected , persistOutput ) ;
691699 assert . ok (
692700 Buffer . byteLength ( JSON . stringify ( projected ) , "utf8" ) <
693701 canonical . truncation . totalStdoutBytes ,
0 commit comments