code2llm 0.5.92__tar.gz → 0.5.93__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 (120) hide show
  1. {code2llm-0.5.92 → code2llm-0.5.93}/PKG-INFO +1 -1
  2. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/__init__.py +1 -1
  3. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/cli_exports/prompt.py +82 -16
  4. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/readme_exporter.py +2 -1
  5. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/nlp/__init__.py +1 -1
  6. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm.egg-info/PKG-INFO +1 -1
  7. {code2llm-0.5.92 → code2llm-0.5.93}/pyproject.toml +1 -1
  8. {code2llm-0.5.92 → code2llm-0.5.93}/setup.py +1 -1
  9. {code2llm-0.5.92 → code2llm-0.5.93}/tests/test_prompt_txt.py +34 -0
  10. {code2llm-0.5.92 → code2llm-0.5.93}/LICENSE +0 -0
  11. {code2llm-0.5.92 → code2llm-0.5.93}/README.md +0 -0
  12. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/__main__.py +0 -0
  13. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/analysis/__init__.py +0 -0
  14. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/analysis/call_graph.py +0 -0
  15. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/analysis/cfg.py +0 -0
  16. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/analysis/coupling.py +0 -0
  17. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/analysis/data_analysis.py +0 -0
  18. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/analysis/dfg.py +0 -0
  19. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/analysis/pipeline_detector.py +0 -0
  20. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/analysis/side_effects.py +0 -0
  21. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/analysis/smells.py +0 -0
  22. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/analysis/type_inference.py +0 -0
  23. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/api.py +0 -0
  24. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/cli.py +0 -0
  25. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/cli_analysis.py +0 -0
  26. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/cli_commands.py +0 -0
  27. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/cli_exports/__init__.py +0 -0
  28. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/cli_exports/code2logic.py +0 -0
  29. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/cli_exports/formats.py +0 -0
  30. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/cli_exports/orchestrator.py +0 -0
  31. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/cli_parser.py +0 -0
  32. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/__init__.py +0 -0
  33. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/analyzer.py +0 -0
  34. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/config.py +0 -0
  35. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/file_analyzer.py +0 -0
  36. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/file_cache.py +0 -0
  37. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/file_filter.py +0 -0
  38. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/gitignore.py +0 -0
  39. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/lang/__init__.py +0 -0
  40. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/lang/base.py +0 -0
  41. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/lang/cpp.py +0 -0
  42. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/lang/csharp.py +0 -0
  43. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/lang/generic.py +0 -0
  44. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/lang/go_lang.py +0 -0
  45. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/lang/java.py +0 -0
  46. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/lang/php.py +0 -0
  47. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/lang/ruby.py +0 -0
  48. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/lang/rust.py +0 -0
  49. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/lang/typescript.py +0 -0
  50. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/large_repo.py +0 -0
  51. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/models.py +0 -0
  52. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/refactoring.py +0 -0
  53. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/repo_files.py +0 -0
  54. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/streaming/__init__.py +0 -0
  55. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/streaming/cache.py +0 -0
  56. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/streaming/incremental.py +0 -0
  57. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/streaming/prioritizer.py +0 -0
  58. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/streaming/scanner.py +0 -0
  59. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/streaming/strategies.py +0 -0
  60. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/streaming_analyzer.py +0 -0
  61. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/core/toon_size_manager.py +0 -0
  62. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/__init__.py +0 -0
  63. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/article_view.py +0 -0
  64. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/base.py +0 -0
  65. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/context_exporter.py +0 -0
  66. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/context_view.py +0 -0
  67. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/evolution_exporter.py +0 -0
  68. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/flow_constants.py +0 -0
  69. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/flow_exporter.py +0 -0
  70. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/flow_renderer.py +0 -0
  71. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/html_dashboard.py +0 -0
  72. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/index_generator.py +0 -0
  73. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/json_exporter.py +0 -0
  74. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/llm_exporter.py +0 -0
  75. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/map_exporter.py +0 -0
  76. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/mermaid_exporter.py +0 -0
  77. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/project_yaml_exporter.py +0 -0
  78. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/report_generators.py +0 -0
  79. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/toon/__init__.py +0 -0
  80. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/toon/helpers.py +0 -0
  81. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/toon/metrics.py +0 -0
  82. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/toon/module_detail.py +0 -0
  83. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/toon/renderer.py +0 -0
  84. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/toon.py +0 -0
  85. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/toon_view.py +0 -0
  86. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/validate_project.py +0 -0
  87. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/exporters/yaml_exporter.py +0 -0
  88. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/generators/__init__.py +0 -0
  89. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/generators/llm_flow.py +0 -0
  90. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/generators/llm_task.py +0 -0
  91. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/generators/mermaid.py +0 -0
  92. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/nlp/config.py +0 -0
  93. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/nlp/entity_resolution.py +0 -0
  94. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/nlp/intent_matching.py +0 -0
  95. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/nlp/normalization.py +0 -0
  96. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/nlp/pipeline.py +0 -0
  97. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/patterns/__init__.py +0 -0
  98. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/patterns/detector.py +0 -0
  99. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/refactor/__init__.py +0 -0
  100. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm/refactor/prompt_engine.py +0 -0
  101. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm.egg-info/SOURCES.txt +0 -0
  102. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm.egg-info/dependency_links.txt +0 -0
  103. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm.egg-info/entry_points.txt +0 -0
  104. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm.egg-info/requires.txt +0 -0
  105. {code2llm-0.5.92 → code2llm-0.5.93}/code2llm.egg-info/top_level.txt +0 -0
  106. {code2llm-0.5.92 → code2llm-0.5.93}/setup.cfg +0 -0
  107. {code2llm-0.5.92 → code2llm-0.5.93}/tests/test_advanced_analysis.py +0 -0
  108. {code2llm-0.5.92 → code2llm-0.5.93}/tests/test_analyzer.py +0 -0
  109. {code2llm-0.5.92 → code2llm-0.5.93}/tests/test_deep_analysis.py +0 -0
  110. {code2llm-0.5.92 → code2llm-0.5.93}/tests/test_edge_cases.py +0 -0
  111. {code2llm-0.5.92 → code2llm-0.5.93}/tests/test_flow_exporter.py +0 -0
  112. {code2llm-0.5.92 → code2llm-0.5.93}/tests/test_format_quality.py +0 -0
  113. {code2llm-0.5.92 → code2llm-0.5.93}/tests/test_multilanguage_e2e.py +0 -0
  114. {code2llm-0.5.92 → code2llm-0.5.93}/tests/test_nlp_pipeline.py +0 -0
  115. {code2llm-0.5.92 → code2llm-0.5.93}/tests/test_nonpython_cc_calls.py +0 -0
  116. {code2llm-0.5.92 → code2llm-0.5.93}/tests/test_pipeline_detector.py +0 -0
  117. {code2llm-0.5.92 → code2llm-0.5.93}/tests/test_project_toon_export.py +0 -0
  118. {code2llm-0.5.92 → code2llm-0.5.93}/tests/test_prompt_engine.py +0 -0
  119. {code2llm-0.5.92 → code2llm-0.5.93}/tests/test_refactoring_engine.py +0 -0
  120. {code2llm-0.5.92 → code2llm-0.5.93}/tests/test_toon_v2.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code2llm
