codeplain 0.3.13.dev48__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.
Files changed (209) hide show
  1. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/.github/workflows/publish-to-pypi.yml +38 -1
  2. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/CLAUDE.md +3 -3
  3. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/PKG-INFO +1 -1
  4. codeplain-0.3.14.dev50/change_detection.py +161 -0
  5. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/cli_output/dry_run.py +7 -3
  6. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/codeplain_REST_api.py +9 -14
  7. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/docs/generate_cli.py +3 -2
  8. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/docs/plain2code_cli.md +19 -13
  9. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/example_hello_world_golang/config.yaml +2 -1
  10. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/example_hello_world_golang/hello_world_golang.plain +2 -1
  11. codeplain-0.3.14.dev50/examples/example_hello_world_golang/tests/hello_world_golang/display-hello-world.plain +12 -0
  12. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/example_hello_world_python/config.yaml +1 -0
  13. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/example_hello_world_python/hello_world_python.plain +2 -7
  14. codeplain-0.3.14.dev50/examples/example_hello_world_python/tests/hello_world_python/display-hello-world.plain +13 -0
  15. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/example_hello_world_react/config.yaml +1 -0
  16. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/example_hello_world_react/hello_world_react.plain +2 -1
  17. codeplain-0.3.14.dev50/examples/example_hello_world_react/tests/hello_world_react/display-hello-world.plain +11 -0
  18. codeplain-0.3.14.dev50/examples/example_hello_world_react/tests/typescript-react-app-boilerplate/entry-point.plain +11 -0
  19. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/partial_rendering.py +32 -2
  20. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/plain2code.py +42 -14
  21. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/plain2code_arguments.py +69 -12
  22. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/plain2code_telemetry.py +2 -1
  23. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/plain2code_utils.py +14 -0
  24. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/plain_modules.py +73 -14
  25. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/analyze_specification_ambiguity.py +5 -3
  26. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/distill_conformance_test_memory.py +3 -1
  27. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/fix_conformance_test.py +4 -4
  28. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/fix_unit_tests.py +3 -1
  29. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/refactor_code.py +6 -1
  30. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/render_conformance_tests.py +52 -20
  31. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/render_functional_requirement.py +5 -2
  32. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/run_conformance_tests.py +3 -2
  33. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/summarize_conformance_tests.py +3 -1
  34. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/render_context.py +59 -20
  35. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/render_types.py +6 -15
  36. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/requirements.txt +1 -1
  37. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/standard_template_library/typescript-react-app-boilerplate.plain +2 -1
  38. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/data/acceptance_tests_warning/main_requiring_acceptance_tests.plain +2 -1
  39. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/data/acceptance_tests_warning/required_with_acceptance_tests.plain +2 -5
  40. codeplain-0.3.14.dev50/tests/data/acceptance_tests_warning/tests/required_with_acceptance_tests/entry-point.plain +11 -0
  41. codeplain-0.3.14.dev50/tests/data/partial_rendering/pr_code_var.plain +11 -0
  42. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/data/partial_rendering/pr_leaf.plain +4 -2
  43. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/data/partial_rendering/pr_middle.plain +4 -2
  44. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/data/partial_rendering/pr_root.plain +4 -2
  45. codeplain-0.3.14.dev50/tests/data/partial_rendering/pr_solo.plain +14 -0
  46. codeplain-0.3.14.dev50/tests/test_acceptance_scenario_rendered_once.py +169 -0
  47. codeplain-0.3.14.dev50/tests/test_acceptance_scenarios_after_a_code_fix.py +110 -0
  48. codeplain-0.3.14.dev50/tests/test_change_detection.py +405 -0
  49. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_conformance_fix_journal.py +46 -46
  50. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_dry_run_link_validation.py +2 -1
  51. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_fix_unit_tests_action.py +1 -1
  52. codeplain-0.3.14.dev50/tests/test_frid_arguments.py +40 -0
  53. codeplain-0.3.14.dev50/tests/test_functionality_without_scenarios.py +88 -0
  54. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_git_utils.py +13 -13
  55. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_partial_rendering.py +82 -47
  56. codeplain-0.3.14.dev50/tests/test_plain2code.py +91 -0
  57. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_plain2code_utils.py +12 -1
  58. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_plain_modules.py +50 -44
  59. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_render_finished_report.py +2 -0
  60. codeplain-0.3.14.dev50/tests/test_render_range.py +51 -0
  61. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_render_stop_reason.py +5 -5
  62. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_telemetry.py +2 -2
  63. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_terminal_attachment.py +2 -1
  64. codeplain-0.3.14.dev50/tests/test_tests_folders.py +91 -0
  65. codeplain-0.3.14.dev50/tests/test_traceability_warnings.py +69 -0
  66. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tui/plain_module_render_choice_tui.py +4 -6
  67. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tui/state_handlers.py +19 -28
  68. codeplain-0.3.13.dev48/change_detection.py +0 -190
  69. codeplain-0.3.13.dev48/tests/data/partial_rendering/pr_code_var.plain +0 -9
  70. codeplain-0.3.13.dev48/tests/data/partial_rendering/pr_solo.plain +0 -11
  71. codeplain-0.3.13.dev48/tests/test_change_detection.py +0 -394
  72. codeplain-0.3.13.dev48/tests/test_plain2code.py +0 -93
  73. codeplain-0.3.13.dev48/tests/test_render_range.py +0 -42
  74. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/.claude/settings.json +0 -0
  75. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/.flake8 +0 -0
  76. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/.github/dependabot.yml +0 -0
  77. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/.github/workflows/e2e.yml +0 -0
  78. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/.github/workflows/lint-and-test.yml +0 -0
  79. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/.github/workflows/lint-powershell.yml +0 -0
  80. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/.github/workflows/notify-slack-on-main-merge.yml +0 -0
  81. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/.github/workflows/publish-dev-to-pypi.yml +0 -0
  82. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/.github/workflows/publish-install-script.yml +0 -0
  83. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/.gitignore +0 -0
  84. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/.vscode/launch.json +0 -0
  85. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/.vscode/settings.json +0 -0
  86. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/CONTRIBUTING.md +0 -0
  87. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/LICENSE +0 -0
  88. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/README.md +0 -0
  89. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/cli_output/__init__.py +0 -0
  90. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/cli_output/render_summary.py +0 -0
  91. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/cli_output/status.py +0 -0
  92. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/concept_utils.py +0 -0
  93. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/config/__init__.py +0 -0
  94. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/config/system_config.yaml +0 -0
  95. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/conformance_fix_journal.py +0 -0
  96. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/diff_utils.py +0 -0
  97. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/docs/starting_a_plain_project_from_scratch.md +0 -0
  98. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/event_bus.py +0 -0
  99. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/example_hello_world_golang/harness_tests/hello_world_test.go +0 -0
  100. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/example_hello_world_golang/run.sh +0 -0
  101. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/example_hello_world_python/harness_tests/hello_world_display/test_hello_world.py +0 -0
  102. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/example_hello_world_python/run.sh +0 -0
  103. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/example_hello_world_react/harness_tests/hello_world_display/cypress/e2e/hello_world.cy.ts +0 -0
  104. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/example_hello_world_react/harness_tests/hello_world_display/cypress/support/e2e.ts +0 -0
  105. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/example_hello_world_react/harness_tests/hello_world_display/cypress.config.ts +0 -0
  106. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/example_hello_world_react/harness_tests/hello_world_display/package.json +0 -0
  107. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/example_hello_world_react/harness_tests/hello_world_display/tsconfig.json +0 -0
  108. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/example_hello_world_react/run.sh +0 -0
  109. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/examples/run.sh +0 -0
  110. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/file_utils.py +0 -0
  111. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/git_preflight.py +0 -0
  112. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/git_utils.py +0 -0
  113. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/install/bash/examples.sh +0 -0
  114. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/install/bash/install.sh +0 -0
  115. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/install/bash/walkthrough.sh +0 -0
  116. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/install/powershell/examples.ps1 +0 -0
  117. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/install/powershell/install.ps1 +0 -0
  118. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/install/powershell/walkthrough.ps1 +0 -0
  119. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/memory_management.py +0 -0
  120. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/metadata_utils.py +0 -0
  121. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/module_renderer.py +0 -0
  122. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/path_resolution.py +0 -0
  123. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/plain2code_cli.md +0 -0
  124. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/plain2code_console.py +0 -0
  125. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/plain2code_events.py +0 -0
  126. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/plain2code_exceptions.py +0 -0
  127. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/plain2code_logger.py +0 -0
  128. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/plain2code_nodes.py +0 -0
  129. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/plain2code_read_config.py +0 -0
  130. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/plain2code_state.py +0 -0
  131. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/plain_file.py +0 -0
  132. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/plain_spec.py +0 -0
  133. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/pyproject.toml +0 -0
  134. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/pytest.ini +0 -0
  135. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/__init__.py +0 -0
  136. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/base_action.py +0 -0
  137. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/commit_conformance_tests_changes.py +0 -0
  138. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/commit_implementation_code_changes.py +0 -0
  139. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/create_dist.py +0 -0
  140. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/exit_with_error.py +0 -0
  141. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/finish_functional_requirement.py +0 -0
  142. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/prepare_repositories.py +0 -0
  143. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/prepare_testing_environment.py +0 -0
  144. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/actions/run_unit_tests.py +0 -0
  145. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/agent_tools.py +0 -0
  146. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/code_renderer.py +0 -0
  147. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/conformance_tests.py +0 -0
  148. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/implementation_code_helpers.py +0 -0
  149. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/render_utils.py +0 -0
  150. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/state_machine_config.py +0 -0
  151. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/states.py +0 -0
  152. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/render_machine/triggers.py +0 -0
  153. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/resources/codeplain_overview.png +0 -0
  154. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/resources/plain_example.png +0 -0
  155. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/standard_template_library/golang-console-app-template.plain +0 -0
  156. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/standard_template_library/python-console-app-template.plain +0 -0
  157. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/standard_template_library/typescript-react-app-template.plain +0 -0
  158. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/system_config.py +0 -0
  159. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/test_scripts/run_conformance_tests_cypress.ps1 +0 -0
  160. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/test_scripts/run_conformance_tests_cypress.sh +0 -0
  161. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/test_scripts/run_conformance_tests_golang.ps1 +0 -0
  162. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/test_scripts/run_conformance_tests_golang.sh +0 -0
  163. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/test_scripts/run_conformance_tests_python.ps1 +0 -0
  164. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/test_scripts/run_conformance_tests_python.sh +0 -0
  165. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/test_scripts/run_unittests_flutter.ps1 +0 -0
  166. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/test_scripts/run_unittests_flutter.sh +0 -0
  167. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/test_scripts/run_unittests_golang.ps1 +0 -0
  168. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/test_scripts/run_unittests_golang.sh +0 -0
  169. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/test_scripts/run_unittests_python.ps1 +0 -0
  170. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/test_scripts/run_unittests_python.sh +0 -0
  171. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/test_scripts/run_unittests_react.ps1 +0 -0
  172. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/test_scripts/run_unittests_react.sh +0 -0
  173. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/__init__.py +0 -0
  174. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/conftest.py +0 -0
  175. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/data/partial_rendering/pr_implement.plain +0 -0
  176. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/e2e/Dockerfile +0 -0
  177. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/e2e/conftest.py +0 -0
  178. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/e2e/test_hello_world_python.py +0 -0
  179. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/e2e/test_hello_world_python_windows.py +0 -0
  180. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_agent_tools.py +0 -0
  181. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_arg_provenance.py +0 -0
  182. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_cli_output.py +0 -0
  183. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_console_log_styles.py +0 -0
  184. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_distill_conformance_test_memory.py +0 -0
  185. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_file_utils.py +0 -0
  186. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_fix_unit_tests_conformance_context.py +0 -0
  187. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_folder_path_resolution.py +0 -0
  188. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_git_preflight.py +0 -0
  189. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_headless_logging.py +0 -0
  190. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_log_file_name_resolution.py +0 -0
  191. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_logging_config_path_resolution.py +0 -0
  192. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_path_resolution.py +0 -0
  193. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_plain2code_state.py +0 -0
  194. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_prepare_repositories_layout.py +0 -0
  195. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_resolve_config_file.py +0 -0
  196. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_script_path_resolution.py +0 -0
  197. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_system_config.py +0 -0
  198. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_tui_components.py +0 -0
  199. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_tui_usage.py +0 -0
  200. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_usage_summary.py +0 -0
  201. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tests/test_user_error_message.py +0 -0
  202. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tui/__init__.py +0 -0
  203. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tui/components.py +0 -0
  204. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tui/models.py +0 -0
  205. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tui/plain2code_tui.py +0 -0
  206. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tui/spinner.py +0 -0
  207. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tui/styles.css +0 -0
  208. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/tui/widget_helpers.py +0 -0
  209. {codeplain-0.3.13.dev48 → codeplain-0.3.14.dev50}/usage_summary.py +0 -0
