chore(types): pin the gorm column for SearchResult.ContentRevision

The merge pipeline treats revision 0 as "never edited", so the field fails
open to the position path wherever it is not carried over. Make the column
explicit for direct row scans and document the remaining JSON gap.
main
wizardchen 2026-08-06 12:19:12 +08:00 committed by lyingbug
parent c8d6e2103b
commit c9dd5a574e
1 changed files with 7 additions and 1 deletions

View File

@ -211,7 +211,13 @@ type SearchResult struct {
// ContentRevision is the chunk edit revision at retrieval time.
// Internal only: used by the merge pipeline to decide whether source
// coordinates are still trustworthy.
ContentRevision int `json:"-"`
//
// Zero means "never edited", so any construction path that forgets to carry
// it over fails open to the position path. Results rebuilt from JSON (stored
// message references) always land on zero because the field is not
// serialized; the length invariant in chunkTrusted is the remaining guard
// there. Keep the gorm column explicit so direct row scans populate it.
ContentRevision int `gorm:"column:content_revision" json:"-"`
}
// SearchParams represents the search parameters