3
- Version: 0.5.92
3
+ Version: 0.5.93
4
4
  Summary: High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries
5
5
  Home-page: https://github.com/wronai/stts
6
6
  Author: STTS Project
@@ -8,7 +8,7 @@ Includes NLP Processing Pipeline for query normalization, intent matching,
8
8
  and entity resolution with multilingual support.
9
9
  """
10
10
 
11
- __version__ = "0.5.92"
11
+ __version__ = "0.5.93"
12
12
  __author__ = "STTS Project"
13
13
 
14
14
  # Core analysis components (lightweight, always needed)
@@ -21,7 +21,10 @@ def _export_prompt_txt(args, output_dir: Path, formats: list[str], source_path:
21
21
  lines.append("")
22
22
  lines.append("Missing files (not generated in this run):")
23
23
  for name in missing:
24
- lines.append(f"- {output_rel_path}/{name}")
24
+ if output_rel_path:
25
+ lines.append(f"- {output_rel_path}/{name}")
26
+ else:
27
+ lines.append(f"- {name}")
25
28
 
26
29
  # Analyze generated files and build dynamic footer
27
30
  file_analysis = _analyze_generated_files(output_dir)
@@ -69,14 +72,16 @@ def _get_prompt_paths(source_path: Optional[Path], output_dir: Path) -> Tuple[st
69
72
  try:
70
73
  output_rel_path = str(output_dir.relative_to(source_path))
71
74
  except ValueError:
72
- output_rel_path = str(output_dir)
75
+ # When output is not relative to source, use empty string for just filenames
76
+ output_rel_path = ""
73
77
  else:
74
78
  cwd = Path.cwd()
75
79
  project_path = cwd.name
76
80
  try:
77
81
  output_rel_path = str(output_dir.relative_to(cwd))
78
82
  except ValueError:
79
- output_rel_path = str(output_dir)
83
+ # When output is not relative to cwd, use empty string for just filenames
84
+ output_rel_path = ""
80
85
  return project_path, output_rel_path
81
86
 
82
87
 
@@ -107,6 +112,7 @@ def _build_prompt_header(project_path: str) -> List[str]:
107
112
  return [
108
113
  "You are an AI assistant helping me understand and improve a codebase.",
109
114
  "Use the attached/generated files as the authoritative context.",
115
+ "Your goal is to refactor the project based on these files, not just summarize it.",
110
116
  "",
111
117
  f"we are in project path: {project_path}",
112
118
  "",
@@ -134,7 +140,10 @@ def _build_prompt_file_lines(output_dir: Path, output_rel_path: str, files: list
134
140
 
135
141
  file_path = output_dir / existing
136
142
  size_str = _format_size(file_path.stat().st_size)
137
- lines.append(f"- {output_rel_path}/{existing} ({desc}) [{size_str}]")
143
+ if output_rel_path:
144
+ lines.append(f"- {output_rel_path}/{existing} ({desc}) [{size_str}]")
145
+ else:
146
+ lines.append(f"- {existing} ({desc}) [{size_str}]")
138
147
 
139
148
  return lines
140
149
 
@@ -232,9 +241,15 @@ def _build_missing_files_section(output_dir: Path, output_rel_path: str) -> List
232
241
  for name in missing:
233
242
  # Special handling for validation and duplication files
234
243
  if name in ['validation.toon.yaml', 'duplication.toon.yaml']:
235
- lines.append(f"- {output_rel_path}/project/{name}")
244
+ if output_rel_path:
245
+ lines.append(f"- {output_rel_path}/project/{name}")
246
+ else:
247
+ lines.append(f"- project/{name}")
236
248
  else:
237
- lines.append(f"- {output_rel_path}/{name}")
249
+ if output_rel_path:
250
+ lines.append(f"- {output_rel_path}/{name}")
251
+ else:
252
+ lines.append(f"- {name}")
238
253
  return lines
239
254
 
240
255
 
@@ -340,35 +355,78 @@ def _build_dynamic_tasks(file_analysis: dict) -> List[str]:
340
355
  project_logic_file = file_analysis.get('project_logic_file', 'project.toon')
341
356
 
342
357
  tasks = [
343
- "- Summarize the architecture, main flows, and structural dependencies.",
344
- "- Identify the highest-risk areas and propose a refactoring plan.",
345
- "- If you suggest changes, keep behavior backward compatible and provide concrete steps.",
358
+ "- Treat this prompt as a refactoring brief: identify the highest-priority changes and prepare concrete edits.",
359
+ "- Use the file set to decide whether the first pass should focus on correctness, duplication, complexity reduction, or architecture cleanup.",
360
+ "- If you can safely implement the refactor, do it; otherwise give an exact file-by-file change plan and test plan.",
346
361
  ]
347
362
 
348
363
  if file_analysis['has_analysis_toon']:
349
- tasks.append(f"- Highlight critical functions (CC 10) and top problem areas from {analysis_file}.")
364
+ tasks.append(f"- Use {analysis_file} to locate high-CC functions and god modules that should be split first.")
350
365
 
351
366
  if file_analysis['has_map_toon']:
352
- tasks.append(f"- Cross-check imports, exports, and signatures against {map_file} before proposing splits.")
367
+ tasks.append(f"- Keep module boundaries intact and update imports/exports according to {map_file}.")
353
368
 
354
369
  if file_analysis['has_evolution_toon']:
355
- tasks.append(f"- Prioritize refactoring actions by impact/effort ratio from {evolution_file}.")
370
+ tasks.append(f"- Use {evolution_file} as the execution backlog and work from the top-ranked items.")
356
371
 
357
372
  if file_analysis.get('has_project_toon_yaml'):
358
- tasks.append(f"- Compare the compact project overview in {project_toon_file} with the main analysis files.")
373
+ tasks.append(f"- Keep {project_toon_file} aligned with the refactored architecture.")
359
374
 
360
375
  if file_analysis.get('has_project_logic'):
361
- tasks.append(f"- Use {project_logic_file} to validate the compact project overview against the rest of the analysis.")
376
+ tasks.append(f"- Use {project_logic_file} only as a legacy cross-check when needed.")
362
377
 
363
378
  if file_analysis['has_validation_toon']:
364
- tasks.append(f"- Review validation findings from {validation_file} generated by vallm.")
379
+ tasks.append(f"- Treat {validation_file} as a P0 blocker and resolve validation problems before structural cleanup.")
365
380
 
366
381
  if file_analysis['has_duplication_toon']:
367
- tasks.append(f"- Analyze code duplication patterns from {duplication_file} generated by redup.")
382
+ tasks.append(f"- Treat {duplication_file} as a P0/P1 issue and remove duplicated logic after blockers.")
368
383
 
369
384
  return tasks
370
385
 
371
386
 
387
+ def _build_priority_order(file_analysis: dict) -> List[str]:
388
+ """Build a state-dependent priority order for refactoring."""
389
+ analysis_file = file_analysis.get('analysis_file', 'analysis.toon')
390
+ map_file = file_analysis.get('map_file', 'map.toon.yaml')
391
+ evolution_file = file_analysis.get('evolution_file', 'evolution.toon.yaml')
392
+ project_toon_file = file_analysis.get('project_toon_file', 'project.toon.yaml')
393
+ project_logic_file = file_analysis.get('project_logic_file', 'project.toon')
394
+ validation_file = file_analysis.get('validation_file', 'project/validation.toon.yaml')
395
+ duplication_file = file_analysis.get('duplication_file', 'project/duplication.toon.yaml')
396
+
397
+ priorities = []
398
+
399
+ if file_analysis.get('has_validation_toon'):
400
+ priorities.append(f"P0 — Fix validation issues from {validation_file} first.")
401
+
402
+ if file_analysis.get('has_duplication_toon'):
403
+ priorities.append(f"P0/P1 — Remove duplicated logic reported in {duplication_file}.")
404
+
405
+ if file_analysis.get('has_analysis_toon'):
406
+ priorities.append(f"P1 — Split or simplify the highest-CC / god modules identified in {analysis_file}.")
407
+
408
+ if file_analysis.get('has_map_toon'):
409
+ priorities.append(f"P1 — Preserve module boundaries and update imports/exports according to {map_file}.")
410
+
411
+ if file_analysis.get('has_project_toon_yaml'):
412
+ priorities.append(f"P2 — Keep the compact project overview in {project_toon_file} aligned with the refactor.")
413
+
414
+ if file_analysis.get('has_evolution_toon'):
415
+ priorities.append(f"P2 — Execute the highest-impact items from {evolution_file} in order of benefit/risk.")
416
+
417
+ if file_analysis.get('has_project_logic'):
418
+ priorities.append(f"P3 — Use {project_logic_file} only as a legacy cross-check.")
419
+
420
+ if not priorities:
421
+ priorities = [
422
+ "P1 — Inspect analysis.toon and map.toon.yaml to identify the safest first refactor.",
423
+ "P2 — Turn the findings into concrete code edits and tests.",
424
+ "P3 — Keep changes minimal, backward compatible, and reversible.",
425
+ ]
426
+
427
+ return priorities
428
+
429
+
372
430
  def _build_prompt_footer(chunked: bool = False, file_analysis: dict = None) -> List[str]:
373
431
  """Build dynamic footer section of prompt based on generated files."""
374
432
  if file_analysis is None:
@@ -381,6 +439,14 @@ def _build_prompt_footer(chunked: bool = False, file_analysis: dict = None) -> L
381
439
  tasks = _build_dynamic_tasks(file_analysis)
382
440
  for task in tasks:
383
441
  lines.append(task)
442
+
443
+ # Priority order
444
+ priorities = _build_priority_order(file_analysis)
445
+ if priorities:
446
+ lines.append("")
447
+ lines.append("Priority Order:")
448
+ for priority in priorities:
449
+ lines.append(priority)
384
450
 
385
451
  # Dynamic focus areas
386
452
  focus_areas = _build_dynamic_focus_areas(file_analysis)
@@ -238,7 +238,8 @@ grep -E "^ .*[0-9]{{3,}}$" project.toon.yaml | sort -t',' -k2 -n -r | head -10
238
238
  - **Files section**: Lists all existing generated files with descriptions, including `project.toon.yaml` when generated by `-f all`
239
239
  - **Source files section**: Highlights important source files such as `cli_exports/orchestrator.py`
240
240
  - **Missing section**: Shows which files weren't generated (if any)
241
- - **Task section**: Instructions for LLM analysis
241
+ - **Task section**: Refactoring brief with concrete execution instructions, not just analysis
242
+ - **Priority Order section**: State-dependent refactoring priorities, starting with blockers and then architecture cleanup
242
243
  - **Requirements section**: Guidelines for suggested changes
243
244
 
244
245
  **Example usage**:
@@ -4,7 +4,7 @@ Provides query normalization, intent matching, and entity resolution
4
4
  with multilingual support and fuzzy matching.
5
5
  """
