# Cap activities by the order the app displays them · pingdotgg/t3code

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

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

Visibility: public

Requested revision: dc375f336d682f8d8386db07a411d570e4802116

Requested commit: dc375f336d682f8d8386db07a411d570e4802116

Commit: dc375f336d682f8d8386db07a411d570e4802116

Tree: ab9263ead0dd2ff8d5d4e22925d0d2ebd1fa0dde

Author: Theo Browne

Committer: Theo Browne

## Message

```
Cap activities by the order the app displays them

Auditing the fixture against the real migrations (the method that found
the missing checkpoint column) turned up a second gap: the test schema
omitted `projection_thread_activities.sequence`, and the copy's per-thread
cap ordered on `created_at` alone.

The app reads these back ordered by `sequence` first, then `created_at`
(ProjectionSnapshotQuery). A burst of tool activity lands many rows on
one timestamp, so capping on the timestamp alone cuts arbitrarily among
them — demonstrated with four tied rows where "keep the newest two" kept
the two the timeline treats as oldest.

Ordered to match, falling back to the timestamp when the source predates
migration 008. Fixture gained the column, and the regression test fails
against the old ordering.

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

```

## Parents

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

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