@@ -14,6 +14,9 @@ jobs:
14
14
  runs-on: ubuntu-latest
15
15
  permissions:
16
16
  contents: write
17
+ outputs:
18
+ # The notify job replies in the start notice's thread.
19
+ slack-ts: ${{ steps.slack-start.outputs.ts }}
17
20
 
18
21
  steps:
19
22
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -23,6 +26,7 @@ jobs:
23
26
 
24
27
  # Non-fatal: Slack being down must not block the release.
25
28
  - name: Notify Slack (start)
29
+ id: slack-start
26
30
  if: ${{ vars.SLACK_CHANNEL_ID != '' }}
27
31
  continue-on-error: true
28
32
  uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v4.0.0
@@ -93,6 +97,13 @@ jobs:
93
97
  if: ${{ !cancelled() && vars.SLACK_CHANNEL_ID != '' }}
94
98
  runs-on: ubuntu-latest
95
99
 
100
+ env:
101
+ # Notices reply in the start notice's thread, quoted so YAML keeps the ts a
102
+ # string. Without a start notice (its post failed or never ran) this is null,
103
+ # which the Slack client drops, and they post to the channel. Failures are
104
+ # also broadcast to the channel; success stays in the thread.
105
+ THREAD_TS: ${{ needs.build.outputs.slack-ts && format('"{0}"', needs.build.outputs.slack-ts) || 'null' }}
106
+
96
107
  steps:
