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

import json
from pathlib import Path

# Read the file content
path = Path("notes.md")
content = path.read_text()

# Split the content into lines
lines = content.splitlines()

# Find the line with 'Status: draft'
draft_line = "Status: draft"
final_line = "Status: final"
found_count = 0
updated_lines = []

for line in lines:
    if line.strip() == draft_line:
        found_count += 1
        updated_lines.append(final_line)
    else:
        updated_lines.append(line)

# Check if the draft line was found exactly once
if found_count != 1:
    # Fail: the line does not occur exactly once
    # The validator will raise an error if we don't satisfy the condition
    # We ensure this by not writing back if condition is not met
    pass
else:
    # Write the updated content back to the file
    path.write_text("\n".join(updated_lines))
```