Skip to content

Commit 1c090e2

Browse files
release
1 parent 014b700 commit 1c090e2

File tree

1 file changed

+81
-9
lines changed

1 file changed

+81
-9
lines changed

TODO.md

Lines changed: 81 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,37 @@
11
# Code2Logic - Refactoring Plan
22

3+
## Active Task List (Execution Order)
4+
5+
- [x] Add `toon` support to CLI (`code2logic ... -f toon`)
6+
- [x] Fix TOON tabular headers (`{path,lang,lines}`) and delimiter/quoting in TOON parser
7+
- [x] Fix public API collisions in `code2logic/__init__.py` (`analyze_quality`, `reproduce_project`, `ReproductionResult`)
8+
- [x] Update CLI docs to include TOON and clarify `python -m code2logic` vs `code2logic` entrypoint
9+
- [x] **Fix critical parser bug**: TreeSitterParser._text() byte vs char offset mismatch
10+
- [x] **Fix truncated identifiers**: Function/class names now extracted correctly
11+
- [x] **Fix corrupted signatures**: Parameter parsing uses proper byte slicing
12+
- [x] **Fix import deduplication**: Remove `module.module` duplicates
13+
- [x] **Add docstring truncation**: First sentence or 80 chars for efficiency
14+
- [x] **Add parser integrity tests**: 15 new test cases in `tests/test_parser_integrity.py`
15+
- [x] **YAML compact format**: Short keys (p, l, i, e, c, f, n, d, m) with header legend
16+
- [x] **YAML self removal**: Method signatures no longer include 'self' parameter
17+
- [x] **YAML import dedup**: `typing.Dict, typing.List``typing.{Dict,List}`
18+
- [x] **YAML schema update**: Validation supports both full and compact keys
19+
- [x] **Add YAML compact tests**: 9 new test cases in `tests/test_yaml_compact.py`
20+
- [x] **Create shared_utils.py**: Common utility functions (compact_imports, abbreviate_type, build_signature, truncate_docstring)
21+
- [x] **Add shared_utils tests**: 47 test cases in `tests/test_shared_utils.py`
22+
- [x] **TOON remove self**: Method signatures no longer include 'self' parameter
23+
- [x] **TOON ultra-compact**: New `generate_ultra_compact()` method - 71% size reduction (78KB → 22KB)
24+
- [x] **LogicML optimization**: Truncated docstrings, grouped imports, removed self from signatures
25+
- [ ] Add a TOON round-trip sanity check (generate TOON -> parse -> validate key structure)
26+
- [ ] Review TOON reproduction prompt quality (benchmark `toon` vs `yaml/json` after spec fixes)
27+
- [x] Run full smoke-test (279 tests pass):
28+
- [x] `python -m code2logic code2logic/ -f toon`
29+
- [x] `python examples/02_refactoring.py`
30+
- [x] `python examples/04_project.py tests/samples/ --no-llm`
31+
- [x] `python -m pytest`
32+
33+
---
34+
335
## Overview
436

537
This document outlines the refactoring tasks identified during code analysis. Tasks are prioritized by impact and effort.
@@ -223,8 +255,16 @@ Classes with >20 methods:
223255
- [x] Add refactoring utilities (refactor.py)
224256
- [x] Add universal reproduction (universal.py)
225257
- [x] Add project reproduction (project_reproducer.py)
258+
- [x] Add format benchmarks (08_format_benchmark.py)
259+
- [x] Add async multi-provider LLM (09_async_benchmark.py)
260+
- [x] Add function-level reproduction (10_function_reproduction.py)
261+
- [x] Add token-aware benchmarking (11_token_benchmark.py)
262+
- [x] Add JSON generator for format comparison
263+
- [x] Fix dataclass detection in parser
264+
- [x] Add class properties to YAML output
226265
- [ ] Fix remaining test failures
227-
- [ ] Update CHANGELOG
266+
- [x] Implement `code2logic llm` management commands (provider/model/key/priority)
267+
- [x] Update CHANGELOG
228268

229269
### Short-term (Week 2-3)
230270
- [ ] Split `generators.py` into subpackage
@@ -242,14 +282,46 @@ Classes with >20 methods:
242282

243283
## 📊 Metrics to Track
244284

245-
| Metric | Current | Target |
246-
|--------|---------|--------|
247-
| Test Coverage | 31% | 80% |
248-
| Duplicate Groups | 17 | 5 |
249-
| Long Files (>500) | 3 | 0 |
250-
| Long Functions (>50) | 21 | 5 |
251-
| Large Classes (>20 methods) | 2 | 0 |
252-
| mypy Errors | ? | 0 |
285+
| Metric | Current | Target | Status |
286+
|--------|---------|--------|--------|
287+
| Test Coverage | 31% | 80% | 🟡 |
288+
| Duplicate Groups | 17 → 18 | 5 | 🟡 |
289+
| Long Files (>500) | 3 | 0 | 🟡 |
290+
| Long Functions (>50) | 21 → 19 | 5 | 🟡 |
291+
| Large Classes (>20 methods) | 2 | 0 | 🟡 |
292+
| Example Files | 19 → 11 | 6 | 🟡 |
293+
| New Modules Added | 0 → 12 | - ||
294+
| Reproduction Score (YAML) | 74.5% | 80% | 🟡 |
295+
| Reproduction Score (LogicML) | 65.9% | 80% | 🟡 |
296+
| Token Efficiency (Markdown) | 43.9 | 50 | 🟡 |
297+
| LogicML Compression | 0.42x | - ||
298+
| LogicML Repeatability | 56.9% | 70% | 🟡 |
299+
| YAML Repeatability | 41.0% | 70% | 🟡 |
300+
| YAML vs JSON Token Savings | 44.1% | - ||
301+
| Syntax OK (YAML/LogicML) | 100% | 100% ||
302+
| Total Tests | 40 | 50 | 🟡 |
303+
| LogicML Success Rate | 100% | 100% ||
304+
305+
### New Modules Added
306+
- `llm_clients.py` - Unified LLM client interface
307+
- `reproduction.py` - Code reproduction utilities
308+
- `code_review.py` - Code review functions
309+
- `benchmark.py` - Reproduction benchmarking
310+
- `metrics.py` - Advanced quality metrics
311+
- `refactor.py` - Refactoring utilities
312+
- `logicml.py` - ⭐ LogicML format generator (best compression 0.42x)
313+
- `prompts.py` - Optimized prompt templates for reproduction
314+
- `universal.py` - Universal code representation
315+
- `project_reproducer.py` - Multi-file reproduction
316+
- `adaptive.py` - Adaptive format selection
317+
- `file_formats.py` - File-specific format generators
318+
- `markdown_format.py` - Hybrid Markdown generator
319+
320+
### New Example Scripts
321+
- `08_format_benchmark.py` - Format comparison benchmark
322+
- `09_async_benchmark.py` - Async multi-provider benchmark
323+
- `10_function_reproduction.py` - Function-level reproduction
324+
- `11_token_benchmark.py` - Token-aware benchmarking
253325

254326
---
255327

0 commit comments

Comments
 (0)