@@ -267,4 +267,35 @@ async fn hf_ingestion_config_json() {
267267 let txt = resp. text ( ) . await . unwrap ( ) ;
268268 let v: serde_json:: Value = serde_json:: from_str ( & txt) . unwrap ( ) ;
269269 assert ! ( v. is_object( ) ) ;
270+
271+ // Verify anvil-index.json
272+ let index_url = "http://localhost:50051/models/gpt-oss-20b/anvil-index.json" ;
273+ let index_resp = reqwest:: get ( index_url) . await . unwrap ( ) ;
274+ assert_eq ! ( index_resp. status( ) , 200 , "anvil-index.json should be accessible" ) ;
275+ let index_txt = index_resp. text ( ) . await . unwrap ( ) ;
276+ let index_v: serde_json:: Value = serde_json:: from_str ( & index_txt) . unwrap ( ) ;
277+
278+ // Assert meta fields
279+ assert_eq ! ( index_v[ "meta" ] [ "source_repo" ] , "openai/gpt-oss-20b" ) ;
280+ assert_eq ! ( index_v[ "meta" ] [ "revision" ] , "main" ) ;
281+ assert_eq ! ( index_v[ "meta" ] [ "total_files" ] , 1 ) ;
282+ assert ! ( index_v[ "meta" ] [ "total_bytes" ] . is_number( ) ) ;
283+ assert ! ( index_v[ "meta" ] [ "generated_at" ] . is_string( ) ) ;
284+
285+ // Assert files entry
286+ let files_map = index_v[ "files" ] . as_object ( ) . unwrap ( ) ;
287+ assert_eq ! ( files_map. len( ) , 1 ) ;
288+ assert ! ( files_map. contains_key( "config.json" ) ) ;
289+
290+ let config_json_entry = files_map[ "config.json" ] . as_object ( ) . unwrap ( ) ;
291+ assert ! ( config_json_entry. contains_key( "size" ) ) ;
292+ assert ! ( config_json_entry[ "size" ] . is_number( ) ) ;
293+ assert ! ( config_json_entry. contains_key( "etag" ) ) ;
294+ assert ! ( config_json_entry[ "etag" ] . is_string( ) ) ;
295+ assert ! ( config_json_entry. contains_key( "last_modified" ) ) ;
296+ assert ! ( config_json_entry[ "last_modified" ] . is_string( ) ) ;
297+
298+ // The size in anvil-index.json should match the actual file size.
299+ let expected_config_size = txt. len ( ) as i64 ;
300+ assert_eq ! ( config_json_entry[ "size" ] . as_i64( ) . unwrap( ) , expected_config_size) ;
270301}
0 commit comments