codeplain 0.4.2.dev56__tar.gz → 0.4.3.dev58__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 (207) hide show
  1. codeplain-0.4.3.dev58/.github/scripts/record-linear-release.cjs +178 -0
  2. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/.github/workflows/publish-to-pypi.yml +45 -50
  3. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/PKG-INFO +1 -1
  4. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/cli_output/dry_run.py +4 -2
  5. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/plain2code_utils.py +5 -0
  6. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/plain_modules.py +11 -6
  7. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/analyze_specification_ambiguity.py +2 -2
  8. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/distill_conformance_test_memory.py +1 -2
  9. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/fix_conformance_test.py +2 -6
  10. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/prepare_repositories.py +3 -1
  11. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/refactor_code.py +1 -2
  12. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/render_conformance_tests.py +1 -1
  13. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/render_functional_requirement.py +2 -3
  14. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/run_conformance_tests.py +3 -3
  15. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/summarize_conformance_tests.py +1 -2
  16. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/render_context.py +36 -8
  17. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/render_utils.py +5 -2
  18. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_acceptance_scenario_rendered_once.py +2 -0
  19. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_distill_conformance_test_memory.py +1 -0
  20. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_fix_unit_tests_conformance_context.py +3 -0
  21. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_render_stop_reason.py +1 -1
  22. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_traceability_warnings.py +1 -1
  23. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/.claude/settings.json +0 -0
  24. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/.flake8 +0 -0
  25. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/.github/dependabot.yml +0 -0
  26. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/.github/workflows/e2e.yml +0 -0
  27. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/.github/workflows/lint-and-test.yml +0 -0
  28. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/.github/workflows/lint-powershell.yml +0 -0
  29. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/.github/workflows/notify-slack-on-main-merge.yml +0 -0
  30. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/.github/workflows/publish-dev-to-pypi.yml +0 -0
  31. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/.github/workflows/publish-install-script.yml +0 -0
  32. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/.gitignore +0 -0
  33. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/.vscode/launch.json +0 -0
  34. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/.vscode/settings.json +0 -0
  35. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/CLAUDE.md +0 -0
  36. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/CONTRIBUTING.md +0 -0
  37. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/LICENSE +0 -0
  38. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/README.md +0 -0
  39. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/change_detection.py +0 -0
  40. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/cli_output/__init__.py +0 -0
  41. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/cli_output/render_summary.py +0 -0
  42. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/cli_output/status.py +0 -0
  43. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/codeplain_REST_api.py +0 -0
  44. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/concept_utils.py +0 -0
  45. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/config/__init__.py +0 -0
  46. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/config/system_config.yaml +0 -0
  47. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/conformance_fix_journal.py +0 -0
  48. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/diff_utils.py +0 -0
  49. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/docs/generate_cli.py +0 -0
  50. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/docs/plain2code_cli.md +0 -0
  51. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/docs/starting_a_plain_project_from_scratch.md +0 -0
  52. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/event_bus.py +0 -0
  53. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_golang/config.yaml +0 -0
  54. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_golang/harness_tests/hello_world_test.go +0 -0
  55. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_golang/hello_world_golang.plain +0 -0
  56. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_golang/run.sh +0 -0
  57. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_golang/tests/hello_world_golang/display-hello-world.plain +0 -0
  58. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_python/config.yaml +0 -0
  59. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_python/harness_tests/hello_world_display/test_hello_world.py +0 -0
  60. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_python/hello_world_python.plain +0 -0
  61. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_python/run.sh +0 -0
  62. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_python/tests/hello_world_python/display-hello-world.plain +0 -0
  63. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_react/config.yaml +0 -0
  64. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_react/harness_tests/hello_world_display/cypress/e2e/hello_world.cy.ts +0 -0
  65. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_react/harness_tests/hello_world_display/cypress/support/e2e.ts +0 -0
  66. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_react/harness_tests/hello_world_display/cypress.config.ts +0 -0
  67. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_react/harness_tests/hello_world_display/package.json +0 -0
  68. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_react/harness_tests/hello_world_display/tsconfig.json +0 -0
  69. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_react/hello_world_react.plain +0 -0
  70. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_react/run.sh +0 -0
  71. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_react/tests/hello_world_react/display-hello-world.plain +0 -0
  72. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/example_hello_world_react/tests/typescript-react-app-boilerplate/entry-point.plain +0 -0
  73. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/examples/run.sh +0 -0
  74. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/file_utils.py +0 -0
  75. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/git_preflight.py +0 -0
  76. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/git_utils.py +0 -0
  77. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/install/bash/examples.sh +0 -0
  78. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/install/bash/install.sh +0 -0
  79. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/install/bash/walkthrough.sh +0 -0
  80. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/install/powershell/examples.ps1 +0 -0
  81. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/install/powershell/install.ps1 +0 -0
  82. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/install/powershell/walkthrough.ps1 +0 -0
  83. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/memory_management.py +0 -0
  84. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/metadata_utils.py +0 -0
  85. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/module_renderer.py +0 -0
  86. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/partial_rendering.py +0 -0
  87. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/path_resolution.py +0 -0
  88. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/plain2code.py +0 -0
  89. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/plain2code_arguments.py +0 -0
  90. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/plain2code_cli.md +0 -0
  91. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/plain2code_console.py +0 -0
  92. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/plain2code_events.py +0 -0
  93. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/plain2code_exceptions.py +0 -0
  94. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/plain2code_logger.py +0 -0
  95. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/plain2code_nodes.py +0 -0
  96. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/plain2code_read_config.py +0 -0
  97. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/plain2code_state.py +0 -0
  98. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/plain2code_telemetry.py +0 -0
  99. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/plain_file.py +0 -0
  100. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/plain_spec.py +0 -0
  101. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/pyproject.toml +0 -0
  102. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/pytest.ini +0 -0
  103. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/__init__.py +0 -0
  104. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/base_action.py +0 -0
  105. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/commit_conformance_tests_changes.py +0 -0
  106. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/commit_implementation_code_changes.py +0 -0
  107. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/create_dist.py +0 -0
  108. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/exit_with_error.py +0 -0
  109. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/finish_functional_requirement.py +0 -0
  110. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/fix_unit_tests.py +0 -0
  111. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/prepare_testing_environment.py +0 -0
  112. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/actions/run_unit_tests.py +0 -0
  113. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/agent_tools.py +0 -0
  114. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/code_renderer.py +0 -0
  115. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/conformance_tests.py +0 -0
  116. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/implementation_code_helpers.py +0 -0
  117. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/render_types.py +0 -0
  118. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/state_machine_config.py +0 -0
  119. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/states.py +0 -0
  120. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/render_machine/triggers.py +0 -0
  121. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/requirements.txt +0 -0
  122. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/resources/codeplain_overview.png +0 -0
  123. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/resources/plain_example.png +0 -0
  124. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/standard_template_library/golang-console-app-template.plain +0 -0
  125. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/standard_template_library/python-console-app-template.plain +0 -0
  126. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/standard_template_library/typescript-react-app-boilerplate.plain +0 -0
  127. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/standard_template_library/typescript-react-app-template.plain +0 -0
  128. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/system_config.py +0 -0
  129. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/test_scripts/run_conformance_tests_cypress.ps1 +0 -0
  130. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/test_scripts/run_conformance_tests_cypress.sh +0 -0
  131. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/test_scripts/run_conformance_tests_golang.ps1 +0 -0
  132. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/test_scripts/run_conformance_tests_golang.sh +0 -0
  133. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/test_scripts/run_conformance_tests_python.ps1 +0 -0
  134. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/test_scripts/run_conformance_tests_python.sh +0 -0
  135. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/test_scripts/run_unittests_flutter.ps1 +0 -0
  136. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/test_scripts/run_unittests_flutter.sh +0 -0
  137. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/test_scripts/run_unittests_golang.ps1 +0 -0
  138. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/test_scripts/run_unittests_golang.sh +0 -0
  139. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/test_scripts/run_unittests_python.ps1 +0 -0
  140. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/test_scripts/run_unittests_python.sh +0 -0
  141. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/test_scripts/run_unittests_react.ps1 +0 -0
  142. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/test_scripts/run_unittests_react.sh +0 -0
  143. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/__init__.py +0 -0
  144. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/conftest.py +0 -0
  145. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/data/acceptance_tests_warning/main_requiring_acceptance_tests.plain +0 -0
  146. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/data/acceptance_tests_warning/required_with_acceptance_tests.plain +0 -0
  147. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/data/acceptance_tests_warning/tests/required_with_acceptance_tests/entry-point.plain +0 -0
  148. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/data/partial_rendering/pr_code_var.plain +0 -0
  149. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/data/partial_rendering/pr_implement.plain +0 -0
  150. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/data/partial_rendering/pr_leaf.plain +0 -0
  151. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/data/partial_rendering/pr_middle.plain +0 -0
  152. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/data/partial_rendering/pr_root.plain +0 -0
  153. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/data/partial_rendering/pr_solo.plain +0 -0
  154. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/e2e/Dockerfile +0 -0
  155. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/e2e/conftest.py +0 -0
  156. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/e2e/test_hello_world_python.py +0 -0
  157. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/e2e/test_hello_world_python_windows.py +0 -0
  158. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_acceptance_scenarios_after_a_code_fix.py +0 -0
  159. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_agent_tools.py +0 -0
  160. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_arg_provenance.py +0 -0
  161. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_change_detection.py +0 -0
  162. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_cli_output.py +0 -0
  163. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_conformance_fix_journal.py +0 -0
  164. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_console_log_styles.py +0 -0
  165. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_dependency_pins.py +0 -0
  166. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_dry_run_link_validation.py +0 -0
  167. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_exit_when_done.py +0 -0
  168. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_file_utils.py +0 -0
  169. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_fix_unit_tests_action.py +0 -0
  170. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_folder_path_resolution.py +0 -0
  171. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_frid_arguments.py +0 -0
  172. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_functionality_position.py +0 -0
  173. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_functionality_without_scenarios.py +0 -0
  174. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_git_preflight.py +0 -0
  175. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_git_utils.py +0 -0
  176. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_headless_logging.py +0 -0
  177. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_log_file_name_resolution.py +0 -0
  178. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_logging_config_path_resolution.py +0 -0
  179. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_partial_rendering.py +0 -0
  180. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_path_resolution.py +0 -0
  181. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_plain2code.py +0 -0
  182. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_plain2code_state.py +0 -0
  183. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_plain2code_utils.py +0 -0
  184. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_plain_modules.py +0 -0
  185. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_prepare_repositories_layout.py +0 -0
  186. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_render_finished_report.py +0 -0
  187. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_render_range.py +0 -0
  188. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_resolve_config_file.py +0 -0
  189. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_script_path_resolution.py +0 -0
  190. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_system_config.py +0 -0
  191. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_telemetry.py +0 -0
  192. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_terminal_attachment.py +0 -0
  193. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_tests_folders.py +0 -0
  194. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_tui_components.py +0 -0
  195. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_tui_usage.py +0 -0
  196. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_usage_summary.py +0 -0
  197. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tests/test_user_error_message.py +0 -0
  198. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tui/__init__.py +0 -0
  199. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tui/components.py +0 -0
  200. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tui/models.py +0 -0
  201. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tui/plain2code_tui.py +0 -0
  202. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tui/plain_module_render_choice_tui.py +0 -0
  203. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tui/spinner.py +0 -0
  204. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tui/state_handlers.py +0 -0
  205. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tui/styles.css +0 -0
  206. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/tui/widget_helpers.py +0 -0
  207. {codeplain-0.4.2.dev56 → codeplain-0.4.3.dev58}/usage_summary.py +0 -0