6
6
 
7
- __version__ = "0.5.92"
7
+ __version__ = "0.5.93"
8
8
 
9
9
  from .pipeline import NLPPipeline
10
10
  from .normalization import QueryNormalizer
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: code2llm
3
- Version: 0.5.92
3
+ Version: 0.5.93
4
4
  Summary: High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries
5
5
  Home-page: https://github.com/wronai/stts
6
6
  Author: STTS Project
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "code2llm"
7
- version = "0.5.92"
7
+ version = "0.5.93"
8
8
  description = "High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
4
4
  import os
5
5
 
6
6
  # Read version
7
- version = "0.5.91"
7
+ version = "0.5.92"
8
8
 
9
9
  # Read long description
10
10
  def read_readme():
@@ -121,9 +121,43 @@ class TestPromptTxtGeneration:
121
121
  # Check for key sections
122
122
  assert "You are an AI assistant" in content, "Main instruction should be present"
123
123
  assert "Task:" in content, "Task section should be present"
124
+ assert "refactoring brief" in content, "Task section should instruct refactoring"
125
+ assert "Priority Order:" in content, "Priority section should be present"
124
126
  assert "Constraints:" in content, "Constraints section should be present"
125
127
  assert "we are in project path:" in content, "Project path should be present"
126
128
 
