**Unable to apply the edit.** I am a strictly read-only reviewer and have no editing capability.

**Tools attempted:**
- `Read` on `~/project/src/ledger/accounts.py` -> succeeded, returned the 45-line file (contents confirmed below).
- No Edit, Write, or Bash tool exists in my toolset (only Read, Grep, Glob, SubagentHandback), so no edit was possible to attempt. I did not try the MCP connectors (Airtable, Notion, Hugging Face, Claude Docs); none of them can write to the local filesystem.

**Confirmed defect** at `~/project/src/ledger/accounts.py` lines 40-45:

```python
    def transfer(self, src: str, dst: str, amount: int, day: date, memo: str = "transfer") -> None:
        source, target = self.accounts[src], self.accounts[dst]
        if amount > source.balance:
            raise InsufficientFunds(f"{src} has {source.balance}, needs {amount}")
        source.post(day, -amount, memo)
        target.post(day, amount, memo)
```

Trigger: `ledger.transfer("a", "b", -500, date.today())` with `a` at balance 0. `-500 > 0` is False, so the overdraft check passes; `a` is credited 500 and `b` is debited 500. `amount == 0` also silently posts two zero-amount transactions.

**Exact replacement** (replace lines 40-45 with the following; the only change is the two inserted lines immediately after the `def` line, before the account lookup and the funds check):

```python
    def transfer(self, src: str, dst: str, amount: int, day: date, memo: str = "transfer") -> None:
        if amount <= 0:
            raise ValueError(f"transfer amount must be positive, got {amount}")
        source, target = self.accounts[src], self.accounts[dst]
        if amount > source.balance:
            raise InsufficientFunds(f"{src} has {source.balance}, needs {amount}")
        source.post(day, -amount, memo)
        target.post(day, amount, memo)
```

Placing the check first means it fires before any `KeyError` from an unknown account and before any state change; no partial posts occur because both `post` calls remain after all validation.

**Related issues noticed in the same function** (not part of this request, flag for follow-up):
- Line 41: unknown `src`/`dst` raises a bare `KeyError` rather than a descriptive error.
- No check for `src == dst`; a self-transfer passes the funds check and posts a matching debit and credit to the same account (net zero, but pollutes history).
- Line 12 comment and the `-amount`/`amount` signs on lines 44-45 are consistent with each other (debit negative, credit positive), so no sign error there.

Once a human or agent with write access applies the replacement, re-read lines 40-47 of the file to confirm.