```python
# /// intent
# goal   = "Count the lines that contain TODO in each .cpp file under src. Print each file name and its count, sorted by file name."
# reads  = ["src"]
# writes = []
# output = "printed"
# ///
from pathlib import Path


def count_todos(text):
    return text.count("TODO")


src = Path("src")
files = list(src.glob("*.cpp"))
paths = sorted(files, key=lambda p: p.name)
for p in paths:
    text = p.read_text()
    print(p.name, count_todos(text))
```