129
+ def test_prompt_txt_prioritizes_blockers_when_validation_and_duplication_exist(self, temp_output_dir, mock_args):
130
+ """Test that prompt.txt orders blockers first when validation and duplication outputs exist."""
131
+ formats = ['all']
132
+ source_path = Path('/home/user/myproject')
133
+
134
+ # Create the main generated files plus blocker files
135
+ generated_files = [
136
+ 'analysis.toon',
137
+ 'map.toon.yaml',
138
+ 'evolution.toon.yaml',
139
+ 'project.toon.yaml',
140
+ 'context.md',
141
+ 'README.md',
142
+ ]
143
+ for f in generated_files:
144
+ (temp_output_dir / f).write_text('test')
145
+
146
+ (temp_output_dir / 'project').mkdir(parents=True, exist_ok=True)
147
+ (temp_output_dir / 'project' / 'validation.toon.yaml').write_text('validation')
148
+ (temp_output_dir / 'project' / 'duplication.toon.yaml').write_text('duplication')
149
+
150
+ _export_prompt_txt(mock_args, temp_output_dir, formats, source_path)
151
+
152
+ prompt_file = temp_output_dir / 'prompt.txt'
153
+ content = prompt_file.read_text()
154
+
155
+ assert "Priority Order:" in content, "Priority section should be present"
156
+ assert "P0 — Fix validation issues" in content, "Validation issues should be first priority"
157
+ assert "P0/P1 — Remove duplicated logic" in content, "Duplication issues should be prioritized next"
158
+ assert "P1 — Split or simplify the highest-CC / god modules" in content, "Analysis-driven refactoring should follow blockers"
159
+ assert "P2 — Keep the compact project overview" in content, "Project overview should be preserved as a later priority"
160
+
127
161
  def test_prompt_txt_includes_orchestrator_source_file_description(self, temp_output_dir, temp_source_dir, mock_args):
128
162
  """Test that prompt.txt includes the orchestrator.py source file description."""
129
163
  formats = ['code2logic']
File without changes
File without changes
File without changes
File without changes
File without changes