codeplain 0.3.7__tar.gz → 0.3.9__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 (260) hide show
  1. {codeplain-0.3.7 → codeplain-0.3.9}/.github/workflows/publish-install-script.yml +17 -0
  2. codeplain-0.3.9/.github/workflows/publish-to-pypi.yml +104 -0
  3. {codeplain-0.3.7 → codeplain-0.3.9}/CLAUDE.md +6 -2
  4. {codeplain-0.3.7 → codeplain-0.3.9}/PKG-INFO +4 -4
  5. {codeplain-0.3.7 → codeplain-0.3.9}/cli_output/render_summary.py +2 -2
  6. {codeplain-0.3.7 → codeplain-0.3.9}/cli_output/status.py +2 -2
  7. {codeplain-0.3.7 → codeplain-0.3.9}/codeplain_REST_api.py +6 -2
  8. {codeplain-0.3.7 → codeplain-0.3.9}/docs/plain2code_cli.md +22 -20
  9. {codeplain-0.3.7 → codeplain-0.3.9}/docs/starting_a_plain_project_from_scratch.md +8 -2
  10. {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_golang/run.sh +2 -2
  11. {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_python/run.sh +2 -2
  12. {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_react/run.sh +1 -1
  13. {codeplain-0.3.7 → codeplain-0.3.9}/git_utils.py +0 -10
  14. {codeplain-0.3.7 → codeplain-0.3.9}/install/bash/examples.sh +5 -11
  15. {codeplain-0.3.7 → codeplain-0.3.9}/install/bash/install.sh +3 -1
  16. {codeplain-0.3.7 → codeplain-0.3.9}/install/powershell/examples.ps1 +5 -11
  17. {codeplain-0.3.7 → codeplain-0.3.9}/install/powershell/install.ps1 +5 -1
  18. {codeplain-0.3.7 → codeplain-0.3.9}/memory_management.py +2 -3
  19. codeplain-0.3.9/metadata_utils.py +46 -0
  20. {codeplain-0.3.7 → codeplain-0.3.9}/module_renderer.py +3 -6
  21. {codeplain-0.3.7 → codeplain-0.3.9}/plain2code.py +7 -1
  22. {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_arguments.py +6 -15
  23. {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_cli.md +17 -19
  24. {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_console.py +32 -21
  25. {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_events.py +1 -0
  26. {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_logger.py +3 -7
  27. {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_state.py +17 -1
  28. {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_telemetry.py +17 -11
  29. {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_utils.py +17 -13
  30. {codeplain-0.3.7 → codeplain-0.3.9}/plain_modules.py +73 -41
  31. {codeplain-0.3.7 → codeplain-0.3.9}/pyproject.toml +8 -5
  32. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/create_dist.py +2 -2
  33. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/exit_with_error.py +2 -1
  34. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/fix_conformance_test.py +4 -2
  35. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/prepare_repositories.py +3 -10
  36. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/render_functional_requirement.py +4 -3
  37. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/conformance_tests.py +8 -6
  38. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/render_context.py +6 -6
  39. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/render_utils.py +15 -10
  40. {codeplain-0.3.7 → codeplain-0.3.9}/requirements.txt +3 -3
  41. codeplain-0.3.9/system_config.py +113 -0
  42. {codeplain-0.3.7 → codeplain-0.3.9}/tests/e2e/test_hello_world_python.py +1 -1
  43. {codeplain-0.3.7 → codeplain-0.3.9}/tests/e2e/test_hello_world_python_windows.py +1 -1
  44. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_arg_provenance.py +3 -3
  45. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_cli_output.py +2 -2
  46. codeplain-0.3.9/tests/test_console_log_styles.py +112 -0
  47. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_folder_path_resolution.py +12 -13
  48. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_plain2code.py +1 -2
  49. codeplain-0.3.9/tests/test_plain2code_state.py +36 -0
  50. codeplain-0.3.9/tests/test_plain2code_utils.py +36 -0
  51. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_plain_modules.py +200 -15
  52. codeplain-0.3.9/tests/test_prepare_repositories_layout.py +119 -0
  53. codeplain-0.3.9/tests/test_system_config.py +58 -0
  54. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_telemetry.py +31 -10
  55. codeplain-0.3.9/tests/test_tui_usage.py +209 -0
  56. codeplain-0.3.9/tests/test_usage_summary.py +28 -0
  57. {codeplain-0.3.7 → codeplain-0.3.9}/tui/components.py +29 -20
  58. {codeplain-0.3.7 → codeplain-0.3.9}/tui/plain2code_tui.py +71 -2
  59. {codeplain-0.3.7 → codeplain-0.3.9}/tui/styles.css +4 -0
  60. {codeplain-0.3.7 → codeplain-0.3.9}/tui/widget_helpers.py +20 -1
  61. codeplain-0.3.9/usage_summary.py +30 -0
  62. codeplain-0.3.7/.claude/settings.local.json +0 -66
  63. codeplain-0.3.7/.github/workflows/publish-to-pypi.yml +0 -109
  64. codeplain-0.3.7/.zed/settings.json +0 -46
  65. codeplain-0.3.7/_version.py +0 -1
  66. codeplain-0.3.7/system_config.py +0 -34
  67. {codeplain-0.3.7 → codeplain-0.3.9}/.claude/settings.json +0 -0
  68. {codeplain-0.3.7 → codeplain-0.3.9}/.flake8 +0 -0
  69. {codeplain-0.3.7 → codeplain-0.3.9}/.github/dependabot.yml +0 -0
  70. {codeplain-0.3.7 → codeplain-0.3.9}/.github/workflows/e2e.yml +0 -0
  71. {codeplain-0.3.7 → codeplain-0.3.9}/.github/workflows/lint-and-test.yml +0 -0
  72. {codeplain-0.3.7 → codeplain-0.3.9}/.github/workflows/nofity-slack-on-main-merge.yml +0 -0
  73. {codeplain-0.3.7 → codeplain-0.3.9}/.gitignore +0 -0
  74. {codeplain-0.3.7 → codeplain-0.3.9}/.vscode/launch.json +0 -0
  75. {codeplain-0.3.7 → codeplain-0.3.9}/.vscode/settings.json +0 -0
  76. {codeplain-0.3.7 → codeplain-0.3.9}/LICENSE +0 -0
  77. {codeplain-0.3.7 → codeplain-0.3.9}/README.md +0 -0
  78. {codeplain-0.3.7 → codeplain-0.3.9}/change_detection.py +0 -0
  79. {codeplain-0.3.7 → codeplain-0.3.9}/cli_output/__init__.py +0 -0
  80. {codeplain-0.3.7 → codeplain-0.3.9}/cli_output/dry_run.py +0 -0
  81. {codeplain-0.3.7 → codeplain-0.3.9}/concept_utils.py +0 -0
  82. {codeplain-0.3.7 → codeplain-0.3.9}/config/__init__.py +0 -0
  83. {codeplain-0.3.7 → codeplain-0.3.9}/config/system_config.yaml +0 -0
  84. {codeplain-0.3.7 → codeplain-0.3.9}/diff_utils.py +0 -0
  85. {codeplain-0.3.7 → codeplain-0.3.9}/docs/generate_cli.py +0 -0
  86. {codeplain-0.3.7 → codeplain-0.3.9}/event_bus.py +0 -0
  87. {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_golang/config.yaml +0 -0
  88. {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_golang/harness_tests/hello_world_test.go +0 -0
  89. {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_golang/hello_world_golang.plain +0 -0
  90. {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_python/config.yaml +0 -0
  91. {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_python/harness_tests/hello_world_display/test_hello_world.py +0 -0
  92. {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_python/hello_world_python.plain +0 -0
  93. {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_react/config.yaml +0 -0
  94. {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_react/harness_tests/hello_world_display/cypress/e2e/hello_world.cy.ts +0 -0
  95. {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_react/harness_tests/hello_world_display/cypress/support/e2e.ts +0 -0
  96. {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_react/harness_tests/hello_world_display/cypress.config.ts +0 -0
  97. {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_react/harness_tests/hello_world_display/package.json +0 -0
  98. {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_react/harness_tests/hello_world_display/tsconfig.json +0 -0
  99. {codeplain-0.3.7 → codeplain-0.3.9}/examples/example_hello_world_react/hello_world_react.plain +0 -0
  100. {codeplain-0.3.7 → codeplain-0.3.9}/examples/run.sh +0 -0
  101. {codeplain-0.3.7 → codeplain-0.3.9}/file_utils.py +0 -0
  102. {codeplain-0.3.7 → codeplain-0.3.9}/install/bash/walkthrough.sh +0 -0
  103. {codeplain-0.3.7 → codeplain-0.3.9}/install/powershell/walkthrough.ps1 +0 -0
  104. {codeplain-0.3.7 → codeplain-0.3.9}/partial_rendering.py +0 -0
  105. {codeplain-0.3.7 → codeplain-0.3.9}/path_resolution.py +0 -0
  106. {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_exceptions.py +0 -0
  107. {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_nodes.py +0 -0
  108. {codeplain-0.3.7 → codeplain-0.3.9}/plain2code_read_config.py +0 -0
  109. {codeplain-0.3.7 → codeplain-0.3.9}/plain_file.py +0 -0
  110. {codeplain-0.3.7 → codeplain-0.3.9}/plain_spec.py +0 -0
  111. {codeplain-0.3.7 → codeplain-0.3.9}/pytest.ini +0 -0
  112. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/__init__.py +0 -0
  113. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/analyze_specification_ambiguity.py +0 -0
  114. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/base_action.py +0 -0
  115. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/commit_conformance_tests_changes.py +0 -0
  116. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/commit_implementation_code_changes.py +0 -0
  117. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/finish_functional_requirement.py +0 -0
  118. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/fix_unit_tests.py +0 -0
  119. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/prepare_testing_environment.py +0 -0
  120. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/refactor_code.py +0 -0
  121. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/render_conformance_tests.py +0 -0
  122. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/run_conformance_tests.py +0 -0
  123. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/run_unit_tests.py +0 -0
  124. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/actions/summarize_conformance_tests.py +0 -0
  125. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/code_renderer.py +0 -0
  126. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/implementation_code_helpers.py +0 -0
  127. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/render_types.py +0 -0
  128. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/state_machine_config.py +0 -0
  129. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/states.py +0 -0
  130. {codeplain-0.3.7 → codeplain-0.3.9}/render_machine/triggers.py +0 -0
  131. {codeplain-0.3.7 → codeplain-0.3.9}/resources/codeplain_overview.png +0 -0
  132. {codeplain-0.3.7 → codeplain-0.3.9}/resources/plain_example.png +0 -0
  133. {codeplain-0.3.7 → codeplain-0.3.9}/standard_template_library/golang-console-app-template.plain +0 -0
  134. {codeplain-0.3.7 → codeplain-0.3.9}/standard_template_library/python-console-app-template.plain +0 -0
  135. {codeplain-0.3.7 → codeplain-0.3.9}/standard_template_library/typescript-react-app-boilerplate.plain +0 -0
  136. {codeplain-0.3.7 → codeplain-0.3.9}/standard_template_library/typescript-react-app-template.plain +0 -0
  137. {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_conformance_tests_cypress.ps1 +0 -0
  138. {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_conformance_tests_cypress.sh +0 -0
  139. {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_conformance_tests_golang.ps1 +0 -0
  140. {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_conformance_tests_golang.sh +0 -0
  141. {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_conformance_tests_python.ps1 +0 -0
  142. {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_conformance_tests_python.sh +0 -0
  143. {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_unittests_flutter.ps1 +0 -0
  144. {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_unittests_flutter.sh +0 -0
  145. {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_unittests_golang.ps1 +0 -0
  146. {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_unittests_golang.sh +0 -0
  147. {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_unittests_python.ps1 +0 -0
  148. {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_unittests_python.sh +0 -0
  149. {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_unittests_react.ps1 +0 -0
  150. {codeplain-0.3.7 → codeplain-0.3.9}/test_scripts/run_unittests_react.sh +0 -0
  151. {codeplain-0.3.7 → codeplain-0.3.9}/tests/__init__.py +0 -0
  152. {codeplain-0.3.7 → codeplain-0.3.9}/tests/conftest.py +0 -0
  153. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/acceptance_tests_warning/main_requiring_acceptance_tests.plain +0 -0
  154. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/acceptance_tests_warning/required_with_acceptance_tests.plain +0 -0
  155. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/circular_imports_1.plain +0 -0
  156. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/circular_imports_2.plain +0 -0
  157. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/circular_imports_main.plain +0 -0
  158. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/diamond_import_1.plain +0 -0
  159. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/diamond_import_2.plain +0 -0
  160. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/diamond_import_common.plain +0 -0
  161. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/diamond_imports_main.plain +0 -0
  162. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/import_with_functionalities.plain +0 -0
  163. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/imports_module_with_functionalities.plain +0 -0
  164. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/imports/non_existent_import.plain +0 -0
  165. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/partial_rendering/pr_code_var.plain +0 -0
  166. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/partial_rendering/pr_implement.plain +0 -0
  167. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/partial_rendering/pr_leaf.plain +0 -0
  168. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/partial_rendering/pr_middle.plain +0 -0
  169. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/partial_rendering/pr_root.plain +0 -0
  170. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/partial_rendering/pr_solo.plain +0 -0
  171. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/add_new_task_modal_specification.yaml +0 -0
  172. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/duplicate_specification_heading.plain +0 -0
  173. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/empty_functional_specs_section.plain +0 -0
  174. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/invalid_specification_order.plain +0 -0
  175. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/missing_non_functional_requirements.plain +0 -0
  176. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/no_functional_specs_section.plain +0 -0
  177. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/plain_source_with_absolute_link.plain +0 -0
  178. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/plain_source_with_url_link.plain +0 -0
  179. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/task_list_ui_specification.yaml +0 -0
  180. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/task_manager_with_reference_links.plain +0 -0
  181. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfile/without_non_functional_requirement.plain +0 -0
  182. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_acceptance_tests.plain +0 -0
  183. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_acceptance_tests_nondefined.plain +0 -0
  184. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_defined_nondefined.plain +0 -0
  185. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_defined_nondefined_2.plain +0 -0
  186. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_definition.plain +0 -0
  187. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_noconcepts.plain +0 -0
  188. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_nonconcept.plain +0 -0
  189. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_nondefined.plain +0 -0
  190. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_redefinition.plain +0 -0
  191. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_several_concepts.plain +0 -0
  192. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/concept_validation_valid.plain +0 -0
  193. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts.plain +0 -0
  194. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_base.plain +0 -0
  195. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_example.plain +0 -0
  196. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_missing.plain +0 -0
  197. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_missing_example.plain +0 -0
  198. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_nested.plain +0 -0
  199. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_nested_example.plain +0 -0
  200. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_transitive_example.plain +0 -0
  201. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_transitive_l1.plain +0 -0
  202. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/exported_concepts_transitive_l2.plain +0 -0
  203. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/plain_file_parser_with_comments.plain +0 -0
  204. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/plain_file_with_comments_indented.plain +0 -0
  205. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/regular_plain_source.plain +0 -0
  206. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts.plain +0 -0
  207. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts_defs.plain +0 -0
  208. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts_example.plain +0 -0
  209. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts_l1.plain +0 -0
  210. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts_l2.plain +0 -0
  211. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts_missing.plain +0 -0
  212. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts_module.plain +0 -0
  213. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts_partial.plain +0 -0
  214. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/required_concepts_partial_duplicate.plain +0 -0
  215. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/topological_sort.plain +0 -0
  216. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/plainfileparser/topological_sort_not_referenced.plain +0 -0
  217. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/circular_requires_main.plain +0 -0
  218. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/circular_requires_sub.plain +0 -0
  219. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/diamond_requires_1.plain +0 -0
  220. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/diamond_requires_2.plain +0 -0
  221. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/diamond_requires_common.plain +0 -0
  222. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/diamond_requires_main.plain +0 -0
  223. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/independent_requires_1.plain +0 -0
  224. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/independent_requires_2.plain +0 -0
  225. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/independent_requires_main.plain +0 -0
  226. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/non_existent_require.plain +0 -0
  227. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/normal_requires_1.plain +0 -0
  228. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/normal_requires_2.plain +0 -0
  229. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/normal_requires_common.plain +0 -0
  230. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/requires/normal_requires_main.plain +0 -0
  231. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/sample_base64_image.txt +0 -0
  232. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/simple.plain +0 -0
  233. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/templates/block_level_include.plain +0 -0
  234. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/templates/code_variables.plain +0 -0
  235. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/templates/header.plain +0 -0
  236. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/templates/implement.plain +0 -0
  237. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/templates/implement_2.plain +0 -0
  238. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/templates/template_include.plain +0 -0
  239. {codeplain-0.3.7 → codeplain-0.3.9}/tests/data/templates/test_hardest_problem.plain +0 -0
  240. {codeplain-0.3.7 → codeplain-0.3.9}/tests/e2e/Dockerfile +0 -0
  241. {codeplain-0.3.7 → codeplain-0.3.9}/tests/e2e/conftest.py +0 -0
  242. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_change_detection.py +0 -0
  243. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_file_utils.py +0 -0
  244. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_git_utils.py +0 -0
  245. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_imports.py +0 -0
  246. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_log_file_name_resolution.py +0 -0
  247. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_logging_config_path_resolution.py +0 -0
  248. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_partial_rendering.py +0 -0
  249. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_path_resolution.py +0 -0
  250. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_plainfile.py +0 -0
  251. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_plainfileparser.py +0 -0
  252. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_plainspec.py +0 -0
  253. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_requires.py +0 -0
  254. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_resolve_config_file.py +0 -0
  255. {codeplain-0.3.7 → codeplain-0.3.9}/tests/test_script_path_resolution.py +0 -0
  256. {codeplain-0.3.7 → codeplain-0.3.9}/tui/__init__.py +0 -0
  257. {codeplain-0.3.7 → codeplain-0.3.9}/tui/models.py +0 -0
  258. {codeplain-0.3.7 → codeplain-0.3.9}/tui/plain_module_render_choice_tui.py +0 -0
  259. {codeplain-0.3.7 → codeplain-0.3.9}/tui/spinner.py +0 -0
  260. {codeplain-0.3.7 → codeplain-0.3.9}/tui/state_handlers.py +0 -0
@@ -14,6 +14,9 @@ jobs:
14
14
  name: Upload to Cloudflare R2
15
15
  runs-on: ubuntu-latest
16
16
 
17
+ env:
18
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
19
+
17
20
  steps:
18
21
  - uses: actions/checkout@v4
19
22
 
@@ -54,3 +57,17 @@ jobs:
54
57
  --content-type "text/plain"
55
58
  echo "✓ examples.ps1 uploaded to R2"
56
59
 
60
+ - name: Notify Slack (success)
61
+ if: ${{ success() && env.SLACK_WEBHOOK_URL != '' }}
62
+ run: |
63
+ curl -s -X POST "$SLACK_WEBHOOK_URL" \
64
+ -H 'Content-type: application/json' \
65
+ --data "{\"text\":\"*Codeplain Client*: Install scripts deployed to R2 :white_check_mark: (\`${GITHUB_SHA:0:7}\`, by *${{ github.actor }}*).\"}"
66
+
67
+ - name: Notify Slack (failure)
68
+ if: ${{ failure() && env.SLACK_WEBHOOK_URL != '' }}
69
+ run: |
70
+ curl -s -X POST "$SLACK_WEBHOOK_URL" \
71
+ -H 'Content-type: application/json' \
72
+ --data "{\"text\":\"*Codeplain Client*: Install script deploy to R2 FAILED :x: (\`${GITHUB_SHA:0:7}\`). Users may be getting a stale installer. See <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|the run log>.\"}"
73
+
@@ -0,0 +1,104 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+
7
+ # Least privilege by default: jobs get no GITHUB_TOKEN scopes unless they
8
+ # opt in below.
9
+ permissions: {}
10
+
11
+ jobs:
12
+ build:
13
+ name: Build distribution
14
+ runs-on: ubuntu-latest
15
+ permissions:
16
+ contents: write
17
+
18
+ env:
19
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
20
+
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ with:
24
+ # hatch-vcs derives the version from git tags, so we need full history.
25
+ fetch-depth: 0
26
+
27
+ - name: Notify Slack (start)
28
+ if: ${{ env.SLACK_WEBHOOK_URL != '' }}
29
+ run: |
30
+ curl -s -X POST "$SLACK_WEBHOOK_URL" \
31
+ -H 'Content-type: application/json' \
32
+ --data "{\"text\":\"*Codeplain Client*: Release \`${{ github.ref_name }}\` published by *${{ github.actor }}* — building and publishing to PyPI...\"}"
33
+
34
+ - name: Install uv
35
+ # uv provisions its own Python (honoring requires-python), so no
36
+ # separate actions/setup-python step is needed.
37
+ run: |
38
+ curl -LsSf https://astral.sh/uv/install.sh | sh
39
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
40
+
41
+ - name: Build package
42
+ # hatch-vcs reads the version straight from the release tag.
43
+ run: |
44
+ uv build
45
+ echo "Built distributions:"
46
+ ls -l dist/
47
+
48
+ - name: Store the distribution packages
49
+ uses: actions/upload-artifact@v4
50
+ with:
51
+ name: python-package-distributions
52
+ path: dist/
53
+
54
+ - name: Upload assets to GitHub Release
55
+ env:
56
+ GH_TOKEN: ${{ github.token }}
57
+ run: |
58
+ gh release upload ${{ github.ref_name }} dist/* --clobber
59
+
60
+ - name: Notify Slack (build failure)
61
+ if: ${{ failure() && env.SLACK_WEBHOOK_URL != '' }}
62
+ run: |
63
+ curl -s -X POST "$SLACK_WEBHOOK_URL" \
64
+ -H 'Content-type: application/json' \
65
+ --data "{\"text\":\"*Codeplain Client*: Build of \`${{ github.ref_name }}\` FAILED :x:. Nothing was published to PyPI. See <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|the run log>.\"}"
66
+
67
+ publish-to-pypi:
68
+ name: Publish to PyPI
69
+ needs: build
70
+ runs-on: ubuntu-latest
71
+ environment:
72
+ name: pypi
73
+ url: https://pypi.org/p/codeplain
74
+ permissions:
75
+ # Mint a short-lived OIDC token so PyPI Trusted Publishing can
76
+ # authenticate this run — no long-lived API token needed.
77
+ id-token: write
78
+
79
+ env:
80
+ SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
81
+
82
+ steps:
83
+ - name: Download distribution packages
84
+ uses: actions/download-artifact@v4
85
+ with:
86
+ name: python-package-distributions
87
+ path: dist/
88
+
89
+ - name: Publish to PyPI
90
+ uses: pypa/gh-action-pypi-publish@release/v1
91
+
92
+ - name: Notify Slack (success)
93
+ if: ${{ success() && env.SLACK_WEBHOOK_URL != '' }}
94
+ run: |
95
+ curl -s -X POST "$SLACK_WEBHOOK_URL" \
96
+ -H 'Content-type: application/json' \
97
+ --data "{\"text\":\"*Codeplain Client*: \`${{ github.ref_name }}\` published to PyPI :white_check_mark:. Install with \`pip install --upgrade codeplain\`.\"}"
98
+
99
+ - name: Notify Slack (failure)
100
+ if: ${{ failure() && env.SLACK_WEBHOOK_URL != '' }}
101
+ run: |
102
+ curl -s -X POST "$SLACK_WEBHOOK_URL" \
103
+ -H 'Content-type: application/json' \
104
+ --data "{\"text\":\"*Codeplain Client*: Publishing \`${{ github.ref_name }}\` to PyPI FAILED :x:. See <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|the run log>.\"}"
@@ -212,8 +212,12 @@ Two logging modes:
212
212
  ### Code Generation Process
213
213
  - Templates in `standard_template_library/` use Liquid2 syntax
214
214
  - Template search order: (1) `.plain` file dir, (2) `--template-dir`, (3) built-in standard lib
215
- - Generated code written to `build/` (configurable via `--build-folder`)
216
- - Each FRID render produces a git commit in build folder for rollback capability
215
+ - Each module renders into its own tree under the build folder (configurable via `--build-folder`, default `plain_modules/`):
216
+ - `<build-folder>/<module>/code/` implementation code (its own git repo)
217
+ - `<build-folder>/<module>/tests/` — conformance tests (its own git repo; only created when a conformance tests script is configured)
218
+ - `<build-folder>/<module>/.codeplain/` — module metadata (`module_metadata.json`), not tracked in git
219
+ - `<build-folder>/<module>/.memory/` — conformance test memory, not tracked in git
220
+ - Each FRID render produces a git commit in the `code/` and `tests/` repos for rollback capability
217
221
 
218
222
  ### Configuration
219
223
  - `config.yaml` can be placed in `.plain` file dir or CWD
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codeplain
3
- Version: 0.3.7
3
+ Version: 0.3.9
4
4
  Summary: Transform plain language specifications into working code
5
5
  License-File: LICENSE
6
6
  Classifier: Environment :: Console
@@ -8,7 +8,7 @@ Classifier: Intended Audience :: Developers
8
8
  Classifier: Operating System :: OS Independent
9
9
  Classifier: Topic :: Software Development :: Code Generators
10
10
  Requires-Python: ==3.11.*
11
- Requires-Dist: gitpython==3.1.50
11
+ Requires-Dist: gitpython==3.1.52
12
12
  Requires-Dist: mistletoe==1.5.1
13
13
  Requires-Dist: networkx==3.6.1
14
14
  Requires-Dist: python-frontmatter==1.3.0
@@ -16,7 +16,7 @@ Requires-Dist: python-liquid2==0.4.0
16
16
  Requires-Dist: pyyaml==6.0.3
17
17
  Requires-Dist: requests==2.34.2
18
18
  Requires-Dist: rich==15.0.0
19
- Requires-Dist: sentry-sdk==2.63.0
19
+ Requires-Dist: sentry-sdk==2.66.0
20
20
  Requires-Dist: textual>=7.5.0
21
21
  Requires-Dist: tiktoken==0.13.0
22
22
  Requires-Dist: transitions==0.9.3
@@ -24,7 +24,7 @@ Provides-Extra: dev
24
24
  Requires-Dist: black==26.5.1; extra == 'dev'
25
25
  Requires-Dist: flake8==7.3.0; extra == 'dev'
26
26
  Requires-Dist: isort==8.0.1; extra == 'dev'
27
- Requires-Dist: mypy==2.1.0; extra == 'dev'
27
+ Requires-Dist: mypy==2.3.0; extra == 'dev'
28
28
  Requires-Dist: pytest==9.1.1; extra == 'dev'
29
29
  Description-Content-Type: text/markdown
30
30
 
@@ -4,7 +4,7 @@ from typing import Optional
4
4
 
5
5
  from plain2code_console import console
6
6
  from plain2code_state import RunState
7
- from plain2code_utils import format_duration_hms
7
+ from usage_summary import format_usage_summary
8
8
 
9
9
 
10
10
  def print_exit_summary(
@@ -24,7 +24,7 @@ def print_exit_summary(
24
24
  msg += f" [#8E8F91]render id:\t\t\t[#FFFFFF]{run_state.render_id}\n"
25
25
  msg += f" [#8E8F91]input file:\t\t\t[#FFFFFF]{spec_filename}\n"
26
26
  msg += f" [#8E8F91]generated code folder:\t[#FFFFFF]{run_state.render_generated_code_path or '-'}\n\n"
27
- msg += f"[#8E8F91]functionalities [#FFFFFF]{run_state.rendered_functionalities} [#8E8F91]used credits [#FFFFFF]{run_state.rendered_functionalities} [#8E8F91]render time [#FFFFFF]{format_duration_hms(run_state.render_time_accumulated)}\n"
27
+ msg += format_usage_summary(run_state.rendered_functionalities, run_state.render_time_accumulated) + "\n"
28
28
  console.print(msg)
29
29
 
30
30
  if not run_state.render_succeeded and error_message:
@@ -32,7 +32,7 @@ def _display_credit_line(plan_credits: dict) -> None:
32
32
  # If naive datetime, assume UTC
33
33
  if dt.tzinfo is None:
34
34
  dt = dt.replace(tzinfo=timezone.utc)
35
- formatted_date = dt.strftime("%b %-d, %Y")
35
+ formatted_date = f"{dt.strftime('%b')} {dt.day}, {dt.year}"
36
36
 
37
37
  # Check if expired
38
38
  now = datetime.now(timezone.utc)
@@ -62,7 +62,7 @@ def _display_bucket_credit_line(bucket: dict, label: str) -> None:
62
62
  # If naive datetime, assume UTC
63
63
  if dt.tzinfo is None:
64
64
  dt = dt.replace(tzinfo=timezone.utc)
65
- formatted_date = dt.strftime("%b %-d, %Y")
65
+ formatted_date = f"{dt.strftime('%b')} {dt.day}, {dt.year}"
66
66
 
67
67
  # Check if expired
68
68
  now = datetime.now(timezone.utc)
@@ -5,6 +5,7 @@ import requests
5
5
  from requests.exceptions import ConnectionError, RequestException, Timeout
6
6
 
7
7
  import plain2code_exceptions
8
+ from plain2code_console import RETRY_COLOR
8
9
  from plain2code_state import RunState
9
10
 
10
11
  MAX_RETRIES = 4
@@ -67,8 +68,11 @@ class CodeplainAPI:
67
68
  connection_error_type = "Network error" if is_connection_error else "Error"
68
69
  if attempt < num_retries:
69
70
  if not silent:
70
- self.console.debug(f"{connection_error_type} on attempt {attempt + 1}/{num_retries + 1}: {error}")
71
- self.console.debug(f"Retrying in {retry_delay} seconds...")
71
+ self.console.debug(
72
+ f" {connection_error_type} on attempt {attempt + 1}/{num_retries + 1}: {error}. "
73
+ f"Retrying in {retry_delay} seconds...",
74
+ color=RETRY_COLOR,
75
+ )
72
76
  time.sleep(retry_delay)
73
77
  # Exponential backoff
74
78
  return retry_delay * 2
@@ -9,7 +9,6 @@ usage: generate_cli.py [-h] [--verbose] [--base-folder BASE_FOLDER]
9
9
  [--render-range RENDER_RANGE |
10
10
  --render-from RENDER_FROM] [--force-render]
11
11
  [--unittests-script UNITTESTS_SCRIPT]
12
- [--conformance-tests-folder CONFORMANCE_TESTS_FOLDER]
13
12
  [--conformance-tests-script CONFORMANCE_TESTS_SCRIPT]
14
13
  [--prepare-environment-script PREPARE_ENVIRONMENT_SCRIPT]
15
14
  [--test-script-timeout TEST_SCRIPT_TIMEOUT]
@@ -20,8 +19,8 @@ usage: generate_cli.py [-h] [--verbose] [--base-folder BASE_FOLDER]
20
19
  [--conformance-tests-dest CONFORMANCE_TESTS_DEST]
21
20
  [--render-machine-graph]
22
21
  [--logging-config-path LOGGING_CONFIG_PATH]
23
- [--headless]
24
- filename
22
+ [--headless] [--status] [--version]
23
+ [filename]
25
24
 
26
25
  Render plain code to target code. Path arguments resolve based on where they
27
26
  were written: values given on the command line are resolved against the
@@ -39,7 +38,7 @@ positional arguments:
39
38
 
40
39
  options:
41
40
  -h, --help show this help message and exit
42
- --verbose, -v Enable verbose output
41
+ --verbose, -v Set default log level to DEBUG for TUI and file logs
43
42
  --base-folder BASE_FOLDER
44
43
  Base folder for the build files
45
44
  --build-folder BUILD_FOLDER
@@ -66,18 +65,17 @@ options:
66
65
  --force-render Force re-render of all the required modules.
67
66
  --unittests-script UNITTESTS_SCRIPT
68
67
  Shell script to run unit tests on generated code.
69
- Receives the build folder path as its first argument
70
- (default: 'plain_modules').
71
- --conformance-tests-folder CONFORMANCE_TESTS_FOLDER
72
- Folder for conformance test files
68
+ Receives the module's code folder path as its first
69
+ argument (e.g. `plain_modules/module_name/code`).
73
70
  --conformance-tests-script CONFORMANCE_TESTS_SCRIPT
74
71
  Path to conformance tests shell script. Every
75
72
  conformance test script should accept two arguments:
76
- 1) Path to a folder (e.g. `plain_modules/module_name`)
77
- containing generated source code, 2) Path to a
78
- subfolder of the conformance tests folder (e.g.
79
- `conformance_tests/subfoldername`) containing test
80
- files.
73
+ 1) Path to a folder (e.g.
74
+ `plain_modules/module_name/code`) containing generated
75
+ source code, 2) Path to a subfolder of the module's
76
+ tests folder (e.g.
77
+ `plain_modules/module_name/tests/subfoldername`)
78
+ containing test files.
81
79
  --prepare-environment-script PREPARE_ENVIRONMENT_SCRIPT
82
80
  Path to a shell script that prepares the testing
83
81
  environment. The script should accept the source code
@@ -90,9 +88,9 @@ options:
90
88
  --api-key API_KEY API key used to access the API. If not provided, the
91
89
  `CODEPLAIN_API_KEY` environment variable is used.
92
90
  --full-plain Full preview ***plain specification before code
93
- generation.Use when you want to preview context of all
94
- ***plain primitives that are going to be included in
95
- order to render the given module.
91
+ generation. Use when you want to preview context of
92
+ all ***plain primitives that are going to be included
93
+ in order to render the given module.
96
94
  --dry-run Dry run preview of the code generation (without
97
95
  actually making any changes).
98
96
  --replay-with REPLAY_WITH
@@ -109,10 +107,10 @@ options:
109
107
  Target folder to copy rendered contents of code to
110
108
  (used only if --copy-build is set).
111
109
  --copy-conformance-tests
112
- If set, copy the conformance tests of code in
113
- `--conformance-tests-folder` folder to `--conformance-
114
- tests-dest` folder successful rendering. Requires
115
- --conformance-tests-script.
110
+ If set, copy the module's conformance tests (from
111
+ `<build-folder>/<module>/tests`) to `--conformance-
112
+ tests-dest` folder after successful rendering.
113
+ Requires --conformance-tests-script.
116
114
  --conformance-tests-dest CONFORMANCE_TESTS_DEST
117
115
  Target folder to copy conformance tests of code to
118
116
  (used only if --copy-conformance-tests is set).
@@ -123,6 +121,10 @@ options:
123
121
  --headless Run in headless mode: no TUI, no terminal output
124
122
  except a single render-started message. All logs are
125
123
  written to the log file.
124
+ --status Display account status including user information, API
125
+ key label, and rendering credits. Does not render any
126
+ code.
127
+ --version Display the client version and exit.
126
128
 
127
129
  configuration:
128
130
  --config-name CONFIG_NAME
@@ -22,10 +22,16 @@ my-new-project/
22
22
  ├── run_unittests_[language].sh # Unit test script
23
23
  ├── run_conformance_tests_[language].sh # Conformance test script
24
24
  ├── build/ # Generated final code
25
- ├── plain_modules/ # Generated modules code
26
- └── conformance_tests/ # Generated conformanece tests code
25
+ └── plain_modules/ # Generated modules
26
+ └── my_app/ # One folder per module
27
+ ├── .codeplain/ # Module metadata
28
+ ├── .memory/ # Conformance test memory
29
+ ├── code/ # Generated code
30
+ └── tests/ # Generated conformance tests
27
31
  ```
28
32
 
33
+ The `tests/` folder is only created when a conformance test script is configured.
34
+
29
35
  In this guide we will cover how to create each of these step by step.
30
36
 
31
37
  ## 1. Define Your .plain File
@@ -20,11 +20,11 @@ if [ $? -ne 0 ]; then
20
20
  exit 1
21
21
  fi
22
22
 
23
- cd plain_modules/hello_world_golang
23
+ cd plain_modules/hello_world_golang/code
24
24
 
25
25
  # We need to compile the tests so that we can execute them in the current folder
26
26
  # (https://stackoverflow.com/questions/23847003/golang-tests-and-working-directory/29541248#29541248)
27
- go test -c ../../harness_tests/hello_world_test.go
27
+ go test -c ../../../harness_tests/hello_world_test.go
28
28
 
29
29
  # Check if test compilation has failed for the hello world example
30
30
  if [ $? -ne 0 ]; then
@@ -7,9 +7,9 @@ if [ $? -ne 0 ]; then
7
7
  exit 1
8
8
  fi
9
9
 
10
- cd plain_modules/hello_world_python
10
+ cd plain_modules/hello_world_python/code
11
11
 
12
- python ../../harness_tests/hello_world_display/test_hello_world.py
12
+ python ../../../harness_tests/hello_world_display/test_hello_world.py
13
13
 
14
14
  # Check if the test harness has failed for the hello world example
15
15
  if [ $? -ne 0 ]; then
@@ -20,7 +20,7 @@ if [ $? -ne 0 ]; then
20
20
  exit 1
21
21
  fi
22
22
 
23
- ../../test_scripts/run_conformance_tests_cypress.sh plain_modules/hello_world_react harness_tests/hello_world_display ${VERBOSE:+-v}
23
+ ../../test_scripts/run_conformance_tests_cypress.sh plain_modules/hello_world_react/code harness_tests/hello_world_display ${VERBOSE:+-v}
24
24
 
25
25
  # Check if the test harness has failed for the hello world example
26
26
  if [ $? -ne 0 ]; then
@@ -64,7 +64,6 @@ def init_git_repo(
64
64
  path_to_repo: Union[str, os.PathLike],
65
65
  module_name: Optional[str] = None,
66
66
  render_id: Optional[str] = None,
67
- initial_files: Optional[dict[str, str]] = None,
68
67
  ) -> Repo:
69
68
  """
70
69
  Initializes a new git repository in the given path.
@@ -79,10 +78,6 @@ def init_git_repo(
79
78
  repo = Repo.init(path_to_repo)
80
79
  _ensure_git_config(repo)
81
80
 
82
- if initial_files:
83
- file_utils.store_response_files(path_to_repo, initial_files, [])
84
- repo.git.add(".")
85
-
86
81
  repo.git.commit(
87
82
  "--allow-empty", "-m", _get_full_commit_message(INITIAL_COMMIT_MESSAGE, module_name, None, render_id)
88
83
  )
@@ -95,14 +90,9 @@ def clone_repo(
95
90
  new_repo_path: str,
96
91
  module_name: Optional[str] = None,
97
92
  render_id: Optional[str] = None,
98
- initial_files: Optional[dict[str, str]] = None,
99
93
  ) -> Repo:
100
94
  repo = Repo.clone_from(source_repo_path, new_repo_path)
101
95
 
102
- if initial_files:
103
- file_utils.store_response_files(new_repo_path, initial_files, [])
104
- repo.git.add(".")
105
-
106
96
  repo.git.commit(
107
97
  "--allow-empty", "-m", _get_full_commit_message(INITIAL_COMMIT_MESSAGE, module_name, None, render_id)
108
98
  )
@@ -13,7 +13,7 @@ NC="${NC:-\033[0m}"
13
13
 
14
14
  # Examples configuration
15
15
  EXAMPLES_FOLDER_NAME="plainlang-examples"
16
- EXAMPLES_DOWNLOAD_URL="https://github.com/Codeplain-ai/plainlang-examples/archive/refs/tags/0.1.zip"
16
+ EXAMPLES_DOWNLOAD_URL="https://codeplain.ai/examples/unix"
17
17
 
18
18
  # Show current directory and ask for extraction path
19
19
  CURRENT_DIR=$(pwd)
@@ -55,18 +55,12 @@ if [ "$SKIP_DOWNLOAD" = false ]; then
55
55
  if [ $? -eq 0 ] && [ -s "$TEMP_ZIP" ]; then
56
56
  echo -e " ${GRAY}Extracting to ${EXTRACT_PATH}...${NC}"
57
57
 
58
- # Extract the zip file
59
- unzip -q -o "$TEMP_ZIP" -d "$EXTRACT_PATH" 2>/dev/null
58
+ # Extract the zip file (contents are at the zip root, so extract into the target folder)
59
+ EXTRACTED_DIR="${EXTRACT_PATH}/${EXAMPLES_FOLDER_NAME}"
60
+ rm -rf "$EXTRACTED_DIR" 2>/dev/null # Remove existing if present
61
+ unzip -q -o "$TEMP_ZIP" -d "$EXTRACTED_DIR" 2>/dev/null
60
62
 
61
63
  if [ $? -eq 0 ]; then
62
- # Find and rename extracted directory to remove version number
63
- EXTRACTED_DIR="${EXTRACT_PATH}/${EXAMPLES_FOLDER_NAME}"
64
- VERSIONED_DIR=$(find "$EXTRACT_PATH" -maxdepth 1 -type d -name "${EXAMPLES_FOLDER_NAME}-*" | head -1)
65
- if [ -n "$VERSIONED_DIR" ]; then
66
- rm -rf "$EXTRACTED_DIR" 2>/dev/null # Remove existing if present
67
- mv "$VERSIONED_DIR" "$EXTRACTED_DIR"
68
- fi
69
-
70
64
  # Remove the .gitignore file from the root of the extracted directory
71
65
  if [ -f "${EXTRACTED_DIR}/.gitignore" ]; then
72
66
  rm -f "${EXTRACTED_DIR}/.gitignore"
@@ -396,10 +396,12 @@ if [ -n "${CODEPLAIN_API_KEY:-}" ]; then
396
396
  # Ensure the freshly installed tool is findable in this session.
397
397
  export PATH="$HOME/.local/bin:$PATH"
398
398
  echo -e "${GRAY}Verifying your installation...${NC}"
399
- if codeplain --status > /dev/null 2>&1; then
399
+ if verify_output=$(codeplain --status 2>&1); then
400
400
  echo -e "${GREEN}✓${NC} Installation verified."
401
401
  else
402
402
  echo -e "${RED}Something went wrong during installation.${NC}"
403
+ echo -e "${GRAY}Output of 'codeplain --status':${NC}"
404
+ echo "$verify_output"
403
405
  echo -e "${GRAY}Please restart your terminal and try again, or reinstall with:${NC}"
404
406
  echo -e " uv tool install --force codeplain"
405
407
  exit 1
@@ -11,7 +11,7 @@ if (-not $env:NC) { $NC = "$([char]27)[0m" } else
11
11
 
12
12
  # Examples configuration
13
13
  $EXAMPLES_FOLDER_NAME = "plainlang-examples"
14
- $EXAMPLES_DOWNLOAD_URL = "https://github.com/Codeplain-ai/plainlang-examples/archive/refs/tags/0.1.zip"
14
+ $EXAMPLES_DOWNLOAD_URL = "https://codeplain.ai/examples/windows"
15
15
 
16
16
  # Show current directory and ask for extraction path
17
17
  $CURRENT_DIR = Get-Location
@@ -58,18 +58,12 @@ if (-not $SKIP_DOWNLOAD) {
58
58
  Write-Host " ${GRAY}Extracting to ${EXTRACT_PATH}...${NC}"
59
59
 
60
60
  try {
61
- Expand-Archive -Path $TEMP_ZIP -DestinationPath $EXTRACT_PATH -Force
62
-
63
- # Find and rename extracted directory to remove version number
61
+ # Extract the zip file (contents are at the zip root, so extract into the target folder)
64
62
  $EXTRACTED_DIR = Join-Path $EXTRACT_PATH $EXAMPLES_FOLDER_NAME
65
- $VERSIONED_DIR = Get-ChildItem -Path $EXTRACT_PATH -Directory -Filter "${EXAMPLES_FOLDER_NAME}-*" | Select-Object -First 1
66
-
67
- if ($VERSIONED_DIR) {
68
- if (Test-Path $EXTRACTED_DIR) {
69
- Remove-Item -Path $EXTRACTED_DIR -Recurse -Force -ErrorAction SilentlyContinue
70
- }
71
- Rename-Item -Path $VERSIONED_DIR.FullName -NewName $EXAMPLES_FOLDER_NAME
63
+ if (Test-Path $EXTRACTED_DIR) {
64
+ Remove-Item -Path $EXTRACTED_DIR -Recurse -Force -ErrorAction SilentlyContinue
72
65
  }
66
+ Expand-Archive -Path $TEMP_ZIP -DestinationPath $EXTRACTED_DIR -Force
73
67
 
74
68
  # Remove the .gitignore file from the root of the extracted directory
75
69
  $GITIGNORE_PATH = Join-Path $EXTRACTED_DIR ".gitignore"
@@ -426,16 +426,20 @@ if ($downloadExamples -notmatch '^[Nn]$') {
426
426
  if ($env:CODEPLAIN_API_KEY) {
427
427
  Write-Host "${GRAY}Verifying your installation...${NC}"
428
428
  $verifyOk = $false
429
+ $verifyOutput = ""
429
430
  try {
430
- & codeplain --status *> $null
431
+ $verifyOutput = & codeplain --status 2>&1 | Out-String
431
432
  $verifyOk = ($LASTEXITCODE -eq 0)
432
433
  } catch {
434
+ $verifyOutput = $_ | Out-String
433
435
  $verifyOk = $false
434
436
  }
435
437
  if ($verifyOk) {
436
438
  Write-Host "${GREEN}✓${NC} Installation verified."
437
439
  } else {
438
440
  Write-Host "${RED}Something went wrong during installation.${NC}"
441
+ Write-Host "${GRAY}Output of 'codeplain --status':${NC}"
442
+ Write-Host $verifyOutput
439
443
  Write-Host "${GRAY}Please restart your terminal and try again, or reinstall with:${NC}"
440
444
  Write-Host " uv tool install --force codeplain"
441
445
  exit 1
@@ -3,7 +3,6 @@ import os
3
3
 
4
4
  import file_utils
5
5
  from plain2code_console import console
6
- from plain_modules import CODEPLAIN_MEMORY_SUBFOLDER
7
6
  from render_machine.implementation_code_helpers import ImplementationCodeHelpers
8
7
  from render_machine.render_context import RenderContext
9
8
 
@@ -24,9 +23,9 @@ class MemoryManager:
24
23
  console.debug(f"Loaded {len(memory_files_content)} memory files.")
25
24
  return memory_files, memory_files_content
26
25
 
27
- def __init__(self, codeplain_api, module_name: str, conformance_tests_folder: str):
26
+ def __init__(self, codeplain_api, memory_folder: str):
28
27
  self.codeplain_api = codeplain_api
29
- self.memory_folder = os.path.join(conformance_tests_folder, module_name, CODEPLAIN_MEMORY_SUBFOLDER)
28
+ self.memory_folder = memory_folder
30
29
 
31
30
  def create_conformance_tests_memory(
32
31
  self, render_context: RenderContext, exit_code: int, conformance_tests_issue: str
@@ -0,0 +1,46 @@
1
+ """Read/write helpers for the per-module metadata file (``module_metadata.json``).
2
+
3
+ These helpers operate purely on a metadata path or a plain dict. Module-specific
4
+ logic — computing the hashes, assembling the payload from the spec and required
5
+ modules — stays on :class:`plain_modules.PlainModule`.
6
+ """
7
+
8
+ from __future__ import annotations
9
+
10
+ import json
11
+ import os
12
+
13
+ MODULE_METADATA_FILENAME = "module_metadata.json"
14
+ MODULE_FUNCTIONALITIES = "functionalities"
15
+ REQUIRED_MODULES_FUNCTIONALITIES = "required_modules_functionalities"
16
+
17
+
18
+ def load_metadata(metadata_path: str) -> dict | None:
19
+ """Return the parsed metadata dict, or None if the file does not exist."""
20
+ if not os.path.exists(metadata_path):
21
+ return None
22
+
23
+ with open(metadata_path, "r", encoding="utf-8") as f:
24
+ return json.load(f)
25
+
26
+
27
+ def write_metadata(metadata_path: str, metadata: dict) -> None:
28
+ """Write metadata as indented JSON, creating the parent folder if needed."""
29
+ os.makedirs(os.path.dirname(metadata_path), exist_ok=True)
30
+
31
+ with open(metadata_path, "w", encoding="utf-8") as f:
32
+ json.dump(metadata, f, indent=4)
33
+
34
+
35
+ def truncate_functionalities(metadata: dict, keep_count: int) -> bool:
36
+ """Trim the functionalities list in ``metadata`` in place to ``keep_count`` entries.
37
+
38
+ Returns True if the list was shortened, False if it was already short enough
39
+ (in which case ``metadata`` is left untouched).
40
+ """
41
+ functionalities = metadata.get(MODULE_FUNCTIONALITIES, [])
42
+ if len(functionalities) <= keep_count:
43
+ return False
44
+
45
+ metadata[MODULE_FUNCTIONALITIES] = functionalities[:keep_count]
46
+ return True
@@ -1,5 +1,4 @@
1
1
  import argparse
2
- import os
3
2
  import threading
4
3
 
5
4
  from event_bus import EventBus
@@ -48,9 +47,8 @@ class ModuleRenderer:
48
47
  self.codeplainAPI,
49
48
  memory_manager,
50
49
  plain_module,
51
- build_folder=os.path.join(self.args.build_folder, plain_module.module_name),
50
+ build_folder=plain_module.module_build_folder,
52
51
  build_dest=self.args.build_dest,
53
- conformance_tests_folder=self.args.conformance_tests_folder,
54
52
  conformance_tests_dest=self.args.conformance_tests_dest,
55
53
  unittests_script=self.args.unittests_script,
56
54
  conformance_tests_script=self.args.conformance_tests_script,
@@ -115,8 +113,7 @@ class ModuleRenderer:
115
113
 
116
114
  memory_manager = MemoryManager(
117
115
  self.codeplainAPI,
118
- plain_module.module_name,
119
- self.args.conformance_tests_folder,
116
+ plain_module.module_memory_folder,
120
117
  )
121
118
  render_context = self._build_render_context_for_module(
122
119
  plain_module,
@@ -165,7 +162,7 @@ class ModuleRenderer:
165
162
  if self.args.copy_build:
166
163
  rendered_code_path = f"{self.args.build_dest}/"
167
164
  else:
168
- rendered_code_path = self.args.build_folder
165
+ rendered_code_path = self.plain_module.module_build_folder
169
166
 
170
167
  self.run_state.set_render_generated_code_path(rendered_code_path)
171
168
  self.event_bus.publish(RenderCompleted(rendered_code_path=rendered_code_path))