Commit 61e1e60
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 4afed36 commit 61e1e60
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| 210 | + | |
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| |||
0 commit comments