code2logic 1.0.45__tar.gz → 1.0.46__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.
- {code2logic-1.0.45 → code2logic-1.0.46}/PKG-INFO +1 -1
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/__init__.py +1 -1
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/analyzer.py +73 -46
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/cli.py +1 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/pyproject.toml +1 -1
- {code2logic-1.0.45 → code2logic-1.0.46}/LICENSE +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/README.md +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/__main__.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/adaptive.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/base.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/base_generator.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/benchmark.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/benchmarks/__init__.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/benchmarks/common.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/benchmarks/results.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/benchmarks/runner.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/chunked_reproduction.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/code_review.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/config.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/core/__init__.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/dependency.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/errors.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/file_formats.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/formats/__init__.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/function_logic.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/generators.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/gherkin.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/integrations/__init__.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/intent.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/llm/__init__.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/llm.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/llm_clients.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/llm_profiler.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/logicml.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/markdown_format.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/mcp_server.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/metrics.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/models.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/parsers.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/project_comparison.md +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/project_reproducer.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/prompts.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/py.typed +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/quality.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/refactor.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/reproducer.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/reproduction.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/schemas/__init__.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/schemas/json_schema.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/schemas/logicml_schema.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/schemas/markdown_schema.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/schemas/yaml_schema.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/shared_utils.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/similarity.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/terminal.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/tools/__init__.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/toon_format.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/universal.py +0 -0
- {code2logic-1.0.45 → code2logic-1.0.46}/code2logic/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code2logic
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.46
|
|
4
4
|
Summary: Code2Logic - Source code to logical representation converter for LLM analysis, featuring Tree-sitter parsing, dependency graph analysis, and multi-language support.
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
License-File: LICENSE
|
|
@@ -5,6 +5,7 @@ Provides the high-level API for analyzing codebases.
|
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
7
|
import logging
|
|
8
|
+
import os
|
|
8
9
|
import sys
|
|
9
10
|
import time
|
|
10
11
|
from collections import defaultdict
|
|
@@ -218,63 +219,89 @@ class ProjectAnalyzer:
|
|
|
218
219
|
|
|
219
220
|
def _scan_files(self):
|
|
220
221
|
"""Scan and parse all source files."""
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
222
|
+
scan_start = time.time()
|
|
223
|
+
files_seen = 0
|
|
224
|
+
files_parsed = 0
|
|
225
|
+
files_matched = 0
|
|
226
|
+
scan_progress_every = 500
|
|
227
|
+
|
|
228
|
+
for root, dirnames, filenames in os.walk(self.root_path):
|
|
229
|
+
dirnames[:] = [d for d in dirnames if d not in self.IGNORE_DIRS]
|
|
230
|
+
for filename in filenames:
|
|
231
|
+
files_seen += 1
|
|
232
|
+
fp = Path(root) / filename
|
|
233
|
+
|
|
234
|
+
if filename in self.IGNORE_FILES:
|
|
235
|
+
continue
|
|
232
236
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
237
|
+
ext = fp.suffix.lower()
|
|
238
|
+
language = self.LANGUAGE_EXTENSIONS.get(ext)
|
|
239
|
+
if language is None and ext == '':
|
|
240
|
+
try:
|
|
241
|
+
with fp.open('r', encoding='utf-8', errors='ignore') as f:
|
|
242
|
+
language = self._language_from_shebang(f.readline())
|
|
243
|
+
except Exception:
|
|
244
|
+
language = None
|
|
241
245
|
|
|
242
|
-
|
|
243
|
-
|
|
246
|
+
if language is None:
|
|
247
|
+
continue
|
|
244
248
|
|
|
245
|
-
|
|
249
|
+
files_matched += 1
|
|
250
|
+
self.languages[language] += 1
|
|
246
251
|
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
+
if self.verbose and files_seen > 0 and (files_seen % scan_progress_every) == 0:
|
|
253
|
+
log.info(
|
|
254
|
+
"Scan progress: seen=%d matched=%d parsed=%d modules=%d time=%.2fs",
|
|
255
|
+
files_seen,
|
|
256
|
+
files_matched,
|
|
257
|
+
files_parsed,
|
|
258
|
+
len(self.modules),
|
|
259
|
+
time.time() - scan_start,
|
|
260
|
+
)
|
|
252
261
|
|
|
253
|
-
|
|
262
|
+
try:
|
|
263
|
+
content = fp.read_text(encoding='utf-8', errors='ignore')
|
|
264
|
+
except Exception:
|
|
265
|
+
continue
|
|
254
266
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
module = self.ts_parser.parse(rel_path, content, language)
|
|
260
|
-
except Exception as e:
|
|
261
|
-
if self.verbose:
|
|
262
|
-
log.debug("Tree-sitter parser failed for %s: %s", rel_path, e)
|
|
267
|
+
try:
|
|
268
|
+
rel_path = str(fp.relative_to(self.root_path))
|
|
269
|
+
except Exception:
|
|
270
|
+
rel_path = str(fp)
|
|
263
271
|
|
|
264
|
-
|
|
272
|
+
module = None
|
|
265
273
|
try:
|
|
266
|
-
|
|
274
|
+
if self.ts_parser and self.ts_parser.is_available(language):
|
|
275
|
+
module = self.ts_parser.parse(rel_path, content, language)
|
|
267
276
|
except Exception as e:
|
|
268
277
|
if self.verbose:
|
|
269
|
-
log.debug("
|
|
270
|
-
|
|
278
|
+
log.debug("Tree-sitter parser failed for %s: %s", rel_path, e)
|
|
279
|
+
|
|
280
|
+
if module is None:
|
|
281
|
+
try:
|
|
282
|
+
module = self.fallback_parser.parse(rel_path, content, language)
|
|
283
|
+
except Exception as e:
|
|
284
|
+
if self.verbose:
|
|
285
|
+
log.debug("Fallback parser failed for %s: %s", rel_path, e)
|
|
286
|
+
continue
|
|
287
|
+
|
|
288
|
+
if module:
|
|
289
|
+
files_parsed += 1
|
|
290
|
+
try:
|
|
291
|
+
module.file_bytes = fp.stat().st_size
|
|
292
|
+
except Exception:
|
|
293
|
+
module.file_bytes = len(content.encode('utf-8', errors='ignore'))
|
|
294
|
+
self.modules.append(module)
|
|
271
295
|
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
296
|
+
if self.verbose:
|
|
297
|
+
log.info(
|
|
298
|
+
"Scan finished: seen=%d matched=%d parsed=%d modules=%d time=%.2fs",
|
|
299
|
+
files_seen,
|
|
300
|
+
files_matched,
|
|
301
|
+
files_parsed,
|
|
302
|
+
len(self.modules),
|
|
303
|
+
time.time() - scan_start,
|
|
304
|
+
)
|
|
278
305
|
|
|
279
306
|
def _detect_entrypoints(self) -> List[str]:
|
|
280
307
|
"""Detect project entry points."""
|
|
@@ -510,6 +510,7 @@ def _code2logic_llm_cli(argv: list[str]) -> None:
|
|
|
510
510
|
|
|
511
511
|
|
|
512
512
|
def main(argv=None):
|
|
513
|
+
cli_start = time.time()
|
|
513
514
|
parser = argparse.ArgumentParser(
|
|
514
515
|
description='Analyze source code and generate logical representations',
|
|
515
516
|
formatter_class=argparse.RawDescriptionHelpFormatter
|
|
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
4
4
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "code2logic"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.46"
|
|
8
8
|
description = "Code2Logic - Source code to logical representation converter for LLM analysis, featuring Tree-sitter parsing, dependency graph analysis, and multi-language support."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|