Done is written before the agent starts
builds on: Choose what to hand to an agent, Write a task the agent can finish, Give the context it can't find, Size tasks so each step is checkable, Ask for a plan before code, Give it an executable definition of done, Rule out shortcuts explicitly
These two tests are the definition of done. You write them before any code exists.
- `test_filters_by_status`: done means only order 2, the refunded one, comes back.
- `test_unknown_status_is_rejected`: a typo like `refundd` must fail loudly. Without this test, a typo could quietly return an empty export while the suite stays green.
Then take three steps:
1. Run them and see red: `TypeError`, because `status` isn't a parameter yet.
2. Commit the file.
3. Tell the agent the file is read-only.
**Afterwards, check:** `git diff <that commit> -- tests/export/test_status_filter.py` shows nothing.
// Python
# tests/export/test_status_filter.py
# db: test-database fixture the project already provides
import pytest
from orders.export import export_orders
def test_filters_by_status(db):
db.add_order(id=1, status="paid")
db.add_order(id=2, status="refunded")
rows = export_orders(db, status="refunded")
assert [r["id"] for r in rows] == [2]
def test_unknown_status_is_rejected(db):
with pytest.raises(ValueError):
export_orders(db, status="refundd")