Skip to content

Checkpoints v2: write compact transcript.jsonl alongside full session data #152

@jcleira

Description

@jcleira

Description

Partio currently stores full JSONL session data in git objects on the checkpoint branch. For large sessions this means fetching/reading the full event stream to get a summary view. A compact transcript.jsonl containing only normalized turn-level entries (user prompt + assistant response, stripped of internal tool calls) would make session browsing faster and reduce storage cost for downstream consumers.

This is the approach taken in entireio/cli (changelog 0.5.2, PRs #828, #788, #781).

What to implement

  1. Add a checkpoints_v2 boolean field to the Config type (default: false) as a feature flag.
  2. When the flag is enabled, after writing the full checkpoint blob, also write a compact transcript.jsonl to a v2 ref path (e.g. refs/partio/checkpoints/v2/<repo-id>).
  3. The compact transcript format: one JSON object per turn, each with {"role": "user"|"assistant", "ts": "...", "content": "..."}. Strip raw tool-call events and internal events; keep only conversation-level content.
  4. The v2 ref write must use the same git plumbing approach (hash-object, mktree, commit-tree, update-ref) as the existing checkpoint storage.
  5. Add a unit test for the compact transcript generation from a sample JSONL session.

Acceptance Criteria

  • When checkpoints_v2 feature flag is enabled, a compact transcript.jsonl is written to a v2 ref layout alongside the full session JSONL
  • The compact transcript contains normalized, per-turn entries (user prompt + assistant response) instead of raw JSONL events
  • The v2 ref layout uses a stable path structure (e.g. refs/partio/checkpoints/v2/main)
  • When checkpoints_v2 is disabled (default), no v2 refs are written — existing behavior is unchanged
  • make test passes
  • make lint passes

Source

Inspired by entireio/cli changelog 0.5.2 (PRs #828, #788, #781)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions