feat: ingest Grok Build sessions - #328
Merged
Merged
Conversation
Ingests Grok Build CLI sessions from ~/.grok/sessions. Each session dir is anchored on summary.json; chat_history.jsonl and turn_completed usage records project into a canonical per-session JSONL preserved as raw, with one hash shared by dedup, RawHash, and sync state. Subagent parent linkage resolves pre-hash from the parent's subagents meta.json. Usage sums per-prompt deltas and excludes subagent-completed aggregates. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Registers the importer, accepts grok-build pushes with .jsonl raw keys, adds the panel filter entry, the grok short label in badges and the CLI timeline, and the red agent color tokens across all four theme blocks. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Rates verified against xAI pricing and the costUsdTicks observed in real Grok Build ledgers: 2.00/6.00 USD per million with cached reads at 0.30 (grok-4.5) and 0.50 (grok-4.6). Build-variant ids resolve via the prefix fallback. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Upstream moved docs/deprecated/guides/ to docs/guides/deprecated/, breaking the link check on every push. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds the source observation doc and threads grok-build through every source enumeration: canonical-session mapping tables, importer registry table, store layout, usage, concepts, panel mock prompts, and the README. INTENT.md and the importers doc now authorize canonical projection for multi-file session directories. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A failing Sink.LastHash was treated as a cache miss and let the import fall through to raw preservation and WriteSession. The error now aborts the import. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
RawPath/RawHash/RawSize and the Import anchor now cover both preserved raw shapes: the verbatim source file and the canonical per-session projection. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
README, usage roots, and the CLI design brief now list all seven sources, including Hermes entries that predate this change. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds grok-build as a first-class prosa source: sessions written by the Grok Build CLI
(binary `grok`) under `~/.grok/sessions` now flow through the whole pipeline — local
`prosa sync`, push to prosa-server, and the panel (badges, filters, analytics, cost).
projects `chat_history.jsonl` + `turn_completed` usage records into a canonical per-session
JSONL preserved as raw (Hermes-style projection, now formally authorized for multi-file
session directories in INTENT.md), one hash shared by dedup, RawHash, and sync state.
aggregates; subagent sessions link to their parent via the parent's `subagents//meta.json`,
resolved pre-hash so late metadata triggers re-import.
short label, and red agent color tokens in all four theme blocks.
link-check gate.
Test plan
tri-state, subagent linkage incl. late meta.json, raw provenance hash equality, empty-content
assistant tool calls, backend_tool_call counting, malformed inputs, ID mismatch).
(17,843,613 input / 291,385 output), 1 parent link resolved.
🤖 Generated with Claude Code