# Fix single-column recency ordering and validate limits · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/8dee88913cb2ef9d2f092caed5e492a73edb78a9)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: 8dee88913cb2ef9d2f092caed5e492a73edb78a9

Requested commit: 8dee88913cb2ef9d2f092caed5e492a73edb78a9

Commit: 8dee88913cb2ef9d2f092caed5e492a73edb78a9

Tree: 4ee320a61495390aeb637b209dd2d6bc074944af

Author: Theo Browne

Committer: Theo Browne

## Message

```
Fix single-column recency ordering and validate limits

Two more from Macroscope review:

- `ORDER BY COALESCE(...)` throws on a source down to one recency
  column. SQLite requires at least two arguments, so the pre-017 schema
  the column filter exists to support was exactly the case that aborted.
  Emit the column directly when only one survives the filter.
- `seedDevDatabase` accepted non-positive limits. Both are bound into
  `LIMIT ?`, where SQLite reads a negative as "no limit" — a caller
  bypassing the CLI flags silently got a full-table copy instead of the
  bounded one the options contract promises. Rejected before the target
  is touched, alongside the existing upper-bound check.

Both regression tests confirmed failing without their fix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

```

## Parents

- [dba56bafa3119833e0497177defcb8760f6ddd21](https://git.cafe/pingdotgg/t3code/commit/dba56bafa3119833e0497177defcb8760f6ddd21?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/8dee88913cb2ef9d2f092caed5e492a73edb78a9?format=markdown)
