refactor(storage): FrameTable vs FullFrameTable - #2975
Conversation
Add a FullFrameTable wrapper for the two narrow contexts where the FT covers a whole file: (a) fresh out of compressStream / CompressBytes / StoreFile / UploadFramed, and (b) the future StorageDiff fallback latch (#2919). Producers return *FullFrameTable; downcast via Table() to feed the hot read path or assign to BuildData.FrameData. FrameTable itself stays the authoritative type — what BuildData stores, what DeserializeFrameTable and TrimToRanges return, what ReadAt and OpenRangeReader accept. No on-disk format change, no behavior change.
❌ 5 Tests Failed:
View the top 3 failed test(s) by shortest run time
View the full list of 3 ❄️ flaky test(s)
To view more test analytics, go to the Test Analytics Dashboard |
There was a problem hiding this comment.
Code Review
In packages/orchestrator/pkg/sandbox/build_upload_v4.go, fullFT can be nil for uncompressed uploads, which will cause a nil pointer dereference when calling UncompressedSize, CompressedSize, or IsCompressed. Using the nil-safe Table() method to get the underlying *FrameTable before calling these methods will prevent this panic.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Make the FullFrameTable wrapper unembedded (private named field), so methods on the inner FrameTable are no longer promoted. The only way to use a *FullFrameTable is now its nil-safe Table() — calling methods directly on a nil *FullFrameTable becomes a compile error instead of a runtime panic. This catches the bug Gemini flagged on build_upload_v4.go: fullFT is nil for uncompressed uploads, and Go's embed selector would deref it before reaching the underlying nil-safe FrameTable methods. Now fixed by extracting ft := fullFT.Table() once and routing all calls through it. Same fix applied to debug-logging in storage_fs/storage_google. TrimToRanges, DeserializeFrameTable, Serialize, and newFrameTableFromEntries are all reverted to their original bodies (no behavior delta in FrameTable itself).
…v/infra into lev-frametable-full-partial-split
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Add a FullFrameTable wrapper for the two narrow contexts where the FT covers a whole file: (a) fresh out of compressStream / CompressBytes / StoreFile / UploadFramed, and (b) the future StorageDiff fallback latch (#2919). Producers return *FullFrameTable; downcast via Table() to feed the hot read path or assign to BuildData.FrameData.
FrameTable itself stays the authoritative type — what BuildData stores, what DeserializeFrameTable and TrimToRanges return, what ReadAt and OpenRangeReader accept. No on-disk format change, no behavior change.