Commit 66ff818
authored
docs(ai-chat): state the transcript ordering contract for custom storage (#4917)
Adds an explicit ordering rule to the "Writing your own storage" list in
the transcript storage guide.
The ordering contract was implicit: the page said `put` for a known id
keeps its position and that `load` returns the whole conversation in
order, but never told an adapter author how to preserve order in a
row-per-message store, and never warned against a write-timestamp
column. That gap is easy to trip over (reaching for a `seq`/timestamp
column) because the contract deliberately has no sequence number, only
an order.
The new bullet states it outright: order is a transcript position, not a
write time; a document store gets it from `transcript.entries`; a row
store needs an order column set once when a `put` first inserts an id,
in `put`-arrival order, and left unchanged on an in-place replace; don't
sort by a write timestamp, because a replaced message must keep its
place and a mid-turn steering message sorts before the answer it shaped.
Docs-only. Verified against the runtime's `applyChanges`/`buildChanges`
in `transcriptStorage.ts`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)1 parent f0daa56 commit 66ff818
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
| 216 | + | |
216 | 217 | | |
217 | 218 | | |
218 | 219 | | |
| |||
0 commit comments