97
108
  - name: Notify Slack (build failure)
98
109
  if: ${{ needs.build.result == 'failure' }}
@@ -103,6 +114,8 @@ jobs:
103
114
  errors: true
104
115
  payload: |
105
116
  channel: ${{ vars.SLACK_CHANNEL_ID }}
117
+ thread_ts: ${{ env.THREAD_TS }}
118
+ reply_broadcast: ${{ env.THREAD_TS != 'null' }}
106
119
  text: >-
107
120
  *Codeplain Client*: Build of `${{ github.ref_name }}` FAILED :x:. Nothing was published to PyPI.
108
121
  See <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|the run log>.
@@ -116,6 +129,8 @@ jobs:
116
129
  errors: true
117
130
  payload: |
118
131
  channel: ${{ vars.SLACK_CHANNEL_ID }}
132
+ thread_ts: ${{ env.THREAD_TS }}
133
+ reply_broadcast: ${{ env.THREAD_TS != 'null' }}
119
134
  text: >-
120
135
  *Codeplain Client*: Publishing `${{ github.ref_name }}` to PyPI FAILED :x:.
121
136
  See <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|the run log>.
@@ -141,6 +156,7 @@ jobs:
141
156
  errors: true
142
157
  payload: |
143
158
  channel: ${{ vars.SLACK_CHANNEL_ID }}
