ara-cli 0.1.9.69__py3-none-any.whl → 0.1.10.8__py3-none-any.whl

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.

Potentially problematic release.


This version of ara-cli might be problematic. Click here for more details.

Files changed (150) hide show
  1. ara_cli/__init__.py +18 -2
  2. ara_cli/__main__.py +248 -62
  3. ara_cli/ara_command_action.py +155 -86
  4. ara_cli/ara_config.py +226 -80
  5. ara_cli/ara_subcommands/__init__.py +0 -0
  6. ara_cli/ara_subcommands/autofix.py +26 -0
  7. ara_cli/ara_subcommands/chat.py +27 -0
  8. ara_cli/ara_subcommands/classifier_directory.py +16 -0
  9. ara_cli/ara_subcommands/common.py +100 -0
  10. ara_cli/ara_subcommands/create.py +75 -0
  11. ara_cli/ara_subcommands/delete.py +22 -0
  12. ara_cli/ara_subcommands/extract.py +22 -0
  13. ara_cli/ara_subcommands/fetch_templates.py +14 -0
  14. ara_cli/ara_subcommands/list.py +65 -0
  15. ara_cli/ara_subcommands/list_tags.py +25 -0
  16. ara_cli/ara_subcommands/load.py +48 -0
  17. ara_cli/ara_subcommands/prompt.py +136 -0
  18. ara_cli/ara_subcommands/read.py +47 -0
  19. ara_cli/ara_subcommands/read_status.py +20 -0
  20. ara_cli/ara_subcommands/read_user.py +20 -0
  21. ara_cli/ara_subcommands/reconnect.py +27 -0
  22. ara_cli/ara_subcommands/rename.py +22 -0
  23. ara_cli/ara_subcommands/scan.py +14 -0
  24. ara_cli/ara_subcommands/set_status.py +22 -0
  25. ara_cli/ara_subcommands/set_user.py +22 -0
  26. ara_cli/ara_subcommands/template.py +16 -0
  27. ara_cli/artefact_autofix.py +649 -68
  28. ara_cli/artefact_creator.py +8 -11
  29. ara_cli/artefact_deleter.py +2 -4
  30. ara_cli/artefact_fuzzy_search.py +22 -10
  31. ara_cli/artefact_link_updater.py +4 -4
  32. ara_cli/artefact_lister.py +29 -55
  33. ara_cli/artefact_models/artefact_data_retrieval.py +23 -0
  34. ara_cli/artefact_models/artefact_load.py +11 -3
  35. ara_cli/artefact_models/artefact_model.py +146 -39
  36. ara_cli/artefact_models/artefact_templates.py +70 -44
  37. ara_cli/artefact_models/businessgoal_artefact_model.py +23 -25
  38. ara_cli/artefact_models/epic_artefact_model.py +34 -26
  39. ara_cli/artefact_models/feature_artefact_model.py +203 -64
  40. ara_cli/artefact_models/keyfeature_artefact_model.py +21 -24
  41. ara_cli/artefact_models/serialize_helper.py +1 -1
  42. ara_cli/artefact_models/task_artefact_model.py +83 -15
  43. ara_cli/artefact_models/userstory_artefact_model.py +37 -27
  44. ara_cli/artefact_models/vision_artefact_model.py +23 -42
  45. ara_cli/artefact_reader.py +92 -91
  46. ara_cli/artefact_renamer.py +8 -4
  47. ara_cli/artefact_scan.py +66 -3
  48. ara_cli/chat.py +622 -162
  49. ara_cli/chat_agent/__init__.py +0 -0
  50. ara_cli/chat_agent/agent_communicator.py +62 -0
  51. ara_cli/chat_agent/agent_process_manager.py +211 -0
  52. ara_cli/chat_agent/agent_status_manager.py +73 -0
  53. ara_cli/chat_agent/agent_workspace_manager.py +76 -0
  54. ara_cli/commands/__init__.py +0 -0
  55. ara_cli/commands/command.py +7 -0
  56. ara_cli/commands/extract_command.py +15 -0
  57. ara_cli/commands/load_command.py +65 -0
  58. ara_cli/commands/load_image_command.py +34 -0
  59. ara_cli/commands/read_command.py +117 -0
  60. ara_cli/completers.py +144 -0
  61. ara_cli/directory_navigator.py +37 -4
  62. ara_cli/error_handler.py +134 -0
  63. ara_cli/file_classifier.py +6 -5
  64. ara_cli/file_lister.py +1 -1
  65. ara_cli/file_loaders/__init__.py +0 -0
  66. ara_cli/file_loaders/binary_file_loader.py +33 -0
  67. ara_cli/file_loaders/document_file_loader.py +34 -0
  68. ara_cli/file_loaders/document_reader.py +245 -0
  69. ara_cli/file_loaders/document_readers.py +233 -0
  70. ara_cli/file_loaders/file_loader.py +50 -0
  71. ara_cli/file_loaders/file_loaders.py +123 -0
  72. ara_cli/file_loaders/image_processor.py +89 -0
  73. ara_cli/file_loaders/markdown_reader.py +75 -0
  74. ara_cli/file_loaders/text_file_loader.py +187 -0
  75. ara_cli/global_file_lister.py +51 -0
  76. ara_cli/list_filter.py +1 -1
  77. ara_cli/output_suppressor.py +1 -1
  78. ara_cli/prompt_extractor.py +215 -88
  79. ara_cli/prompt_handler.py +521 -134
  80. ara_cli/prompt_rag.py +2 -2
  81. ara_cli/tag_extractor.py +83 -38
  82. ara_cli/template_loader.py +245 -0
  83. ara_cli/template_manager.py +18 -13
  84. ara_cli/templates/prompt-modules/commands/empty.commands.md +2 -12
  85. ara_cli/templates/prompt-modules/commands/extract_general.commands.md +12 -0
  86. ara_cli/templates/prompt-modules/commands/extract_markdown.commands.md +11 -0
  87. ara_cli/templates/prompt-modules/commands/extract_python.commands.md +13 -0
  88. ara_cli/templates/prompt-modules/commands/feature_add_or_modifiy_specified_behavior.commands.md +36 -0
  89. ara_cli/templates/prompt-modules/commands/feature_generate_initial_specified_bevahior.commands.md +53 -0
  90. ara_cli/templates/prompt-modules/commands/prompt_template_tech_stack_transformer.commands.md +95 -0
  91. ara_cli/templates/prompt-modules/commands/python_bug_fixing_code.commands.md +34 -0
  92. ara_cli/templates/prompt-modules/commands/python_generate_code.commands.md +27 -0
  93. ara_cli/templates/prompt-modules/commands/python_refactoring_code.commands.md +39 -0
  94. ara_cli/templates/prompt-modules/commands/python_step_definitions_generation_and_fixing.commands.md +40 -0
  95. ara_cli/templates/prompt-modules/commands/python_unittest_generation_and_fixing.commands.md +48 -0
  96. ara_cli/update_config_prompt.py +9 -3
  97. ara_cli/version.py +1 -1
  98. ara_cli-0.1.10.8.dist-info/METADATA +241 -0
  99. ara_cli-0.1.10.8.dist-info/RECORD +193 -0
  100. tests/test_ara_command_action.py +73 -59
  101. tests/test_ara_config.py +341 -36
  102. tests/test_artefact_autofix.py +1060 -0
  103. tests/test_artefact_link_updater.py +3 -3
  104. tests/test_artefact_lister.py +52 -132
  105. tests/test_artefact_renamer.py +2 -2
  106. tests/test_artefact_scan.py +327 -33
  107. tests/test_chat.py +2063 -498
  108. tests/test_file_classifier.py +24 -1
  109. tests/test_file_creator.py +3 -5
  110. tests/test_file_lister.py +1 -1
  111. tests/test_global_file_lister.py +131 -0
  112. tests/test_list_filter.py +2 -2
  113. tests/test_prompt_handler.py +746 -0
  114. tests/test_tag_extractor.py +19 -13
  115. tests/test_template_loader.py +192 -0
  116. tests/test_template_manager.py +5 -4
  117. tests/test_update_config_prompt.py +2 -2
  118. ara_cli/ara_command_parser.py +0 -327
  119. ara_cli/templates/prompt-modules/blueprints/complete_pytest_unittest.blueprint.md +0 -27
  120. ara_cli/templates/prompt-modules/blueprints/task_todo_list_implement_feature_BDD_way.blueprint.md +0 -30
  121. ara_cli/templates/prompt-modules/commands/artefact_classification.commands.md +0 -9
  122. ara_cli/templates/prompt-modules/commands/artefact_extension.commands.md +0 -17
  123. ara_cli/templates/prompt-modules/commands/artefact_formulation.commands.md +0 -14
  124. ara_cli/templates/prompt-modules/commands/behave_step_generation.commands.md +0 -102
  125. ara_cli/templates/prompt-modules/commands/code_generation_complex.commands.md +0 -20
  126. ara_cli/templates/prompt-modules/commands/code_generation_simple.commands.md +0 -13
  127. ara_cli/templates/prompt-modules/commands/error_fixing.commands.md +0 -20
  128. ara_cli/templates/prompt-modules/commands/feature_file_update.commands.md +0 -18
  129. ara_cli/templates/prompt-modules/commands/feature_formulation.commands.md +0 -43
  130. ara_cli/templates/prompt-modules/commands/js_code_generation_simple.commands.md +0 -13
  131. ara_cli/templates/prompt-modules/commands/refactoring.commands.md +0 -15
  132. ara_cli/templates/prompt-modules/commands/refactoring_analysis.commands.md +0 -9
  133. ara_cli/templates/prompt-modules/commands/reverse_engineer_feature_file.commands.md +0 -15
  134. ara_cli/templates/prompt-modules/commands/reverse_engineer_program_flow.commands.md +0 -19
  135. ara_cli/templates/template.businessgoal +0 -10
  136. ara_cli/templates/template.capability +0 -10
  137. ara_cli/templates/template.epic +0 -15
  138. ara_cli/templates/template.example +0 -6
  139. ara_cli/templates/template.feature +0 -26
  140. ara_cli/templates/template.issue +0 -14
  141. ara_cli/templates/template.keyfeature +0 -15
  142. ara_cli/templates/template.task +0 -6
  143. ara_cli/templates/template.userstory +0 -17
  144. ara_cli/templates/template.vision +0 -14
  145. ara_cli-0.1.9.69.dist-info/METADATA +0 -16
  146. ara_cli-0.1.9.69.dist-info/RECORD +0 -158
  147. tests/test_ara_autofix.py +0 -219
  148. {ara_cli-0.1.9.69.dist-info → ara_cli-0.1.10.8.dist-info}/WHEEL +0 -0
  149. {ara_cli-0.1.9.69.dist-info → ara_cli-0.1.10.8.dist-info}/entry_points.txt +0 -0
  150. {ara_cli-0.1.9.69.dist-info → ara_cli-0.1.10.8.dist-info}/top_level.txt +0 -0
