from __future__ import annotations

import gc
import inspect
import os
import time
from pathlib import Path
from typing import List

import dill as pickle
import pytest
from inference.core.workflows.core_steps.models.foundation.glm_ocr.v1 import \
    BlockManifest
from inference.core.workflows.execution_engine.entities.base import \
    OutputDefinition
from inference.core.workflows.execution_engine.entities.types import \
    STRING_KIND


def codeflash_wrap(codeflash_wrapped, codeflash_test_module_name, codeflash_test_class_name, codeflash_test_name, codeflash_function_name, codeflash_line_id, codeflash_loop_index, *args, **kwargs):
    test_id = f'{codeflash_test_module_name}:{codeflash_test_class_name}:{codeflash_test_name}:{codeflash_line_id}:{codeflash_loop_index}'
    if not hasattr(codeflash_wrap, 'index'):
        codeflash_wrap.index = {}
    if test_id in codeflash_wrap.index:
        codeflash_wrap.index[test_id] += 1
    else:
        codeflash_wrap.index[test_id] = 0
    codeflash_test_index = codeflash_wrap.index[test_id]
    invocation_id = f'{codeflash_line_id}_{codeflash_test_index}'
    test_stdout_tag = f"{codeflash_test_module_name}:{(codeflash_test_class_name + '.' if codeflash_test_class_name else '')}{codeflash_test_name}:{codeflash_function_name}:{codeflash_loop_index}:{invocation_id}"
    print(f'!$######{test_stdout_tag}######$!')
    exception = None
    gc.disable()
    try:
        counter = time.perf_counter_ns()
        return_value = codeflash_wrapped(*args, **kwargs)
        codeflash_duration = time.perf_counter_ns() - counter
    except Exception as e:
        codeflash_duration = time.perf_counter_ns() - counter
        exception = e
    gc.enable()
    print(f'!######{test_stdout_tag}######!')
    iteration = os.environ['CODEFLASH_TEST_ITERATION']
    with Path('{codeflash_run_tmp_dir_client_side}', f'test_return_values_{iteration}.bin').open('ab') as f:
        pickled_values = pickle.dumps((args, kwargs, exception)) if exception else pickle.dumps((args, kwargs, return_value))
        _test_name = f"{codeflash_test_module_name}:{(codeflash_test_class_name + '.' if codeflash_test_class_name else '')}{codeflash_test_name}:{codeflash_function_name}:{codeflash_line_id}".encode('ascii')
        f.write(len(_test_name).to_bytes(4, byteorder='big'))
        f.write(_test_name)
        f.write(codeflash_duration.to_bytes(8, byteorder='big'))
        f.write(len(pickled_values).to_bytes(4, byteorder='big'))
        f.write(pickled_values)
        f.write(codeflash_loop_index.to_bytes(8, byteorder='big'))
        f.write(len(invocation_id).to_bytes(4, byteorder='big'))
        f.write(invocation_id.encode('ascii'))
    if exception:
        raise exception
    return return_value

