-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathapp.doql.less
More file actions
555 lines (501 loc) · 20.5 KB
/
Copy pathapp.doql.less
File metadata and controls
555 lines (501 loc) · 20.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
// LESS format — define @variables here as needed
app {
name: code2llm;
version: 0.5.168;
description: "High-performance Python code flow analysis with optimized TOON format - CFG, DFG, call graphs, and intelligent code queries";
license: Apache-2.0;
authors: "Tom Sapletta <tom@sapletta.com>";
keywords: "static-analysis, control-flow, data-flow, call-graph, reverse-engineering, toon-format, code-analysis, ast, optimization, complexity-analysis";
homepage: https://github.com/wronai/stts;
repository: https://github.com/wronai/stts;
}
dependencies {
runtime: "networkx>=2.6, matplotlib>=3.4, pyyaml>=5.4, numpy>=1.20, jinja2>=3.0, radon>=5.1, astroid>=3.0, code2logic, vulture>=2.10, tiktoken>=0.5, tree-sitter>=0.21, tree-sitter-python>=0.21, tree-sitter-javascript>=0.21, tree-sitter-typescript>=0.21, tree-sitter-go>=0.21, tree-sitter-rust>=0.21, tree-sitter-java>=0.21, tree-sitter-c>=0.21, tree-sitter-cpp>=0.22, tree-sitter-c-sharp>=0.21, tree-sitter-php>=0.22, tree-sitter-ruby>=0.21";
dev: "pytest>=6.2, pytest-cov>=2.12, pytest-xdist>=3.0, black>=21.0, flake8>=3.9, mypy>=0.910, goal>=2.1.218, costs>=0.1.20, pfix>=0.1.60";
}
entity[name="FlowNode"] {
id: string!;
type: string!;
label: string!;
function: string;
file: string;
line: int;
column: int;
conditions: List[str]!;
data_flow: List[str]!;
metadata: Dict[str, Any]!;
}
entity[name="FlowEdge"] {
source: string!;
target: string!;
edge_type: string!;
label: string;
conditions: List[str]!;
}
entity[name="FunctionInfo"] {
name: string!;
qualified_name: string!;
file: string!;
line: int!;
column: int!;
module: string!;
class_name: string;
is_method: bool!;
is_private: bool!;
is_property: bool!;
docstring: string;
args: List[str]!;
returns: string;
decorators: List[str]!;
cfg_entry: string;
cfg_exit: string;
cfg_nodes: List[str]!;
calls: List[str]!;
called_by: List[str]!;
complexity: Dict[str, Any]!;
centrality: float!;
reachability: string!;
}
entity[name="ClassInfo"] {
name: string!;
qualified_name: string!;
file: string!;
line: int!;
module: string!;
bases: List[str]!;
methods: List[str]!;
docstring: string;
is_state_machine: bool!;
}
entity[name="ModuleInfo"] {
name: string!;
file: string!;
is_package: bool!;
source_kind: string!;
line_count: int!;
imports: List[str]!;
functions: List[str]!;
classes: List[str]!;
}
entity[name="Pattern"] {
name: string!;
type: string!;
confidence: float!;
functions: List[str]!;
entry_points: List[str]!;
exit_points: List[str]!;
metadata: Dict[str, Any]!;
}
entity[name="CodeSmell"] {
name: string!;
type: string!;
file: string!;
line: int!;
severity: float!;
description: string!;
context: Dict[str, Any]!;
}
entity[name="Mutation"] {
variable: string!;
file: string!;
line: int!;
type: string!;
scope: string!;
context: string!;
}
entity[name="DataFlow"] {
variable: string!;
dependencies: Set[str]!;
metadata: Dict[str, Any]!;
}
interface[type="api"] {
type: rest;
framework: flask;
}
interface[type="cli"] {
framework: argparse;
}
interface[type="cli"] page[name="code2llm"] {
entry: code2llm.cli:main;
}
workflow[name="install"] {
trigger: manual;
step-1: run cmd=$(PYTHON) -m pip install -e .;
step-2: run cmd=echo "✓ code2llm installed with TOON format support";
}
workflow[name="dev-install"] {
trigger: manual;
step-1: run cmd=$(PYTHON) -m pip install -e ".[dev]";
step-2: run cmd=echo "✓ code2llm installed with dev dependencies";
}
workflow[name="test"] {
trigger: manual;
step-1: run cmd=$(PYTHON) -m pytest tests/ -v --tb=short 2>/dev/null || echo "No tests yet - create tests/ directory";
}
workflow[name="test-cov"] {
trigger: manual;
step-1: run cmd=$(PYTHON) -m pytest tests/ --cov=code2llm --cov-report=html --cov-report=term 2>/dev/null || echo "No tests yet";
}
workflow[name="test-toon"] {
trigger: manual;
step-1: run cmd=echo "🎯 Testing TOON format...";
step-2: run cmd=$(PYTHON) -m code2llm ./ -v -o ./test_toon -m hybrid -f toon;
step-3: run cmd=$(PYTHON) validate_toon.py test_toon/analysis.toon;
step-4: run cmd=echo "✓ TOON format test complete";
}
workflow[name="validate-toon"] {
trigger: manual;
step-1: depend target=test-toon;
}
workflow[name="test-all-formats"] {
trigger: manual;
step-1: run cmd=echo "📊 Testing all output formats...";
step-2: run cmd=$(PYTHON) -m code2llm ./ -v -o ./test_all -m hybrid -f all;
step-3: run cmd=$(PYTHON) validate_toon.py test_all/analysis.toon;
step-4: run cmd=echo "✓ All formats test complete";
}
workflow[name="test-comprehensive"] {
trigger: manual;
step-1: run cmd=echo "🚀 Running comprehensive test suite...";
step-2: run cmd=bash project.sh;
step-3: run cmd=echo "✓ Comprehensive tests complete";
}
workflow[name="lint"] {
trigger: manual;
step-1: run cmd=$(PYTHON) -m flake8 code2llm/ --max-line-length=100 --ignore=E203,W503 2>/dev/null || echo "flake8 not installed";
step-2: run cmd=$(PYTHON) -m black --check code2llm/ 2>/dev/null || echo "black not installed";
step-3: run cmd=echo "✓ Linting complete";
}
workflow[name="format"] {
trigger: manual;
step-1: run cmd=$(PYTHON) -m black code2llm/ --line-length=100 2>/dev/null || echo "black not installed, run: pip install black";
step-2: run cmd=echo "✓ Code formatted";
}
workflow[name="typecheck"] {
trigger: manual;
step-1: run cmd=$(PYTHON) -m mypy code2llm/ --ignore-missing-imports 2>/dev/null || echo "mypy not installed";
}
workflow[name="check"] {
trigger: manual;
step-1: run cmd=echo "✓ All checks passed";
}
workflow[name="run"] {
trigger: manual;
step-1: run cmd=$(PYTHON) -m code2llm ../python/stts_core -v -o ./output;
}
workflow[name="analyze"] {
trigger: manual;
step-1: run cmd=echo "🎯 Running TOON format analysis on current project...";
step-2: run cmd=$(PYTHON) -m code2llm ./ -v -o ./analysis -m hybrid -f toon;
step-3: run cmd=$(PYTHON) validate_toon.py analysis/analysis.toon;
step-4: run cmd=echo "✓ TOON analysis complete - check analysis/analysis.toon";
}
workflow[name="analyze-all"] {
trigger: manual;
step-1: run cmd=echo "📊 Running analysis with all formats...";
step-2: run cmd=$(PYTHON) -m code2llm ./ -v -o ./analysis_all -m hybrid -f all;
step-3: run cmd=$(PYTHON) validate_toon.py analysis_all/analysis.toon;
step-4: run cmd=echo "✓ All formats analysis complete - check analysis_all/";
}
workflow[name="toon-demo"] {
trigger: manual;
step-1: run cmd=echo "🎯 Quick TOON format demo...";
step-2: run cmd=$(PYTHON) -m code2llm ./ -v -o ./demo -m hybrid -f toon;
step-3: run cmd=echo "📁 Generated: demo/analysis.toon";
step-4: run cmd=echo "📊 Size: $$(du -h demo/analysis.toon | cut -f1)";
step-5: run cmd=echo "🔍 Preview:";
step-6: run cmd=head -20 demo/analysis.toon;
}
workflow[name="toon-compare"] {
trigger: manual;
step-1: run cmd=echo "📊 Comparing TOON vs YAML formats...";
step-2: run cmd=$(PYTHON) -m code2llm ./ -v -o ./compare -m hybrid -f toon,yaml;
step-3: run cmd=echo "📁 Files generated:";
step-4: run cmd=echo " - TOON: compare/analysis.toon ($$(du -h compare/analysis.toon | cut -f1))";
step-5: run cmd=echo " - YAML: compare/analysis.yaml ($$(du -h compare/analysis.yaml | cut -f1))";
step-6: run cmd=echo " - Ratio: $$(echo "scale=1; $$(du -k compare/analysis.yaml | cut -f1) / $$(du -k compare/analysis.toon | cut -f1)" | bc)x smaller";
step-7: run cmd=$(PYTHON) validate_toon.py compare/analysis.yaml compare/analysis.toon;
}
workflow[name="toon-validate"] {
trigger: manual;
step-1: run cmd=echo "🔍 Validating TOON format structure...";
step-2: run cmd=$(PYTHON) validate_toon.py analysis/analysis.toon 2>/dev/null || $(PYTHON) validate_toon.py test_toon/analysis.toon 2>/dev/null || echo "Run 'make test-toon' first";
}
workflow[name="build"] {
trigger: manual;
step-1: run cmd=rm -rf build/ dist/ *.egg-info;
step-2: run cmd=$(PYTHON) -m build;
step-3: run cmd=echo "✓ Build complete - check dist/";
}
workflow[name="publish-test"] {
trigger: manual;
step-1: run cmd=echo "🚀 Publishing to TestPyPI...";
step-2: run cmd=$(PYTHON) -m venv publish-test-env;
step-3: run cmd=publish-test-env/bin/pip install twine;
step-4: run cmd=publish-test-env/bin/python -m twine upload --repository testpypi dist/*;
step-5: run cmd=rm -rf publish-test-env;
step-6: run cmd=echo "✓ Published to TestPyPI";
}
workflow[name="bump-patch"] {
trigger: manual;
step-1: run cmd=echo "🔢 Bumping patch version...";
step-2: run cmd=$(PYTHON) scripts/bump_version.py patch 2>/dev/null || echo "Create scripts/bump_version.py or edit pyproject.toml manually";
}
workflow[name="bump-minor"] {
trigger: manual;
step-1: run cmd=echo "🔢 Bumping minor version...";
step-2: run cmd=$(PYTHON) scripts/bump_version.py minor 2>/dev/null || echo "Create scripts/bump_version.py or edit pyproject.toml manually";
}
workflow[name="bump-major"] {
trigger: manual;
step-1: run cmd=echo "🔢 Bumping major version...";
step-2: run cmd=$(PYTHON) scripts/bump_version.py major 2>/dev/null || echo "Create scripts/bump_version.py or edit pyproject.toml manually";
}
workflow[name="publish"] {
trigger: manual;
step-1: run cmd=echo "🚀 Publishing to PyPI...";
step-2: run cmd=echo "🔢 Bumping patch version...";
step-3: run cmd=$(MAKE) bump-patch;
step-4: run cmd=echo "🔨 Rebuilding package with new version...";
step-5: run cmd=$(MAKE) build;
step-6: run cmd=echo "📦 Publishing to PyPI...";
step-7: run cmd=$(PYTHON) -m venv publish-env;
step-8: run cmd=publish-env/bin/pip install twine;
step-9: run cmd=publish-env/bin/python -m twine upload dist/*;
step-10: run cmd=rm -rf publish-env;
step-11: run cmd=echo "✓ Published to PyPI";
}
workflow[name="mermaid-png"] {
trigger: manual;
step-1: run cmd=$(PYTHON) mermaid_to_png.py --batch output output;
}
workflow[name="install-mermaid"] {
trigger: manual;
step-1: run cmd=npm install -g @mermaid-js/mermaid-cli;
}
workflow[name="check-mermaid"] {
trigger: manual;
step-1: run cmd=echo "Checking available Mermaid renderers...";
step-2: run cmd=which mmdc > /dev/null && echo "✓ mmdc (mermaid-cli)" || echo "✗ mmdc (run: npm install -g @mermaid-js/mermaid-cli)";
step-3: run cmd=which npx > /dev/null && echo "✓ npx (for @mermaid-js/mermaid-cli)" || echo "✗ npx (install Node.js)";
step-4: run cmd=which puppeteer > /dev/null && echo "✓ puppeteer" || echo "✗ puppeteer (run: npm install -g puppeteer)";
}
workflow[name="clean"] {
trigger: manual;
step-1: run cmd=rm -rf build/ dist/ *.egg-info;
step-2: run cmd=rm -rf .pytest_cache .coverage htmlcov/;
step-3: run cmd=rm -rf code2llm/__pycache__ code2llm/*/__pycache__;
step-4: run cmd=rm -rf test_* demo compare analysis analysis_all output_* 2>/dev/null || true;
step-5: run cmd=find . -name "*.pyc" -delete 2>/dev/null || true;
step-6: run cmd=find . -name "__pycache__" -type d -exec rm -rf {} + 2>/dev/null || true;
step-7: run cmd=echo "✓ Cleaned build artifacts and test outputs";
}
workflow[name="clean-png"] {
trigger: manual;
step-1: run cmd=rm -f output/*.png;
step-2: run cmd=echo "✓ Cleaned PNG files";
}
workflow[name="quickstart"] {
trigger: manual;
step-1: run cmd=echo "🚀 Quick Start with code2llm TOON format:";
step-2: run cmd=echo "";
step-3: run cmd=echo "1. Install: make install";
step-4: run cmd=echo "2. Test TOON: make test-toon";
step-5: run cmd=echo "3. Analyze: make analyze";
step-6: run cmd=echo "4. Compare: make toon-compare";
step-7: run cmd=echo "5. All formats: make test-all-formats";
step-8: run cmd=echo "";
step-9: run cmd=echo "📖 For more: make help";
}
workflow[name="help"] {
trigger: manual;
step-1: run cmd=echo "code2llm - Python Code Flow Analysis Tool with LLM Integration and TOON Format";
step-2: run cmd=echo "";
step-3: run cmd=echo "🚀 Installation:";
step-4: run cmd=echo " make install - Install package";
step-5: run cmd=echo " make dev-install - Install with development dependencies";
step-6: run cmd=echo "";
step-7: run cmd=echo "🧪 Testing:";
step-8: run cmd=echo " make test - Run test suite";
step-9: run cmd=echo " make test-toon - Test TOON format only";
step-10: run cmd=echo " make validate-toon - Validate TOON format output";
step-11: run cmd=echo " make test-all-formats - Test all output formats";
step-12: run cmd=echo "";
step-13: run cmd=echo "🔧 Code Quality:";
step-14: run cmd=echo " make lint - Run linters (flake8, black --check)";
step-15: run cmd=echo " make format - Format code with black";
step-16: run cmd=echo " make typecheck - Run mypy type checking";
step-17: run cmd=echo " make check - Run all quality checks";
step-18: run cmd=echo "";
step-19: run cmd=echo "📊 Analysis:";
step-20: run cmd=echo " make analyze - Run analysis on current project (TOON format)";
step-21: run cmd=echo " make run - Run with example arguments";
step-22: run cmd=echo " make analyze-all - Run analysis with all formats";
step-23: run cmd=echo "";
step-24: run cmd=echo "🎯 TOON Format:";
step-25: run cmd=echo " make toon-demo - Quick TOON format demo";
step-26: run cmd=echo " make toon-compare - Compare TOON vs YAML formats";
step-27: run cmd=echo " make toon-validate - Validate TOON format structure";
step-28: run cmd=echo "";
step-29: run cmd=echo "📦 Building & Release:";
step-30: run cmd=echo " make build - Build distribution packages";
step-31: run cmd=echo " make publish - Publish to PyPI (with version bump)";
step-32: run cmd=echo " make publish-test - Publish to TestPyPI";
step-33: run cmd=echo " make bump-patch - Bump patch version";
step-34: run cmd=echo " make bump-minor - Bump minor version";
step-35: run cmd=echo " make bump-major - Bump major version";
step-36: run cmd=echo "";
step-37: run cmd=echo "🎨 Visualization:";
step-38: run cmd=echo " make mermaid-png - Generate PNG from all Mermaid files";
step-39: run cmd=echo " make install-mermaid - Install Mermaid CLI renderer";
step-40: run cmd=echo " make check-mermaid - Check available Mermaid renderers";
step-41: run cmd=echo "";
step-42: run cmd=echo "🧹 Maintenance:";
step-43: run cmd=echo " make clean - Remove build artifacts";
step-44: run cmd=echo " make clean-png - Clean PNG files";
step-45: run cmd=echo "";
}
workflow[name="health"] {
trigger: manual;
step-1: run cmd=docker compose ps;
step-2: run cmd=docker compose exec app echo "Health check passed";
}
workflow[name="import-makefile-hint"] {
trigger: manual;
step-1: run cmd=echo 'Run: taskfile import Makefile to import existing targets.';
}
workflow[name="all"] {
trigger: manual;
step-1: run cmd=taskfile run install;
step-2: run cmd=taskfile run lint;
step-3: run cmd=taskfile run test;
}
workflow[name="fmt"] {
trigger: manual;
step-1: run cmd=ruff format .;
}
workflow[name="sumd"] {
trigger: manual;
step-1: run cmd=echo "# $(basename $(pwd))" > SUMD.md
echo "" >> SUMD.md
echo "$(python3 -c "import tomllib; f=open('pyproject.toml','rb'); d=tomllib.load(f); print(d.get('project',{}).get('description','Project description'))" 2>/dev/null || echo 'Project description')" >> SUMD.md
echo "" >> SUMD.md
echo "## Contents" >> SUMD.md
echo "" >> SUMD.md
echo "- [Metadata](#metadata)" >> SUMD.md
echo "- [Architecture](#architecture)" >> SUMD.md
echo "- [Dependencies](#dependencies)" >> SUMD.md
echo "- [Source Map](#source-map)" >> SUMD.md
echo "- [Intent](#intent)" >> SUMD.md
echo "" >> SUMD.md
echo "## Metadata" >> SUMD.md
echo "" >> SUMD.md
echo "- **name**: \`$(basename $(pwd))\`" >> SUMD.md
echo "- **version**: \`$(python3 -c "import tomllib; f=open('pyproject.toml','rb'); d=tomllib.load(f); print(d.get('project',{}).get('version','unknown'))" 2>/dev/null || echo 'unknown')\`" >> SUMD.md
echo "- **python_requires**: \`>=$(python3 --version 2>/dev/null | cut -d' ' -f2 | cut -d. -f1,2)\`" >> SUMD.md
echo "- **license**: $(python3 -c "import tomllib; f=open('pyproject.toml','rb'); d=tomllib.load(f); print(d.get('project',{}).get('license',{}).get('text','MIT'))" 2>/dev/null || echo 'MIT')" >> SUMD.md
echo "- **ecosystem**: SUMD + DOQL + testql + taskfile" >> SUMD.md
echo "- **generated_from**: pyproject.toml, Taskfile.yml, Makefile, src/" >> SUMD.md
echo "" >> SUMD.md
echo "## Architecture" >> SUMD.md
echo "" >> SUMD.md
echo '```' >> SUMD.md
echo "SUMD (description) → DOQL/source (code) → taskfile (automation) → testql (verification)" >> SUMD.md
echo '```' >> SUMD.md
echo "" >> SUMD.md
echo "## Source Map" >> SUMD.md
echo "" >> SUMD.md
find . -name '*.py' -not -path './.venv/*' -not -path './venv/*' -not -path './__pycache__/*' -not -path './.git/*' | head -50 | sed 's|^./||' | sed 's|^|- |' >> SUMD.md
echo "Generated SUMD.md";
step-2: run cmd=python3 -c "
import json, os, subprocess
from pathlib import Path
project_name = Path.cwd().name
py_files = list(Path('.').rglob('*.py'))
py_files = [f for f in py_files if not any(x in str(f) for x in ['.venv', 'venv', '__pycache__', '.git'])]
data = {
'project_name': project_name,
'description': 'SUMD - Structured Unified Markdown Descriptor for AI-aware project refactorization',
'files': [{'path': str(f), 'type': 'python'} for f in py_files[:100]]
}
with open('sumd.json', 'w') as f:
json.dump(data, f, indent=2)
print('Generated sumd.json')
" 2>/dev/null || echo 'Python generation failed, using fallback';
}
workflow[name="sumr"] {
trigger: manual;
step-1: run cmd=echo "# $(basename $(pwd)) - Summary Report" > SUMR.md
echo "" >> SUMR.md
echo "SUMR - Summary Report for project analysis" >> SUMR.md
echo "" >> SUMR.md
echo "## Contents" >> SUMR.md
echo "" >> SUMR.md
echo "- [Metadata](#metadata)" >> SUMR.md
echo "- [Quality Status](#quality-status)" >> SUMR.md
echo "- [Metrics](#metrics)" >> SUMR.md
echo "- [Refactoring Analysis](#refactoring-analysis)" >> SUMR.md
echo "- [Intent](#intent)" >> SUMR.md
echo "" >> SUMR.md
echo "## Metadata" >> SUMR.md
echo "" >> SUMR.md
echo "- **name**: \`$(basename $(pwd))\`" >> SUMR.md
echo "- **version**: \`$(python3 -c "import tomllib; f=open('pyproject.toml','rb'); d=tomllib.load(f); print(d.get('project',{}).get('version','unknown'))" 2>/dev/null || echo 'unknown')\`" >> SUMR.md
echo "- **generated_at**: \`$(date -Iseconds)\`" >> SUMR.md
echo "" >> SUMR.md
echo "## Quality Status" >> SUMR.md
echo "" >> SUMR.md
if [ -f pyqual.yaml ]; then
echo "- **pyqual_config**: ✅ Present" >> SUMR.md
echo "- **last_run**: $(stat -c %y .pyqual/pipeline.db 2>/dev/null | cut -d' ' -f1 || echo 'N/A')" >> SUMR.md
else
echo "- **pyqual_config**: ❌ Missing" >> SUMR.md
fi
echo "" >> SUMR.md
echo "## Metrics" >> SUMR.md
echo "" >> SUMR.md
py_files=$(find . -name '*.py' -not -path './.venv/*' -not -path './venv/*' | wc -l)
echo "- **python_files**: $py_files" >> SUMR.md
lines=$(find . -name '*.py' -not -path './.venv/*' -not -path './venv/*' -exec cat {} \; 2>/dev/null | wc -l)
echo "- **total_lines**: $lines" >> SUMR.md
echo "" >> SUMR.md
echo "## Refactoring Analysis" >> SUMR.md
echo "" >> SUMR.md
echo "Run \`code2llm ./ -f evolution\` for detailed refactoring queue." >> SUMR.md
echo "Generated SUMR.md";
step-2: run cmd=python3 -c "
import json, os, subprocess
from pathlib import Path
from datetime import datetime
project_name = Path.cwd().name
py_files = len([f for f in Path('.').rglob('*.py') if not any(x in str(f) for x in ['.venv', 'venv', '__pycache__', '.git'])])
data = {
'project_name': project_name,
'report_type': 'SUMR',
'generated_at': datetime.now().isoformat(),
'metrics': {
'python_files': py_files,
'has_pyqual_config': Path('pyqual.yaml').exists()
}
}
with open('SUMR.json', 'w') as f:
json.dump(data, f, indent=2)
print('Generated SUMR.json')
" 2>/dev/null || echo 'Python generation failed, using fallback';
}
tests {
import: testql-scenarios/**/*.testql.toon.yaml;
}
env_vars {
keys: CODE2FLOW_CALLS_SPLIT, CODE2FLOW_CALLS_KEEP_MAIN, CODE2FLOW_CALLS_MIN_NODES, CODE2FLOW_CALLS_MAX_NODES, CODE2FLOW_CALLS_MAX_PARTS, CODE2FLOW_CALLS_INCLUDE_SINGLETONS, CODE2FLOW_MERMAID_MAX_EDGES, CODE2FLOW_MERMAID_MAX_TEXT_SIZE;
}
deploy {
target: docker;
}
environment[name="local"] {
runtime: docker-compose;
env_file: .env;
template_file: .env.example;
python_version: >=3.8;
vars: CODE2FLOW_CALLS_INCLUDE_SINGLETONS, CODE2FLOW_CALLS_KEEP_MAIN, CODE2FLOW_CALLS_MAX_NODES, CODE2FLOW_CALLS_MAX_PARTS, CODE2FLOW_CALLS_MIN_NODES, CODE2FLOW_CALLS_SPLIT, CODE2FLOW_MERMAID_MAX_EDGES, CODE2FLOW_MERMAID_MAX_TEXT_SIZE;
}