kimi-code

Identity

  • Names: com.moonshot.kimi-code; short alias kimi-code.
  • Native format: kimi-code-wire-jsonl, sessions/<workDirKey>/<sessionId>/agents/<agentId>/wire.jsonl, with state.json.
  • Entity keys: context.append_message records stored context. content.part shares stepUuid for folding; a derived message ID may use that key within its agent lane. tool.call.toolCallId and tool.result.toolCallId join only within that lane and when unique. Physical-position keys are capture-scoped.
  • Notes: turn.prompt and turn.steer are acceptance observations, not evidence of delivery to a consuming turn. Source origin supplies author/injection when recorded. Persisted result output can be wrapped, dropped or reordered during request projection, so retain raw/display output and mark model content absent. The typed result’s default isError: false has success semantics only under this pin. Compaction uses contextSummary with unknown extent. Undo/microcompaction stay native. No media URL is fetched.
For kimi-code-wire-jsonl, each native agent conversation has sessionId: agentId and namespace equal to the enclosing native session ID, verbatim. main is its own stream, not an alias of the container (the enclosing native session). Use the nested encoding in the registry index only when an installation scope is also required. Do not concatenate agent contexts.

Position basis

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

Destinations

kimi-code: native facts without a standard field

  • Lineage: state.forkedFrom, the native forked marker and state.agents[agentId].parentAgentId retain fork/copy/parent evidence. Agent-level links require a conforming agent-stream identity first. Do not emit the draft’s cross-container SessionRefs or infer root.
Within a container, parentAgentId names the parent conversation using that same namespace. Cross-container fork links require the recorded source container and child ID. A lane alone still cannot establish another conversation.

Usage

  • Inference: Each llm.request records one attempt. The pinned turnStep contract is <turnId>.<step>; step.end revises that step’s final request, leaving failed attempts distinct. A completed step without a request supports a derived call. usage.record may repeat step usage and stays vendor data. Input-other/cache-read/cache-creation are disjoint; the configured request model is not proof of the served model.

Lane and unassigned facts

Facts without established session ownership use manifest _meta["com.moonshot.kimi-code/unassigned"] with the common shape. An export 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. Use a documented vendor loss or report for omitted unassigned facts; do not create a new core category.

Evidence

Basis: source-verified at commit 1ab19190e9bd2f5bb5c40c8ba58fc121da6b4941 (agent-core records/context/loop/usage and kosong usage types), with existing wire and authored fixtures. No release version or native runtime capture is established. Evidence applies only to the named formats and explicit mappings above. A real capture covers only the behavior that was exercised. A writer probe run without a model covers persistence, not model or tool execution. Authored tests do not qualify an agent version. Unlisted formats and link mappings remain unqualified.

Observations from 2026-10-27

observed, version 2.3.3: Kimi 2.3.3 retained two primary sessions and one actual child. Keep native subagent.spawned as a vendor event until its parent-side ASR spawn mapping is established. Child discovery alone does not identify a delegating call; the conversion retained an ASR-412 notice. Keep native records in native.record or native.blob rather than unregistered details metadata. The ctx conversion produced 3 streams and 136 records, with 0 errors, 1 notice, 0 gaps and 0 unidentified inputs under validator-v0.1.2. These counts describe the selected output; an empty bundle qualifies no source format. No sanitized native fixture was retained for this observation. Whole native records use native.record or native.blob, with JSON text columns preserved as strings. The exporter’s own bookkeeping for serialization, partitioning and message keys belongs in the exporter namespace (rs.ctx for ctx), not to a provider metadata destination. These runs add no evidence for approvals, lineage links, compaction boundaries or exact request context that they did not exercise.