class TestBlockManifestDescribeOutputsBasic:
    """Basic tests for fundamental functionality"""

    def test_describe_outputs_returns_list(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that describe_outputs returns a list'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsBasic', 'test_describe_outputs_returns_list', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_not_empty(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that describe_outputs returns a non-empty list'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsBasic', 'test_describe_outputs_not_empty', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_contains_output_definitions(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that all items in the returned list are OutputDefinition instances'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsBasic', 'test_describe_outputs_contains_output_definitions', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        for item in result:
            pass

    def test_describe_outputs_first_output_name(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        "Test that the first output is named 'parsed_output'"
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsBasic', 'test_describe_outputs_first_output_name', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_first_output_kind(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that the first output has STRING_KIND in its kind list'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsBasic', 'test_describe_outputs_first_output_kind', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_first_output_has_description(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that the first output has a non-empty description'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsBasic', 'test_describe_outputs_first_output_has_description', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_is_classmethod(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that describe_outputs can be called on the class directly'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsBasic', 'test_describe_outputs_is_classmethod', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_returns_consistent_results(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that multiple calls to describe_outputs return consistent results'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsBasic', 'test_describe_outputs_returns_consistent_results', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result1 = codeflash_output
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsBasic', 'test_describe_outputs_returns_consistent_results', 'describe_outputs', '3', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result2 = codeflash_output

class TestBlockManifestDescribeOutputsEdgeCases:
    """Edge case tests for unusual or boundary conditions"""

    def test_describe_outputs_output_name_is_string(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that output name is a string'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsEdgeCases', 'test_describe_outputs_output_name_is_string', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_output_kind_is_list(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that output kind is a list'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsEdgeCases', 'test_describe_outputs_output_kind_is_list', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_output_kind_not_empty(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that output kind list is not empty'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsEdgeCases', 'test_describe_outputs_output_kind_not_empty', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_exactly_one_output(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that exactly one output is defined'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsEdgeCases', 'test_describe_outputs_exactly_one_output', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_description_is_string(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that description is a string type'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsEdgeCases', 'test_describe_outputs_description_is_string', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_describe_outputs_description_contains_text(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that description contains meaningful text about recognized text'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsEdgeCases', 'test_describe_outputs_description_contains_text', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        desc_lower = result[0].description.lower()

    def test_describe_outputs_output_attributes_all_present(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that all expected attributes are present on the output'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsEdgeCases', 'test_describe_outputs_output_attributes_all_present', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        output = result[0]

class TestBlockManifestDescribeOutputsLargeScale:
    """Large-scale tests to assess performance and consistency"""

    def test_describe_outputs_multiple_calls_performance(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that describe_outputs can handle 1000 sequential calls'
        results = []
        for i in range(1000):
            _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
            _call__bound__arguments.apply_defaults()
            codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsLargeScale', 'test_describe_outputs_multiple_calls_performance', 'describe_outputs', '2_0', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
            codeflash_output = codeflash_return_value
            result = codeflash_output
            results.append(result)
        first_result = results[0]
        for result in results[1:]:
            pass

    def test_describe_outputs_result_immutability_check(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        "Test that modifying returned list doesn't affect subsequent calls"
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsLargeScale', 'test_describe_outputs_result_immutability_check', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result1 = codeflash_output
        original_length = len(result1)
        modified_list = result1.copy()
        modified_list.append(None)
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsLargeScale', 'test_describe_outputs_result_immutability_check', 'describe_outputs', '6', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result2 = codeflash_output

    def test_describe_outputs_kind_list_contains_only_strings(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that the kind list contains only string values'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsLargeScale', 'test_describe_outputs_kind_list_contains_only_strings', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        kind_list = result[0].kind
        for kind_item in kind_list:
            pass

    def test_describe_outputs_string_kind_constant_value(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that STRING_KIND matches the expected value in the output'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsLargeScale', 'test_describe_outputs_string_kind_constant_value', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

class TestBlockManifestDescribeOutputsOutputDefinition:
    """Tests focused on OutputDefinition structure and content"""

    def test_output_definition_type_check(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that returned item is exactly OutputDefinition type'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsOutputDefinition', 'test_output_definition_type_check', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_parsed_output_name_exact_match(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        "Test that output name exactly matches 'parsed_output'"
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsOutputDefinition', 'test_parsed_output_name_exact_match', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_output_kind_contains_string_kind_exactly(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that STRING_KIND is in the kind list'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsOutputDefinition', 'test_output_kind_contains_string_kind_exactly', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        output_kinds = result[0].kind

    def test_output_description_mentions_recognition(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that description mentions recognition'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsOutputDefinition', 'test_output_description_mentions_recognition', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        description = result[0].description

    def test_output_description_mentions_text(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that description mentions text'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsOutputDefinition', 'test_output_description_mentions_text', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        description = result[0].description

    def test_output_description_mentions_image(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that description mentions image'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsOutputDefinition', 'test_output_description_mentions_image', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        description = result[0].description

class TestBlockManifestDescribeOutputsReturnType:
    """Tests to verify return type and structure"""

    def test_return_type_is_list_of_output_definitions(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that return type is List[OutputDefinition]'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsReturnType', 'test_return_type_is_list_of_output_definitions', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_return_type_annotation_compliance(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that the method signature returns List[OutputDefinition]'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsReturnType', 'test_return_type_annotation_compliance', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output

    def test_output_has_all_required_fields(self):
        codeflash_loop_index = int(os.environ['CODEFLASH_LOOP_INDEX'])
        'Test that each output has name, kind, and description fields'
        _call__bound__arguments = inspect.signature(BlockManifest.describe_outputs).bind()
        _call__bound__arguments.apply_defaults()
        codeflash_return_value = codeflash_wrap(BlockManifest.describe_outputs, 'tests.inference.unit_tests.test_describe_outputs__unit_test_1', 'TestBlockManifestDescribeOutputsReturnType', 'test_output_has_all_required_fields', 'describe_outputs', '1', codeflash_loop_index, *_call__bound__arguments.args, **_call__bound__arguments.kwargs)
        codeflash_output = codeflash_return_value
        result = codeflash_output
        for output in result:
            pass