159
+ thread_ts: ${{ env.THREAD_TS }}
144
160
  text: >-
145
161
  *Codeplain Client*: pre-release `${{ github.ref_name }}` published to PyPI :test_tube:.
146
162
  Normal installs are unaffected — try it with `pip install --pre codeplain==${{ steps.version.outputs.version }}`.
@@ -154,10 +170,27 @@ jobs:
154
170
  errors: true
155
171
  payload: |
156
172
  channel: ${{ vars.SLACK_CHANNEL_ID }}
173
+ thread_ts: ${{ env.THREAD_TS }}
157
174
  text: >-
158
175
  *Codeplain Client*: `${{ github.ref_name }}` published to PyPI :white_check_mark:.
159
176
  Install with `pip install --upgrade codeplain`.
160
177
 
178
+ # Success also puts a ✅ on the start notice, so the result shows in the
179
+ # channel without another message. Needs the app's reactions:write scope.
180
+ # Non-fatal: the result is already posted, and a re-run gets already_reacted.
181
+ - name: Notify Slack (✅ on the start notice)
182
+ if: ${{ needs.publish-to-pypi.result == 'success' && env.THREAD_TS != 'null' }}
183
+ continue-on-error: true
184
+ uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v4.0.0
185
+ with:
186
+ method: reactions.add
187
+ token: ${{ secrets.SLACK_BOT_TOKEN }}
188
+ errors: true
189
+ payload: |
190
+ channel: ${{ vars.SLACK_CHANNEL_ID }}
191
+ timestamp: ${{ env.THREAD_TS }}
192
+ name: white_check_mark
193
+
161
194
  # Release pipelines to be turned on only after the rest of the infrastructure
162
195
  # is ready.
163
196
  #
@@ -165,7 +198,7 @@ jobs:
165
198
  # # keeps its minimal permissions and no checkout.
166
199
  # linear-release:
167
200
  # name: Record release in Linear
168
- # needs: publish-to-pypi
201
+ # needs: [build, publish-to-pypi]
169
202
  # runs-on: ubuntu-latest
170
203
  #
171
204
  # permissions:
@@ -192,6 +225,9 @@ jobs:
192
225
  # # outcome — `failure()` would never fire.
193
226
  # - name: Notify Slack (release not recorded)
194
227
  # if: ${{ steps.linear.outcome == 'failure' && vars.SLACK_CHANNEL_ID != '' }}
228
+ # env:
229
+ # # See the notify job.
230
+ # THREAD_TS: ${{ needs.build.outputs.slack-ts && format('"{0}"', needs.build.outputs.slack-ts) || 'null' }}
195
231
  # uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v4.0.0
