Grok ingests (canonical backup)¶
grok_ingests in ifixedx_local stores the raw Grok model payload from Home xAI refreshes. It is an audit/replay layer — not used for feed ordering today.
When rows are written¶
Only when GET /api/for-you runs with xai=1 (Home timeline source Grok / xAI) and the server attaches xaiIngest on the JSON response.
Flow:
fetchTrendingTweetsViaXai → grokItemsToTweets → rankTweets (platform + refined)
│
└── xaiIngest { items, model, … } on ComparePayload
│
└── persistComparePayload → grok_ingests.insert (if items present)
Live X and seed paths do not write grok_ingests.
API payload (XaiIngestPayload)¶
Type: src/api/types.ts
Field |
Type |
Meaning |
|---|---|---|
|
ISO string |
Server timestamp when batch was built |
|
string |
xAI model id used for the call |
|
boolean |
Whether live search was requested |
|
string? |
Server warning text (quota, parse, etc.) |
|
|
Unmodified Grok JSON objects before |
Ranked tweets in platform_style / refined are derived from these items; scores live on posts, not inside itemsJson.
RxDB document (GrokIngestDoc)¶
Schema: src/db/ifixedxDb.ts (grokIngestSchema)
Field |
Type |
Notes |
|---|---|---|
|
string (PK) |
|
|
number |
|
|
string |
Copy of |
|
string |
Max 120 chars |
|
boolean |
|
|
string |
Max 4000 chars |
|
string |
|
|
string |
Always |
Indexed: storedAt (newest-first queries).
Size guard¶
If itemsJson.length > 890_000, insert is skipped (console warning). Normal batches should fit; huge Grok responses may lose raw backup but still persist ranked posts.
Relationship to Pipetrix¶
Store |
Content |
|---|---|
|
Raw Grok batch (replay, diff prompts, train eval) |
|
Normalized tweet + |
|
Last ranked platform/refined scores for session rehydrate |
Canonical ingest may run in parallel from the same API response; grok_ingests does not replace canonical.
Future ranking / exp-sharing use¶
Planned uses (not implemented):
Replay Grok output after
search.tschanges without re-calling xAICompare
items[].…fields to rankedbreakdownfor calibrationStore prompt version ids in
mixerMetaJsonalongside Ranking lab snapshot
Wipe¶
Removed with full local wipe — Wipe local data.