```python
# /// intent
# goal   = "Change the status line in notes.md from 'Status: draft' to 'Status: final' if it occurs exactly once"
# reads  = ["notes.md"]
# writes = ["notes.md"]
# output = "none"
# ///

from pathlib import Path

path = Path("notes.md")
text = path.read_text()
assert text.count("Status: draft") == 1, "the status line occurs exactly once"
path.write_text(text.replace("Status: draft", "Status: final"))
```