196
232
  # with:
197
233
  # method: chat.postMessage
@@ -199,6 +235,7 @@ jobs:
199
235
  # errors: true
200
236
  # payload: |
201
237
  # channel: ${{ vars.SLACK_CHANNEL_ID }}
238
+ # thread_ts: ${{ env.THREAD_TS }}
202
239
  # text: >-
203
240
  # *Codeplain Client*: `${{ github.ref_name }}` is on PyPI, but recording it in Linear FAILED :warning:.
204
241
  # See <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|the run log>.
@@ -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 1,3 # Render functionalities 1-3
80
- python plain2code.py file.plain --render-from 2 # Resume from functionality 2
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`
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: codeplain
3
- Version: 0.3.13.dev48
3
+ Version: 0.3.14.dev50
4
4
  Summary: Transform plain language specifications into working code
5
5
  License-File: LICENSE
6
6
  Classifier: Environment :: Console
@@ -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
- if plain_spec.ACCEPTANCE_TESTS in specifications:
26
- for i, acceptance_test in enumerate(specifications[plain_spec.ACCEPTANCE_TESTS], 1):
27
- console.info(f"Generating acceptance test #{i}:\n\n{acceptance_test}\n")
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["conformance_tests_plan_summary_string"]
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
- acceptance_test,
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
- acceptance_test (dict): A dictionary containing acceptance test information.
480
+ scenario_id (str): The scenario-id of the acceptance scenario to render.
488
481
 
489
482
  Returns:
490
- dict: The rendered acceptance tests.
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
- "acceptance_test": acceptance_test,
501
+ "scenario_id": scenario_id,
508
502
  }
509
503
 
510
- return self.post_request(endpoint_url, headers, payload, run_state)
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
- # Add the parent directory to the path so we can import plain2code_arguments
5
- sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
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-from RENDER_FROM] [--force-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
- [--template-dir TEMPLATE_DIR] [--copy-build]
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. `1`
55
- , `2`, `3`). Use comma to separate start and end IDs.
56
- If only one functionality ID is provided, only that
57
- functionality is rendered. Range is inclusive of both
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. `2`). The functionality with this
62
- ID will be included in the output. The functionality
63
- ID must match one of the functionalities in your plain
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.
@@ -1,3 +1,4 @@
1
1
  verbose: true
2
2
  unittests-script: ../../test_scripts/run_unittests_golang.sh
3
- conformance-tests-script: ../../test_scripts/run_conformance_tests_golang.sh
3
+ conformance-tests-script: ../../test_scripts/run_conformance_tests_golang.sh
4
+ tests-folder: tests
@@ -10,4 +10,5 @@ import:
10
10
 
11
11
  ***functional specs***
12
12
 
13
- - Display "hello, world"
13
+ # display-hello-world
14
+ :App: displays "hello, world".
@@ -0,0 +1,12 @@
1
+ ---
2
+ module: hello_world_golang
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
+
12
+ ***acceptance tests***
@@ -1,3 +1,4 @@
1
1
  unittests-script: ../../test_scripts/run_unittests_python.sh
2
2
  conformance-tests-script: ../../test_scripts/run_conformance_tests_python.sh
3
3
  verbose: true
4
+ tests-folder: tests
@@ -10,10 +10,5 @@ import:
10
10
 
11
11
  ***functional specs***
12
12
 
13
- - Display "hello, world"
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***
@@ -1,2 +1,3 @@
1
1
  conformance-tests-script: ../../test_scripts/run_conformance_tests_cypress.sh
2
2
  verbose: true
3
+ tests-folder: tests
@@ -8,4 +8,5 @@ requires:
8
8
 
9
9
  ***functional specs***
10
10
 
11
- - Display "hello, world"
11
+ # display-hello-world
12
+ :App: displays "hello, world".
@@ -0,0 +1,11 @@
1
+ ---
2
+ module: hello_world_react
3
+ func_id: display-hello-world
4
+ ---
5
+
6
+ ***conformance tests***
7
+
8
+ # shows-hello-world
9
+ Opening :App: in a browser shows "hello, world".
10
+
11
+ ***acceptance tests***
@@ -0,0 +1,11 @@
1
+ ---
2
+ module: typescript-react-app-boilerplate
3
+ func_id: entry-point
4
+ ---
5
+
6
+ ***conformance tests***
7
+
8
+ # app-starts
9
+ :App: starts and serves a page on port 3000.
10
+
11
+ ***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
- return int(partial_start.frid) > int(plain_module_render_state.last_render_frid)
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(