Auto-derived from metrics — CC hotspots from
astanalysis, coverage gaps fromcoverage.json. Last updated: 2026-04-19 (v0.3.3) Manual items in P0 and Manual backlog sections survive regeneration.
- Raise test coverage to ≥ 50% before tagging 0.2.0 stable
- Add
sumd/__main__.pyto supportpython -m sumd - Real testql CLI scenario file (
sumd-cli.testql.toon.yaml) instead of smoke placeholder - Validate rc1 on CI before promoting to 0.2.0 stable
| CC | File | Function | Action |
|---|---|---|---|
| 15 | sumd/renderer.py |
_parse_calls_hubs |
Split hub detection from formatting |
| 14 | sumd/renderer.py |
_collect_pkg_sources |
Extract _scan_sources() helper |
| 13 | sumd/parser.py |
validate_codeblocks |
Split: _check_fence_format(), _check_markpact_kind() |
| 12 | sumd/renderer.py |
_render_test_contracts |
Split by contract type (smoke / crud / api) |
| 12 | sumd/extractor.py |
extract_openapi |
Extract _parse_paths(), _build_endpoint() |
| 12 | sumd/extractor.py |
extract_dockerfile |
Separate stage detection from content rendering |
| 10 | sumd/renderer.py |
_render_extras |
Extract per-format renderers |
| 10 | sumd/renderer.py |
_render_deployment_docker |
Split multi-compose logic |
| 10 | sumd/extractor.py |
generate_map_toon |
Split: _collect_map_files(), _render_map_detail() |
| 10 | sumd/extractor.py |
extract_taskfile |
Extract task-type classifiers |
| 10 | sumd/extractor.py |
_collect_map_files |
Already a sub-function — revisit call sites |
| 10 | sumd/extractor.py |
_analyse_py_top_classes |
Split parsing from formatting |
| 10 | sumd/cli.py |
_scan_one_project |
Extract profile dispatch |
Target: CC ≤ 10 for all functions. Current average (production code): ~4.6.
| Coverage | Missing lines | Module |
|---|---|---|
| 0% | 103 | sumd/mcp_server.py |
| 0% | 486 | sumd/cli.py |
| 14% | 91 | sumd/toon_parser.py |
| 36% | 303 | sumd/extractor.py |
| 36% | 417 | sumd/renderer.py |
cli.py(0%) — addtests/test_dogfood.pyintegration tests (see P1) + CLI unit tests viaclick.testing.CliRunnermcp_server.py(0%) — addtests/test_mcp_server.py; at minimum test tool registration and thatmain()doesn't crashtoon_parser.py(14%) — addtests/test_toon_parser.pycovering each_parse_toon_block_*functionextractor.py(36%) — extendtest_extractor.pywith edge-case fixtures (missing files, empty files, malformed YAML)renderer.py(36%) — addtests/test_renderer.pyparametrised over section fixtures
Add tests/test_dogfood.py — tests that scan the sumd project itself:
def test_sumd_scans_itself():
# sumd scan . --fix --profile rich must exit 0 and produce valid SUMD.md
...
def test_sumd_scans_all_profiles():
for profile in ['minimal', 'light', 'rich']:
# each profile must exit 0
...
def test_sumr_generates_sumr_md():
# sumr . must produce SUMR.md with expected sections
...These catch full-pipeline regressions not visible via unit tests.
sumd/mcp_server.py — 103 lines, 0% coverage, no tests anywhere.
# tests/test_mcp_server.py
def test_mcp_tools_registered():
...
def test_mcp_main_no_crash():
...These items improve autonomy of the dev process; not blocking release.
- Coverage ratchet:
sumd scan . --update-gates— only raisescoverage_min, never lowers it - Pre-commit hook:
task install:hooks→.git/hooks/pre-commitrunssumd scan . --fix --profile lighton every commit touching.pyfiles - TODO auto-regeneration:
sumd scan . --todogenerates this file from live metrics (CC + coverage + duplication)