-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Context
When the Granola API adds new fields or changes its schema, our Rust structs and database schema may not capture the new data. The extra_json column (migration v002) partially addresses this via #[serde(flatten)], but only captures unknown fields — explicitly defined fields that aren't stored in the DB are silently discarded, and the original response is lost.
Proposal
Add an api_snapshot column to every synced entity table. During sync, store the serialized API response for each entity so that future migrations can backfill newly-modeled fields from historical data.
For small entities, store the response verbatim. For large entities (transcripts, panels), redact bulk content fields that are already stored in dedicated columns, replacing them with a "[stored]" sentinel.
Measured sizes from live API (Feb 2026):
| Entity | Items | Per-item | Total | Redaction needed? |
|---|---|---|---|---|
| Documents | 550 | 2–25 KB (mean 5.7 KB) | 3.0 MB | No |
| People | 6 | 0.5–1.7 KB | 6 KB | No |
| Templates | 31 | 0.9–2.4 KB | 49 KB | No |
| Recipes | 1 | 127 KB | 127 KB | No |
| Calendar events | 21 | 0.7–2.9 KB | 39 KB | No |
| Panels | per-doc | 6–25 KB (mean 19 KB) | ~10 MB | Yes — content, original_content, generated_lines, suggested_questions |
| Transcripts | per-doc | 24–135 KB (mean 82 KB) | ~45 MB | Yes — utterance text |
With redaction, total storage for all entities is estimated at ~5 MB.