gemini-cli

Identity

  • Names: gemini-cli / com.google.gemini-cli.
  • Native format: gemini-cli-jsonl; gemini-cli-chat-recording also covers legacy whole-document JSON. Prefer migrated .jsonl to its .json sibling. Several native files can belong to one session; include the recording segment when identifying each source position.
  • Session ID: Metadata sessionId, verbatim, with no namespace. Never use projectHash or a filename timestamp.
  • Entity keys: Message id; toolCalls[].id, or GenAI functionCall.id / functionResponse.id. Results embedded in one uniquely identified call use that structural correspondence. Missing call IDs are derived and do not authorize positional joins. A token report attached to one model response supports a derived inference ID from its message ID. Stored model is requested configuration.
  • Revisions and rewind: pushMessage appends full observations keyed by message id. Fold growth and preserve changed final facts with supersedes, or declare revision_history. $rewindTo names the first removed message; target its predecessor on the current native history, or null. The pinned loader clears history if the target is absent. $set.messages is a membership snapshot within its recording segment. Known removals can form a prune; reordering without a qualified branch contract remains native evidence with an ordering loss.
  • Notes: Only functionResponse.response.output bounded by <tool_output_masked> and </tool_output_masked> proves masking. Preserve sibling media and earlier captured revisions. tokens.input includes cached tokens. tokens.output excludes thoughts; add them only when both counts are recorded. Keep native totals and tool-token counts. Thought descriptions are reasoning summaries. summary maps to title, projectHash to project ID. Legacy snapshots use snapshot assembly throughout. Checkpoint ownership outside this input is unqualified.

Position basis

Use only positions established by the stated format and mapping evidence. Current-state rows without transcript positions form the snapshot tail. A protocol commit boundary takes precedence over physical EOF; uncommitted bytes are not a gap.

Destinations

gemini-cli: native facts without a standard field

  • Lineage: At the pinned writer, kind: subagent plus chats/<parent session ID>/<child>.jsonl establishes spawnedBy with native_structure and subagent scope. kind: main establishes primary scope only. Generic parent fields or shared IDs do not establish forks, roots or copies.

Usage

Select one report per native accounting identity only when this entry establishes that identity. Keep unjoinable or overlapping reports as native evidence. Declare incomplete semantic coverage. Schema defaults and placeholder zeros are not reported usage. Rules for what a backend includes in its usage counts require evidence; do not infer them from a model name.

Lane and unassigned facts

Facts without established session ownership use manifest _meta["com.google.gemini-cli/unassigned"] with the common shape. Selection may retain these facts with any session subset, including an empty subset, but must not imply session ownership. State the selection policy in the export report.

Losses

Declare every applicable loss under ASR-157. Missing model rendering, accounting joins, lineage or exact context boundaries remain losses when this entry does not qualify them. Unknown ownership is not itself lost data. For omitted unassigned facts, use a documented vendor loss or report; do not create a new core category.

Evidence

Basis: source-verified at google-gemini/gemini-cli commit a5c49a5c4ab5ebe8119c3b363772ad043bbc4ceb (chatRecordingTypes.ts, chatRecordingService.ts, toolOutputMaskingService.ts); sanitized CLI 0.52.0 resume capture and authored semantic fixtures. The source revision and capture version are separate evidence. Evidence applies only to the named formats and explicit mappings above. A real capture covers only exercised behavior. A no-model writer probe covers persistence, not model or tool execution. Authored tests do not qualify an agent version. Unlisted formats and link mappings remain unqualified.