diff --git a/plain2code.py b/plain2code.py index ae11074..b1f2e76 100644 --- a/plain2code.py +++ b/plain2code.py @@ -49,17 +49,6 @@ DEFAULT_TEMPLATE_DIRS = importlib.resources.files("standard_template_library") -MAX_UNITTEST_FIX_ATTEMPTS = 20 -MAX_CONFORMANCE_TEST_FIX_ATTEMPTS = 20 -MAX_CONFORMANCE_TEST_RUNS = 20 -MAX_REFACTORING_ITERATIONS = 5 -MAX_UNIT_TEST_RENDER_RETRIES = 2 - -MAX_ISSUE_LENGTH = 10000 # Characters. - -UNRECOVERABLE_ERROR_EXIT_CODES = [69] -TIMEOUT_ERROR_EXIT_CODE = 124 - def get_render_range(render_range, plain_source): render_range = render_range.split(",") diff --git a/tui/components.py b/tui/components.py index f4ad923..9eb947c 100644 --- a/tui/components.py +++ b/tui/components.py @@ -271,6 +271,7 @@ def on_mount(self) -> None: """Initialize default labels on mount.""" self.module_text = "Module: " self.functionality_text = "Functionality:" + self._refresh_content() def compose(self): @@ -355,7 +356,7 @@ class FRIDProgress(Vertical): CONFORMANCE_TEST_VALIDATION_TEXT = "Conformance tests" RENDERING_MODULE_TEXT = "Module: " - RENDERING_FUNCTIONALITY_TEXT = "Functionality:" + RENDERING_FUNCTIONALITY_TEXT = "Functionality " def __init__( self, @@ -367,7 +368,7 @@ def __init__( self.unittests_script = unittests_script self.conformance_tests_script = conformance_tests_script - def update_fr_text(self, text: str) -> None: + def update_functionality_text(self, text: str) -> None: try: # Update the rendering info box instead info_box = self.query_one(RenderingInfoBox) diff --git a/tui/state_handlers.py b/tui/state_handlers.py index a3a786c..d9eb2b3 100644 --- a/tui/state_handlers.py +++ b/tui/state_handlers.py @@ -66,8 +66,9 @@ def __init__(self, tui, unittests_script: Optional[str], conformance_tests_scrip def handle(self, _: list[str], snapshot: RenderContextSnapshot, _previous_state_segments: list[str]) -> None: """Handle READY_FOR_FRID_IMPLEMENTATION state.""" # Update FRID text - rendering_functionality_text = f"{tui_components.FRIDProgress.RENDERING_FUNCTIONALITY_TEXT} {snapshot.frid_context.functional_requirement_text}" - get_frid_progress(self.tui).update_fr_text(rendering_functionality_text) + + rendering_functionality_text = f"{tui_components.FRIDProgress.RENDERING_FUNCTIONALITY_TEXT}{snapshot.frid_context.frid}: {snapshot.frid_context.functional_requirement_text}" + get_frid_progress(self.tui).update_functionality_text(rendering_functionality_text) # Set progress states update_progress_item_status(self.tui, TUIComponents.FRID_PROGRESS_RENDER_FR.value, ProgressItem.PROCESSING) @@ -216,11 +217,21 @@ def handle(self, segments: list[str], snapshot: RenderContextSnapshot, previous_ ) elif segments[2] == States.CONFORMANCE_TEST_ENV_PREPARED.value: running_text = f"Running conformance tests for functional requirement {snapshot.conformance_tests_running_context.current_testing_frid}" + if snapshot.conformance_tests_running_context.current_testing_module_name != snapshot.module_name: + running_text += ( + f" of module {snapshot.conformance_tests_running_context.current_testing_module_name}" + ) + update_progress_item_substates( self.tui, TUIComponents.FRID_PROGRESS_CONFORMANCE_TEST.value, [Substate(running_text)] ) elif segments[2] == States.CONFORMANCE_TEST_FAILED.value: fixing_text = f"Fixing conformance tests for functional requirement {snapshot.conformance_tests_running_context.current_testing_frid}" + if snapshot.conformance_tests_running_context.current_testing_module_name != snapshot.module_name: + fixing_text += ( + f" of module {snapshot.conformance_tests_running_context.current_testing_module_name}" + ) + update_progress_item_substates( self.tui, TUIComponents.FRID_PROGRESS_CONFORMANCE_TEST.value, [Substate(fixing_text)] )