codeplain 0.1.1__tar.gz → 0.2.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codeplain-0.1.1 → codeplain-0.2.2}/PKG-INFO +5 -23
- {codeplain-0.1.1 → codeplain-0.2.2}/codeplain.egg-info/PKG-INFO +5 -23
- {codeplain-0.1.1 → codeplain-0.2.2}/codeplain.egg-info/SOURCES.txt +28 -1
- codeplain-0.2.2/codeplain.egg-info/requires.txt +18 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/codeplain.egg-info/top_level.txt +5 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/codeplain_REST_api.py +111 -35
- codeplain-0.2.2/concept_utils.py +216 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/config/__init__.py +0 -1
- codeplain-0.2.2/diff_utils.py +32 -0
- codeplain-0.2.2/event_bus.py +45 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/file_utils.py +34 -24
- {codeplain-0.1.1 → codeplain-0.2.2}/git_utils.py +84 -19
- codeplain-0.2.2/memory_management.py +97 -0
- codeplain-0.2.2/module_renderer.py +149 -0
- codeplain-0.2.2/plain2code.py +267 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/plain2code_arguments.py +30 -8
- {codeplain-0.1.1 → codeplain-0.2.2}/plain2code_console.py +12 -3
- codeplain-0.2.2/plain2code_events.py +62 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/plain2code_exceptions.py +4 -0
- codeplain-0.2.2/plain2code_logger.py +127 -0
- codeplain-0.2.2/plain2code_state.py +39 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/plain2code_utils.py +8 -26
- codeplain-0.2.2/plain_file.py +703 -0
- codeplain-0.2.2/plain_modules.py +135 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/plain_spec.py +7 -5
- {codeplain-0.1.1 → codeplain-0.2.2}/pyproject.toml +24 -34
- codeplain-0.2.2/render_machine/__init__.py +0 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/actions/analyze_specification_ambiguity.py +9 -7
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/actions/commit_conformance_tests_changes.py +11 -5
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/actions/commit_implementation_code_changes.py +2 -1
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/actions/create_dist.py +6 -6
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/actions/exit_with_error.py +6 -1
- codeplain-0.2.2/render_machine/actions/finish_functional_requirement.py +18 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/actions/fix_conformance_test.py +48 -38
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/actions/fix_unit_tests.py +10 -8
- codeplain-0.2.2/render_machine/actions/prepare_repositories.py +73 -0
- codeplain-0.2.2/render_machine/actions/prepare_testing_environment.py +40 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/actions/refactor_code.py +12 -10
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/actions/render_conformance_tests.py +42 -29
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/actions/render_functional_requirement.py +29 -12
- codeplain-0.2.2/render_machine/actions/run_conformance_tests.py +73 -0
- codeplain-0.2.2/render_machine/actions/run_unit_tests.py +46 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/actions/summarize_conformance_tests.py +10 -6
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/code_renderer.py +21 -3
- codeplain-0.2.2/render_machine/conformance_tests.py +169 -0
- codeplain-0.2.2/render_machine/implementation_code_helpers.py +26 -0
- codeplain-0.2.2/render_machine/render_context.py +448 -0
- codeplain-0.2.2/render_machine/render_types.py +186 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/render_utils.py +17 -9
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/state_machine_config.py +50 -18
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/states.py +1 -1
- codeplain-0.2.2/spinner.py +88 -0
- codeplain-0.2.2/standard_template_library/golang-console-app-template.plain +29 -0
- codeplain-0.2.2/standard_template_library/python-console-app-template.plain +24 -0
- codeplain-0.2.2/standard_template_library/typescript-react-app-boilerplate.plain +8 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/standard_template_library/typescript-react-app-template.plain +5 -10
- codeplain-0.2.2/tests/test_git_utils.py +458 -0
- codeplain-0.2.2/tests/test_imports.py +42 -0
- codeplain-0.2.2/tests/test_plainfile.py +271 -0
- codeplain-0.2.2/tests/test_plainfileparser.py +532 -0
- codeplain-0.2.2/tests/test_plainspec.py +67 -0
- codeplain-0.2.2/tests/test_requires.py +27 -0
- codeplain-0.2.2/tui/__init__.py +1 -0
- codeplain-0.2.2/tui/components.py +372 -0
- codeplain-0.2.2/tui/models.py +56 -0
- codeplain-0.2.2/tui/plain2code_tui.py +268 -0
- codeplain-0.2.2/tui/state_handlers.py +307 -0
- codeplain-0.2.2/tui/styles.css +213 -0
- codeplain-0.2.2/tui/widget_helpers.py +159 -0
- codeplain-0.1.1/codeplain.egg-info/requires.txt +0 -34
- codeplain-0.1.1/plain2code.py +0 -218
- codeplain-0.1.1/plain2code_state.py +0 -75
- codeplain-0.1.1/render_machine/actions/prepare_repositories.py +0 -50
- codeplain-0.1.1/render_machine/actions/prepare_testing_environment.py +0 -30
- codeplain-0.1.1/render_machine/actions/run_conformance_tests.py +0 -44
- codeplain-0.1.1/render_machine/actions/run_unit_tests.py +0 -38
- codeplain-0.1.1/render_machine/implementation_code_helpers.py +0 -20
- codeplain-0.1.1/render_machine/render_context.py +0 -280
- codeplain-0.1.1/render_machine/render_types.py +0 -36
- codeplain-0.1.1/standard_template_library/golang-console-app-template.plain +0 -36
- codeplain-0.1.1/standard_template_library/python-console-app-template.plain +0 -32
- {codeplain-0.1.1 → codeplain-0.2.2}/LICENSE +0 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/README.md +0 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/codeplain.egg-info/dependency_links.txt +0 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/codeplain.egg-info/entry_points.txt +0 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/config/system_config.yaml +0 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/hash_key.py +0 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/plain2code_nodes.py +0 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/plain2code_read_config.py +0 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/actions/base_action.py +0 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/conformance_test_helpers.py +0 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/render_machine/triggers.py +0 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/setup.cfg +0 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/standard_template_library/__init__.py +0 -0
- {codeplain-0.1.1 → codeplain-0.2.2}/system_config.py +0 -0
|
@@ -1,48 +1,30 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codeplain
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Transform plain language specifications into working code
|
|
5
5
|
Classifier: Environment :: Console
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
7
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
8
7
|
Classifier: Operating System :: OS Independent
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
10
8
|
Classifier: Topic :: Software Development :: Code Generators
|
|
11
9
|
Requires-Python: >=3.11
|
|
12
10
|
Description-Content-Type: text/markdown
|
|
13
11
|
License-File: LICENSE
|
|
14
12
|
Requires-Dist: python-liquid2==0.3.0
|
|
15
13
|
Requires-Dist: mistletoe==1.3.0
|
|
16
|
-
Requires-Dist: langchain==1.0.8
|
|
17
|
-
Requires-Dist: langchain-core==1.2.3
|
|
18
|
-
Requires-Dist: langchain-openai==1.0.3
|
|
19
|
-
Requires-Dist: langchain-anthropic==1.1.0
|
|
20
|
-
Requires-Dist: langchain-aws==1.0.0
|
|
21
|
-
Requires-Dist: langchain-cerebras==0.8.0
|
|
22
|
-
Requires-Dist: langchain-google-genai==4.1.2
|
|
23
|
-
Requires-Dist: langchain-ollama==1.0.0
|
|
24
14
|
Requires-Dist: requests==2.32.3
|
|
25
|
-
Requires-Dist: langsmith==0.4.4
|
|
26
|
-
Requires-Dist: rich==14.2.0
|
|
27
15
|
Requires-Dist: tiktoken==0.12.0
|
|
28
16
|
Requires-Dist: PyYAML==6.0.2
|
|
29
17
|
Requires-Dist: gitpython==3.1.42
|
|
30
|
-
Requires-Dist: lizard==1.18.0
|
|
31
|
-
Requires-Dist: textual==1.0.0
|
|
32
|
-
Requires-Dist: SQLAlchemy==2.0.36
|
|
33
|
-
Requires-Dist: psycopg2==2.9.10
|
|
34
|
-
Requires-Dist: python-dotenv==1.1.0
|
|
35
18
|
Requires-Dist: transitions==0.9.3
|
|
36
|
-
Requires-Dist:
|
|
19
|
+
Requires-Dist: textual==1.0.0
|
|
20
|
+
Requires-Dist: rich==14.2.0
|
|
21
|
+
Requires-Dist: python-frontmatter==1.1.0
|
|
22
|
+
Requires-Dist: networkx==3.6.1
|
|
37
23
|
Provides-Extra: dev
|
|
38
24
|
Requires-Dist: pytest==8.3.5; extra == "dev"
|
|
39
25
|
Requires-Dist: flake8==7.0.0; extra == "dev"
|
|
40
26
|
Requires-Dist: black==24.2.0; extra == "dev"
|
|
41
27
|
Requires-Dist: isort==5.13.2; extra == "dev"
|
|
42
|
-
Requires-Dist: flake8-bugbear==24.12.12; extra == "dev"
|
|
43
|
-
Requires-Dist: flake8-unused-arguments==0.0.13; extra == "dev"
|
|
44
|
-
Requires-Dist: flake8-eradicate==1.5.0; extra == "dev"
|
|
45
|
-
Requires-Dist: pep8-naming==0.15.1; extra == "dev"
|
|
46
28
|
Requires-Dist: mypy==1.11.2; extra == "dev"
|
|
47
29
|
Dynamic: license-file
|
|
48
30
|
|
|
@@ -1,48 +1,30 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: codeplain
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.2
|
|
4
4
|
Summary: Transform plain language specifications into working code
|
|
5
5
|
Classifier: Environment :: Console
|
|
6
6
|
Classifier: Intended Audience :: Developers
|
|
7
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
8
7
|
Classifier: Operating System :: OS Independent
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
10
8
|
Classifier: Topic :: Software Development :: Code Generators
|
|
11
9
|
Requires-Python: >=3.11
|
|
12
10
|
Description-Content-Type: text/markdown
|
|
13
11
|
License-File: LICENSE
|
|
14
12
|
Requires-Dist: python-liquid2==0.3.0
|
|
15
13
|
Requires-Dist: mistletoe==1.3.0
|
|
16
|
-
Requires-Dist: langchain==1.0.8
|
|
17
|
-
Requires-Dist: langchain-core==1.2.3
|
|
18
|
-
Requires-Dist: langchain-openai==1.0.3
|
|
19
|
-
Requires-Dist: langchain-anthropic==1.1.0
|
|
20
|
-
Requires-Dist: langchain-aws==1.0.0
|
|
21
|
-
Requires-Dist: langchain-cerebras==0.8.0
|
|
22
|
-
Requires-Dist: langchain-google-genai==4.1.2
|
|
23
|
-
Requires-Dist: langchain-ollama==1.0.0
|
|
24
14
|
Requires-Dist: requests==2.32.3
|
|
25
|
-
Requires-Dist: langsmith==0.4.4
|
|
26
|
-
Requires-Dist: rich==14.2.0
|
|
27
15
|
Requires-Dist: tiktoken==0.12.0
|
|
28
16
|
Requires-Dist: PyYAML==6.0.2
|
|
29
17
|
Requires-Dist: gitpython==3.1.42
|
|
30
|
-
Requires-Dist: lizard==1.18.0
|
|
31
|
-
Requires-Dist: textual==1.0.0
|
|
32
|
-
Requires-Dist: SQLAlchemy==2.0.36
|
|
33
|
-
Requires-Dist: psycopg2==2.9.10
|
|
34
|
-
Requires-Dist: python-dotenv==1.1.0
|
|
35
18
|
Requires-Dist: transitions==0.9.3
|
|
36
|
-
Requires-Dist:
|
|
19
|
+
Requires-Dist: textual==1.0.0
|
|
20
|
+
Requires-Dist: rich==14.2.0
|
|
21
|
+
Requires-Dist: python-frontmatter==1.1.0
|
|
22
|
+
Requires-Dist: networkx==3.6.1
|
|
37
23
|
Provides-Extra: dev
|
|
38
24
|
Requires-Dist: pytest==8.3.5; extra == "dev"
|
|
39
25
|
Requires-Dist: flake8==7.0.0; extra == "dev"
|
|
40
26
|
Requires-Dist: black==24.2.0; extra == "dev"
|
|
41
27
|
Requires-Dist: isort==5.13.2; extra == "dev"
|
|
42
|
-
Requires-Dist: flake8-bugbear==24.12.12; extra == "dev"
|
|
43
|
-
Requires-Dist: flake8-unused-arguments==0.0.13; extra == "dev"
|
|
44
|
-
Requires-Dist: flake8-eradicate==1.5.0; extra == "dev"
|
|
45
|
-
Requires-Dist: pep8-naming==0.15.1; extra == "dev"
|
|
46
28
|
Requires-Dist: mypy==1.11.2; extra == "dev"
|
|
47
29
|
Dynamic: license-file
|
|
48
30
|
|
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
LICENSE
|
|
2
2
|
README.md
|
|
3
3
|
codeplain_REST_api.py
|
|
4
|
+
concept_utils.py
|
|
5
|
+
diff_utils.py
|
|
6
|
+
event_bus.py
|
|
4
7
|
file_utils.py
|
|
5
8
|
git_utils.py
|
|
6
9
|
hash_key.py
|
|
10
|
+
memory_management.py
|
|
11
|
+
module_renderer.py
|
|
7
12
|
plain2code.py
|
|
8
13
|
plain2code_arguments.py
|
|
9
14
|
plain2code_console.py
|
|
15
|
+
plain2code_events.py
|
|
10
16
|
plain2code_exceptions.py
|
|
17
|
+
plain2code_logger.py
|
|
11
18
|
plain2code_nodes.py
|
|
12
19
|
plain2code_read_config.py
|
|
13
20
|
plain2code_state.py
|
|
14
21
|
plain2code_utils.py
|
|
22
|
+
plain_file.py
|
|
23
|
+
plain_modules.py
|
|
15
24
|
plain_spec.py
|
|
16
25
|
pyproject.toml
|
|
26
|
+
spinner.py
|
|
17
27
|
system_config.py
|
|
18
28
|
codeplain.egg-info/PKG-INFO
|
|
19
29
|
codeplain.egg-info/SOURCES.txt
|
|
@@ -23,8 +33,10 @@ codeplain.egg-info/requires.txt
|
|
|
23
33
|
codeplain.egg-info/top_level.txt
|
|
24
34
|
config/__init__.py
|
|
25
35
|
config/system_config.yaml
|
|
36
|
+
render_machine/__init__.py
|
|
26
37
|
render_machine/code_renderer.py
|
|
27
38
|
render_machine/conformance_test_helpers.py
|
|
39
|
+
render_machine/conformance_tests.py
|
|
28
40
|
render_machine/implementation_code_helpers.py
|
|
29
41
|
render_machine/render_context.py
|
|
30
42
|
render_machine/render_types.py
|
|
@@ -38,6 +50,7 @@ render_machine/actions/commit_conformance_tests_changes.py
|
|
|
38
50
|
render_machine/actions/commit_implementation_code_changes.py
|
|
39
51
|
render_machine/actions/create_dist.py
|
|
40
52
|
render_machine/actions/exit_with_error.py
|
|
53
|
+
render_machine/actions/finish_functional_requirement.py
|
|
41
54
|
render_machine/actions/fix_conformance_test.py
|
|
42
55
|
render_machine/actions/fix_unit_tests.py
|
|
43
56
|
render_machine/actions/prepare_repositories.py
|
|
@@ -51,4 +64,18 @@ render_machine/actions/summarize_conformance_tests.py
|
|
|
51
64
|
standard_template_library/__init__.py
|
|
52
65
|
standard_template_library/golang-console-app-template.plain
|
|
53
66
|
standard_template_library/python-console-app-template.plain
|
|
54
|
-
standard_template_library/typescript-react-app-
|
|
67
|
+
standard_template_library/typescript-react-app-boilerplate.plain
|
|
68
|
+
standard_template_library/typescript-react-app-template.plain
|
|
69
|
+
tests/test_git_utils.py
|
|
70
|
+
tests/test_imports.py
|
|
71
|
+
tests/test_plainfile.py
|
|
72
|
+
tests/test_plainfileparser.py
|
|
73
|
+
tests/test_plainspec.py
|
|
74
|
+
tests/test_requires.py
|
|
75
|
+
tui/__init__.py
|
|
76
|
+
tui/components.py
|
|
77
|
+
tui/models.py
|
|
78
|
+
tui/plain2code_tui.py
|
|
79
|
+
tui/state_handlers.py
|
|
80
|
+
tui/styles.css
|
|
81
|
+
tui/widget_helpers.py
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
python-liquid2==0.3.0
|
|
2
|
+
mistletoe==1.3.0
|
|
3
|
+
requests==2.32.3
|
|
4
|
+
tiktoken==0.12.0
|
|
5
|
+
PyYAML==6.0.2
|
|
6
|
+
gitpython==3.1.42
|
|
7
|
+
transitions==0.9.3
|
|
8
|
+
textual==1.0.0
|
|
9
|
+
rich==14.2.0
|
|
10
|
+
python-frontmatter==1.1.0
|
|
11
|
+
networkx==3.6.1
|
|
12
|
+
|
|
13
|
+
[dev]
|
|
14
|
+
pytest==8.3.5
|
|
15
|
+
flake8==7.0.0
|
|
16
|
+
black==24.2.0
|
|
17
|
+
isort==5.13.2
|
|
18
|
+
mypy==1.11.2
|
|
@@ -6,6 +6,7 @@ codeplain_local_api
|
|
|
6
6
|
codeplain_models
|
|
7
7
|
codeplain_types
|
|
8
8
|
codeplain_utils
|
|
9
|
+
concept_utils
|
|
9
10
|
config
|
|
10
11
|
content_extractor
|
|
11
12
|
event_bus
|
|
@@ -16,21 +17,25 @@ llm
|
|
|
16
17
|
llm_exceptions
|
|
17
18
|
llm_handler
|
|
18
19
|
llm_selector
|
|
20
|
+
module_renderer
|
|
19
21
|
plain2code
|
|
20
22
|
plain2code_arguments
|
|
21
23
|
plain2code_console
|
|
22
24
|
plain2code_events
|
|
23
25
|
plain2code_exceptions
|
|
26
|
+
plain2code_logger
|
|
24
27
|
plain2code_nodes
|
|
25
28
|
plain2code_read_config
|
|
26
29
|
plain2code_state
|
|
27
30
|
plain2code_tui
|
|
28
31
|
plain2code_utils
|
|
29
32
|
plain_file
|
|
33
|
+
plain_modules
|
|
30
34
|
plain_spec
|
|
31
35
|
render_cache
|
|
32
36
|
render_machine
|
|
33
37
|
spinner
|
|
34
38
|
standard_template_library
|
|
35
39
|
system_config
|
|
40
|
+
tui
|
|
36
41
|
tui_components
|
|
@@ -93,53 +93,42 @@ class CodeplainAPI:
|
|
|
93
93
|
f"Connection error: Unable to reach the Codeplain API at {self.api_url}. Please try again or contact support."
|
|
94
94
|
)
|
|
95
95
|
|
|
96
|
-
def get_plain_source_tree(self, plain_source, loaded_templates, run_state: RunState):
|
|
97
|
-
"""
|
|
98
|
-
Builds plain source tree from the given plain text source in Markdown format.
|
|
99
|
-
|
|
100
|
-
Args:
|
|
101
|
-
plain_source (str): A string containing the plain text source to be parsed.
|
|
102
|
-
loaded_templates (dict): A dictionary containing the loaded templates.
|
|
103
|
-
|
|
104
|
-
Returns:
|
|
105
|
-
dict: A plain source tree.
|
|
106
|
-
|
|
107
|
-
Raises:
|
|
108
|
-
Exception: If parsing of plain_source fails.
|
|
109
|
-
"""
|
|
110
|
-
endpoint_url = f"{self.api_url}/plain_source_tree"
|
|
111
|
-
headers = {"X-API-Key": self.api_key, "Content-Type": "application/json"}
|
|
112
|
-
|
|
113
|
-
payload = {"plain_source": plain_source, "loaded_templates": loaded_templates}
|
|
114
|
-
|
|
115
|
-
return self.post_request(endpoint_url, headers, payload, run_state)
|
|
116
|
-
|
|
117
96
|
def render_functional_requirement(
|
|
118
97
|
self,
|
|
119
|
-
frid,
|
|
120
|
-
plain_source_tree,
|
|
121
|
-
linked_resources,
|
|
122
|
-
existing_files_content,
|
|
98
|
+
frid: str,
|
|
99
|
+
plain_source_tree: dict,
|
|
100
|
+
linked_resources: dict,
|
|
101
|
+
existing_files_content: dict,
|
|
102
|
+
memory_files_content: dict,
|
|
103
|
+
module_name: str,
|
|
104
|
+
required_modules: dict,
|
|
123
105
|
run_state: RunState,
|
|
124
|
-
):
|
|
106
|
+
) -> dict[str, str]:
|
|
125
107
|
"""
|
|
126
108
|
Renders the content of a functional requirement based on the provided ID,
|
|
127
|
-
|
|
109
|
+
corresponding sections from a Plain document, and existing files' content.
|
|
128
110
|
|
|
129
111
|
Args:
|
|
130
112
|
frid (str): The unique identifier for the functional requirement to be rendered.
|
|
131
113
|
plain_source_tree (dict): A dictionary containing the plain source tree.
|
|
132
|
-
linked_resources (dict): A dictionary where the keys represent
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
114
|
+
linked_resources (dict): A dictionary where the keys represent filenames of linked
|
|
115
|
+
resources and the values are dictionaries containing
|
|
116
|
+
the content of the linked resources and the sections
|
|
117
|
+
they are linked to.
|
|
118
|
+
existing_files_content (dict): A dictionary where the keys represent filenames
|
|
119
|
+
and the values are the content of those files.
|
|
120
|
+
memory_files_content (dict): A dictionary where the keys represent memory filenames
|
|
121
|
+
and the values are the content of those files.
|
|
122
|
+
module_name (str): The name of the module to render the functional requirement for.
|
|
123
|
+
required_modules (dict): A dictionary where the keys represent module names
|
|
124
|
+
and the values are lists of functionalities implemented in those modules.
|
|
125
|
+
run_state (RunState): The current state of the rendering process.
|
|
137
126
|
Returns:
|
|
138
|
-
str: A
|
|
139
|
-
|
|
127
|
+
dict[str, str]: A dictionary where the keys are filenames and the values
|
|
128
|
+
are the rendered code for those files.
|
|
140
129
|
|
|
141
130
|
Raises:
|
|
142
|
-
ValueError: If the frid is invalid or the necessary
|
|
131
|
+
ValueError: If the frid is invalid or the necessary sections cannot be found.
|
|
143
132
|
"""
|
|
144
133
|
endpoint_url = f"{self.api_url}/render_functional_requirement"
|
|
145
134
|
headers = {"X-API-Key": self.api_key, "Content-Type": "application/json"}
|
|
@@ -149,6 +138,9 @@ class CodeplainAPI:
|
|
|
149
138
|
"plain_source_tree": plain_source_tree,
|
|
150
139
|
"linked_resources": linked_resources,
|
|
151
140
|
"existing_files_content": existing_files_content,
|
|
141
|
+
"memory_files_content": memory_files_content,
|
|
142
|
+
"module_name": module_name,
|
|
143
|
+
"required_modules": required_modules,
|
|
152
144
|
}
|
|
153
145
|
|
|
154
146
|
return self.post_request(endpoint_url, headers, payload, run_state)
|
|
@@ -159,6 +151,8 @@ class CodeplainAPI:
|
|
|
159
151
|
plain_source_tree,
|
|
160
152
|
linked_resources,
|
|
161
153
|
existing_files_content,
|
|
154
|
+
module_name: str,
|
|
155
|
+
required_modules,
|
|
162
156
|
unittests_issue,
|
|
163
157
|
run_state: RunState,
|
|
164
158
|
):
|
|
@@ -170,12 +164,52 @@ class CodeplainAPI:
|
|
|
170
164
|
"plain_source_tree": plain_source_tree,
|
|
171
165
|
"linked_resources": linked_resources,
|
|
172
166
|
"existing_files_content": existing_files_content,
|
|
167
|
+
"module_name": module_name,
|
|
168
|
+
"required_modules": required_modules,
|
|
173
169
|
"unittests_issue": unittests_issue,
|
|
174
170
|
"unittest_batch_id": run_state.unittest_batch_id,
|
|
175
171
|
}
|
|
176
172
|
|
|
177
173
|
return self.post_request(endpoint_url, headers, payload, run_state)
|
|
178
174
|
|
|
175
|
+
def create_conformance_test_memory(
|
|
176
|
+
self,
|
|
177
|
+
frid,
|
|
178
|
+
plain_source_tree,
|
|
179
|
+
linked_resources,
|
|
180
|
+
existing_files_content,
|
|
181
|
+
memory_files_content,
|
|
182
|
+
module_name,
|
|
183
|
+
required_modules,
|
|
184
|
+
code_diff,
|
|
185
|
+
conformance_tests_files,
|
|
186
|
+
acceptance_tests,
|
|
187
|
+
conformance_tests_issue,
|
|
188
|
+
conformance_tests_folder_name,
|
|
189
|
+
previous_conformance_tests_issue_old,
|
|
190
|
+
run_state: RunState,
|
|
191
|
+
):
|
|
192
|
+
endpoint_url = f"{self.api_url}/create_conformance_test_memory"
|
|
193
|
+
headers = {"X-API-Key": self.api_key, "Content-Type": "application/json"}
|
|
194
|
+
|
|
195
|
+
payload = {
|
|
196
|
+
"frid": frid,
|
|
197
|
+
"plain_source_tree": plain_source_tree,
|
|
198
|
+
"linked_resources": linked_resources,
|
|
199
|
+
"existing_files_content": existing_files_content,
|
|
200
|
+
"memory_files_content": memory_files_content,
|
|
201
|
+
"module_name": module_name,
|
|
202
|
+
"required_modules": required_modules,
|
|
203
|
+
"code_diff": code_diff,
|
|
204
|
+
"conformance_tests_files": conformance_tests_files,
|
|
205
|
+
"acceptance_tests": acceptance_tests,
|
|
206
|
+
"conformance_tests_issue": conformance_tests_issue,
|
|
207
|
+
"conformance_tests_folder_name": conformance_tests_folder_name,
|
|
208
|
+
"previous_conformance_tests_issue": previous_conformance_tests_issue_old,
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
return self.post_request(endpoint_url, headers, payload, run_state)
|
|
212
|
+
|
|
179
213
|
def refactor_source_files_if_needed(self, frid, files_to_check, existing_files_content, run_state: RunState):
|
|
180
214
|
endpoint_url = f"{self.api_url}/refactor_source_files_if_needed"
|
|
181
215
|
headers = {"X-API-Key": self.api_key, "Content-Type": "application/json"}
|
|
@@ -195,6 +229,9 @@ class CodeplainAPI:
|
|
|
195
229
|
plain_source_tree,
|
|
196
230
|
linked_resources,
|
|
197
231
|
existing_files_content,
|
|
232
|
+
memory_files_content,
|
|
233
|
+
module_name: str,
|
|
234
|
+
required_modules,
|
|
198
235
|
conformance_tests_folder_name,
|
|
199
236
|
conformance_tests_json,
|
|
200
237
|
all_acceptance_tests,
|
|
@@ -209,6 +246,9 @@ class CodeplainAPI:
|
|
|
209
246
|
"plain_source_tree": plain_source_tree,
|
|
210
247
|
"linked_resources": linked_resources,
|
|
211
248
|
"existing_files_content": existing_files_content,
|
|
249
|
+
"memory_files_content": memory_files_content,
|
|
250
|
+
"module_name": module_name,
|
|
251
|
+
"required_modules": required_modules,
|
|
212
252
|
"conformance_tests_folder_name": conformance_tests_folder_name,
|
|
213
253
|
"conformance_tests_json": conformance_tests_json,
|
|
214
254
|
"all_acceptance_tests": all_acceptance_tests,
|
|
@@ -242,6 +282,10 @@ class CodeplainAPI:
|
|
|
242
282
|
plain_source_tree,
|
|
243
283
|
linked_resources,
|
|
244
284
|
existing_files_content,
|
|
285
|
+
memory_files_content,
|
|
286
|
+
module_name: str,
|
|
287
|
+
conformance_tests_module_name: str,
|
|
288
|
+
required_modules,
|
|
245
289
|
code_diff,
|
|
246
290
|
conformance_tests_files,
|
|
247
291
|
acceptance_tests,
|
|
@@ -260,6 +304,10 @@ class CodeplainAPI:
|
|
|
260
304
|
"plain_source_tree": plain_source_tree,
|
|
261
305
|
"linked_resources": linked_resources,
|
|
262
306
|
"existing_files_content": existing_files_content,
|
|
307
|
+
"memory_files_content": memory_files_content,
|
|
308
|
+
"module_name": module_name,
|
|
309
|
+
"conformance_tests_module_name": conformance_tests_module_name,
|
|
310
|
+
"required_modules": required_modules,
|
|
263
311
|
"code_diff": code_diff,
|
|
264
312
|
"conformance_tests_files": conformance_tests_files,
|
|
265
313
|
"conformance_tests_issue": conformance_tests_issue,
|
|
@@ -279,7 +327,10 @@ class CodeplainAPI:
|
|
|
279
327
|
plain_source_tree,
|
|
280
328
|
linked_resources,
|
|
281
329
|
existing_files_content,
|
|
330
|
+
memory_files_content,
|
|
282
331
|
conformance_tests_files,
|
|
332
|
+
module_name: str,
|
|
333
|
+
required_modules,
|
|
283
334
|
acceptance_test,
|
|
284
335
|
run_state: RunState,
|
|
285
336
|
):
|
|
@@ -293,7 +344,11 @@ class CodeplainAPI:
|
|
|
293
344
|
and the values are the content of those resources.
|
|
294
345
|
existing_files_content (dict): A dictionary where the keys represent code base
|
|
295
346
|
filenames and the values are the content of those files.
|
|
347
|
+
memory_files_content (dict): A dictionary where the keys represent memory filenames
|
|
348
|
+
and the values are the content of those files.
|
|
296
349
|
conformance_tests_files (dict): A dictionary containing conformance test files.
|
|
350
|
+
required_modules (dict): A dictionary where the keys represent module names
|
|
351
|
+
and the values are lists of functionalities implemented in those modules.
|
|
297
352
|
acceptance_test (dict): A dictionary containing acceptance test information.
|
|
298
353
|
|
|
299
354
|
Returns:
|
|
@@ -310,7 +365,10 @@ class CodeplainAPI:
|
|
|
310
365
|
"plain_source_tree": plain_source_tree,
|
|
311
366
|
"linked_resources": linked_resources,
|
|
312
367
|
"existing_files_content": existing_files_content,
|
|
368
|
+
"memory_files_content": memory_files_content,
|
|
313
369
|
"conformance_tests_files": conformance_tests_files,
|
|
370
|
+
"module_name": module_name,
|
|
371
|
+
"required_modules": required_modules,
|
|
314
372
|
"acceptance_test": acceptance_test,
|
|
315
373
|
}
|
|
316
374
|
|
|
@@ -322,6 +380,8 @@ class CodeplainAPI:
|
|
|
322
380
|
plain_source_tree,
|
|
323
381
|
linked_resources,
|
|
324
382
|
existing_files_content,
|
|
383
|
+
module_name: str,
|
|
384
|
+
required_modules,
|
|
325
385
|
implementation_code_diff,
|
|
326
386
|
fixed_implementation_code_diff,
|
|
327
387
|
run_state: RunState,
|
|
@@ -334,6 +394,8 @@ class CodeplainAPI:
|
|
|
334
394
|
"plain_source_tree": plain_source_tree,
|
|
335
395
|
"linked_resources": linked_resources,
|
|
336
396
|
"existing_files_content": existing_files_content,
|
|
397
|
+
"module_name": module_name,
|
|
398
|
+
"required_modules": required_modules,
|
|
337
399
|
"implementation_code_diff": implementation_code_diff,
|
|
338
400
|
"fixed_implementation_code_diff": fixed_implementation_code_diff,
|
|
339
401
|
}
|
|
@@ -350,12 +412,24 @@ class CodeplainAPI:
|
|
|
350
412
|
|
|
351
413
|
return self.post_request(endpoint_url, headers, payload, run_state)
|
|
352
414
|
|
|
415
|
+
def fail_functional_requirement(self, frid, run_state: RunState):
|
|
416
|
+
endpoint_url = f"{self.api_url}/fail_functional_requirement"
|
|
417
|
+
headers = {"X-API-Key": self.api_key, "Content-Type": "application/json"}
|
|
418
|
+
|
|
419
|
+
payload = {
|
|
420
|
+
"frid": frid,
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
return self.post_request(endpoint_url, headers, payload, run_state)
|
|
424
|
+
|
|
353
425
|
def summarize_finished_conformance_tests(
|
|
354
426
|
self,
|
|
355
427
|
frid,
|
|
356
428
|
plain_source_tree,
|
|
357
429
|
linked_resources,
|
|
358
430
|
conformance_test_files_content,
|
|
431
|
+
module_name: str,
|
|
432
|
+
required_modules,
|
|
359
433
|
run_state: RunState,
|
|
360
434
|
):
|
|
361
435
|
endpoint_url = f"{self.api_url}/summarize_finished_conformance_tests"
|
|
@@ -365,6 +439,8 @@ class CodeplainAPI:
|
|
|
365
439
|
"plain_source_tree": plain_source_tree,
|
|
366
440
|
"linked_resources": linked_resources,
|
|
367
441
|
"conformance_test_files_content": conformance_test_files_content,
|
|
442
|
+
"module_name": module_name,
|
|
443
|
+
"required_modules": required_modules,
|
|
368
444
|
}
|
|
369
445
|
|
|
370
446
|
return self.post_request(endpoint_url, headers, payload, run_state)
|