codeplain 0.3.13.dev49__tar.gz → 0.3.14.dev50__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/CLAUDE.md +3 -3
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/PKG-INFO +1 -1
- codeplain-0.3.14.dev50/change_detection.py +161 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/cli_output/dry_run.py +7 -3
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/codeplain_REST_api.py +9 -14
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/docs/generate_cli.py +3 -2
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/docs/plain2code_cli.md +19 -13
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/example_hello_world_golang/config.yaml +2 -1
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/example_hello_world_golang/hello_world_golang.plain +2 -1
- codeplain-0.3.14.dev50/examples/example_hello_world_golang/tests/hello_world_golang/display-hello-world.plain +12 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/example_hello_world_python/config.yaml +1 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/example_hello_world_python/hello_world_python.plain +2 -7
- codeplain-0.3.14.dev50/examples/example_hello_world_python/tests/hello_world_python/display-hello-world.plain +13 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/example_hello_world_react/config.yaml +1 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/example_hello_world_react/hello_world_react.plain +2 -1
- codeplain-0.3.14.dev50/examples/example_hello_world_react/tests/hello_world_react/display-hello-world.plain +11 -0
- codeplain-0.3.14.dev50/examples/example_hello_world_react/tests/typescript-react-app-boilerplate/entry-point.plain +11 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/partial_rendering.py +32 -2
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/plain2code.py +42 -14
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/plain2code_arguments.py +69 -12
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/plain2code_telemetry.py +2 -1
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/plain2code_utils.py +14 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/plain_modules.py +73 -14
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/analyze_specification_ambiguity.py +5 -3
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/distill_conformance_test_memory.py +3 -1
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/fix_conformance_test.py +4 -4
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/fix_unit_tests.py +3 -1
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/refactor_code.py +6 -1
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/render_conformance_tests.py +52 -20
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/render_functional_requirement.py +5 -2
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/run_conformance_tests.py +3 -2
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/summarize_conformance_tests.py +3 -1
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/render_context.py +59 -20
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/render_types.py +6 -15
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/requirements.txt +1 -1
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/standard_template_library/typescript-react-app-boilerplate.plain +2 -1
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/data/acceptance_tests_warning/main_requiring_acceptance_tests.plain +2 -1
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/data/acceptance_tests_warning/required_with_acceptance_tests.plain +2 -5
- codeplain-0.3.14.dev50/tests/data/acceptance_tests_warning/tests/required_with_acceptance_tests/entry-point.plain +11 -0
- codeplain-0.3.14.dev50/tests/data/partial_rendering/pr_code_var.plain +11 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/data/partial_rendering/pr_leaf.plain +4 -2
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/data/partial_rendering/pr_middle.plain +4 -2
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/data/partial_rendering/pr_root.plain +4 -2
- codeplain-0.3.14.dev50/tests/data/partial_rendering/pr_solo.plain +14 -0
- codeplain-0.3.14.dev50/tests/test_acceptance_scenario_rendered_once.py +169 -0
- codeplain-0.3.14.dev50/tests/test_acceptance_scenarios_after_a_code_fix.py +110 -0
- codeplain-0.3.14.dev50/tests/test_change_detection.py +405 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_conformance_fix_journal.py +46 -46
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_dry_run_link_validation.py +2 -1
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_fix_unit_tests_action.py +1 -1
- codeplain-0.3.14.dev50/tests/test_frid_arguments.py +40 -0
- codeplain-0.3.14.dev50/tests/test_functionality_without_scenarios.py +88 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_git_utils.py +13 -13
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_partial_rendering.py +82 -47
- codeplain-0.3.14.dev50/tests/test_plain2code.py +91 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_plain2code_utils.py +12 -1
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_plain_modules.py +50 -44
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_render_finished_report.py +2 -0
- codeplain-0.3.14.dev50/tests/test_render_range.py +51 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_render_stop_reason.py +5 -5
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_telemetry.py +2 -2
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_terminal_attachment.py +2 -1
- codeplain-0.3.14.dev50/tests/test_tests_folders.py +91 -0
- codeplain-0.3.14.dev50/tests/test_traceability_warnings.py +69 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tui/plain_module_render_choice_tui.py +4 -6
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tui/state_handlers.py +19 -28
- codeplain-0.3.13.dev49/change_detection.py +0 -190
- codeplain-0.3.13.dev49/tests/data/partial_rendering/pr_code_var.plain +0 -9
- codeplain-0.3.13.dev49/tests/data/partial_rendering/pr_solo.plain +0 -11
- codeplain-0.3.13.dev49/tests/test_change_detection.py +0 -394
- codeplain-0.3.13.dev49/tests/test_plain2code.py +0 -93
- codeplain-0.3.13.dev49/tests/test_render_range.py +0 -42
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/.claude/settings.json +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/.flake8 +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/.github/dependabot.yml +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/.github/workflows/e2e.yml +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/.github/workflows/lint-and-test.yml +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/.github/workflows/lint-powershell.yml +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/.github/workflows/notify-slack-on-main-merge.yml +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/.github/workflows/publish-dev-to-pypi.yml +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/.github/workflows/publish-install-script.yml +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/.github/workflows/publish-to-pypi.yml +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/.gitignore +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/.vscode/launch.json +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/.vscode/settings.json +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/CONTRIBUTING.md +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/LICENSE +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/README.md +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/cli_output/__init__.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/cli_output/render_summary.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/cli_output/status.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/concept_utils.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/config/__init__.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/config/system_config.yaml +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/conformance_fix_journal.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/diff_utils.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/docs/starting_a_plain_project_from_scratch.md +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/event_bus.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/example_hello_world_golang/harness_tests/hello_world_test.go +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/example_hello_world_golang/run.sh +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/example_hello_world_python/harness_tests/hello_world_display/test_hello_world.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/example_hello_world_python/run.sh +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/example_hello_world_react/harness_tests/hello_world_display/cypress/e2e/hello_world.cy.ts +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/example_hello_world_react/harness_tests/hello_world_display/cypress/support/e2e.ts +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/example_hello_world_react/harness_tests/hello_world_display/cypress.config.ts +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/example_hello_world_react/harness_tests/hello_world_display/package.json +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/example_hello_world_react/harness_tests/hello_world_display/tsconfig.json +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/example_hello_world_react/run.sh +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/examples/run.sh +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/file_utils.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/git_preflight.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/git_utils.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/install/bash/examples.sh +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/install/bash/install.sh +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/install/bash/walkthrough.sh +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/install/powershell/examples.ps1 +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/install/powershell/install.ps1 +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/install/powershell/walkthrough.ps1 +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/memory_management.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/metadata_utils.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/module_renderer.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/path_resolution.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/plain2code_cli.md +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/plain2code_console.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/plain2code_events.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/plain2code_exceptions.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/plain2code_logger.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/plain2code_nodes.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/plain2code_read_config.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/plain2code_state.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/plain_file.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/plain_spec.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/pyproject.toml +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/pytest.ini +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/__init__.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/base_action.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/commit_conformance_tests_changes.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/commit_implementation_code_changes.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/create_dist.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/exit_with_error.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/finish_functional_requirement.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/prepare_repositories.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/prepare_testing_environment.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/actions/run_unit_tests.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/agent_tools.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/code_renderer.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/conformance_tests.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/implementation_code_helpers.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/render_utils.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/state_machine_config.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/states.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/render_machine/triggers.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/resources/codeplain_overview.png +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/resources/plain_example.png +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/standard_template_library/golang-console-app-template.plain +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/standard_template_library/python-console-app-template.plain +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/standard_template_library/typescript-react-app-template.plain +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/system_config.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/test_scripts/run_conformance_tests_cypress.ps1 +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/test_scripts/run_conformance_tests_cypress.sh +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/test_scripts/run_conformance_tests_golang.ps1 +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/test_scripts/run_conformance_tests_golang.sh +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/test_scripts/run_conformance_tests_python.ps1 +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/test_scripts/run_conformance_tests_python.sh +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/test_scripts/run_unittests_flutter.ps1 +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/test_scripts/run_unittests_flutter.sh +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/test_scripts/run_unittests_golang.ps1 +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/test_scripts/run_unittests_golang.sh +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/test_scripts/run_unittests_python.ps1 +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/test_scripts/run_unittests_python.sh +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/test_scripts/run_unittests_react.ps1 +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/test_scripts/run_unittests_react.sh +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/__init__.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/conftest.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/data/partial_rendering/pr_implement.plain +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/e2e/Dockerfile +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/e2e/conftest.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/e2e/test_hello_world_python.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/e2e/test_hello_world_python_windows.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_agent_tools.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_arg_provenance.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_cli_output.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_console_log_styles.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_distill_conformance_test_memory.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_file_utils.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_fix_unit_tests_conformance_context.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_folder_path_resolution.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_git_preflight.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_headless_logging.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_log_file_name_resolution.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_logging_config_path_resolution.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_path_resolution.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_plain2code_state.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_prepare_repositories_layout.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_resolve_config_file.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_script_path_resolution.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_system_config.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_tui_components.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_tui_usage.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_usage_summary.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tests/test_user_error_message.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tui/__init__.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tui/components.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tui/models.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tui/plain2code_tui.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tui/spinner.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tui/styles.css +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/tui/widget_helpers.py +0 -0
- {codeplain-0.3.13.dev49 → codeplain-0.3.14.dev50}/usage_summary.py +0 -0
|
@@ -76,8 +76,8 @@ python plain2code.py path/to/file.plain --log-to-file
|
|
|
76
76
|
python plain2code.py path/to/file.plain --headless
|
|
77
77
|
|
|
78
78
|
# Render specific functionality range
|
|
79
|
-
python plain2code.py file.plain --render-range
|
|
80
|
-
python plain2code.py file.plain --render-from
|
|
79
|
+
python plain2code.py file.plain --render-range add-task,delete-task # Render add-task through delete-task
|
|
80
|
+
python plain2code.py file.plain --render-from delete-task # Resume from delete-task
|
|
81
81
|
|
|
82
82
|
# Run with examples
|
|
83
83
|
cd examples/example_hello_world_python
|
|
@@ -136,7 +136,7 @@ black . --check && isort . --check-only && flake8 . && mypy . --check-untyped-de
|
|
|
136
136
|
|
|
137
137
|
**Plain Modules**: A `.plain` file can `import` other `.plain` files, creating a module dependency tree. The renderer processes required modules first (depth-first), then the top module.
|
|
138
138
|
|
|
139
|
-
**Functionalities (FRIDs)**: Each functional requirement in a `.plain` file has a unique ID (FRID). The renderer processes them sequentially. State is checkpointed after each FRID.
|
|
139
|
+
**Functionalities (FRIDs)**: Each functional requirement in a `.plain` file has a unique ID (FRID), the func-id of its `# <func-id>` heading. The renderer processes them sequentially. State is checkpointed after each FRID.
|
|
140
140
|
|
|
141
141
|
**Render State Machine** (`render_machine/states.py`): Hierarchical FSM with states like:
|
|
142
142
|
- `IMPLEMENTING_FRID` → `PROCESSING_UNIT_TESTS` → `REFACTORING_CODE` → `PROCESSING_CONFORMANCE_TESTS`
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import TYPE_CHECKING, Literal
|
|
5
|
+
|
|
6
|
+
if TYPE_CHECKING:
|
|
7
|
+
from plain_modules import PlainModule
|
|
8
|
+
|
|
9
|
+
MODULE_FUNCTIONALITIES_KEY = "functionalities"
|
|
10
|
+
NON_FUNCTIONAL_SOURCE_HASH_KEY = "non_functional_source_hash"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@dataclass
|
|
14
|
+
class FunctionalityChange:
|
|
15
|
+
module: str
|
|
16
|
+
frid: str
|
|
17
|
+
change_type: Literal["added", "removed", "edited", "moved"]
|
|
18
|
+
detail: str | None = None
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@dataclass
|
|
22
|
+
class PartialRenderStart:
|
|
23
|
+
module: "PlainModule"
|
|
24
|
+
frid: str
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def determine_partial_render_start(plain_module: "PlainModule") -> PartialRenderStart | None:
|
|
28
|
+
"""Determine where to start partial rendering based on spec changes.
|
|
29
|
+
|
|
30
|
+
Returns None (only full render is safe) if non-FR sections changed
|
|
31
|
+
(e.g. definitions, implementation reqs) since previously-rendered FRs
|
|
32
|
+
were generated without that context, if no changes are found, or if
|
|
33
|
+
all changes are trailing removals that don't require rendering.
|
|
34
|
+
"""
|
|
35
|
+
all_modules = plain_module.all_required_modules + [plain_module]
|
|
36
|
+
|
|
37
|
+
for module in all_modules:
|
|
38
|
+
if _non_functional_content_changed(module):
|
|
39
|
+
return None
|
|
40
|
+
|
|
41
|
+
changes = _detect_module_changes(module)
|
|
42
|
+
if not changes:
|
|
43
|
+
continue
|
|
44
|
+
|
|
45
|
+
earliest_frid = _get_earliest_affected_frid(changes, _stored_frids(module), _current_frids(module))
|
|
46
|
+
if earliest_frid is None:
|
|
47
|
+
continue
|
|
48
|
+
return PartialRenderStart(module=module, frid=earliest_frid)
|
|
49
|
+
|
|
50
|
+
return None
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _non_functional_content_changed(module: "PlainModule") -> bool:
|
|
54
|
+
"""Check whether anything outside functional specs changed since last render.
|
|
55
|
+
|
|
56
|
+
A missing stored hash (older builds) is treated as changed — partial rendering
|
|
57
|
+
is unsafe without a known baseline.
|
|
58
|
+
"""
|
|
59
|
+
metadata = module.load_module_metadata()
|
|
60
|
+
if not metadata:
|
|
61
|
+
return False
|
|
62
|
+
stored_hash = metadata.get(NON_FUNCTIONAL_SOURCE_HASH_KEY)
|
|
63
|
+
if stored_hash is None:
|
|
64
|
+
return True
|
|
65
|
+
return stored_hash != module.get_module_non_functional_source_hash()
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def _stored_functionalities(module: "PlainModule") -> list[dict[str, str]]:
|
|
69
|
+
metadata = module.load_module_metadata()
|
|
70
|
+
return metadata.get(MODULE_FUNCTIONALITIES_KEY, []) if metadata else []
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
def _stored_frids(module: "PlainModule") -> list[str]:
|
|
74
|
+
return [functionality["id"] for functionality in _stored_functionalities(module)]
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def _current_frids(module: "PlainModule") -> list[str]:
|
|
78
|
+
return [functionality["id"] for functionality in module._get_module_functional_requirements()]
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def _get_earliest_affected_frid(
|
|
82
|
+
changes: list[FunctionalityChange], old_frids: list[str], new_frids: list[str]
|
|
83
|
+
) -> str | None:
|
|
84
|
+
"""The func-id of the earliest functionality in the new order that must be re-rendered.
|
|
85
|
+
|
|
86
|
+
Rendering runs from this functionality to the end of the module, so an at-or-before start
|
|
87
|
+
point is always safe: it can re-render unchanged trailing functionalities, but never skips
|
|
88
|
+
a changed one.
|
|
89
|
+
|
|
90
|
+
Returns None when every change is a removal past the end of the new order (only trailing
|
|
91
|
+
functionalities were removed, so nothing needs rendering).
|
|
92
|
+
"""
|
|
93
|
+
earliest = None
|
|
94
|
+
for change in changes:
|
|
95
|
+
position = _affected_position(change, old_frids, new_frids)
|
|
96
|
+
if position is None:
|
|
97
|
+
continue
|
|
98
|
+
if earliest is None or position < earliest:
|
|
99
|
+
earliest = position
|
|
100
|
+
if earliest is None:
|
|
101
|
+
return None
|
|
102
|
+
return new_frids[earliest]
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def _affected_position(change: FunctionalityChange, old_frids: list[str], new_frids: list[str]) -> int | None:
|
|
106
|
+
"""Where in the new order the change must be rendered from.
|
|
107
|
+
|
|
108
|
+
A removed functionality has no place in the new order, so the one that took its place is
|
|
109
|
+
rendered instead. A removal past the end of the new order needs no render.
|
|
110
|
+
"""
|
|
111
|
+
if change.change_type == "removed":
|
|
112
|
+
position = old_frids.index(change.frid)
|
|
113
|
+
return position if position < len(new_frids) else None
|
|
114
|
+
|
|
115
|
+
return new_frids.index(change.frid)
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def _detect_module_changes(module: "PlainModule") -> list[FunctionalityChange]:
|
|
119
|
+
old_frs = _stored_functionalities(module)
|
|
120
|
+
new_frs = module._get_module_functional_requirements()
|
|
121
|
+
|
|
122
|
+
if old_frs == new_frs:
|
|
123
|
+
return []
|
|
124
|
+
|
|
125
|
+
old_frids = [functionality["id"] for functionality in old_frs]
|
|
126
|
+
new_frids = [functionality["id"] for functionality in new_frs]
|
|
127
|
+
old_markdown = {functionality["id"]: functionality["markdown"] for functionality in old_frs}
|
|
128
|
+
|
|
129
|
+
changes: list[FunctionalityChange] = []
|
|
130
|
+
name = module.module_name
|
|
131
|
+
|
|
132
|
+
for frid in _moved_frids(old_frids, new_frids):
|
|
133
|
+
changes.append(FunctionalityChange(module=name, frid=frid, change_type="moved"))
|
|
134
|
+
|
|
135
|
+
for functionality in new_frs:
|
|
136
|
+
frid = functionality["id"]
|
|
137
|
+
if frid in old_markdown and functionality["markdown"] != old_markdown[frid]:
|
|
138
|
+
changes.append(FunctionalityChange(module=name, frid=frid, change_type="edited"))
|
|
139
|
+
|
|
140
|
+
for frid in old_frids:
|
|
141
|
+
if frid not in new_frids:
|
|
142
|
+
changes.append(FunctionalityChange(module=name, frid=frid, change_type="removed"))
|
|
143
|
+
|
|
144
|
+
for frid in new_frids:
|
|
145
|
+
if frid not in old_markdown:
|
|
146
|
+
changes.append(FunctionalityChange(module=name, frid=frid, change_type="added"))
|
|
147
|
+
|
|
148
|
+
return changes
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
def _moved_frids(old_frids: list[str], new_frids: list[str]) -> list[str]:
|
|
152
|
+
"""The func-ids the two orders keep but place differently, in the new order.
|
|
153
|
+
|
|
154
|
+
Only the functionalities present in both orders are compared, so an addition or a removal
|
|
155
|
+
alone shifts no one: it is a move only when the kept functionalities swap places.
|
|
156
|
+
"""
|
|
157
|
+
kept = set(old_frids) & set(new_frids)
|
|
158
|
+
old_order = [frid for frid in old_frids if frid in kept]
|
|
159
|
+
new_order = [frid for frid in new_frids if frid in kept]
|
|
160
|
+
|
|
161
|
+
return [frid for position, frid in enumerate(new_order) if old_order[position] != frid]
|
|
@@ -22,9 +22,13 @@ def print_dry_run_output(plain_source_tree: dict, render_range: Optional[list[st
|
|
|
22
22
|
f"{functional_requirement_text}\n"
|
|
23
23
|
"-------------------------------------\n"
|
|
24
24
|
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
for section, label in (
|
|
26
|
+
(plain_spec.CONFORMANCE_TESTS, "Conformance scenarios"),
|
|
27
|
+
(plain_spec.ACCEPTANCE_TESTS, "Acceptance scenarios"),
|
|
28
|
+
):
|
|
29
|
+
scenario_ids = [scenario["id"] for scenario in specifications.get(section) or []]
|
|
30
|
+
if scenario_ids:
|
|
31
|
+
console.info(f"{label}: {', '.join(scenario_ids)}\n")
|
|
28
32
|
else:
|
|
29
33
|
console.info(
|
|
30
34
|
"-------------------------------------\n"
|
|
@@ -82,6 +82,7 @@ ERROR_CODE_EXCEPTIONS = {
|
|
|
82
82
|
"MissingResource": plain2code_exceptions.MissingResource,
|
|
83
83
|
"PlainSyntaxError": plain2code_exceptions.PlainSyntaxError,
|
|
84
84
|
"InternalServerError": plain2code_exceptions.InternalServerError,
|
|
85
|
+
"OutdatedClient": plain2code_exceptions.OutdatedClientVersion,
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
|
|
@@ -363,7 +364,6 @@ class CodeplainAPI:
|
|
|
363
364
|
required_modules,
|
|
364
365
|
conformance_tests_folder_name,
|
|
365
366
|
conformance_tests_json,
|
|
366
|
-
all_acceptance_tests,
|
|
367
367
|
run_state: RunState,
|
|
368
368
|
):
|
|
369
369
|
endpoint_url = f"{self.api_url}/render_conformance_tests"
|
|
@@ -380,11 +380,10 @@ class CodeplainAPI:
|
|
|
380
380
|
"required_modules": required_modules,
|
|
381
381
|
"conformance_tests_folder_name": conformance_tests_folder_name,
|
|
382
382
|
"conformance_tests_json": conformance_tests_json,
|
|
383
|
-
"all_acceptance_tests": all_acceptance_tests,
|
|
384
383
|
}
|
|
385
384
|
|
|
386
385
|
response = self.post_request(endpoint_url, headers, payload, run_state)
|
|
387
|
-
return response["patched_response_files"], response["
|
|
386
|
+
return response["patched_response_files"], response["traceability"]
|
|
388
387
|
|
|
389
388
|
def generate_folder_name_from_functional_requirement(
|
|
390
389
|
self,
|
|
@@ -419,11 +418,9 @@ class CodeplainAPI:
|
|
|
419
418
|
required_modules,
|
|
420
419
|
code_diff,
|
|
421
420
|
conformance_tests_files,
|
|
422
|
-
acceptance_tests,
|
|
423
421
|
conformance_tests_issue,
|
|
424
422
|
implementation_fix_count,
|
|
425
423
|
conformance_tests_folder_name,
|
|
426
|
-
current_testing_frid_high_level_implementation_plan: Optional[str],
|
|
427
424
|
conflicting_requirements_count: int,
|
|
428
425
|
fix_attempts_journal: list,
|
|
429
426
|
run_state: RunState,
|
|
@@ -446,14 +443,10 @@ class CodeplainAPI:
|
|
|
446
443
|
"conformance_tests_issue": conformance_tests_issue,
|
|
447
444
|
"implementation_fix_count": implementation_fix_count,
|
|
448
445
|
"conformance_tests_folder_name": conformance_tests_folder_name,
|
|
449
|
-
"current_testing_frid_high_level_implementation_plan": current_testing_frid_high_level_implementation_plan,
|
|
450
446
|
"conflicting_requirements_count": conflicting_requirements_count,
|
|
451
447
|
"fix_attempts_journal": fix_attempts_journal,
|
|
452
448
|
}
|
|
453
449
|
|
|
454
|
-
if acceptance_tests is not None:
|
|
455
|
-
payload["acceptance_tests"] = acceptance_tests
|
|
456
|
-
|
|
457
450
|
return self.post_request(endpoint_url, headers, payload, run_state)
|
|
458
451
|
|
|
459
452
|
def render_acceptance_tests(
|
|
@@ -466,7 +459,7 @@ class CodeplainAPI:
|
|
|
466
459
|
conformance_tests_files,
|
|
467
460
|
module_name: str,
|
|
468
461
|
required_modules,
|
|
469
|
-
|
|
462
|
+
scenario_id,
|
|
470
463
|
run_state: RunState,
|
|
471
464
|
):
|
|
472
465
|
"""
|
|
@@ -484,10 +477,11 @@ class CodeplainAPI:
|
|
|
484
477
|
conformance_tests_files (dict): A dictionary containing conformance test files.
|
|
485
478
|
required_modules (dict): A dictionary where the keys represent module names
|
|
486
479
|
and the values are lists of functionalities implemented in those modules.
|
|
487
|
-
|
|
480
|
+
scenario_id (str): The scenario-id of the acceptance scenario to render.
|
|
488
481
|
|
|
489
482
|
Returns:
|
|
490
|
-
|
|
483
|
+
tuple: The rendered acceptance tests, and the traceability of every scenario of the
|
|
484
|
+
functionality a test is due for.
|
|
491
485
|
|
|
492
486
|
Raises:
|
|
493
487
|
Exception: If the request fails or returns an error.
|
|
@@ -504,10 +498,11 @@ class CodeplainAPI:
|
|
|
504
498
|
"conformance_tests_files": conformance_tests_files,
|
|
505
499
|
"module_name": module_name,
|
|
506
500
|
"required_modules": required_modules,
|
|
507
|
-
"
|
|
501
|
+
"scenario_id": scenario_id,
|
|
508
502
|
}
|
|
509
503
|
|
|
510
|
-
|
|
504
|
+
response = self.post_request(endpoint_url, headers, payload, run_state)
|
|
505
|
+
return response["patched_response_files"], response["traceability"]
|
|
511
506
|
|
|
512
507
|
def analyze_rendering(
|
|
513
508
|
self,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import sys
|
|
3
3
|
|
|
4
|
-
#
|
|
5
|
-
|
|
4
|
+
# Put the checkout first on the path so we read its plain2code_arguments, not an
|
|
5
|
+
# installed copy of codeplain that would reflect whatever was last released.
|
|
6
|
+
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
def main():
|
|
@@ -6,15 +6,15 @@ usage: generate_cli.py [-h] [--verbose] [--base-folder BASE_FOLDER]
|
|
|
6
6
|
[--log-to-file | --no-log-to-file]
|
|
7
7
|
[--log-file-name LOG_FILE_NAME]
|
|
8
8
|
[--config-name CONFIG_NAME]
|
|
9
|
-
[--render-range RENDER_RANGE |
|
|
10
|
-
--render
|
|
11
|
-
[--unittests-script UNITTESTS_SCRIPT]
|
|
9
|
+
[--render-range RENDER_RANGE | --render-from RENDER_FROM]
|
|
10
|
+
[--force-render] [--unittests-script UNITTESTS_SCRIPT]
|
|
12
11
|
[--conformance-tests-script CONFORMANCE_TESTS_SCRIPT]
|
|
13
12
|
[--prepare-environment-script PREPARE_ENVIRONMENT_SCRIPT]
|
|
14
13
|
[--test-script-timeout TEST_SCRIPT_TIMEOUT]
|
|
15
14
|
[--api [API]] [--api-key API_KEY] [--full-plain]
|
|
16
15
|
[--dry-run] [--replay-with REPLAY_WITH]
|
|
17
|
-
[--
|
|
16
|
+
[--job-tag JOB_TAG] [--template-dir TEMPLATE_DIR]
|
|
17
|
+
[--tests-folder TESTS_FOLDER] [--copy-build]
|
|
18
18
|
[--build-dest BUILD_DEST] [--copy-conformance-tests]
|
|
19
19
|
[--conformance-tests-dest CONFORMANCE_TESTS_DEST]
|
|
20
20
|
[--render-machine-graph]
|
|
@@ -51,17 +51,17 @@ options:
|
|
|
51
51
|
a file already exists at the resolved path, it will be
|
|
52
52
|
overwritten by the current logs.
|
|
53
53
|
--render-range RENDER_RANGE
|
|
54
|
-
Specify a range of functionalities to render (e.g.
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
start and end IDs.
|
|
54
|
+
Specify a range of functionalities to render (e.g.
|
|
55
|
+
`add-task`, `add-task,list-tasks`). Use comma to
|
|
56
|
+
separate start and end IDs. If only one functionality
|
|
57
|
+
ID is provided, only that functionality is rendered.
|
|
58
|
+
Range is inclusive of both start and end IDs.
|
|
59
59
|
--render-from RENDER_FROM
|
|
60
60
|
Continue generation starting from this specific
|
|
61
|
-
functionality (e.g. `
|
|
62
|
-
ID will be included in the output. The
|
|
63
|
-
ID must match one of the functionalities
|
|
64
|
-
file.
|
|
61
|
+
functionality (e.g. `add-task`). The functionality
|
|
62
|
+
with this ID will be included in the output. The
|
|
63
|
+
functionality ID must match one of the functionalities
|
|
64
|
+
in your plain file.
|
|
65
65
|
--force-render Force re-render of all the required modules.
|
|
66
66
|
--unittests-script UNITTESTS_SCRIPT
|
|
67
67
|
Shell script to run unit tests on generated code.
|
|
@@ -94,12 +94,18 @@ options:
|
|
|
94
94
|
--dry-run Dry run preview of the code generation (without
|
|
95
95
|
actually making any changes).
|
|
96
96
|
--replay-with REPLAY_WITH
|
|
97
|
+
--job-tag JOB_TAG Tag sent to the server with every request and attached
|
|
98
|
+
to the render's LangSmith traces (max 300 characters).
|
|
97
99
|
--template-dir TEMPLATE_DIR
|
|
98
100
|
Path to a custom template directory. Templates are
|
|
99
101
|
searched in the following order: 1) Directory
|
|
100
102
|
containing the plain file, 2) Custom template
|
|
101
103
|
directory (if provided through this argument), 3)
|
|
102
104
|
Built-in standard_template_library directory
|
|
105
|
+
--tests-folder TESTS_FOLDER
|
|
106
|
+
Folder scanned for test plain files; repeat the option
|
|
107
|
+
for more than one. Defaults to 'tests' next to the
|
|
108
|
+
plain file.
|
|
103
109
|
--copy-build If set, copy the rendered contents of code in `--base-
|
|
104
110
|
folder` folder to `--build-dest` folder after
|
|
105
111
|
successful rendering.
|
|
@@ -10,10 +10,5 @@ import:
|
|
|
10
10
|
|
|
11
11
|
***functional specs***
|
|
12
12
|
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
***acceptance tests***
|
|
16
|
-
|
|
17
|
-
- :App: should exit with status code 0 indicating successful execution.
|
|
18
|
-
|
|
19
|
-
- :App: should complete execution in under 1 second.
|
|
13
|
+
# display-hello-world
|
|
14
|
+
:App: displays "hello, world".
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
---
|
|
2
|
+
module: hello_world_python
|
|
3
|
+
func_id: display-hello-world
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
***conformance tests***
|
|
7
|
+
|
|
8
|
+
# prints-hello-world
|
|
9
|
+
Running :App: prints "hello, world".
|
|
10
|
+
- :App: exits with status code 0.
|
|
11
|
+
- :App: completes in under 1 second.
|
|
12
|
+
|
|
13
|
+
***acceptance tests***
|
|
@@ -3,7 +3,7 @@ from typing import Literal
|
|
|
3
3
|
|
|
4
4
|
import plain_spec
|
|
5
5
|
from change_detection import PartialRenderStart, determine_partial_render_start
|
|
6
|
-
from plain2code_exceptions import ModuleDoesNotExistError
|
|
6
|
+
from plain2code_exceptions import MissingPreviousFunctionalitiesError, ModuleDoesNotExistError
|
|
7
7
|
from plain_modules import PlainModule
|
|
8
8
|
|
|
9
9
|
|
|
@@ -83,6 +83,30 @@ def module_comes_before_or_equal(
|
|
|
83
83
|
raise ValueError(f"Module {module1.module_name} and {module2.module_name} not found in {all_required_modules}")
|
|
84
84
|
|
|
85
85
|
|
|
86
|
+
def _check_last_rendered_frid(module: PlainModule, last_rendered_frid: str | None) -> None:
|
|
87
|
+
"""Stop when the build folder was rendered for a functionality the module no longer has.
|
|
88
|
+
|
|
89
|
+
The resume point comes from the commit messages of the build folder. A folder rendered by a
|
|
90
|
+
client that numbered the functionalities names none of today's func-ids, and neither does one
|
|
91
|
+
whose functionality was removed from the specification. Either way the render cannot continue
|
|
92
|
+
from it.
|
|
93
|
+
"""
|
|
94
|
+
if last_rendered_frid is None:
|
|
95
|
+
return
|
|
96
|
+
|
|
97
|
+
frids = list(plain_spec.get_frids(module.plain_source))
|
|
98
|
+
if last_rendered_frid in frids:
|
|
99
|
+
return
|
|
100
|
+
|
|
101
|
+
raise MissingPreviousFunctionalitiesError(
|
|
102
|
+
f"The build folder of module {module.module_name} was rendered for functionality "
|
|
103
|
+
f"'{last_rendered_frid}', which the module does not have. Its functionalities are: "
|
|
104
|
+
f"{', '.join(frids)}.\n\n"
|
|
105
|
+
"A build folder rendered by a client that numbered the functionalities cannot be continued. "
|
|
106
|
+
f"Remove {module.build_folder} and render again."
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
|
|
86
110
|
def get_plain_module_render_state(
|
|
87
111
|
plain_module: PlainModule, render_conformance_tests: bool = False
|
|
88
112
|
) -> PlainModuleRenderState | None:
|
|
@@ -114,6 +138,8 @@ def get_plain_module_render_state(
|
|
|
114
138
|
)
|
|
115
139
|
module = found_module
|
|
116
140
|
|
|
141
|
+
_check_last_rendered_frid(module, last_rendered_frid)
|
|
142
|
+
|
|
117
143
|
pr = PlainModuleRenderState(
|
|
118
144
|
last_render_module=module,
|
|
119
145
|
last_render_frid=last_rendered_frid,
|
|
@@ -201,7 +227,11 @@ def change_is_only_future_work(
|
|
|
201
227
|
if plain_module_render_state.last_render_frid is None:
|
|
202
228
|
return True
|
|
203
229
|
|
|
204
|
-
|
|
230
|
+
frids = list(plain_spec.get_frids(partial_start.module.plain_source))
|
|
231
|
+
if plain_module_render_state.last_render_frid not in frids:
|
|
232
|
+
return False
|
|
233
|
+
|
|
234
|
+
return frids.index(partial_start.frid) > frids.index(plain_module_render_state.last_render_frid)
|
|
205
235
|
|
|
206
236
|
|
|
207
237
|
def _resume_render_choice(
|
|
@@ -272,29 +272,53 @@ def report_render_finished(
|
|
|
272
272
|
pass
|
|
273
273
|
|
|
274
274
|
|
|
275
|
-
def
|
|
276
|
-
"""
|
|
277
|
-
|
|
275
|
+
def _has_scenarios(plain_source_tree) -> bool:
|
|
276
|
+
"""Whether a test plain file bound a scenario to any functionality of the module."""
|
|
277
|
+
for functionality in plain_source_tree.get(plain_spec.FUNCTIONAL_REQUIREMENTS) or []:
|
|
278
|
+
if functionality.get(plain_spec.CONFORMANCE_TESTS) or functionality.get(plain_spec.ACCEPTANCE_TESTS):
|
|
279
|
+
return True
|
|
280
|
+
return False
|
|
278
281
|
|
|
279
|
-
|
|
280
|
-
|
|
282
|
+
|
|
283
|
+
def warn_about_functionalities_without_scenarios(plain_module) -> None:
|
|
284
|
+
"""Warn about every functionality whose test plain file holds no conformance scenario.
|
|
285
|
+
|
|
286
|
+
Such a functionality is rendered, but no conformance test is rendered or run for it.
|
|
287
|
+
"""
|
|
288
|
+
functionalities = [
|
|
289
|
+
f"{module_name}:{func_id}" for module_name, func_id in plain_module.functionalities_without_scenarios
|
|
290
|
+
]
|
|
291
|
+
if not functionalities:
|
|
292
|
+
return
|
|
293
|
+
|
|
294
|
+
console.warning(
|
|
295
|
+
f"No conformance scenario is written for {', '.join(functionalities)}, "
|
|
296
|
+
"so each one is rendered without conformance tests."
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
def warn_if_scenarios_without_conformance_script(plain_module, args) -> None:
|
|
301
|
+
"""Warn when a test plain file was found but conformance tests are disabled.
|
|
302
|
+
|
|
303
|
+
The scenarios are rendered as conformance tests, so without a conformance tests script
|
|
304
|
+
none of them is rendered.
|
|
281
305
|
"""
|
|
282
306
|
if args.conformance_tests_script:
|
|
283
307
|
return
|
|
284
308
|
|
|
285
|
-
|
|
309
|
+
module_names_with_scenarios = [
|
|
286
310
|
module.module_name
|
|
287
311
|
for module in plain_module.all_required_modules + [plain_module]
|
|
288
|
-
if
|
|
312
|
+
if _has_scenarios(module.plain_source)
|
|
289
313
|
]
|
|
290
|
-
if not
|
|
314
|
+
if not module_names_with_scenarios:
|
|
291
315
|
return
|
|
292
316
|
|
|
293
|
-
module_names = ", ".join(
|
|
317
|
+
module_names = ", ".join(module_names_with_scenarios)
|
|
294
318
|
console.warning(
|
|
295
|
-
f"
|
|
296
|
-
"
|
|
297
|
-
"
|
|
319
|
+
f"Test scenarios were found ({module_names}) but no conformance tests script is configured, "
|
|
320
|
+
"so no scenario is rendered. Set --conformance-tests-script or 'conformance_tests_script' "
|
|
321
|
+
"in the config file to render them."
|
|
298
322
|
)
|
|
299
323
|
|
|
300
324
|
|
|
@@ -326,7 +350,8 @@ def render( # noqa: C901
|
|
|
326
350
|
enter_pause_event = threading.Event()
|
|
327
351
|
signal.signal(signal.SIGTERM, lambda _signum, _frame: stop_event.set())
|
|
328
352
|
|
|
329
|
-
|
|
353
|
+
warn_if_scenarios_without_conformance_script(plain_module, args)
|
|
354
|
+
warn_about_functionalities_without_scenarios(plain_module)
|
|
330
355
|
|
|
331
356
|
# A built module can be distributed as a "<module>.module" zip archive instead of an unpacked directory.
|
|
332
357
|
# Extract any such module to a scratch location up front. Scratch dirs are removed in main()'s finally.
|
|
@@ -488,6 +513,8 @@ def main(): # noqa: C901
|
|
|
488
513
|
os.path.basename(args.filename),
|
|
489
514
|
args.build_folder,
|
|
490
515
|
template_dirs,
|
|
516
|
+
args.tests_folder,
|
|
517
|
+
args.render_conformance_tests,
|
|
491
518
|
)
|
|
492
519
|
except Exception as e:
|
|
493
520
|
console.error(f"Error: {user_error_message(e)}")
|
|
@@ -503,7 +530,8 @@ def main(): # noqa: C901
|
|
|
503
530
|
console.info("Printing dry run output...\n")
|
|
504
531
|
render_range = plain_spec.compute_render_range(args, plain_module.plain_source)
|
|
505
532
|
print_dry_run_output(plain_module.plain_source, render_range)
|
|
506
|
-
|
|
533
|
+
warn_if_scenarios_without_conformance_script(plain_module, args)
|
|
534
|
+
warn_about_functionalities_without_scenarios(plain_module)
|
|
507
535
|
return
|
|
508
536
|
|
|
509
537
|
event_bus = EventBus()
|