@@ -1,158 +0,0 @@
1
- ara_cli/__init__.py,sha256=0zl7IegxTid26EBGLav_fXZ4CCIV3H5TfAoFQiOHjvg,148
2
- ara_cli/__main__.py,sha256=Z6XYWRLceIoZPvfC-X9EXouSZdtFOOe84kKVWJGA4r4,1861
3
- ara_cli/ara_command_action.py,sha256=dD97IeH7x5udKC_APk5TbuVXPiyU2XSBV2uqy52nQ9A,21625
4
- ara_cli/ara_command_parser.py,sha256=v8LUdkBSI2771gI53PdrxtD8YVjhk-7E8vgTEsTGnRM,17952
5
- ara_cli/ara_config.py,sha256=gOeaFR5Bkxk1EbN7qvJuHeaLICgy7irCREOIQD6_98M,3832
6
- ara_cli/artefact_autofix.py,sha256=-7XHl7j5O1kwWeBeIybnA4CI8v6SlXRNkV1KQ9nSWLQ,6817
7
- ara_cli/artefact_creator.py,sha256=tUNCNvfFYMheyF_viyrQhm2-43AkbHFoQaHui9ntvws,6002
8
- ara_cli/artefact_deleter.py,sha256=Co4wwCH3yW8H9NrOq7_2p5571EeHr0TsfE-H8KqoOfY,1900
9
- ara_cli/artefact_fuzzy_search.py,sha256=BBDe-IP75sWZjG6nTNFtVljjL01JlQUy5ccJBZ6Trow,2429
10
- ara_cli/artefact_link_updater.py,sha256=itMS_Z64jE8bBly9WA01z8PqkBeNW6ntTO7ryMeCTRg,3703
11
- ara_cli/artefact_lister.py,sha256=jhk4n4eqp7hDIq07q43QzS7-36BM3OfZ4EABxCeOGcw,4764
12
- ara_cli/artefact_reader.py,sha256=_RqBY1f1DWH2DThXETYuHeTB2ip0wgYuGvHYI_D6EJ4,8062
13
- ara_cli/artefact_renamer.py,sha256=loIn1DF9kVnjhH7wP1v5qUvt3s0uKeWXuQPrHXenQGE,4025
14
- ara_cli/artefact_scan.py,sha256=J3aCAOltVr1oS6Lwnv51gtZC_G8faORGTccFY3kkBX4,2368
15
- ara_cli/chat.py,sha256=7xTtPEDk052_wmIzoti7GavEJ1vpRxe5c084WQ1C7dg,28617
16
- ara_cli/classifier.py,sha256=zWskj7rBYdqYBGjksBm46iTgVU5IIf2PZsJr4qeiwVU,1878
17
- ara_cli/codefusionretriever.py,sha256=fCHgXdIBRzkVAnapX-KI2NQ44XbrrF4tEQmn5J6clUI,1980
18
- ara_cli/codehierachieretriever.py,sha256=Xd3EgEWWhkSf1TmTWtf8X5_YvyE_4B66nRrqarwSiTU,1182
19
- ara_cli/commandline_completer.py,sha256=b00Dqb5n7SecpxYIDLxAfYhp8X6e3c8a5qYz6ko0i3E,1192
20
- ara_cli/directory_navigator.py,sha256=6QbSAjJrJ5a6Lutol9J4HFgVDMiAQ672ny9TATrh04U,3318
21
- ara_cli/file_classifier.py,sha256=JsY7Y_D8WL-fiWz57zwzttg6SEajxWVxpDkFG_149-Q,3967
22
- ara_cli/file_lister.py,sha256=VFpUmHU1d6sQvJWSeuFqkZZ0Ci3ZYCUtAUfvgWypaYU,2314
23
- ara_cli/filename_validator.py,sha256=Aw9PL8d5-Ymhp3EY6lDrUBk3cudaNqo1Uw5RzPpI1jA,118
24
- ara_cli/list_filter.py,sha256=Not17hIngI37gZsLtIKxopB-BmyWoOGlBzSqBwh-Zpc,5273
25
- ara_cli/output_suppressor.py,sha256=ZByUwLH2DxOb-eJ31KQbtIziBKdykoyxvwxZ0tSammA,371
26
- ara_cli/prompt_chat.py,sha256=kd_OINDQFit6jN04bb7mzgY259JBbRaTaNp9F-webkc,1346
27
- ara_cli/prompt_extractor.py,sha256=a8LwPj6U8sG_v3SqDXQyPvDZQds4kHnYSO8eGissYJA,7503
28
- ara_cli/prompt_handler.py,sha256=eUkiA4CnBlSBQPZRQ78i7HqllvIDYlJgrSqQmwQHtp8,17621
29
- ara_cli/prompt_rag.py,sha256=vmlt4-rSboWibwgO_KUF79TK99YXT5KXjmbD9FeWdZY,7449
30
- ara_cli/run_file_lister.py,sha256=XbrrDTJXp1LFGx9Lv91SNsEHZPP-PyEMBF_P4btjbDA,2360
31
- ara_cli/tag_extractor.py,sha256=4krQyvmLR2ffhe7N7lWC7QjaxXcb90HaQdmjnBiD8ak,2523
32
- ara_cli/template_manager.py,sha256=YXPj2jGNDb-diIHFEK_vGJ-ZucodnXSGAPofKTnOofI,6633
33
- ara_cli/update_config_prompt.py,sha256=PZgNIN3dTw6p80GyX8Sp5apkAhSoykwnkEbHo3IOkUo,4571
34
- ara_cli/version.py,sha256=47jiKD51bfE-X5CaysuEIPJuxXII3Vvv_DNLT7glr-I,146
35
- ara_cli/artefact_models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
- ara_cli/artefact_models/artefact_load.py,sha256=dNcwZDW2Dk0bts9YnPZ0ESmWD2NbsLIvl4Z-qQeGmTQ,401
37
- ara_cli/artefact_models/artefact_mapping.py,sha256=8aD0spBjkJ8toMAmFawc6UTUxB6-tEEViZXv2I-r88Q,1874
38
- ara_cli/artefact_models/artefact_model.py,sha256=nZZS6WyVuODblLnVTH6VZli--eFrDiwNMtjwHTs2KBI,14703
39
- ara_cli/artefact_models/artefact_templates.py,sha256=Vd7SwoRVKNGKZmxBKS6f9FE1ThUOCqZLScu0ClPfIu8,8321
40
- ara_cli/artefact_models/businessgoal_artefact_model.py,sha256=jqYFMXjWle0YW9RvcFLDBAwy61bdT5VuDT_6lTOFzMw,4853
41
- ara_cli/artefact_models/capability_artefact_model.py,sha256=SZqHx4O2mj4urn77Stnj4_Jxtlq3-LgBBU9SMkByppI,3079
42
- ara_cli/artefact_models/epic_artefact_model.py,sha256=IadQWs6SWNcLgwvtOQWmYDyV9xLr3WwAsx-YMFan5fA,5765
43
- ara_cli/artefact_models/example_artefact_model.py,sha256=UXrKbaPotg1jwcrVSdCeo-XH4tTD_-U1e3giaBn5_xg,1384
44
- ara_cli/artefact_models/feature_artefact_model.py,sha256=BeLsq9ZinzIDwss8nurIbxJZQ2qPgyRKRHrRlrl-zHA,15583
45
- ara_cli/artefact_models/issue_artefact_model.py,sha256=v6CpKnkqiUh6Wch2kkEmyyW49c8ysdy1qz8l1Ft9uJA,2552
46
- ara_cli/artefact_models/keyfeature_artefact_model.py,sha256=a3MyAiePN9n_GTN6QkTvamdsaorwVUff6w-9CdRZSlo,4243
47
- ara_cli/artefact_models/serialize_helper.py,sha256=0XCruO70-fyfLfTn7pnt8NrSQe79eYNUAjuQaV8K6_8,586
48
- ara_cli/artefact_models/task_artefact_model.py,sha256=kHMw_Tr-Ud3EeHWpRWy4jI0xFnPzGZ-FT52c5rSrT1k,3558
49
- ara_cli/artefact_models/userstory_artefact_model.py,sha256=u6G8wdeE2EpOsg1OPR-s8uShB4A77GfqN0vkSSuthFI,6582
50
- ara_cli/artefact_models/vision_artefact_model.py,sha256=KcNE3QQjyT29ZMMhCQo4pOcXKTkI6pXLvyfqoN2kuUQ,5920
51
- ara_cli/templates/agile.artefacts,sha256=nTA8dp98HWKAD-0qhmNpVYIfkVGoJshZqMJGnphiOsE,7932
52
- ara_cli/templates/template.businessgoal,sha256=3OU-y8dOCRbRsB9ovBzwFPxHSbG0dqbkok0uJnZIOd4,524
53
- ara_cli/templates/template.businessgoal.prompt_log.md,sha256=xF6bkgj_GqAAqHxJWJiQNt11mEuSGemIqoZ2wOo6dI0,214
54
- ara_cli/templates/template.capability,sha256=NZ7ZhwXqD9ZHwTAHxgPxfZWYicW_BvoU_onBHsMOlpQ,487
55
- ara_cli/templates/template.capability.prompt_log.md,sha256=eO8EzrHgb2vYJ-DP1jGzAfDlMo8nY75hZDfhh0s40uQ,208
56
- ara_cli/templates/template.epic,sha256=8dO4KYBB6Tdg9k0KOZWFZXQmUR8RRwBNCo85sMhOARE,632
57
- ara_cli/templates/template.epic.prompt_log.md,sha256=70MeWRL8Yl64eXwxPFG9KeMeoSziB2O0vv-tYLI8B3g,190
58
- ara_cli/templates/template.example,sha256=TXZCb5yVNINlEbrtcyjRqtLoHN0llvSxSqKfL-45r3w,386
59
- ara_cli/templates/template.example.prompt_log.md,sha256=PiLVx-tE0FqtLcXMsOvgCFDHIQ0EkOYhZRweJL49kHo,199
60
- ara_cli/templates/template.feature,sha256=h8PSBEJgfPPKlBPrE7tAI_8RamIriVdqI7GWRytlJRg,1066
61
- ara_cli/templates/template.feature.prompt_log.md,sha256=8xJUgCnYf18cmlDu90r2mF0039g2QOd38B7ZYg2Aefg,199
62
- ara_cli/templates/template.issue,sha256=Bzk_3m8yKDfV-BpNPmdDO3qoOCZ_gK6Yx84Bf2vaOJU,722
63
- ara_cli/templates/template.issue.prompt_log.md,sha256=dqO26R1xlftqb6nf_BLTEfCZx60yDKqqJZzEluB4Qco,193
64
- ara_cli/templates/template.keyfeature,sha256=2naABQSAvvyJDr3rqzq1a3MkqSUjaKopqiN2GJGRfmg,761
65
- ara_cli/templates/template.keyfeature.prompt_log.md,sha256=VUXZ72Z7KQ9Gp7NR_uWNVa3qSDqFflbNZay_02-X9DY,208
66
- ara_cli/templates/template.steps.prompt_log.md,sha256=sd8g1KtwgpPvU-vGWAFCDXiWHk6glRQlno5yrRN02_8,193
67
- ara_cli/templates/template.task,sha256=t6Lis-nP425XR5CuCG3l8qfTxSt-9zWjdcA9i8Id_ek,435
68
- ara_cli/templates/template.task.prompt_log.md,sha256=4kAy1zC0k3_y3SoYb-mg3rQEJCW_c43X7ggOLZ321TE,190
69
- ara_cli/templates/template.userstory,sha256=x6fouctaYl6I9gAyR8KXLVXec7oUT4uFm4EcvYMrwkM,679
70
- ara_cli/templates/template.userstory.prompt_log.md,sha256=Yp62iF7zDy2XNIwwJN35jKKSmezinK_JKbSvVuagtmA,205
71
- ara_cli/templates/template.vision,sha256=FZYcXUZtFOLvk0H1UEMhrJrDWZnS2CSmDv9feMkyYjU,594
72
- ara_cli/templates/template.vision.prompt_log.md,sha256=CAzBzj3O23CzrPIUq3xzpXGKn3_nAvyBLRUi-5Bnq_0,196
73
- ara_cli/templates/prompt-modules/blueprints/complete_pytest_unittest.blueprint.md,sha256=LEK9cfOPCxqVNMRJhdyBqSpCsl9mD7H_1QkVyqIKlCY,613
74
- ara_cli/templates/prompt-modules/blueprints/empty.blueprint.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
- ara_cli/templates/prompt-modules/blueprints/task_todo_list_C4_architecture_analysis.blueprint.md,sha256=jEZrZaVK_pkRhLp1SpTX3xR6BGXkox6NafXEjX_GDvM,3099
76
- ara_cli/templates/prompt-modules/blueprints/task_todo_list_implement_feature_BDD_way.blueprint.md,sha256=EimfgzjhFIsZnJ0qMNbVlUQEU0vC9Sv1VupesLz7A1E,2088
77
- ara_cli/templates/prompt-modules/commands/architecture_C4_analysis.commands.md,sha256=xzfmOBsETlh90P1haJOiC8y8eLPboZ3yFodbuSUPLBU,1557
78
- ara_cli/templates/prompt-modules/commands/architecture_radon_cc_score.commands.md,sha256=t-cozhSQPGUOoYfdySBL4n-yQykvCc4s5n0AKpKCn0Q,3074
79
- ara_cli/templates/prompt-modules/commands/architecture_radon_halstead_v.commands.md,sha256=YBQKZdTJ4QRnBocsWTvT9dmaHOKys1hE0NJC7LPl2vQ,1676
80
- ara_cli/templates/prompt-modules/commands/architecture_radon_maintainability_score.commands.md,sha256=9nBsY_EYNI9GmD-KzbGKdtEDP4YoY7ECV2QWEzoznfc,5511
81
- ara_cli/templates/prompt-modules/commands/artefact_classification.commands.md,sha256=6qA0v-1_GYtI2UNIg1kzkidCOpLj1YqkeSL6PpvfK5Q,829
82
- ara_cli/templates/prompt-modules/commands/artefact_extension.commands.md,sha256=9nN3nZ9wl5eabtb1VrhH3qUsEC4kTD5yoc_woMejqd0,1060
83
- ara_cli/templates/prompt-modules/commands/artefact_formulation.commands.md,sha256=kB4mmVGraMuquqlWkC51Fqw9fara3U-82ldJlSBG3k0,797
84
- ara_cli/templates/prompt-modules/commands/behave_step_generation.commands.md,sha256=18Zzw_rhBY5Lyx_PrIUEGiidSLNCIgIUucUUQHVXFdo,4240
85
- ara_cli/templates/prompt-modules/commands/code_generation_complex.commands.md,sha256=gQE4JoXkEFWh9YyQBMrLjljT9WoGljRfpdFtUIbT4lw,1413
86
- ara_cli/templates/prompt-modules/commands/code_generation_simple.commands.md,sha256=_PX0Q108bgNqnxz4VKSkuaU2OiHS9eRMqXH2kO9d0E4,836
87
- ara_cli/templates/prompt-modules/commands/empty.commands.md,sha256=XynQO_CPitumyZ9ky6AvqeE00Kl5A3-VDa1MOoChd8c,807
88
- ara_cli/templates/prompt-modules/commands/error_fixing.commands.md,sha256=HaWY8djKQRB-CfCGVEndczBYsg_OSXnE6vDU7_LaU2o,1425
89
- ara_cli/templates/prompt-modules/commands/feature_file_update.commands.md,sha256=NEv95oef4p5H0qUjMkLnu1ljRGV0q4-lNUL1NAJbI-0,1611
90
- ara_cli/templates/prompt-modules/commands/feature_formulation.commands.md,sha256=8D9LfJYqUKBh-TKc-WFJT6v4m69VgKZAhplYysro29U,1754
91
- ara_cli/templates/prompt-modules/commands/js_code_generation_simple.commands.md,sha256=_j_gONkhJDXE5TUPTpyYlF45uZ4MSZG1LnoHlndnRGY,832
92
- ara_cli/templates/prompt-modules/commands/refactoring.commands.md,sha256=3I4df3oeGOrGPqnu_IvDSQNzNscYK1VbEpFxu8DwGrQ,932
93
- ara_cli/templates/prompt-modules/commands/refactoring_analysis.commands.md,sha256=RjMAa6rBCou0XGhu1-IFGy21EgcxSUkGWSCCqbw6CFw,1028
94
- ara_cli/templates/prompt-modules/commands/reverse_engineer_feature_file.commands.md,sha256=9togxxeBTcSvD5hLdBqyC-rUCF-xhU68PtD5rQySbFY,964
95
- ara_cli/templates/prompt-modules/commands/reverse_engineer_program_flow.commands.md,sha256=-pW71nV064aTfLTyYEnkH5eAaZPH3HRdOQsSxAfiNu8,1315
96
- ara_cli/templates/prompt-modules/intentions/classify_task.intention.md,sha256=9ZiEOBFiku24SX4kBJlSCgm5ScYlNZIcNPoHwtGbWIU,254
97
- ara_cli/templates/prompt-modules/intentions/empty.intention.md,sha256=6dqUtORC992KagZX2Up2yHHvBjVgDTj--wIyYbG4jhc,48
98
- ara_cli/templates/prompt-modules/intentions/error_fixing.intention.md,sha256=pcfG4csCF830lk8anDCkOA0ewTYnRo5mg0Y0w-fyEJU,206
99
- ara_cli/templates/prompt-modules/intentions/feature_fix_steps_for_scenario.intention.md,sha256=4rVHzCKvLdSyS4gCoyUEtF0L4BvdBB2UI7dHuhuk4W8,126
100
- ara_cli/templates/prompt-modules/intentions/feature_formulation.intention.md,sha256=VXQUPM0P-2Pwia_4O7cwy1Iu47ZJTudU2ZzwqvNw7ls,155
101
- ara_cli/templates/prompt-modules/intentions/feature_reverse_formulation_from_code.intention.md,sha256=iUTiqNT0fe35qrf9vLFOKev_3R232aTKmV8CKj_m0W4,92
102
- ara_cli/templates/prompt-modules/intentions/feature_scenario_implementation.intention.md,sha256=ZuJoiDFNFnjBFCwOnlZmwRxoVJ1Ie6VHkar7aZH4Wi4,201
103
- ara_cli/templates/prompt-modules/intentions/feature_scenario_implementation_update.intention.md,sha256=3KF9fD3Co9SjO9msXP0N_UsSuSfdLBGpr3NILfwAnnI,391
104
- ara_cli/templates/prompt-modules/intentions/feature_scenario_outline_extension.intention.md,sha256=GECphLzX8UbSUmI5aLr_OxdjjPLzwm4-xt6OTIz5xiI,140
105
- ara_cli/templates/prompt-modules/intentions/feature_update_formulation.intention.md,sha256=US3bo7K5yyXjUHHqA4fTojmUIWTxpmPrDXUv2BckUsQ,163
106
- ara_cli/templates/prompt-modules/intentions/fibonacci_example_implementation.intention.md,sha256=jGlhS7855wjdcIT6UODNsQ3oFfZY5Nm-Q8VdFQlfBBo,264
107
- ara_cli/templates/prompt-modules/intentions/js_implementation_from_task_description.intention.md,sha256=Nbg9_ttCAQV4N9f8W_hygkS4Rc47xPbGRC9nZcCDd1Q,207
108
- ara_cli/templates/prompt-modules/intentions/js_steps_implementation.intention.md,sha256=FcrpA_fbq1N8SUV0BQrk2g23CQ3Z8pjlSzJZtO9mr-A,247
109
- ara_cli/templates/prompt-modules/intentions/python_cli_implementation_with_test.intention.md,sha256=CmksBiOUlNMXF7Unc7Xmslj8eiVhzEPQc3qNoqIPNRw,215
110
- ara_cli/templates/prompt-modules/intentions/python_code_understanding.intention.md,sha256=J_kUmSYujLiBTP9l-ALQGdZW3fzO-V2SpYxjq4AsWmM,450
111
- ara_cli/templates/prompt-modules/intentions/task_implementation.intention.md,sha256=Jgkz4jrq6b8PYhA57HcM_c6sXZC2qThpQiDxB3JMEy8,198
112
- ara_cli/templates/prompt-modules/intentions/task_prompt_control_by_status.intention.md,sha256=ULzrmeo0Qc_JsxZ-Y_JilKsRRIHzNXrI-Zg_28Yz5PE,750
113
- ara_cli/templates/prompt-modules/intentions/task_stepwise_implementation_by_number.intention.md,sha256=a36x-q34YllznoalAVuFptvhqOHIBYdD8b0DrLEb-e0,208
114
- ara_cli/templates/prompt-modules/intentions/task_stepwise_implementation_by_status.intention.md,sha256=Vx9d9GSn4TITbLzf3Okk7rzWoDDqOjxEdlMXPLN4wKE,241
115
- ara_cli/templates/prompt-modules/rules/architecture_analyst.rules.md,sha256=LX2dqweuoeVKZhTteQYkFdtXI7jsQ5BGYPGU-bhJgwo,4649
116
- ara_cli/templates/prompt-modules/rules/code_analyst.rules.md,sha256=YQdqcDovuBU6a9r8qVObQDBtDqJhtYL0fRcjs_c8nA8,795
117
- ara_cli/templates/prompt-modules/rules/empty.rules.md,sha256=LDltJy8-KYHbK9BRhP7FXhOeq8jFTW6GbRAvFiehlDY,71
118
- ara_cli/templates/prompt-modules/rules/error_analyst.rules.md,sha256=KMSFO-qj5fEqWZZr7GwdyaJNyElfNBlXsy1xu2LEDDA,1054
119
- ara_cli/templates/prompt-modules/rules/gherkin_expert.rules.md,sha256=lbu839e29GCaw_s3-ENmjSdwf8pRBnAWf8e1JSx8PsE,1077
120
- ara_cli/templates/prompt-modules/rules/js_expert_developer.rules.md,sha256=KnymLhEZe-TWra-zUXPMA55WZsrJmHq4osVfWHHrZRA,814
121
- ara_cli/templates/prompt-modules/rules/product_owner.rules.md,sha256=NQYZ0JHOlssk6N_8MD5VEt5Aa-TKoqfzEpUQe9k4FlI,2201
122
- ara_cli/templates/prompt-modules/rules/python_behave.rules.md,sha256=0CG8S6W-lkLEu0zz2dFwxWCIgZM8QERlk4PCWybTMwA,1257
123
- ara_cli/templates/prompt-modules/rules/python_developer.rules.md,sha256=XkteyHS8wNdg4Kxtu45ca8q0kXUSBVEpDzqwNdis3fk,600
124
- ara_cli/templates/specification_breakdown_files/template.concept.exploration.md,sha256=Snti9j5CXMQb0799CQe-4MlLWTcathUVQQJWlvwPXBA,2117
125
- ara_cli/templates/specification_breakdown_files/template.concept.md,sha256=tyAZojoQF0Xn4BEOtEsT1PZlpPsQSUGsojnvjTqbxks,587
126
- ara_cli/templates/specification_breakdown_files/template.customer.exploration.md,sha256=mMd66EPkoCzpJH24CfOD5xBrovsdDX6OA_zQi0u8P_g,2273
127
- ara_cli/templates/specification_breakdown_files/template.customer.md,sha256=gaIhWIfk41e8P5Gpi1PeyIw9MzhiWB7YUgrA5vq4v-w,1460
128
- ara_cli/templates/specification_breakdown_files/template.persona.exploration.md,sha256=CAJ195w07xWSkNvssgAa_c3ub2f_XCBW0bi_dTns0r8,4183
129
- ara_cli/templates/specification_breakdown_files/template.persona.md,sha256=ujVzw2gzrr5IW8l4fjl0XjNB-JIKCL-SU20H_8YrVDc,2329
130
- ara_cli/templates/specification_breakdown_files/template.step.exploration.md,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
131
- ara_cli/templates/specification_breakdown_files/template.step.md,sha256=nzDRl9Xo-fJKeDKxIRh9njidV1SOd2ZOPi7eM3YG9DU,1052
132
- ara_cli/templates/specification_breakdown_files/template.technology.exploration.md,sha256=zQyiJcmbUfXdte-5uZwZUpT6ey0zwfZ00P4VwI97jQk,2274
133
- ara_cli/templates/specification_breakdown_files/template.technology.md,sha256=bySiksz-8xtq0Nnj4svqe2MgUftWrVkbK9AcrDUE3KY,952
134
- tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
135
- tests/test_ara_autofix.py,sha256=EFVzhVTNPDRVxpoK0CY6OAM88EjZTRXh-uxFGS1AVWk,10695
136
- tests/test_ara_command_action.py,sha256=Y5MrG6VjXgebliKfdFaCaS8i3GoZCGSLpj3AWCbL5Lk,25695
137
- tests/test_ara_config.py,sha256=1LWby_iSestTIIqK-1clggL8kmbGGbtlYfsxAHaMMF8,2232
138
- tests/test_artefact_fuzzy_search.py,sha256=5Sh3_l9QK8-WHn6JpGPU1b6h4QEnl2JoMq1Tdp2cj1U,1261
139
- tests/test_artefact_link_updater.py,sha256=gN5KFF1uY7OoBh8Mr5jWpqXp02YCU5OSIpSU76Rm4Gs,2137
140
- tests/test_artefact_lister.py,sha256=VCEOCgDgnAOeUUgIoGAbWgz60hf9UT-tdHg18LGfB34,22656
141
- tests/test_artefact_reader.py,sha256=660K-d8ed-j8hulsUB_7baPD2-hhbg9TffUR5yVc4Uo,927
142
- tests/test_artefact_renamer.py,sha256=N9JnnKBEJChTYEdltHoiDnn5UCNQUPj9H9YqOvLzbH0,3458
143
- tests/test_artefact_scan.py,sha256=7w4wqCj8VEwk676JiSqh0FCAOT-kFq624u2JDrhzpuw,5860
144
- tests/test_chat.py,sha256=-00mni6Kik_RO8BGUpWqaL4S0wt2MbUBi5jD06dSHJM,47538
145
- tests/test_classifier.py,sha256=grYGPksydNdPsaEBQxYHZTuTdcJWz7VQtikCKA6BNaQ,1920
146
- tests/test_directory_navigator.py,sha256=7G0MVrBbtBvbrFUpL0zb_9EkEWi1dulWuHsrQxMJxDY,140
147
- tests/test_file_classifier.py,sha256=hbGp0-_A_LgQ0pGv1jWDEIyCgvDyfChcvvVfbxjNY2U,10938
148
- tests/test_file_creator.py,sha256=D3G7MbgE0m8JmZihxnTryxLco6iZdbV--2CGc0L20FM,2109
149
- tests/test_file_lister.py,sha256=f6B_vIv-wAulKH2ZGgNg4SG79XqGGbfwoIvZlbEnYyM,4306
150
- tests/test_list_filter.py,sha256=gSRKirTtFuhRS3QlFHqWl89WvCvAdVEnFsCWTYmgB2o,7928
151
- tests/test_tag_extractor.py,sha256=nSiAYlTKZ7TLAOtcJpwK5zTWHhFYU0tI5xKnivLc1dU,2712
152
- tests/test_template_manager.py,sha256=q-LMHRG4rHkD6ON6YW4cpZxUx9hul6Or8wVVRC2kb-8,4099
153
- tests/test_update_config_prompt.py,sha256=vSsLvc18HZdVjVM93qXWVbJt752xTLL6VGjSVCrPufk,6729
154
- ara_cli-0.1.9.69.dist-info/METADATA,sha256=rInVDCWbgC4qvLyE2StAFpOXWahBfD7OBkfE5csu6SQ,415
155
- ara_cli-0.1.9.69.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
156
- ara_cli-0.1.9.69.dist-info/entry_points.txt,sha256=v4h7MzysTgSIDYfEo3oj4Kz_8lzsRa3hq-KJHEcLVX8,45
157
- ara_cli-0.1.9.69.dist-info/top_level.txt,sha256=WM4cLHT5DYUaWzLtRj-gu3yVNFpGQ6lLRI3FMmC-38I,14
158
- ara_cli-0.1.9.69.dist-info/RECORD,,
tests/test_ara_autofix.py DELETED
@@ -1,219 +0,0 @@
1
- import pytest
2
- from unittest.mock import patch, mock_open, MagicMock
3
- from ara_cli.artefact_autofix import (
4
- read_report_file,
5
- parse_report,
6
- apply_autofix,
7
- read_artefact,
8
- determine_artefact_type_and_class,
9
- run_agent,
10
- write_corrected_artefact,
11
- construct_prompt,
12
- fix_title_mismatch
13
- )
14
- from ara_cli.artefact_models.artefact_model import ArtefactType
15
-
16
- @pytest.fixture
17
- def mock_artefact_type():
18
- """Provides a mock for the ArtefactType enum member."""
19
- mock_type = MagicMock()
20
- mock_type.value = "feature"
21
- return mock_type
22
-
23
- @pytest.fixture
24
- def mock_artefact_class():
25
- """Provides a mock for the Artefact class."""
26
- mock_class = MagicMock()
27
- mock_class._title_prefix.return_value = "Feature:"
28
- # Mock the serialize method for the agent tests
29
- mock_class.serialize.return_value = "llm corrected content"
30
- return mock_class
31
-
32
-
33
- def test_read_report_file_success():
34
- """Tests successful reading of the report file."""
35
- mock_content = "# Artefact Check Report\n- `file.feature`: reason"
36
- with patch("builtins.open", mock_open(read_data=mock_content)) as m:
37
- content = read_report_file()
38
- assert content == mock_content
39
- m.assert_called_once_with("incompatible_artefacts_report.md", "r", encoding="utf-8")
40
-
41
- def test_read_report_file_not_found(capsys):
42
- with patch("builtins.open", side_effect=OSError("File not found")):
43
- content = read_report_file()
44
- assert content is None
45
- assert "Artefact scan results file not found" in capsys.readouterr().out
46
-
47
- def test_parse_report_with_issues():
48
- content = "# Artefact Check Report\n\n## feature\n- `path/to/file.feature`: A reason\n"
49
- expected = {"feature": [("path/to/file.feature", "A reason")]}
50
- assert parse_report(content) == expected
51
-
52
- def test_parse_report_no_issues():
53
- content = "# Artefact Check Report\n\nNo problems found.\n"
54
- assert parse_report(content) == {}
55
-
56
- def test_parse_report_invalid_format():
57
- assert parse_report("This is not a valid report") == {}
58
-
59
- def test_parse_report_invalid_line_format():
60
- content = "# Artefact Check Report\n\n## feature\n- an invalid line\n"
61
- assert parse_report(content) == {"feature": []}
62
-
63
- def test_read_artefact_success():
64
- mock_content = "Feature: My Feature"
65
- with patch("builtins.open", mock_open(read_data=mock_content)) as m:
66
- content = read_artefact("file.feature")
67
- assert content == mock_content
68
- m.assert_called_once_with("file.feature", 'r', encoding="utf-8")
69
-
70
- def test_read_artefact_file_not_found(capsys):
71
- with patch("builtins.open", side_effect=FileNotFoundError):
72
- result = read_artefact("nonexistent.feature")
73
- assert result is None
74
- assert "File not found: nonexistent.feature" in capsys.readouterr().out
75
-
76
- @patch("ara_cli.artefact_models.artefact_mapping.artefact_type_mapping")
77
- def test_determine_artefact_type_and_class_no_class_found(mock_mapping, capsys):
78
- mock_mapping.get.return_value = None
79
- # The function returns (None, None) if the class is not in the mapping.
80
- artefact_type, artefact_class = determine_artefact_type_and_class("feature")
81
- assert artefact_type is None
82
- assert artefact_class is None
83
- # The print statement inside the function is called before returning, so this check is valid.
84
- assert "No artefact class found for" in capsys.readouterr().out
85
-
86
- @patch("ara_cli.artefact_models.artefact_model.ArtefactType", side_effect=ValueError)
87
- def test_determine_artefact_type_and_class_invalid(mock_artefact_type_enum, capsys):
88
- artefact_type, artefact_class = determine_artefact_type_and_class("invalid_classifier")
89
- assert artefact_type is None
90
- assert artefact_class is None
91
- assert "Invalid classifier: invalid_classifier" in capsys.readouterr().out
92
-
93
- def test_write_corrected_artefact():
94
- with patch("builtins.open", mock_open()) as m:
95
- write_corrected_artefact("file.feature", "corrected content")
96
- m.assert_called_once_with("file.feature", 'w', encoding="utf-8")
97
- m().write.assert_called_once_with("corrected content")
98
-
99
- def test_construct_prompt_for_task():
100
- prompt = construct_prompt(ArtefactType.task, "some reason", "file.task", "text")
101
- assert "For task artefacts, if the action items looks like template or empty" in prompt
102
-
103
- @patch("ara_cli.artefact_autofix.run_agent")
104
- @patch("ara_cli.artefact_autofix.determine_artefact_type_and_class", return_value=(None, None))
105
- @patch("ara_cli.artefact_autofix.read_artefact", return_value="original text")
106
- def test_apply_autofix_exits_when_classifier_is_invalid(mock_read, mock_determine, mock_run_agent):
107
- """Tests that apply_autofix exits early if the classifier is invalid."""
108
- result = apply_autofix("file.feature", "invalid", "reason", deterministic=True, non_deterministic=True)
109
- assert result is False
110
- mock_read.assert_called_once_with("file.feature")
111
- mock_determine.assert_called_once_with("invalid")
112
- mock_run_agent.assert_not_called()
113
-
114
- @patch("ara_cli.artefact_autofix.run_agent")
115
- @patch("ara_cli.artefact_autofix.write_corrected_artefact")
116
- @patch("ara_cli.artefact_autofix.fix_title_mismatch", return_value="fixed text")
117
- @patch("ara_cli.artefact_autofix.determine_artefact_type_and_class")
118
- @patch("ara_cli.artefact_autofix.read_artefact", return_value="original text")
119
- def test_apply_autofix_for_title_mismatch_with_deterministic_flag(mock_read, mock_determine, mock_fix_title, mock_write, mock_run_agent, mock_artefact_type, mock_artefact_class):
120
- """Tests that a deterministic fix is applied when the flag is True."""
121
- mock_determine.return_value = (mock_artefact_type, mock_artefact_class)
122
- reason = "Filename-Title Mismatch: some details"
123
-
124
- result = apply_autofix("file.feature", "feature", reason, deterministic=True, non_deterministic=False)
125
-
126
- assert result is True
127
- mock_fix_title.assert_called_once_with("file.feature", "original text", mock_artefact_class)
128
- mock_write.assert_called_once_with("file.feature", "fixed text")
129
- mock_run_agent.assert_not_called()
130
-
131
- @patch("ara_cli.artefact_autofix.run_agent")
132
- @patch("ara_cli.artefact_autofix.write_corrected_artefact")
133
- @patch("ara_cli.artefact_autofix.fix_title_mismatch")
134
- @patch("ara_cli.artefact_autofix.determine_artefact_type_and_class")
135
- @patch("ara_cli.artefact_autofix.read_artefact", return_value="original text")
136
- def test_apply_autofix_skips_title_mismatch_without_deterministic_flag(mock_read, mock_determine, mock_fix_title, mock_write, mock_run_agent, mock_artefact_type, mock_artefact_class):
137
- """Tests that a deterministic fix is skipped when the flag is False."""
138
- mock_determine.return_value = (mock_artefact_type, mock_artefact_class)
139
- reason = "Filename-Title Mismatch: some details"
140
-
141
- result = apply_autofix("file.feature", "feature", reason, deterministic=False, non_deterministic=True)
142
-
143
- assert result is False
144
- mock_fix_title.assert_not_called()
145
- mock_write.assert_not_called()
146
- mock_run_agent.assert_not_called()
147
-
148
- @patch("ara_cli.artefact_autofix.write_corrected_artefact")
149
- @patch("ara_cli.artefact_autofix.run_agent")
150
- @patch("ara_cli.artefact_autofix.determine_artefact_type_and_class")
151
- @patch("ara_cli.artefact_autofix.read_artefact", return_value="original text")
152
- def test_apply_autofix_for_llm_fix_with_non_deterministic_flag(mock_read, mock_determine, mock_run_agent, mock_write, mock_artefact_type, mock_artefact_class):
153
- """Tests that an LLM fix is applied when the non-deterministic flag is True."""
154
- mock_determine.return_value = (mock_artefact_type, mock_artefact_class)
155
- mock_run_agent.return_value = mock_artefact_class
156
- reason = "Pydantic validation error"
157
-
158
- result = apply_autofix("file.feature", "feature", reason, deterministic=False, non_deterministic=True)
159
-
160
- assert result is True
161
- mock_run_agent.assert_called_once()
162
- mock_write.assert_called_once_with("file.feature", "llm corrected content")
163
-
164
- @patch("ara_cli.artefact_autofix.write_corrected_artefact")
165
- @patch("ara_cli.artefact_autofix.run_agent")
166
- @patch("ara_cli.artefact_autofix.determine_artefact_type_and_class")
167
- @patch("ara_cli.artefact_autofix.read_artefact", return_value="original text")
168
- def test_apply_autofix_skips_llm_fix_without_non_deterministic_flag(mock_read, mock_determine, mock_run_agent, mock_write, mock_artefact_type, mock_artefact_class):
169
- """Tests that an LLM fix is skipped when the non-deterministic flag is False."""
170
- mock_determine.return_value = (mock_artefact_type, mock_artefact_class)
171
- reason = "Pydantic validation error"
172
-
173
- result = apply_autofix("file.feature", "feature", reason, deterministic=True, non_deterministic=False)
174
-
175
- assert result is False
176
- mock_run_agent.assert_not_called()
177
- mock_write.assert_not_called()
178
-
179
- @patch("ara_cli.artefact_autofix.run_agent", side_effect=Exception("LLM failed"))
180
- @patch("ara_cli.artefact_autofix.determine_artefact_type_and_class")
181
- @patch("ara_cli.artefact_autofix.read_artefact", return_value="original text")
182
- def test_apply_autofix_llm_exception(mock_read, mock_determine, mock_run_agent, capsys, mock_artefact_type, mock_artefact_class):
183
- """Tests that an exception during an LLM fix is handled gracefully."""
184
- mock_determine.return_value = (mock_artefact_type, mock_artefact_class)
185
- reason = "Pydantic validation error"
186
-
187
- result = apply_autofix("file.feature", "feature", reason, deterministic=False, non_deterministic=True)
188
-
189
- assert result is False
190
- assert "LLM agent failed to fix artefact at file.feature: LLM failed" in capsys.readouterr().out
191
-
192
- # === Other Tests ===
193
-
194
- def test_fix_title_mismatch_success(mock_artefact_class):
195
- artefact_text = "Feature: wrong title\nSome other content"
196
- file_path = "path/to/correct_title.feature"
197
-
198
- expected_text = "Feature: correct title\nSome other content"
199
-
200
- result = fix_title_mismatch(file_path, artefact_text, mock_artefact_class)
201
-
202
- assert result == expected_text
203
- mock_artefact_class._title_prefix.assert_called_once()
204
-
205
- def test_fix_title_mismatch_prefix_not_found(capsys, mock_artefact_class):
206
- artefact_text = "No title prefix here"
207
- file_path = "path/to/correct_title.feature"
208
-
209
- result = fix_title_mismatch(file_path, artefact_text, mock_artefact_class)
210
-
211
- assert result == artefact_text # Should return original text
212
- assert "Warning: Title prefix 'Feature:' not found" in capsys.readouterr().out
213
-
214
- @patch("pydantic_ai.Agent")
215
- def test_run_agent_exception_handling(mock_agent_class):
216
- mock_agent_instance = mock_agent_class.return_value
217
- mock_agent_instance.run_sync.side_effect = Exception("Agent error")
218
- with pytest.raises(Exception, match="Agent error"):
219
- run_agent("prompt", MagicMock())