The product is an executable named `ledger` at the application root. It stores everything in a relational database through the shipped persistence library, and every command either completes in full or changes nothing. `DATABASE_URL` names the database. A value beginning `postgres://` or `postgresql://` is a PostgreSQL DSN. Any other value is a SQLite file path, optionally prefixed `sqlite://`. When `DATABASE_URL` is unset, `DATABASE_PATH` is used, then `data/app.db`. Three tables. Amounts are stored as integer cents and never as floating point. Every successful command except `init` writes CSV to standard output: one header row, then data rows, comma-separated, no quoting, no trailing spaces, `\n` line endings. `init` writes nothing. A failing command writes nothing to standard output and one diagnostic line to standard error. | `2` | Usage error: unknown command, unknown table or report, wrong argument count. | 1. **A rejected command changes nothing.** A command checks every input and rule before its first write. A load that rejects row 11 stores none of rows 1 to 10. A transfer stores both of its rows or neither. | `ledger load ` | Loads `accounts`, `categories`, or `transactions` from a file whose header matches the table's columns in the order above. Writes `table,loaded` and `
,`. | A loaded transaction keeps the `txn_id` from its file. | `ledger account add ` | The new account row. | | `ledger account get ` | The account row. | | `ledger account rename ` | The updated account row. | | `ledger account delete ` | `deleted` and the code. Refused while the account has transactions. | | `ledger txn post []` | The new transaction row. | | `ledger txn get ` | The transaction row. | | `ledger txn amend ` | The updated transaction row. Only the amount changes. | | `ledger txn delete ` | `deleted` and the id. | 2. **No command leaves an account balance below zero.** An account's balance is the sum of its transaction amounts. Posting, amending, deleting, transferring, and loading are all subject to this rule, checked before the command writes anything. | `ledger transfer ` | Two transaction rows in category `TRANSFER`: `-amount` on `` with memo `transfer to `, then `+amount` on `` with memo `transfer from `. The amount is positive and the accounts differ. | | `ledger report balances` | `account,name,transactions,balance` per account ordered by code, then `TOTAL,,,`. | | `ledger report categories` | `category,description,transactions,inflow,outflow,net` per category ordered by code, including categories with no transactions, then `TOTAL,,,,,`. | | `ledger report monthly` | `month,transactions,inflow,outflow,net` per `YYYY-MM` that has transactions, ascending, then `TOTAL,,,,`. | The completed application provides a POSIX-compatible `bin/test.sh` that runs its own automated test suite from the application root and exits zero only when every test passes. The suite covers each command, each exit code, and each rule above against a real temporary database. `sources/run.sh` is the scoring entry point. It is supplied, not authored, and is staged verbatim into the application root with the seed files. `drydock uat` runs `sh sources/run.sh` from the completed application root and takes its exit code and output as the score.