@@ -0,0 +1,178 @@
1
+ // Records a deploy or a release as a Linear release. Run it from actions/github-script:
2
+ //
3
+ // script: return require('./.github/scripts/record-linear-release.cjs')({ github, context, core })
4
+ //
5
+ // Environment:
6
+ // LINEAR_ACCESS_KEY The pipeline's access key. Without one, nothing is recorded.
7
+ // LINEAR_RELEASE_MODE "live" records the release. Anything else only logs what would be sent.
8
+ // RELEASE_SHA The commit that was deployed or tagged.
9
+ // RELEASE_VERSION The release tag, or for a deploy its short SHA (the default).
10
+ // RELEASE_BRANCH The branch PRs merge into. Defaults to main.
11
+ // RELEASE_NOTES "prs" (the default) lists the PRs. "github-release" copies the body of
12
+ // the GitHub release tagged RELEASE_VERSION.
13
+ //
14
+ // Output: release-url, the release's page in Linear. It stays empty when the release is only logged.
15
+ 'use strict';
16
+
17
+ const LINEAR_API = 'https://api.linear.app/graphql';
18
+ const MAX_BASE_CANDIDATES = 20;
19
+
20
+ // On GitHub, "#12" is a PR or issue of the same repo. Linear matches a bare "#12" against every
21
+ // repo it knows, so it can link a PR from another repo. Every reference is therefore written out
22
+ // as a full link, except in code (fenced or inline), existing links and URLs. GitHub redirects
23
+ // /pull/N to /issues/N when N is an issue.
24
+ function linkReferences(text, owner, repo) {
25
+ const untouched = /(```[\s\S]*?```|~~~[\s\S]*?~~~|`[^`\n]*`|\[[^\]\n]*\]\([^)\n]*\)|<[^>\n]*>|https?:\/\/[^\s)]+)/;
26
+ return text
27
+ .split(untouched)
28
+ .map((part, i) =>
29
+ i % 2
30
+ ? part
31
+ : part
32
+ .replace(
33
+ /(^|[^\w/#&])([\w.-]+)\/([\w.-]+)#(\d+)\b/g,
34
+ (_, pre, o, r, n) => `${pre}[${o}/${r}#${n}](https://github.com/${o}/${r}/pull/${n})`,
35
+ )
36
+ .replace(
37
+ /(^|[^\w/#&[]|\bPR ?)#(\d+)\b/g,
38
+ (_, pre, n) => `${pre}[#${n}](https://github.com/${owner}/${repo}/pull/${n})`,
39
+ ),
40
+ )
41
+ .join('');
42
+ }
43
+
44
+ function prNotes(prs, owner, repo) {
45
+ const link = (n) => `[#${n}](https://github.com/${owner}/${repo}/pull/${n})`;
46
+ const dependabot = prs.filter((pr) => pr.user.login === 'dependabot[bot]');
47
+ const lines = prs
48
+ .filter((pr) => !dependabot.includes(pr))
49
+ .map((pr) => `- ${link(pr.number)} ${linkReferences(pr.title, owner, repo)} · ${pr.user.login}`);
50
+ if (dependabot.length) {
51
+ const s = dependabot.length > 1 ? 's' : '';
52
+ lines.push(`- ${dependabot.length} Dependabot update${s}: ${dependabot.map((pr) => link(pr.number)).join(', ')}`);
53
+ }
54
+ return lines.join('\n');
55
+ }
56
+
57
+ // The PRs merged into `branch` since the newest earlier release in this pipeline.
58
+ async function pullRequestsSince({ github, owner, repo, branch, head, version, releases }) {
59
+ const compare = async (base, target, page = 1, perPage = 1) =>
60
+ (await github.rest.repos.compareCommitsWithBasehead({ owner, repo, basehead: `${base}...${target}`, page, per_page: perPage }))
61
+ .data;
62
+
63
+ // Testing can be deployed from a branch. Such a deploy gets no PRs; they count once they reach the branch.
64
+ if (!['ahead', 'identical'].includes((await compare(head, branch)).status)) {
65
+ return { prs: [], reason: `${head.slice(0, 7)} is not on ${branch}` };
66
+ }
67
+
68
+ // Sorted by completion time, since an older release whose notes were edited can be listed first.
69
+ // A release that is not on the branch is a branch deploy and is never a base. This release itself
70
+ // (a re-run) is skipped, but another version at the same commit is a base, and leaves no new PRs.
71
+ const candidates = releases
72
+ .filter((r) => r.commitSha && r.version !== version)
73
+ .sort((a, b) => Date.parse(b.completedAt || b.createdAt) - Date.parse(a.completedAt || a.createdAt))
74
+ .slice(0, MAX_BASE_CANDIDATES);
75
+ let base;
76
+ for (const release of candidates) {
77
+ const { status } = await compare(release.commitSha, head);
78
+ if (status === 'diverged') continue;
79
+ // "behind": the newest release is ahead of this commit, so this deploy is a rollback.
80
+ if (status === 'behind') return { prs: [], reason: `rollback: ${release.version} is newer` };
81
+ base = release;
82
+ break;
83
+ }
84
+ if (!base) return { prs: [], reason: 'no earlier release on the branch' };
85
+
86
+ const commits = [];
87
+ for (let page = 1; ; page++) {
88
+ const data = await compare(base.commitSha, head, page, 100);
89
+ commits.push(...data.commits);
90
+ if (data.commits.length < 100 || commits.length >= data.total_commits) break;
91
+ }
92
+
93
+ // GitHub knows each commit's PR, whatever the merge method.
94
+ const prs = new Map();
95
+ for (const { sha } of commits) {
96
+ const { data } = await github.rest.repos.listPullRequestsAssociatedWithCommit({ owner, repo, commit_sha: sha });
97
+ for (const pr of data) {
98
+ if (pr.merged_at && pr.base.ref === branch && !prs.has(pr.number)) prs.set(pr.number, pr);
99
+ }
100
+ }
101
+ return { prs: [...prs.values()], base };
102
+ }
103
+
104
+ module.exports = async ({ github, context, core }) => {
105
+ const key = process.env.LINEAR_ACCESS_KEY;
106
+ const live = process.env.LINEAR_RELEASE_MODE === 'live';
107
+ if (!key) {
108
+ if (live) throw new Error('LINEAR_RELEASE_MODE is live, but this pipeline has no Linear access key');
109
+ core.notice('No Linear access key for this pipeline, so the release is not recorded.');
110
+ return;
111
+ }
112
+ const required = (name) => {
113
+ if (!process.env[name]) throw new Error(`${name} is not set`);
114
+ return process.env[name];
115
+ };
116
+ const head = required('RELEASE_SHA');
117
+ const version = process.env.RELEASE_VERSION || head.slice(0, 7);
118
+ const branch = process.env.RELEASE_BRANCH || 'main';
119
+ const { owner, repo } = context.repo;
120
+
121
+ const linear = async (query, variables) => {
122
+ const res = await fetch(LINEAR_API, {
123
+ method: 'POST',
124
+ headers: { 'Content-Type': 'application/json', Authorization: key },
125
+ body: JSON.stringify({ query, variables }),
126
+ signal: AbortSignal.timeout(30_000),
127
+ });
128
+ const body = await res.json().catch(() => ({}));
129
+ if (!res.ok || body.errors) throw new Error(`Linear API ${res.status}: ${JSON.stringify(body.errors || body)}`);
130
+ return body.data;
131
+ };
132
+
133
+ const { recentReleasesByAccessKey: releases } = await linear(
134
+ 'query { recentReleasesByAccessKey(limit: 50) { commitSha version completedAt createdAt } }',
135
+ );
136
+ const { prs, base, reason } = await pullRequestsSince({ github, owner, repo, branch, head, version, releases });
137
+
138
+ const links = [{ label: 'GitHub run', url: `${context.serverUrl}/${owner}/${repo}/actions/runs/${context.runId}` }];
139
+ let notes;
140
+ if (process.env.RELEASE_NOTES === 'github-release') {
141
+ const { data } = await github.rest.repos.getReleaseByTag({ owner, repo, tag: version });
142
+ notes = linkReferences((data.body || '').replace(/\r\n/g, '\n').trim(), owner, repo);
143
+ links.unshift({ label: 'GitHub release', url: data.html_url });
144
+ } else {
145
+ notes = prNotes(prs, owner, repo);
146
+ }
147
+
148
+ const input = {
149
+ name: version,
150
+ version,
151
+ commitSha: head,
152
+ repository: { owner, name: repo, provider: 'github', url: `https://github.com/${owner}/${repo}` },
153
+ pullRequestReferences: prs.map((pr) => ({ repositoryOwner: owner, repositoryName: repo, number: pr.number })),
154
+ links,
155
+ ...(notes ? { releaseNotes: { title: version, content: notes } } : {}),
156
+ };
157
+
158
+ const since = base ? `since ${base.version}` : `none (${reason})`;
159
+ core.info(`PRs ${since}: ${prs.map((pr) => `#${pr.number}`).join(', ') || '-'}`);
160
+ if (!live) {
161
+ core.notice(`Log-only: ${version} would be recorded in Linear with ${prs.length} PRs. Set LINEAR_RELEASE_MODE=live to record it.`);
162
+ core.info(JSON.stringify(input, null, 2));
163
+ return;
164
+ }
165
+
166
+ const { releaseSyncByAccessKey: result } = await linear(
167
+ 'mutation ($input: ReleaseSyncInputBase!) { releaseSyncByAccessKey(input: $input) { success release { url } } }',
168
+ { input },
169
+ );
170
+ // Linear can report a failed sync with HTTP 200.
171
+ if (!result.success || !result.release) throw new Error(`Linear did not record ${version}: ${JSON.stringify(result)}`);
172
+ core.setOutput('release-url', result.release.url);
173
+ core.notice(`Recorded ${version} in Linear: ${result.release.url}`);
174
+ };
175
+
176
+ module.exports.linkReferences = linkReferences;
177
+ module.exports.prNotes = prNotes;
178
+ module.exports.pullRequestsSince = pullRequestsSince;
@@ -93,7 +93,8 @@ jobs:
93
93
  # re-posts without publishing again.
94
94
  notify:
95
95
  name: Notify Slack
96
- needs: [build, publish-to-pypi]
96
+ # linear-release is skipped for pre-releases and failed publishes; this job still runs.
97
+ needs: [build, publish-to-pypi, linear-release]
97
98
  if: ${{ !cancelled() && vars.SLACK_CHANNEL_ID != '' }}
98
99
  runs-on: ubuntu-latest
99
100
 
@@ -163,6 +164,9 @@ jobs:
163
164
 
164
165
  - name: Notify Slack (release published)
165
166
  if: ${{ needs.publish-to-pypi.result == 'success' && !github.event.release.prerelease }}
167
+ env:
168
+ # Empty while the release step only logs, or when it failed.
169
+ RELEASE_URL: ${{ needs.linear-release.outputs.release-url }}
166
170
  uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v4.0.0
167
171
  with:
168
172
  method: chat.postMessage
@@ -173,7 +177,7 @@ jobs:
173
177
  thread_ts: ${{ env.THREAD_TS }}
174
178
  text: >-
175
179
  *Codeplain Client*: `${{ github.ref_name }}` published to PyPI :white_check_mark:.
176
- Install with `pip install --upgrade codeplain`.
180
+ Install with `pip install --upgrade codeplain`.${{ env.RELEASE_URL != '' && format(' <{0}|View release>.', env.RELEASE_URL) || (needs.linear-release.result == 'failure' || needs.linear-release.outputs.outcome == 'failure') && ' Recording it in Linear failed :warning:.' || '' }}
177
181
 
178
182
  # Success also puts a ✅ on the start notice, so the result shows in the
179
183
  # channel without another message. Needs the app's reactions:write scope.
@@ -191,51 +195,42 @@ jobs:
191
195
  timestamp: ${{ env.THREAD_TS }}
192
196
  name: white_check_mark
193
197
 
194
- # Release pipelines to be turned on only after the rest of the infrastructure
195
- # is ready.
196
- #
197
- # # Runs only after the package is on PyPI. Kept as its own job so the publish job
198
- # # keeps its minimal permissions and no checkout.
199
- # linear-release:
200
- # name: Record release in Linear
201
- # needs: [build, publish-to-pypi]
202
- # runs-on: ubuntu-latest
203
- #
204
- # permissions:
205
- # contents: read
206
- #
207
- # steps:
208
- # - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
209
- # with:
210
- # # The scan needs full history.
211
- # fetch-depth: 0
212
- #
213
- # # Non-fatal: the package is already published.
214
- # - name: Record release in Linear
215
- # id: linear
216
- # continue-on-error: true
217
- # uses: linear/linear-release-action@0a25abab892a91062ebf42260dbb2ce6277aa205 # v0.16.0
218
- # with:
219
- # access_key: ${{ secrets.LINEAR_ACCESS_KEY }}
220
- # version: ${{ github.ref_name }}
221
- # # Pin the CLI the action downloads, not just the action.
222
- # cli_version: v0.16.0
223
- #
224
- # # continue-on-error keeps the job green, so this checks the step's own
225
- # # outcome — `failure()` would never fire.
226
- # - name: Notify Slack (release not recorded)
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' }}
231
- # uses: slackapi/slack-github-action@dcb1066f776dd043e64d0e8ba94ca15cc7e1875d # v4.0.0
232
- # with:
233
- # method: chat.postMessage
234
- # token: ${{ secrets.SLACK_BOT_TOKEN }}
235
- # errors: true
236
- # payload: |
237
- # channel: ${{ vars.SLACK_CHANNEL_ID }}
238
- # thread_ts: ${{ env.THREAD_TS }}
239
- # text: >-
240
- # *Codeplain Client*: `${{ github.ref_name }}` is on PyPI, but recording it in Linear FAILED :warning:.
241
- # See <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|the run log>.
198
+ # Stable releases only; pre-releases stay out of the Linear pipeline. Its own
199
+ # job, after the package is on PyPI, so the publish job keeps its minimal
200
+ # permissions and no checkout.
201
+ linear-release:
202
+ name: Record release in Linear
203
+ needs: publish-to-pypi
204
+ if: ${{ !github.event.release.prerelease }}
205
+ runs-on: ubuntu-latest
206
+ # pull-requests lets the step look up each commit's PR.
207
+ permissions:
208
+ contents: read
209
+ pull-requests: read
210
+ outputs:
211
+ # The notify job links the release, or says recording it failed.
212
+ release-url: ${{ steps.linear.outputs.release-url }}
213
+ outcome: ${{ steps.linear.outcome }}
214
+
215
+ steps:
216
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
217
+ with:
218
+ persist-credentials: false
219
+
220
+ # The release gets the PRs merged since the previous one, and the GitHub
221
+ # release text as notes; a re-run updates it. Log-only until
222
+ # LINEAR_RELEASE_MODE is "live". Non-fatal: the package is already published.
223
+ - name: Record release in Linear
224
+ id: linear
225
+ continue-on-error: true
226
+ # A hung API call must not hold up the Slack notice.
227
+ timeout-minutes: 10
228
+ uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
229
+ env:
230
+ LINEAR_ACCESS_KEY: ${{ secrets.LINEAR_ACCESS_KEY }}
231
+ LINEAR_RELEASE_MODE: ${{ vars.LINEAR_RELEASE_MODE }}
232
+ RELEASE_VERSION: ${{ github.event.release.tag_name }}
233
+ RELEASE_SHA: ${{ github.sha }}
234
+ RELEASE_NOTES: github-release
235
+ with:
236
+ script: return require('./.github/scripts/record-linear-release.cjs')({ github, context, core })
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: codeplain
3
- Version: 0.4.2.dev56
3
+ Version: 0.4.3.dev58
4
4
  Summary: Transform plain language specifications into working code
5
5
  License-File: LICENSE
6
6
  Classifier: Environment :: Console
@@ -4,10 +4,12 @@ from typing import Optional
4
4
 
5
5
  import plain_spec
6
6
  from plain2code_console import console
7
+ from plain2code_utils import functionality_position, with_position
7
8
 
8
9
 
9
10
  def print_dry_run_output(plain_source_tree: dict, render_range: Optional[list[str]]):
10
11
  """Print dry run output showing what would be rendered."""
12
+ frids = list(plain_spec.get_frids(plain_source_tree))
11
13
  frid = plain_spec.get_first_frid(plain_source_tree)
12
14
 
13
15
  while frid is not None:
@@ -18,7 +20,7 @@ def print_dry_run_output(plain_source_tree: dict, render_range: Optional[list[st
18
20
  functional_requirement_text = specifications[plain_spec.FUNCTIONAL_REQUIREMENTS][-1]
19
21
  console.info(
20
22
  "-------------------------------------\n"
21
- f"Rendering functionality {frid}:\n"
23
+ f"Rendering functionality {with_position(frid, functionality_position(frids, frid))}:\n"
22
24
  f"{functional_requirement_text}\n"
23
25
  "-------------------------------------\n"
24
26
  )
@@ -32,7 +34,7 @@ def print_dry_run_output(plain_source_tree: dict, render_range: Optional[list[st
32
34
  else:
33
35
  console.info(
34
36
  "-------------------------------------\n"
35
- f"Skipping rendering iteration: {frid}\n"
37
+ f"Skipping rendering iteration: {with_position(frid, functionality_position(frids, frid))}\n"
36
38
  "-------------------------------------"
37
39
  )
38
40
 
@@ -43,6 +43,11 @@ def functionality_position(frids: list[str], frid: Optional[str]) -> Optional[st
43
43
  return f"{frids.index(frid) + 1}/{len(frids)}"
44
44
 
45
45
 
46
+ def with_position(name: Optional[str], position: Optional[str]) -> Optional[str]:
47
+ """A functionality name followed by its position, as "list-expenses (1/3)"."""
48
+ return f"{name} ({position})" if position else name
49
+
50
+
46
51
  def qualified_frid(module_name: Optional[str], frid: Optional[str]) -> Optional[str]:
47
52
  """A functionality named as `<module>:<func-id>`.
48
53
 
@@ -31,6 +31,7 @@ from metadata_utils import (
31
31
  REQUIRED_MODULES_FUNCTIONALITIES,
32
32
  )
33
33
  from plain2code_console import console
34
+ from plain2code_utils import functionality_position, with_position
34
35
  from render_machine.implementation_code_helpers import ImplementationCodeHelpers
35
36
 
36
37
  CODEPLAIN_MEMORY_SUBFOLDER = ".memory"
@@ -516,18 +517,22 @@ class PlainModule:
516
517
 
517
518
  if not os.path.exists(self.module_build_folder):
518
519
  raise MissingPreviousFunctionalitiesError(
519
- f"Cannot start rendering from functionality {first_render_frid} for module '{self.module_name}' because the source code folder does not exist.\n\n"
520
+ f"Cannot start rendering from functionality {self._frid_label(first_render_frid)} for module '{self.module_name}' because the source code folder does not exist.\n\n"
520
521
  f"To fix this, please render the module from the beginning by running:\n"
521
522
  f" codeplain {self.module_name}{plain_file.PLAIN_SOURCE_FILE_EXTENSION}"
522
523
  )
523
524
 
524
525
  if not os.path.exists(self.module_conformance_tests_folder) and render_conformance_tests:
525
526
  raise MissingPreviousFunctionalitiesError(
526
- f"Cannot start rendering from functionality {first_render_frid} for module '{self.module_name}' because the conformance tests folder does not exist.\n\n"
527
+ f"Cannot start rendering from functionality {self._frid_label(first_render_frid)} for module '{self.module_name}' because the conformance tests folder does not exist.\n\n"
527
528
  f"To fix this, please render the module from the beginning by running:\n"
528
529
  f" codeplain {self.module_name}{plain_file.PLAIN_SOURCE_FILE_EXTENSION}"
529
530
  )
530
531
 
532
+ def _frid_label(self, frid: str) -> str | None:
533
+ """A functionality of this module named for the logs, as "func-id (3/12)"."""
534
+ return with_position(frid, functionality_position(list(plain_spec.get_frids(self.plain_source)), frid))
535
+
531
536
  def _ensure_frid_commit_exists(
532
537
  self,
533
538
  frid: str,
@@ -548,8 +553,8 @@ class PlainModule:
548
553
  # Check in build folder
549
554
  if not git_utils.has_commit_for_frid(self.module_build_folder, frid, self.module_name):
550
555
  raise MissingPreviousFunctionalitiesError(
551
- f"Cannot start rendering from functionality {first_render_frid} for module '{self.module_name}' because the implementation of the previous functionality ({frid}) hasn't been completed yet.\n\n"
552
- f"To fix this, please render the missing functionality ({frid}) first by running:\n"
556
+ f"Cannot start rendering from functionality {self._frid_label(first_render_frid)} for module '{self.module_name}' because the implementation of the previous functionality ({self._frid_label(frid)}) hasn't been completed yet.\n\n"
557
+ f"To fix this, please render the missing functionality ({self._frid_label(frid)}) first by running:\n"
553
558
  f" codeplain {self.module_name}{plain_file.PLAIN_SOURCE_FILE_EXTENSION} --render-from {frid}"
554
559
  )
555
560
 
@@ -557,8 +562,8 @@ class PlainModule:
557
562
  if render_conformance_tests:
558
563
  if not git_utils.has_commit_for_frid(self.module_conformance_tests_folder, frid, self.module_name):
559
564
  raise MissingPreviousFunctionalitiesError(
560
- f"Cannot start rendering from functionality {first_render_frid} for module '{self.module_name}' because the conformance tests for the previous functionality ({frid}) haven't been completed yet.\n\n"
561
- f"To fix this, please render the missing functionality ({frid}) first by running:\n"
565
+ f"Cannot start rendering from functionality {self._frid_label(first_render_frid)} for module '{self.module_name}' because the conformance tests for the previous functionality ({self._frid_label(frid)}) haven't been completed yet.\n\n"
566
+ f"To fix this, please render the missing functionality ({self._frid_label(frid)}) first by running:\n"
562
567
  f" codeplain {self.module_name}{plain_file.PLAIN_SOURCE_FILE_EXTENSION} --render-from {frid}"
563
568
  )
564
569
 
@@ -5,7 +5,7 @@ import git_utils
5
5
  import plain_spec
6
6
  from plain2code_console import console
7
7
  from plain2code_exceptions import InternalClientError
8
- from plain2code_utils import AMBIGUITY_CAUSES, qualified_frid
8
+ from plain2code_utils import AMBIGUITY_CAUSES
9
9
  from render_machine.actions.base_action import BaseAction
10
10
  from render_machine.implementation_code_helpers import ImplementationCodeHelpers
11
11
  from render_machine.render_context import RenderContext
@@ -43,7 +43,7 @@ class AnalyzeSpecificationAmbiguity(BaseAction):
43
43
  fixed_implementation_code_diff,
44
44
  run_state=render_context.run_state,
45
45
  )
46
- functionality = qualified_frid(render_context.module_name, render_context.frid_context.frid)
46
+ functionality = render_context.functionality_label()
47
47
  if rendering_analysis:
48
48
  # TODO: Before this output is exposed to the user, we should check the 'guidance' field using LLM in the same way as we do conflicting requirements.
49
49
  console.info(
@@ -1,7 +1,6 @@
1
1
  from typing import Any
2
2
 
3
3
  from plain2code_console import console
4
- from plain2code_utils import qualified_frid
5
4
  from render_machine.actions.base_action import BaseAction
6
5
  from render_machine.implementation_code_helpers import ImplementationCodeHelpers
7
6
  from render_machine.render_context import RenderContext
@@ -27,7 +26,7 @@ class DistillConformanceTestMemory(BaseAction):
27
26
  if not fix_journals:
28
27
  return self.SUCCESSFUL_OUTCOME, None
29
28
 
30
- functionality = qualified_frid(render_context.module_name, render_context.frid_context.frid)
29
+ functionality = render_context.functionality_label()
31
30
  console.info(f"Distilling conformance test fix learnings for functionality {functionality}.")
32
31
 
33
32
  try:
@@ -6,7 +6,6 @@ import plain_spec
6
6
  from memory_management import MemoryManager
7
7
  from plain2code_console import RETRY_COLOR, console
8
8
  from plain2code_exceptions import InternalClientError
9
- from plain2code_utils import qualified_frid
10
9
  from render_machine.actions.base_action import BaseAction
11
10
  from render_machine.implementation_code_helpers import ImplementationCodeHelpers
12
11
  from render_machine.render_context import RenderContext
@@ -45,10 +44,7 @@ class FixConformanceTest(BaseAction):
45
44
 
46
45
  console.info(f"Running conformance tests attempt {ctx.fix_attempts + 1}.")
47
46
 
48
- console.info(
49
- f"Fixing conformance test for functionality "
50
- f"{qualified_frid(ctx.current_testing_module_name, ctx.current_testing_frid)}."
51
- )
47
+ console.info(f"Fixing conformance test for functionality {render_context.testing_functionality_label()}.")
52
48
 
53
49
  if not previous_action_payload.get("previous_conformance_tests_issue"):
54
50
  raise InternalClientError(
@@ -147,7 +143,7 @@ class FixConformanceTest(BaseAction):
147
143
  render_context.conformance_tests_running_context.conflicting_frid = current_testing_frid
148
144
  console.info(
149
145
  f"↻ Potential conflicting functionalities detected while fixing conformance tests "
150
- f"for functionality {qualified_frid(current_testing_module_name, current_testing_frid)}.",
146
+ f"for functionality {render_context.testing_functionality_label()}.",
151
147
  color=RETRY_COLOR,
152
148
  )
153
149
 
@@ -22,7 +22,9 @@ class PrepareRepositories(BaseAction):
22
22
 
23
23
  previous_frid = plain_spec.get_previous_frid(render_context.plain_source_tree, frid)
24
24
 
25
- console.debug(f"Reverting code to version implemented for {previous_frid}.")
25
+ console.debug(
26
+ f"Reverting code to version implemented for {render_context.functionality_label(previous_frid)}."
27
+ )
26
28
 
27
29
  render_context.plain_module.revert_code_to_frid(previous_frid)
28
30
  # conformance tests are still not fully implemented
@@ -2,7 +2,6 @@ from typing import Any
2
2
 
3
3
  import file_utils
4
4
  from plain2code_console import console
5
- from plain2code_utils import qualified_frid
6
5
  from render_machine.actions.base_action import BaseAction
7
6
  from render_machine.implementation_code_helpers import ImplementationCodeHelpers
8
7
  from render_machine.render_context import RenderContext
@@ -23,7 +22,7 @@ class RefactorCode(BaseAction):
23
22
  render_context.frid_context.refactoring_iteration += 1
24
23
 
25
24
  if render_context.frid_context.refactoring_iteration >= MAX_REFACTORING_ITERATIONS:
26
- functionality = qualified_frid(render_context.module_name, render_context.frid_context.frid)
25
+ functionality = render_context.functionality_label()
27
26
  error_message = (
28
27
  f"Refactoring iterations limit of {MAX_REFACTORING_ITERATIONS} reached "
29
28
  f"for functionality {functionality}."
@@ -147,7 +147,7 @@ class RenderConformanceTests(BaseAction):
147
147
  that writes a test the specification did not ask for, or leaves one it did ask for unwritten,
148
148
  must say so instead of reporting success.
149
149
  """
150
- frid = render_context.conformance_tests_running_context.current_testing_frid
150
+ frid = render_context.testing_functionality_label()
151
151
 
152
152
  missing = traceability.get("missing") or []
153
153
  if missing:
@@ -5,7 +5,6 @@ import render_machine.render_utils as render_utils
5
5
  from memory_management import MemoryManager
6
6
  from plain2code_console import RETRY_COLOR, console
7
7
  from plain2code_exceptions import FunctionalRequirementTooComplex
8
- from plain2code_utils import qualified_frid
9
8
  from render_machine.actions.base_action import BaseAction
10
9
  from render_machine.implementation_code_helpers import ImplementationCodeHelpers
11
10
  from render_machine.render_context import MAX_UNITTEST_FIX_ATTEMPTS, RenderContext
@@ -37,7 +36,7 @@ class RenderFunctionalRequirement(BaseAction):
37
36
  def execute(self, render_context: RenderContext, _previous_action_payload: Any | None):
38
37
  if render_context.frid_context.functional_requirement_render_attempts >= MAX_CODE_GENERATION_RETRIES:
39
38
  # A render attempt is only restarted once its unit tests used up every fix round.
40
- functionality = qualified_frid(render_context.module_name, render_context.frid_context.frid)
39
+ functionality = render_context.functionality_label()
41
40
  error_msg = (
42
41
  f"Functionality {functionality}: unit tests still fail after "
43
42
  f"{MAX_CODE_GENERATION_RETRIES} render attempts, {MAX_UNITTEST_FIX_ATTEMPTS} fix rounds each."
@@ -54,7 +53,7 @@ class RenderFunctionalRequirement(BaseAction):
54
53
  console.info(
55
54
  f"↻ Unittests could not be fixed after rendering the functionality. "
56
55
  f"Restarting rendering functionality "
57
- f"{qualified_frid(render_context.module_name, render_context.frid_context.frid)} from scratch.",
56
+ f"{render_context.functionality_label()} from scratch.",
58
57
  color=RETRY_COLOR,
59
58
  )
60
59
 
@@ -3,7 +3,6 @@ from typing import Any
3
3
 
4
4
  import render_machine.render_utils as render_utils
5
5
  from plain2code_console import console
6
- from plain2code_utils import qualified_frid
7
6
  from render_machine.actions.base_action import BaseAction
8
7
  from render_machine.render_context import RenderContext
9
8
  from render_machine.render_types import RenderError
@@ -34,11 +33,11 @@ class RunConformanceTests(BaseAction):
34
33
  )
35
34
  )
36
35
 
37
- ctx = render_context.conformance_tests_running_context
36
+ position = render_context.testing_functionality_position()
38
37
  console.info(
39
38
  f"Running conformance tests script {conformance_tests_script} "
40
39
  + f"for {conformance_tests_folder_name} ("
41
- + f"functionality {qualified_frid(ctx.current_testing_module_name, ctx.current_testing_frid)}"
40
+ + f"functionality {render_context.testing_functionality_label()}"
42
41
  + ")."
43
42
  )
44
43
  exit_code, conformance_tests_issue, conformance_tests_temp_log_file_path = render_utils.execute_script(
@@ -47,6 +46,7 @@ class RunConformanceTests(BaseAction):
47
46
  "Conformance Tests",
48
47
  frid=render_context.conformance_tests_running_context.current_testing_frid,
49
48
  module=render_context.conformance_tests_running_context.current_testing_module_name,
49
+ frid_position=position,
50
50
  timeout=render_context.test_script_timeout,
51
51
  stop_event=render_context.stop_event,
52
52
  )
@@ -1,7 +1,6 @@
1
1
  from typing import Any
2
2
 
3
3
  from plain2code_console import console
4
- from plain2code_utils import qualified_frid
5
4
  from render_machine.actions.base_action import BaseAction
6
5
  from render_machine.render_context import RenderContext
7
6
 
@@ -10,7 +9,7 @@ class SummarizeConformanceTests(BaseAction):
10
9
  SUCCESSFUL_OUTCOME = "conformance_tests_summarized"
11
10
 
12
11
  def execute(self, render_context: RenderContext, _previous_action_payload: Any | None):
13
- functionality = qualified_frid(render_context.module_name, render_context.frid_context.frid)
12
+ functionality = render_context.functionality_label()
14
13
  console.info(f"Summarizing conformance tests for functionality {functionality}.")
15
14
 
16
15
  _, existing_conformance_test_files_content = (