-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsumd.json
More file actions
144 lines (144 loc) · 55 KB
/
Copy pathsumd.json
File metadata and controls
144 lines (144 loc) · 55 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
{
"project_name": "Ze źródeł",
"description": "SUMD - Structured Unified Markdown Descriptor for AI-aware project refactorization",
"sections": [
{
"name": "contents",
"type": "unknown",
"content": "- [Metadata](#metadata)\n- [Architecture](#architecture)\n- [Workflows](#workflows)\n- [Quality Pipeline (`pyqual.yaml`)](#quality-pipeline-pyqualyaml)\n- [Dependencies](#dependencies)\n- [Source Map](#source-map)\n- [Refactoring Analysis](#refactoring-analysis)\n- [Intent](#intent)",
"level": 2
},
{
"name": "metadata",
"type": "metadata",
"content": "- **name**: `redsl`\n- **version**: `1.2.45`\n- **python_requires**: `>=3.11`\n- **license**: Apache-2.0\n- **ai_model**: `openrouter/openai/gpt-5-mini`\n- **ecosystem**: SUMD + DOQL + testql + taskfile\n- **generated_from**: pyproject.toml, requirements.txt, Taskfile.yml, Makefile, app.doql.css, goal.yaml, .env.example, Dockerfile, docker-compose.yml, src(5 mod), project/(5 analysis files)",
"level": 2
},
{
"name": "architecture",
"type": "architecture",
"content": "```\nSUMD (description) → DOQL/source (code) → taskfile (automation) → testql (verification)\n```",
"level": 2
},
{
"name": "# doql application declaration (`app.doql.css`)",
"type": "unknown",
"content": "```css markpact:doql path=app.doql.css\napp {\n name: \"redsl\";\n version: \"1.2.28\";\n}\n\ninterface[type=\"cli\"] {\n framework: click;\n}\ninterface[type=\"cli\"] page[name=\"redsl\"] {\n\n}\n\nworkflow[name=\"install\"] {\n trigger: \"manual\";\n step-1: run cmd=$(PIP) install -r requirements.txt;\n}\n\nworkflow[name=\"dev-install\"] {\n trigger: \"manual\";\n step-1: run cmd=$(PIP) install -r requirements.txt;\n step-2: run cmd=$(PIP) install -e \".[dev]\";\n}\n\nworkflow[name=\"test\"] {\n trigger: \"manual\";\n step-1: run cmd=$(PYTHON) -m pytest tests/ -v -m \"not slow\";\n}\n\nworkflow[name=\"test-fast\"] {\n trigger: \"manual\";\n step-1: run cmd=$(PYTHON) -m pytest tests/ -q -m \"not slow and not integration and not e2e\";\n}\n\nworkflow[name=\"test-all\"] {\n trigger: \"manual\";\n step-1: run cmd=$(PYTHON) -m pytest tests/ -v;\n}\n\nworkflow[name=\"lint\"] {\n trigger: \"manual\";\n step-1: run cmd=$(PYTHON) -m ruff check redsl/ tests/;\n}\n\nworkflow[name=\"type-check\"] {\n trigger: \"manual\";\n step-1: run cmd=$(PYTHON) -m mypy redsl/;\n}\n\nworkflow[name=\"format\"] {\n trigger: \"manual\";\n step-1: run cmd=$(PYTHON) -m ruff format redsl/ tests/;\n step-2: run cmd=$(PYTHON) -m ruff check --fix redsl/ tests/;\n}\n\nworkflow[name=\"format-check\"] {\n trigger: \"manual\";\n step-1: run cmd=$(PYTHON) -m ruff format --check redsl/ tests/;\n}\n\nworkflow[name=\"docker-up\"] {\n trigger: \"manual\";\n step-1: run cmd=$(DOCKER_COMPOSE) up -d;\n}\n\nworkflow[name=\"docker-down\"] {\n trigger: \"manual\";\n step-1: run cmd=$(DOCKER_COMPOSE) down;\n}\n\nworkflow[name=\"docker-build\"] {\n trigger: \"manual\";\n step-1: run cmd=$(DOCKER_COMPOSE) build;\n}\n\nworkflow[name=\"run\"] {\n trigger: \"manual\";\n step-1: depend target=docker-up;\n}\n\nworkflow[name=\"run-local\"] {\n trigger: \"manual\";\n step-1: run cmd=$(PYTHON) -m uvicorn redsl.api:app --reload --host 0.0.0.0 --port 8000;\n}\n\nworkflow[name=\"clean\"] {\n trigger: \"manual\";\n step-1: run cmd=find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true;\n step-2: run cmd=find . -type f -name \"*.pyc\" -delete 2>/dev/null || true;\n step-3: run cmd=find . -type d -name \".pytest_cache\" -exec rm -rf {} + 2>/dev/null || true;\n step-4: run cmd=find . -type d -name \".mypy_cache\" -exec rm -rf {} + 2>/dev/null || true;\n step-5: run cmd=rm -rf refactor_output/ 2>/dev/null || true;\n}\n\nworkflow[name=\"fmt\"] {\n trigger: \"manual\";\n step-1: run cmd=ruff format .;\n}\n\nworkflow[name=\"build\"] {\n trigger: \"manual\";\n step-1: run cmd=python -m build;\n}\n\nworkflow[name=\"health\"] {\n trigger: \"manual\";\n step-1: run cmd=docker compose ps;\n step-2: run cmd=docker compose exec app echo \"Health check passed\";\n}\n\nworkflow[name=\"up\"] {\n trigger: \"manual\";\n step-1: run cmd=docker compose up -d;\n}\n\nworkflow[name=\"down\"] {\n trigger: \"manual\";\n step-1: run cmd=docker compose down;\n}\n\nworkflow[name=\"logs\"] {\n trigger: \"manual\";\n step-1: run cmd=docker compose logs -f;\n}\n\nworkflow[name=\"ps\"] {\n trigger: \"manual\";\n step-1: run cmd=docker compose ps;\n}\n\nworkflow[name=\"import-makefile-hint\"] {\n trigger: \"manual\";\n step-1: run cmd=echo 'Run: taskfile import Makefile to import existing targets.';\n}\n\nworkflow[name=\"help\"] {\n trigger: \"manual\";\n step-1: run cmd=echo \\\"Dost\\u0119pne komendy:\\; \n step-2: run cmd=echo \\\" install - Instalacja zale\\u017Cno\\u015Bci produkcyjnych\\; \n step-3: run cmd=echo \\\" dev-install - Instalacja zale\\u017Cno\\u015Bci deweloperskich\\; \n step-4: run cmd=echo \\\" test - Uruchomienie test\\xF3w pytest (bez slow)\\; \n step-5: run cmd=echo \" test-fast - Szybkie testy (bez slow/integration/e2e)\";\n step-6: run cmd=echo \\\" test-all - Wszystkie testy w\\u0142\\u0105cznie z slow\\; \n step-7: run cmd=echo \" lint - Sprawdzenie lintingu ruff\";\n step-8: run cmd=echo \\\" type-check - Sprawdzenie typ\\xF3w mypy\\; \n step-9: run cmd=echo \" format - Formatowanie kodu ruff\";\n step-10: run cmd=echo \" format-check - Sprawdzenie formatowania kodu\";\n step-11: run cmd=echo \\\" docker-up - Uruchomienie us\\u0142ug Docker\\; \n step-12: run cmd=echo \\\" docker-down - Zatrzymanie us\\u0142ug Docker\\; \n step-13: run cmd=echo \\\" docker-build - Budowanie obraz\\xF3w Docker\\; \n step-14: run cmd=echo \" run - Uruchomienie aplikacji w Docker\";\n step-15: run cmd=echo \" run-local - Uruchomienie aplikacji lokalnie\";\n step-16: run cmd=echo \\\" clean - Czyszczenie plik\\xF3w tymczasowych\\; \n}\n\ndeploy {\n target: docker-compose;\n compose_file: docker-compose.yml;\n}\n\nenvironment[name=\"local\"] {\n runtime: docker-compose;\n env_file: \".env\";\n}\n\nworkflow[name=\"all\"] {\n trigger: \"manual\";\n step-1: run cmd=taskfile run install;\n step-2: run cmd=taskfile run lint;\n step-3: run cmd=taskfile run test;\n}\n```",
"level": 2
},
{
"name": "# source modules",
"type": "unknown",
"content": "- `redsl.config`\n- `redsl.consciousness_loop`\n- `redsl.history`\n- `redsl.main`\n- `redsl.orchestrator`",
"level": 2
},
{
"name": "workflows",
"type": "workflows",
"content": "",
"level": 2
},
{
"name": "# taskfile tasks (`taskfile.yml`)",
"type": "unknown",
"content": "```yaml markpact:taskfile path=Taskfile.yml\nversion: '1'\nname: redsl\ndescription: Minimal Taskfile\nvariables:\n APP_NAME: redsl\nenvironments:\n local:\n container_runtime: docker\n compose_command: docker compose\npipeline:\n python_version: \"3.12\"\n runner_image: ubuntu-latest\n branches: [main]\n cache: [~/.cache/pip]\n artifacts: [dist/]\n\n stages:\n - name: lint\n tasks: [lint]\n\n - name: test\n tasks: [test]\n\n - name: build\n tasks: [build]\n when: \"branch:main\"\n\ntasks:\n install:\n desc: Install Python dependencies (editable)\n cmds:\n - pip install -e .[dev]\n test:\n desc: Run pytest suite\n cmds:\n - pytest -q\n lint:\n desc: Run ruff lint check\n cmds:\n - ruff check .\n fmt:\n desc: Auto-format with ruff\n cmds:\n - ruff format .\n build:\n desc: Build wheel + sdist\n cmds:\n - python -m build\n clean:\n desc: Remove build artefacts\n cmds:\n - rm -rf build/ dist/ *.egg-info\n up:\n desc: Start services via docker compose\n cmds:\n - docker compose up -d\n down:\n desc: Stop services\n cmds:\n - docker compose down\n logs:\n desc: Tail compose logs\n cmds:\n - docker compose logs -f\n ps:\n desc: Show running compose services\n cmds:\n - docker compose ps\n docker-build:\n desc: Build docker image\n cmds:\n - docker build -t redsl:latest .\n help:\n desc: '[imported from Makefile] help'\n cmds:\n - \"echo \\\"Dost\\u0119pne komendy:\\\"\"\n - \"echo \\\" install - Instalacja zale\\u017Cno\\u015Bci produkcyjnych\\\"\"\n - \"echo \\\" dev-install - Instalacja zale\\u017Cno\\u015Bci deweloperskich\\\"\"\n - \"echo \\\" test - Uruchomienie test\\xF3w pytest (bez slow)\\\"\"\n - echo \" test-fast - Szybkie testy (bez slow/integration/e2e)\"\n - \"echo \\\" test-all - Wszystkie testy w\\u0142\\u0105cznie z slow\\\"\"\n - echo \" lint - Sprawdzenie lintingu ruff\"\n - \"echo \\\" type-check - Sprawdzenie typ\\xF3w mypy\\\"\"\n - echo \" format - Formatowanie kodu ruff\"\n - echo \" format-check - Sprawdzenie formatowania kodu\"\n - \"echo \\\" docker-up - Uruchomienie us\\u0142ug Docker\\\"\"\n - \"echo \\\" docker-down - Zatrzymanie us\\u0142ug Docker\\\"\"\n - \"echo \\\" docker-build - Budowanie obraz\\xF3w Docker\\\"\"\n - echo \" run - Uruchomienie aplikacji w Docker\"\n - echo \" run-local - Uruchomienie aplikacji lokalnie\"\n - \"echo \\\" clean - Czyszczenie plik\\xF3w tymczasowych\\\"\"\n dev-install:\n desc: '[imported from Makefile] dev-install'\n cmds:\n - $(PIP) install -r requirements.txt\n - $(PIP) install -e \".[dev]\"\n test-fast:\n desc: '[imported from Makefile] test-fast'\n cmds:\n - $(PYTHON) -m pytest tests/ -q -m \"not slow and not integration and not e2e\"\n test-all:\n desc: '[imported from Makefile] test-all'\n cmds:\n - $(PYTHON) -m pytest tests/ -v\n type-check:\n desc: '[imported from Makefile] type-check'\n cmds:\n - $(PYTHON) -m mypy redsl/\n format:\n desc: '[imported from Makefile] format'\n cmds:\n - $(PYTHON) -m ruff format redsl/ tests/\n - $(PYTHON) -m ruff check --fix redsl/ tests/\n format-check:\n desc: '[imported from Makefile] format-check'\n cmds:\n - $(PYTHON) -m ruff format --check redsl/ tests/\n docker-up:\n desc: '[imported from Makefile] docker-up'\n cmds:\n - $(DOCKER_COMPOSE) up -d\n docker-down:\n desc: '[imported from Makefile] docker-down'\n cmds:\n - $(DOCKER_COMPOSE) down\n run:\n desc: '[imported from Makefile] run'\n deps:\n - docker-up\n run-local:\n desc: '[imported from Makefile] run-local'\n cmds:\n - $(PYTHON) -m uvicorn redsl.api:app --reload --host 0.0.0.0 --port 8000\n health:\n desc: '[from doql] workflow: health'\n cmds:\n - docker compose ps\n - docker compose exec app echo \"Health check passed\"\n import-makefile-hint:\n desc: '[from doql] workflow: import-makefile-hint'\n cmds:\n - 'echo ''Run: taskfile import Makefile to import existing targets.'''\n all:\n desc: Run install, lint, test\n cmds:\n - taskfile run install\n - taskfile run lint\n - taskfile run test\n```",
"level": 2
},
{
"name": "quality pipeline (`pyqual.yaml`)",
"type": "unknown",
"content": "```yaml markpact:pyqual path=pyqual.yaml\nproject_root: .\npackage_name: redsl\ninclude:\n- '**/*.py'\nexclude:\n- '**/__pycache__/**'\n- '**/node_modules/**'\n- '**/.venv/**'\n- '**/venv/**'\n- '**/.git/**'\n- '**/build/**'\n- '**/dist/**'\n- '**/*.egg-info/**'\n- '**/tests/**'\n- 'archive/**'\n- 'redsl_output/**'\n- 'refactor_output/**'\n- 'vallm_analysis/**'\n- 'vallm_json/**'\n- 'vallm_text/**'\ntools:\n parallel: true\n cache: true\n ruff:\n enabled: true\n max_line_length: 88\n select:\n - E\n - F\n - W\n - I\n - C\n - B\n - A\n - COM\n - C4\n - DTZ\n - T10\n - EM\n - EXE\n - FA\n - ISC\n - ICN\n - G\n - INP\n - PIE\n - T20\n - PT\n - Q\n - RSE\n - RET\n - SIM\n - TID\n - TCH\n - ARG\n - PTH\n - ERA\n - PGH\n - PL\n - TRY\n - FLAKE8-PYTESTSTYLE\n - RUF\n ignore:\n - E501\n - PLR0913\n - PLR0915\n mypy:\n enabled: true\n strict: false\n ignore_missing_imports: true\n disallow_untyped_defs: false\n disallow_incomplete_defs: false\n check_untyped_defs: true\n disallow_untyped_decorators: false\n no_implicit_optional: true\n warn_redundant_casts: true\n warn_unused_ignores: true\n warn_no_return: true\n warn_unreachable: true\n strict_equality: true\n isort:\n enabled: true\n profile: black\n multi_line_output: 3\n line_length: 88\n bandit:\n enabled: true\n exclude_dirs:\n - tests\n coverage:\n enabled: true\n fail_under: 80\n pydocstyle:\n enabled: true\n convention: google\n vulture:\n enabled: true\n min_confidence: 60\nperformance:\n max_workers: 4\n cache_size: 104857600\n chunk_size: 10\nmetrics:\n complexity:\n enabled: true\n max_complexity: 10\n tools:\n - radon\n - xenon\n maintainability:\n enabled: true\n min_maintainability: 70\n tools:\n - radon\n duplication:\n enabled: true\n min_similarity: 0.85\n tools:\n - jscpd\n test_coverage:\n enabled: true\n min_coverage: 80\n tools:\n - coverage\nrules:\n unused-imports:\n enabled: true\n tools:\n - ruff\n - autoflake\n severity: error\n magic-numbers:\n enabled: true\n threshold: 2\n exclude:\n - 0\n - 1\n - -1\n - 2\n severity: warning\n print-statements:\n enabled: true\n severity: warning\n TODO-comments:\n enabled: true\n severity: info\n long-lines:\n enabled: true\n max_length: 88\n severity: warning\n missing-docstrings:\n enabled: true\n public_only: true\n severity: warning\n type-hints:\n enabled: true\n require_return_type: true\n require_param_types: false\n severity: warning\n security-issues:\n enabled: true\n tools:\n - bandit\n severity: error\n code-smells:\n enabled: true\n tools:\n - ruff\n - mypy\n severity: warning\nplugins:\n enabled: true\n directories:\n - ~/.pyqual/plugins\n - ./.pyqual/plugins\nenvironments:\n development:\n rules:\n print-statements:\n enabled: true\n magic-numbers:\n enabled: false\n TODO-comments:\n severity: warning\n performance:\n max_workers: 2\n production:\n rules:\n print-statements:\n enabled: false\n magic-numbers:\n enabled: true\n TODO-comments:\n severity: error\n performance:\n max_workers: 8\n testing:\n rules:\n print-statements:\n enabled: true\n magic-numbers:\n enabled: false\n missing-docstrings:\n enabled: false\n metrics:\n test_coverage:\n enabled: true\n min_coverage: 90\nreporting:\n output_formats:\n - yaml\n - json\n - html\n include_summary: true\n include_details: true\n include_recommendations: true\n output_file: pyqual_report\n```",
"level": 2
},
{
"name": "dependencies",
"type": "dependencies",
"content": "",
"level": 2
},
{
"name": "# runtime",
"type": "unknown",
"content": "```text markpact:deps python\nfastapi>=0.115.0\nuvicorn>=0.44.0\npydantic>=2.10.0\nlitellm>=1.52.0\nchromadb>=0.6.0\npyyaml>=6.0.2\nrich>=13.9.0\nhttpx>=0.28.0\nclick>=8.1.7\npython-dotenv>=1.0.1\ngoal>=2.1.0\ncosts>=0.1.20\npfix>=0.1.60\n```",
"level": 2
},
{
"name": "# development",
"type": "unknown",
"content": "```text markpact:deps python scope=dev\npytest>=9.0\npytest-xdist>=3.5\npytest-cov>=7.1\nruff>=0.15.0\nmypy>=1.13\ngoal>=2.1.0\ncosts>=0.1.20\npfix>=0.1.60\n```",
"level": 2
},
{
"name": "source map",
"type": "unknown",
"content": "*Top 5 modules by symbol density — signatures for LLM orientation.*",
"level": 2
},
{
"name": "# `redsl.main` (`redsl/main.py`)",
"type": "unknown",
"content": "```python\ndef _get_orchestrator(model) # CC=2, fan=2\ndef _analysis_source_method(orch, path) # CC=2, fan=3\ndef _analysis_function_metrics(result) # CC=4, fan=1\ndef _print_analysis_summary(result, path, source_method) # CC=2, fan=1\ndef _print_top_functions(func_metrics) # CC=5, fan=1\ndef _print_alerts(result, func_metrics) # CC=6, fan=2\ndef _print_duplicates(result) # CC=3, fan=3\ndef _print_analysis_plan(result, path) # CC=5, fan=7\ndef cmd_analyze(project_dir) # CC=2, fan=13\ndef cmd_explain(project_dir) # CC=1, fan=4\ndef _print_refactor_report(report, orch) # CC=3, fan=3\ndef cmd_refactor(project_dir, dry_run, auto, max_actions, model) # CC=2, fan=5\ndef cmd_memory_stats() # CC=1, fan=4\ndef cmd_serve(port, host) # CC=1, fan=1\ndef _print_usage() # CC=1, fan=1\ndef _get_arg(args, name, default) # CC=4, fan=2\ndef _has_flag(args, name) # CC=1, fan=0\ndef _dispatch_analyze(args) # CC=1, fan=2\ndef _dispatch_explain(args) # CC=1, fan=2\ndef _dispatch_refactor(args) # CC=2, fan=4\ndef _dispatch_memory_stats(args) # CC=1, fan=1\ndef _dispatch_serve(args) # CC=1, fan=3\ndef main() # CC=3, fan=6\n```",
"level": 2
},
{
"name": "# `redsl.history` (`redsl/history.py`)",
"type": "unknown",
"content": "```python\ndef _default_history_dir(project_dir) # CC=1, fan=0\nclass HistoryEvent: # A single persisted event in the refactor history.\nclass HistoryWriter: # Append-only history logger backed by .redsl/history.jsonl.\n def __init__(project_dir) # CC=1\n def record(event) # CC=1\n def record_event(event_type) # CC=1\n def decision_signature() # CC=2\n def has_recent_signature(signature, limit) # CC=5\nclass HistoryReader: # Read-only access to .redsl/history.jsonl for querying and de\n def __init__(project_dir) # CC=1\n def load_events() # CC=5\n def filter_by_file(target_file) # CC=3\n def filter_by_type(event_type) # CC=3\n def has_recent_proposal(target_file, action) # CC=7\n def has_recent_ticket(title_prefix) # CC=7\n def _format_event_header(ev) # CC=3\n def _format_event_details(ev) # CC=5\n def _maybe_add_cycle_header(ev, current_cycle) # CC=3\n def generate_decision_report() # CC=3\n```",
"level": 2
},
{
"name": "# `redsl.consciousness_loop` (`redsl/consciousness_loop.py`)",
"type": "unknown",
"content": "```python\ndef main_loop() # CC=4, fan=6\nclass ConsciousnessLoop: # Ciągła pętla „świadomości\" agenta.\n def __init__(project_dir, interval_seconds, config) # CC=2\n def run() # CC=5\n def _inner_thought(cycle) # CC=3\n def _self_assessment(cycle) # CC=3\n def _profile_performance(cycle) # CC=3\n def stop() # CC=1\n```",
"level": 2
},
{
"name": "# `redsl.config` (`redsl/config.py`)",
"type": "unknown",
"content": "```python\ndef _default_llm_model() # CC=6, fan=1\ndef _resolve_provider_key(model) # CC=6, fan=3\nclass LLMConfig: # Konfiguracja warstwy LLM.\n def is_local() # CC=1\n def api_key() # CC=1\n def api_key(value) # CC=1\nclass MemoryConfig: # Konfiguracja systemu pamięci.\nclass AnalyzerConfig: # Konfiguracja analizatora kodu.\nclass RefactorConfig: # Konfiguracja silnika refaktoryzacji.\nclass AgentConfig: # Główna konfiguracja agenta.\n def from_env(cls) # CC=4\n```",
"level": 2
},
{
"name": "# `redsl.orchestrator` (`redsl/orchestrator.py`)",
"type": "unknown",
"content": "```python\nclass CycleReport: # Raport z jednego cyklu refaktoryzacji.\nclass RefactorOrchestrator: # Główny orkiestrator — „mózg\" systemu.\n def __init__(config) # CC=2\n def run_cycle(project_dir, max_actions, use_code2llm, validate_regix, rollback_on_failure, use_sandbox, target_file, run_tests) # CC=1\n def run_from_toon_content(project_toon, duplication_toon, validation_toon, source_files, max_actions) # CC=1\n def add_custom_rules(rules_yaml) # CC=1\n def _resolve_limits(project_dir, default_max) # CC=8\n```",
"level": 2
},
{
"name": "refactoring analysis",
"type": "unknown",
"content": "*Pre-refactoring snapshot — use this section to identify targets. Generated from `project/` toon files.*",
"level": 2
},
{
"name": "# code analysis (`project/analysis.toon.yaml`)",
"type": "unknown",
"content": "```toon markpact:analysis path=project/analysis.toon.yaml\n# code2llm | 227f 32227L | python:225,shell:2 | 2026-04-19\n# CC̄=3.8 | critical:7/1329 | dups:0 | cycles:0\n\nHEALTH[8]:\n 🔴 GOD redsl/llm/selection.py = 508L, 6 classes, 27m, max CC=9\n 🟡 CC process_data CC=25 (limit:15)\n 🟡 CC process_data_copy CC=25 (limit:15)\n 🟡 CC refactor_plan_to_tasks CC=17 (limit:15)\n 🟡 CC generate_planfile CC=32 (limit:15)\n 🟡 CC format_cycle_report_toon CC=23 (limit:15)\n 🟡 CC planfile_sync CC=20 (limit:15)\n 🟡 CC pick_coding CC=16 (limit:15)\n\nREFACTOR[2]:\n 1. split redsl/llm/selection.py (god module)\n 2. split 7 high-CC methods (CC>15)\n\nPIPELINES[651]:\n [1] Src [main]: main → run_full_pipeline_example → load_example_yaml → _resolve_yaml_path → ...(1 more)\n PURITY: 100% pure\n [2] Src [main]: main\n PURITY: 100% pure\n [3] Src [main_function]: main_function → process_data\n PURITY: 100% pure\n [4] Src [main]: main → run_basic_analysis_example → load_example_yaml → _resolve_yaml_path → ...(1 more)\n PURITY: 100% pure\n [5] Src [__init__]: __init__\n PURITY: 100% pure\n\nLAYERS:\n test_refactor_project/ CC̄=4.0 ←in:0 →out:0\n │ bad_code 24L 1C 2m CC=4 ←0\n │\n redsl/ CC̄=3.9 ←in:30 →out:25 !! split\n │ !! sumr_planfile 510L 3C 6m CC=32 ←1\n │ !! selection 508L 6C 27m CC=9 ←1\n │ !! models 422L 0C 11m CC=16 ←1\n │ sumd_bridge 412L 2C 13m CC=11 ←0\n │ config 410L 0C 13m CC=7 ←1\n │ radon_analyzer 394L 1C 23m CC=10 ←1\n │ pipeline 390L 1C 14m CC=10 ←1\n │ decision 389L 0C 9m CC=8 ←6\n │ nlp_handlers 358L 1C 10m CC=12 ←0\n │ cli_autonomy 356L 0C 20m CC=6 ←0\n │ __init__ 349L 2C 12m CC=8 ←5\n │ engine 336L 1C 9m CC=12 ←1\n │ base 335L 6C 13m CC=14 ←0\n │ reporting 332L 0C 25m CC=12 ←1\n │ !! cycle 328L 0C 12m CC=23 ←1\n │ quality_gate 325L 1C 10m CC=11 ←4\n │ __init__ 325L 2C 16m CC=10 ←0\n │ agent_bridge 320L 1C 8m CC=12 ←2\n │ doctor_detectors 319L 0C 17m CC=8 ←1\n │ refactor 319L 0C 13m CC=6 ←1\n │ validator 314L 0C 7m CC=12 ←1\n │ regix_bridge 313L 1C 8m CC=9 ←1\n │ aggregator 310L 1C 15m CC=8 ←0\n │ vallm_bridge 306L 1C 7m CC=10 ←1\n │ llx_router 305L 1C 15m CC=10 ←2\n │ hybrid 304L 0C 14m CC=9 ←4\n │ project_parser 300L 1C 18m CC=12 ←0\n │ testql_bridge 297L 2C 10m CC=12 ←0\n │ toon_analyzer 296L 1C 13m CC=14 ←0\n │ store 294L 5C 22m CC=8 ←1\n │ incremental 291L 2C 17m CC=8 ←24\n │ refactor_routes 291L 0C 8m CC=6 ←1\n │ engine 290L 6C 12m CC=10 ←0\n │ perf_bridge 289L 3C 11m CC=6 ←2\n │ __init__ 288L 1C 13m CC=7 ←0\n │ diff_manager 283L 0C 9m CC=9 ←0\n │ growth_control 277L 3C 12m CC=11 ←0\n │ prompts 277L 0C 3m CC=9 ←1\n │ python_analyzer 273L 1C 8m CC=12 ←3\n │ main 272L 0C 23m CC=6 ←1\n │ rule_generator 271L 2C 11m CC=6 ←0\n │ semantic_chunker 270L 2C 11m CC=11 ←0\n │ scheduler 264L 2C 16m CC=9 ←0\n │ github_actions 260L 1C 6m CC=6 ←0\n │ multi_project 251L 3C 10m CC=5 ←0\n │ metrics 249L 1C 11m CC=7 ←2\n │ pyqual_bridge 249L 0C 12m CC=11 ←2\n │ redup_bridge 246L 1C 7m CC=9 ←1\n │ scan 243L 4C 13m CC=8 ←0\n │ catalog 237L 1C 3m CC=5 ←1\n │ __init__ 235L 4C 18m CC=8 ←0\n │ doctor_fixers 230L 0C 9m CC=10 ←0\n │ auto_fix 220L 1C 13m CC=8 ←2\n │ batch 212L 0C 12m CC=7 ←4\n │ history 210L 3C 13m CC=11 ←0\n │ direct_imports 210L 1C 14m CC=7 ←0\n │ sandbox 210L 3C 9m CC=11 ←0\n │ quality_visitor 209L 1C 18m CC=8 ←0\n │ consciousness_loop 204L 1C 7m CC=5 ←0\n │ git_ops 204L 0C 7m CC=6 ←1\n │ body_restorer 203L 0C 7m CC=11 ←1\n │ planfile_bridge 201L 0C 7m CC=10 ←0\n │ !! planfile 199L 0C 5m CC=20 ←0\n │ model_policy 190L 0C 6m CC=11 ←1\n │ paths 189L 0C 9m CC=12 ←4\n │ _indent_fixers 188L 0C 9m CC=9 ←2\n │ applier 187L 2C 7m CC=8 ←0\n │ code2llm_bridge 185L 1C 5m CC=5 ←1\n │ gate 184L 2C 7m CC=10 ←0\n │ refactor 183L 0C 9m CC=7 ←3\n │ _guard_fixers 179L 0C 7m CC=11 ←1\n │ runner 177L 1C 7m CC=8 ←0\n │ timeline_toon 173L 1C 10m CC=11 ←1\n │ cycle 172L 0C 5m CC=7 ←0\n │ orchestrator 170L 2C 5m CC=8 ←0\n │ timeline_analysis 169L 1C 7m CC=11 ←1\n │ audit 168L 0C 10m CC=4 ←1\n │ intent 167L 0C 7m CC=8 ←1\n │ git_timeline 165L 1C 23m CC=5 ←0\n │ _scan_report 158L 0C 8m CC=10 ←0\n │ badge 158L 0C 8m CC=6 ←1\n │ doctor_fstring_fixers 155L 0C 10m CC=10 ←0\n │ analyzer 155L 0C 6m CC=8 ←1\n │ resolution 154L 0C 6m CC=9 ←3\n │ health_model 151L 3C 6m CC=9 ←0\n │ reporter 148L 1C 5m CC=8 ←0\n │ direct_guard 148L 1C 6m CC=8 ←0\n │ functions_parser 148L 1C 6m CC=9 ←0\n │ config 144L 5C 4m CC=6 ←17\n │ review 143L 0C 6m CC=9 ←1\n │ security 142L 2C 6m CC=8 ←1\n │ llm_banner 140L 0C 5m CC=8 ←5\n │ utils 140L 0C 9m CC=7 ←4\n │ batch 139L 0C 7m CC=4 ←0\n │ reporting 138L 0C 5m CC=12 ←2\n │ proactive 138L 2C 5m CC=7 ←0\n │ models 138L 0C 0m CC=0.0 ←0\n │ profiles 136L 0C 3m CC=1 ←2\n │ pr_bot 136L 0C 6m CC=7 ←1\n │ __init__ 134L 0C 2m CC=13 ←1\n │ ecosystem 134L 2C 10m CC=10 ←0\n │ ast_transformers 131L 2C 9m CC=8 ←0\n │ direct_constants 130L 1C 6m CC=9 ←0\n │ memory_learning 129L 0C 6m CC=6 ←1\n │ timeline_git 128L 1C 7m CC=8 ←1\n │ pipeline 126L 0C 6m CC=6 ←1\n │ change_patterns 125L 2C 6m CC=12 ←0\n │ doctor 124L 0C 3m CC=8 ←1\n │ direct_types 124L 1C 5m CC=8 ←0\n │ smart_scorer 122L 0C 5m CC=7 ←0\n │ batch 121L 0C 6m CC=3 ←1\n │ self_model 121L 3C 7m CC=6 ←0\n │ llm_policy 120L 5C 1m CC=2 ←0\n │ examples 118L 0C 14m CC=4 ←1\n │ cli_doctor 116L 0C 8m CC=8 ←0\n │ __init__ 116L 0C 0m CC=0.0 ←0\n │ core 115L 6C 3m CC=1 ←0\n │ models 110L 7C 0m CC=0.0 ←0\n │ verdict 109L 0C 7m CC=10 ←1\n │ webhook 109L 0C 3m CC=4 ←1\n │ timeline_models 107L 3C 3m CC=3 ←0\n │ adaptive_executor 106L 1C 3m CC=7 ←0\n │ reflector 106L 0C 2m CC=5 ←1\n │ fix_decisions 104L 0C 5m CC=4 ←1\n │ proposals 103L 5C 4m CC=3 ←1\n │ awareness 101L 0C 6m CC=6 ←1\n │ resolver 97L 1C 4m CC=8 ←1\n │ models 96L 13C 0m CC=0.0 ←0\n │ example_routes 95L 0C 4m CC=7 ←1\n │ _common 94L 0C 6m CC=4 ←12\n │ __init__ 89L 0C 3m CC=1 ←0\n │ base 89L 1C 2m CC=6 ←2\n │ ast_analyzer 88L 1C 2m CC=7 ←0\n │ config_gen 87L 1C 3m CC=4 ←1\n │ __init__ 87L 0C 0m CC=0.0 ←0\n │ reporter 86L 0C 4m CC=9 ←6\n │ cli_awareness 83L 0C 8m CC=1 ←0\n │ metrics 81L 2C 2m CC=2 ←0\n │ pyqual_example 74L 0C 2m CC=8 ←1\n │ executor 74L 0C 0m CC=0.0 ←0\n │ todo_gen 72L 0C 3m CC=8 ←1\n │ pipeline 71L 4C 4m CC=4 ←0\n │ analyzer 71L 1C 8m CC=1 ←0\n │ __init__ 70L 0C 2m CC=1 ←0\n │ sandbox_execution 69L 0C 1m CC=4 ←1\n │ custom_rules 68L 0C 3m CC=6 ←1\n │ full_pipeline 67L 0C 2m CC=4 ←1\n │ __init__ 67L 0C 0m CC=0.0 ←0\n │ discovery 66L 0C 5m CC=7 ←2\n │ __init__ 64L 0C 0m CC=0.0 ←0\n │ direct 63L 1C 6m CC=1 ←0\n │ models 62L 1C 0m CC=0.0 ←0\n │ mypy_analyzer 61L 1C 2m CC=7 ←0\n │ debug 60L 0C 5m CC=3 ←1\n │ debug_routes 59L 0C 1m CC=1 ←1\n │ hybrid 57L 0C 1m CC=7 ←2\n │ validation 57L 0C 2m CC=6 ←1\n │ duplication_parser 57L 1C 1m CC=12 ←0\n │ runner 56L 0C 2m CC=6 ←0\n │ __init__ 55L 0C 0m CC=0.0 ←0\n │ basic_analysis 54L 0C 2m CC=3 ←1\n │ secrets 53L 2C 2m CC=4 ←0\n │ ruff_analyzer 49L 1C 1m CC=10 ←0\n │ models 49L 3C 0m CC=0.0 ←0\n │ logging 48L 0C 1m CC=6 ←3\n │ bandit_analyzer 47L 1C 1m CC=9 ←0\n │ utils 47L 0C 2m CC=3 ←0\n │ models 46L 6C 0m CC=0.0 ←0\n │ doctor_data 41L 2C 1m CC=2 ←0\n │ api_integration 41L 0C 2m CC=2 ←1\n │ scan 41L 0C 2m CC=6 ←0\n │ __init__ 41L 0C 0m CC=0.0 ←0\n │ doctor_helpers 40L 0C 2m CC=5 ←1\n │ reporter 40L 0C 3m CC=4 ←1\n │ validation_parser 40L 1C 1m CC=12 ←0\n │ pyqual 38L 0C 4m CC=1 ←1\n │ __init__ 38L 0C 0m CC=0.0 ←0\n │ utils 37L 0C 3m CC=4 ←0\n │ debug 36L 0C 1m CC=6 ←0\n │ pyqual_routes 33L 0C 1m CC=1 ←1\n │ __init__ 33L 0C 0m CC=0.0 ←0\n │ doctor_indent_fixers 31L 0C 0m CC=0.0 ←0\n │ models 30L 1C 0m CC=0.0 ←0\n │ __init__ 30L 0C 0m CC=0.0 ←0\n │ __init__ 29L 1C 0m CC=0.0 ←0\n │ __init__ 28L 0C 0m CC=0.0 ←0\n │ discovery 26L 0C 2m CC=5 ←0\n │ __init__ 23L 0C 0m CC=0.0 ←0\n │ __init__ 22L 0C 0m CC=0.0 ←0\n │ tool_check 21L 0C 1m CC=2 ←3\n │ health_routes 20L 0C 1m CC=1 ←1\n │ __init__ 19L 0C 0m CC=0.0 ←0\n │ helpers 17L 0C 2m CC=1 ←2\n │ json_helpers 17L 0C 1m CC=4 ←0\n │ __init__ 17L 0C 0m CC=0.0 ←0\n │ webhook_routes 16L 0C 1m CC=1 ←1\n │ _base 15L 1C 1m CC=1 ←0\n │ __init__ 15L 0C 0m CC=0.0 ←0\n │ __init__ 15L 0C 0m CC=0.0 ←0\n │ core 14L 0C 1m CC=1 ←2\n │ _fixer_utils 13L 0C 1m CC=2 ←3\n │ __main__ 6L 0C 0m CC=0.0 ←0\n │ __init__ 3L 0C 0m CC=0.0 ←0\n │ __init__ 1L 0C 0m CC=0.0 ←0\n │ __main__ 1L 0C 0m CC=0.0 ←0\n │ __init__ 1L 0C 0m CC=0.0 ←0\n │ __init__ 1L 0C 0m CC=0.0 ←0\n │\n test_refactor_bad/ CC̄=3.8 ←in:0 →out:0\n │ !! complex_code 137L 1C 17m CC=25 ←0\n │\n examples/ CC̄=2.3 ←in:0 →out:0\n │ main 168L 0C 5m CC=5 ←0\n │ 00_orders__service 88L 0C 6m CC=6 ←0\n │ main 32L 0C 1m CC=1 ←0\n │ main 30L 0C 1m CC=1 ←0\n │ main 29L 0C 1m CC=1 ←0\n │ main 27L 0C 1m CC=1 ←0\n │ main 27L 0C 1m CC=1 ←0\n │ main 27L 0C 1m CC=1 ←0\n │ main 26L 0C 1m CC=1 ←0\n │ main 25L 0C 1m CC=1 ←0\n │ main 25L 0C 1m CC=1 ←0\n │ main 25L 0C 1m CC=1 ←0\n │\n test_sample_project/ CC̄=2.3 ←in:0 →out:0\n │ sample 32L 0C 3m CC=4 ←0\n │\n .goal/ CC̄=2.0 ←in:0 →out:0\n │ pre-commit-hook 23L 0C 1m CC=2 ←0\n │ vallm-pre-commit.sh 17L 0C 0m CC=0.0 ←0\n │\n refactor_output/ CC̄=1.4 ←in:0 →out:0\n │ 00_app__models 29L 0C 5m CC=3 ←0\n │\n app/ CC̄=0.0 ←in:0 →out:0\n │ models 48L 3C 0m CC=0.0 ←0\n │\n ./ CC̄=0.0 ←in:0 →out:0\n │ project.sh 35L 0C 0m CC=0.0 ←0\n │\n\nCOUPLING:\n redsl redsl.commands redsl.autonomy redsl.analyzers redsl.cli redsl.execution redsl.api redsl.validation redsl.examples redsl.llm redsl.formatters redsl.refactors redsl.config_standard redsl.diagnostics redsl.utils\n redsl ── ←2 ←6 2 8 4 6 ←1 ←1 2 1 2 hub\n redsl.commands 2 ── 13 8 4 3 7 2 1 hub\n redsl.autonomy 6 7 ── 8 ←1 3 hub\n redsl.analyzers ←2 ←8 ←8 ── ←3 ←1 ←1 ←3 ←5 ←1 hub\n redsl.cli 8 1 1 ── 1 1 1 4 4 1 hub\n redsl.execution 2 ←3 ←3 3 ←1 ── ←3 3 ←1 4 1 hub\n redsl.api 3 3 ── 2 6 1 hub\n redsl.validation 1 ←7 1 ←3 ── ←3 2 hub\n redsl.examples 1 1 ←1 1 ←2 ── hub\n redsl.llm 2 3 ←1 ←4 ── 1 hub\n redsl.formatters ←2 ←4 ←6 ── hub\n redsl.refactors ←1 5 ←1 3 ── !! fan-out\n redsl.config_standard 1 1 ←4 ←1 ── hub\n redsl.diagnostics ←2 ←1 ── 1\n redsl.utils ←2 ←1 ←1 ──\n CYCLES: none\n HUB: redsl.cli/ (fan-in=12)\n HUB: redsl.execution/ (fan-in=15)\n HUB: redsl.autonomy/ (fan-in=14)\n HUB: redsl.examples/ (fan-in=13)\n HUB: redsl.commands/ (fan-in=8)\n HUB: redsl.config_standard/ (fan-in=6)\n HUB: redsl.formatters/ (fan-in=12)\n HUB: redsl.llm/ (fan-in=7)\n HUB: redsl.api/ (fan-in=6)\n HUB: redsl.analyzers/ (fan-in=34)\n HUB: redsl.validation/ (fan-in=13)\n HUB: redsl/ (fan-in=30)\n SMELL: redsl.refactors/ fan-out=8 → split needed\n SMELL: redsl.cli/ fan-out=22 → split needed\n SMELL: redsl.execution/ fan-out=13 → split needed\n SMELL: redsl.autonomy/ fan-out=24 → split needed\n SMELL: redsl.commands/ fan-out=40 → split needed\n SMELL: redsl.api/ fan-out=16 → split needed\n SMELL: redsl/ fan-out=25 → split needed\n\nEXTERNAL:\n validation: run `vallm batch .` → validation.toon\n duplication: run `redup scan .` → duplication.toon\n```",
"level": 2
},
{
"name": "# duplication (`project/duplication.toon.yaml`)",
"type": "unknown",
"content": "```toon markpact:analysis path=project/duplication.toon.yaml\n# redup/duplication | 14 groups | 219f 31658L | 2026-04-19\n\nSUMMARY:\n files_scanned: 219\n total_lines: 31658\n dup_groups: 14\n dup_fragments: 47\n saved_lines: 132\n scan_ms: 13458\n\nDUPLICATES[14] (ranked by impact):\n [1907a33a0fa70761] STRU example_basic_analysis L=3 N=9 saved=24 sim=1.00\n redsl/cli/examples.py:26-28 (example_basic_analysis)\n redsl/cli/examples.py:34-36 (example_custom_rules)\n redsl/cli/examples.py:51-53 (example_memory_learning)\n redsl/cli/examples.py:59-61 (example_api_integration)\n redsl/cli/examples.py:67-69 (example_awareness)\n redsl/cli/examples.py:75-77 (example_pyqual)\n redsl/cli/examples.py:83-85 (example_audit)\n redsl/cli/examples.py:91-93 (example_pr_bot)\n redsl/cli/examples.py:99-101 (example_badge)\n [3827f031a50510f3] STRU main L=3 N=9 saved=24 sim=1.00\n redsl/examples/api_integration.py:35-37 (main)\n redsl/examples/audit.py:162-164 (main)\n redsl/examples/awareness.py:95-97 (main)\n redsl/examples/badge.py:152-154 (main)\n redsl/examples/basic_analysis.py:48-50 (main)\n redsl/examples/custom_rules.py:62-64 (main)\n redsl/examples/memory_learning.py:123-125 (main)\n redsl/examples/pr_bot.py:130-132 (main)\n redsl/examples/pyqual_example.py:68-70 (main)\n [66fffac820f1a666] STRU is_available L=3 N=7 saved=18 sim=1.00\n redsl/analyzers/code2llm_bridge.py:47-49 (is_available)\n redsl/analyzers/radon_analyzer.py:31-33 (is_radon_available)\n redsl/analyzers/redup_bridge.py:40-42 (is_available)\n redsl/commands/batch_pyqual/config_gen.py:64-66 (_pyqual_cli_available)\n redsl/commands/batch_pyqual/runner.py:29-31 (_pyqual_cli_available)\n redsl/validation/regix_bridge.py:39-46 (is_available)\n redsl/validation/vallm_bridge.py:138-140 (is_available)\n [5e00de8bc3caf754] STRU _collect_guard_body L=14 N=2 saved=14 sim=1.00\n redsl/commands/_guard_fixers.py:150-163 (_collect_guard_body)\n redsl/refactors/body_restorer.py:45-59 (_collect_guard_body)\n [9b2eb61629d4cf19] STRU fix_stolen_indent L=11 N=2 saved=11 sim=1.00\n redsl/commands/doctor_fixers.py:69-79 (fix_stolen_indent)\n redsl/commands/doctor_fixers.py:81-91 (fix_broken_fstrings)\n [b027db1c8d821268] STRU _register_history_command L=10 N=2 saved=10 sim=1.00\n redsl/commands/cli_awareness.py:22-31 (_register_history_command)\n redsl/commands/cli_awareness.py:44-53 (_register_health_command)\n [ce2537bbaad1fba9] STRU export_config_schema L=7 N=2 saved=7 sim=1.00\n redsl/config_standard/profiles.py:82-88 (export_config_schema)\n redsl/config_standard/proposals.py:78-84 (export_proposal_schema)\n [42758e6f93d15e46] STRU _check_analysis_passed L=5 N=2 saved=5 sim=1.00\n redsl/commands/batch_pyqual/verdict.py:8-12 (_check_analysis_passed)\n redsl/commands/batch_pyqual/verdict.py:15-19 (_check_gates_passed)\n [62499c819ffbba21] STRU batch_hybrid L=4 N=2 saved=4 sim=1.00\n redsl/cli/batch.py:52-55 (batch_hybrid)\n redsl/cli/pyqual.py:31-34 (pyqual_fix)\n [d63bc3468205cd17] EXAC __init__ L=3 N=2 saved=3 sim=1.00\n redsl/llm/registry/sources/base.py:153-155 (__init__)\n redsl/llm/registry/sources/base.py:190-192 (__init__)\n [77d5f2d33a9f8d05] STRU _extract_file_path L=3 N=2 saved=3 sim=1.00\n redsl/autonomy/auto_fix.py:65-67 (_extract_file_path)\n redsl/autonomy/auto_fix.py:70-72 (_extract_function_name)\n [be39955a1d8f8e68] STRU register_model_policy L=3 N=2 saved=3 sim=1.00\n redsl/cli/model_policy.py:10-12 (register_model_policy)\n redsl/cli/models.py:10-12 (register_models)\n [aaae754bdb04529d] STRU model_policy L=3 N=2 saved=3 sim=1.00\n redsl/cli/model_policy.py:16-18 (model_policy)\n redsl/cli/models.py:16-18 (models_group)\n [4e0c5433bfda0d64] STRU _dispatch_analyze L=3 N=2 saved=3 sim=1.00\n redsl/main.py:214-216 (_dispatch_analyze)\n redsl/main.py:219-221 (_dispatch_explain)\n\nREFACTOR[14] (ranked by priority):\n [1] ○ extract_function → redsl/cli/utils/example_basic_analysis.py\n WHY: 9 occurrences of 3-line block across 1 files — saves 24 lines\n FILES: redsl/cli/examples.py\n [2] ○ extract_function → redsl/examples/utils/main.py\n WHY: 9 occurrences of 3-line block across 9 files — saves 24 lines\n FILES: redsl/examples/api_integration.py, redsl/examples/audit.py, redsl/examples/awareness.py, redsl/examples/badge.py, redsl/examples/basic_analysis.py +4 more\n [3] ○ extract_function → redsl/utils/is_available.py\n WHY: 7 occurrences of 3-line block across 7 files — saves 18 lines\n FILES: redsl/analyzers/code2llm_bridge.py, redsl/analyzers/radon_analyzer.py, redsl/analyzers/redup_bridge.py, redsl/commands/batch_pyqual/config_gen.py, redsl/commands/batch_pyqual/runner.py +2 more\n [4] ○ extract_function → redsl/utils/_collect_guard_body.py\n WHY: 2 occurrences of 14-line block across 2 files — saves 14 lines\n FILES: redsl/commands/_guard_fixers.py, redsl/refactors/body_restorer.py\n [5] ○ extract_function → redsl/commands/utils/fix_stolen_indent.py\n WHY: 2 occurrences of 11-line block across 1 files — saves 11 lines\n FILES: redsl/commands/doctor_fixers.py\n [6] ○ extract_function → redsl/commands/utils/_register_history_command.py\n WHY: 2 occurrences of 10-line block across 1 files — saves 10 lines\n FILES: redsl/commands/cli_awareness.py\n [7] ○ extract_function → redsl/config_standard/utils/export_config_schema.py\n WHY: 2 occurrences of 7-line block across 2 files — saves 7 lines\n FILES: redsl/config_standard/profiles.py, redsl/config_standard/proposals.py\n [8] ○ extract_function → redsl/commands/batch_pyqual/utils/_check_analysis_passed.py\n WHY: 2 occurrences of 5-line block across 1 files — saves 5 lines\n FILES: redsl/commands/batch_pyqual/verdict.py\n [9] ○ extract_function → redsl/cli/utils/batch_hybrid.py\n WHY: 2 occurrences of 4-line block across 2 files — saves 4 lines\n FILES: redsl/cli/batch.py, redsl/cli/pyqual.py\n [10] ○ extract_function → redsl/llm/registry/sources/utils/__init__.py\n WHY: 2 occurrences of 3-line block across 1 files — saves 3 lines\n FILES: redsl/llm/registry/sources/base.py\n [11] ○ extract_function → redsl/autonomy/utils/_extract_file_path.py\n WHY: 2 occurrences of 3-line block across 1 files — saves 3 lines\n FILES: redsl/autonomy/auto_fix.py\n [12] ○ extract_function → redsl/cli/utils/register_model_policy.py\n WHY: 2 occurrences of 3-line block across 2 files — saves 3 lines\n FILES: redsl/cli/model_policy.py, redsl/cli/models.py\n [13] ○ extract_function → redsl/cli/utils/model_policy.py\n WHY: 2 occurrences of 3-line block across 2 files — saves 3 lines\n FILES: redsl/cli/model_policy.py, redsl/cli/models.py\n [14] ○ extract_function → redsl/utils/_dispatch_analyze.py\n WHY: 2 occurrences of 3-line block across 1 files — saves 3 lines\n FILES: redsl/main.py\n\nMETRICS-TARGET:\n dup_groups: 14 → 0\n saved_lines: 132 lines recoverable\n```",
"level": 2
},
{
"name": "# evolution / churn (`project/evolution.toon.yaml`)",
"type": "unknown",
"content": "```toon markpact:analysis path=project/evolution.toon.yaml\n# code2llm/evolution | 1255 func | 169f | 2026-04-19\n\nNEXT[7] (ranked by impact):\n [1] !! SPLIT redsl/commands/sumr_planfile.py\n WHY: 510L, 3 classes, max CC=32\n EFFORT: ~4h IMPACT: 16320\n\n [2] !! SPLIT redsl/llm/selection.py\n WHY: 508L, 6 classes, max CC=9\n EFFORT: ~4h IMPACT: 4572\n\n [3] !! SPLIT-FUNC generate_planfile CC=32 fan=35\n WHY: CC=32 exceeds 15\n EFFORT: ~1h IMPACT: 1120\n\n [4] ! SPLIT-FUNC format_cycle_report_toon CC=23 fan=15\n WHY: CC=23 exceeds 15\n EFFORT: ~1h IMPACT: 345\n\n [5] ! SPLIT-FUNC refactor_plan_to_tasks CC=17 fan=20\n WHY: CC=17 exceeds 15\n EFFORT: ~1h IMPACT: 340\n\n [6] ! SPLIT-FUNC planfile_sync CC=20 fan=16\n WHY: CC=20 exceeds 15\n EFFORT: ~1h IMPACT: 320\n\n [7] ! SPLIT-FUNC pick_coding CC=16 fan=15\n WHY: CC=16 exceeds 15\n EFFORT: ~1h IMPACT: 240\n\n\nRISKS[2]:\n ⚠ Splitting redsl/commands/sumr_planfile.py may break 6 import paths\n ⚠ Splitting redsl/llm/selection.py may break 27 import paths\n\nMETRICS-TARGET:\n CC̄: 3.9 → ≤2.7\n max-CC: 32 → ≤16\n god-modules: 2 → 0\n high-CC(≥15): 7 → ≤3\n hub-types: 0 → ≤0\n\nPATTERNS (language parser shared logic):\n _extract_declarations() in base.py — unified extraction for:\n - TypeScript: interfaces, types, classes, functions, arrow funcs\n - PHP: namespaces, traits, classes, functions, includes\n - Ruby: modules, classes, methods, requires\n - C++: classes, structs, functions, #includes\n - C#: classes, interfaces, methods, usings\n - Java: classes, interfaces, methods, imports\n - Go: packages, functions, structs\n - Rust: modules, functions, traits, use statements\n\n Shared regex patterns per language:\n - import: language-specific import/require/using patterns\n - class: class/struct/trait declarations with inheritance\n - function: function/method signatures with visibility\n - brace_tracking: for C-family languages ({ })\n - end_keyword_tracking: for Ruby (module/class/def...end)\n\n Benefits:\n - Consistent extraction logic across all languages\n - Reduced code duplication (~70% reduction in parser LOC)\n - Easier maintenance: fix once, apply everywhere\n - Standardized FunctionInfo/ClassInfo models\n\nHISTORY:\n (first run — no previous data)\n```",
"level": 2
},
{
"name": "# validation (`project/validation.toon.yaml`)",
"type": "unknown",
"content": "```toon markpact:analysis path=project/validation.toon.yaml\n# vallm batch | 359f | 269✓ 3⚠ 0✗ | 2026-04-19\n\nSUMMARY:\n scanned: 359 passed: 269 (74.9%) warnings: 3 errors: 0 unsupported: 90\n\nWARNINGS[3]{path,score}:\n redsl/commands/sumr_planfile.py,0.93\n issues[4]{rule,severity,message,line}:\n complexity.cyclomatic,warning,_extract_complexity_layers has cyclomatic complexity 20 (max: 15),219\n complexity.cyclomatic,warning,refactor_plan_to_tasks has cyclomatic complexity 17 (max: 15),345\n complexity.lizard_cc,warning,_extract_complexity_layers: CC=20 exceeds limit 15,219\n complexity.lizard_cc,warning,refactor_plan_to_tasks: CC=17 exceeds limit 15,345\n test_refactor_bad/complex_code.py,0.93\n issues[4]{rule,severity,message,line}:\n complexity.cyclomatic,warning,process_data has cyclomatic complexity 25 (max: 15),5\n complexity.cyclomatic,warning,process_data_copy has cyclomatic complexity 25 (max: 15),63\n complexity.lizard_cc,warning,process_data: CC=25 exceeds limit 15,5\n complexity.lizard_cc,warning,process_data_copy: CC=25 exceeds limit 15,63\n redsl/cli/models.py,0.98\n issues[1]{rule,severity,message,line}:\n complexity.cyclomatic,warning,pick_coding has cyclomatic complexity 16 (max: 15),76\n\nUNSUPPORTED[5]{bucket,count}:\n *.md,64\n Dockerfile*,1\n *.txt,4\n *.yml,2\n other,19\n```",
"level": 2
},
{
"name": "intent",
"type": "intent",
"content": "ReDSL — Refactor + DSL + Self-Learning. LLM-powered autonomous code refactoring.",
"level": 2
}
]
}