@@ -76,6 +76,8 @@ const EXPECTED_NON_RETRYABLE_ERRORS = new Set([
7676 "PLAN_PROTOCOL_UNSUPPORTED" ,
7777 "PlanProtocolUnsupportedError" ,
7878 "PLAN_V2_INTEGRITY_UNRECOVERABLE" ,
79+ "VIDEO_SOURCE_UNRENDERABLE" ,
80+ "INVALID_VIDEO_METADATA" ,
7981 "PlanV2IntegrityError" ,
8082 "PLAN_ARTIFACT_DIGEST_MISMATCH" ,
8183 "FORMAT_NOT_SUPPORTED_IN_DISTRIBUTED" ,
@@ -209,6 +211,25 @@ describe("HyperframesRenderStack — snapshot", () => {
209211 }
210212 } ) ;
211213
214+ it ( "routes video failures consistently across SAM/CDK and both plan protocols" , ( ) => {
215+ for ( const definition of [ SYNTHED . definition , readSamDefinition ( ) ] ) {
216+ const v1 = getV1TaskStates ( definition ) ;
217+ const v2 = getV2TaskStates ( definition ) ;
218+ for ( const planState of [ v1 . Plan , v2 . PlanV2 ] ) {
219+ const errors = new Set < string > ( ) ;
220+ collectNonRetryableErrors ( planState , errors ) ;
221+ expect ( errors . has ( "VIDEO_SOURCE_UNRENDERABLE" ) ) . toBe ( true ) ;
222+ expect ( errors . has ( "INVALID_VIDEO_METADATA" ) ) . toBe ( true ) ;
223+ expect ( errors . has ( "VIDEO_EXTRACTION_FAILED" ) ) . toBe ( false ) ;
224+ }
225+ for ( const chunkState of [ v1 . RenderChunk , v2 . RenderChunkV2 ] ) {
226+ const errors = new Set < string > ( ) ;
227+ collectNonRetryableErrors ( chunkState , errors ) ;
228+ expect ( errors . has ( "INVALID_VIDEO_METADATA" ) ) . toBe ( true ) ;
229+ }
230+ }
231+ } ) ;
232+
212233 it ( "keeps v1 and v2 locators disjoint across orchestration branches" , ( ) => {
213234 const { definition } = SYNTHED ;
214235 const v1 = JSON . stringify ( {
@@ -271,6 +292,21 @@ function getV2TaskStates(definition: {
271292 } ;
272293}
273294
295+ function getV1TaskStates ( definition : {
296+ States : Record < string , unknown > ;
297+ } ) : Record < "Plan" | "RenderChunk" | "Assemble" , unknown > {
298+ const renderChunks = requireRecord ( definition . States . RenderChunks , "RenderChunks state" ) ;
299+ const processor = isRecord ( renderChunks . Iterator )
300+ ? renderChunks . Iterator
301+ : requireRecord ( renderChunks . ItemProcessor , "RenderChunks processor" ) ;
302+ const innerStates = requireRecord ( processor . States , "RenderChunks processor states" ) ;
303+ return {
304+ Plan : definition . States . Plan ,
305+ RenderChunk : innerStates . RenderChunk ,
306+ Assemble : definition . States . Assemble ,
307+ } ;
308+ }
309+
274310function readSamDefinition ( ) : { States : Record < string , unknown > } {
275311 const source = readFileSync (
276312 new URL ( "../../../../examples/aws-lambda/template.yaml" , import . meta. url ) ,
0 commit comments