Skip to content

fix(cli): stabilize timeline json schema#310

Merged
upsetbit merged 1 commit into
masterfrom
codex/fix-timeline-json-schema
Jun 27, 2026
Merged

fix(cli): stabilize timeline json schema#310
upsetbit merged 1 commit into
masterfrom
codex/fix-timeline-json-schema

Conversation

@upsetbit

Copy link
Copy Markdown
Contributor

Summary

Fixes #299.

Timeline --json now emits a stable snake_case CLI schema instead of raw Go struct field names, and the documented jq example now treats timeline output as NDJSON.

What changed

  • Added a timeline JSON DTO with fields like id, agent, device_id, project, and started_at.
  • Added snake_case token usage fields under usage.
  • Reused the same JSON emitter for local and remote timeline output.
  • Preserved remote profile, parent_session_id, and kinds in remoteSessionToLocal.
  • Updated tests and the docs/usage.md jq example to use NDJSON correctly.

Validation

  • go test ./internal/cli -run 'TestRunNuRemoteListsWithoutLocalStore|TestTimelineSessionPayloadUsesStableJSONSchema' -count=1
  • go test ./internal/cli/... -race
  • go build -o ./bin/prosa ./cmd/prosa
  • pnpm exec markdownlint-cli2 --no-globs docs/usage.md
  • Manual checks with prosa --all --json --limit 1 | jq '{id, ID, agent, Agent, started_at, StartedAt, project, profile}'
  • Manual check of the updated jq -s '[.[] | {agent, project, started_at}]' example

@upsetbit upsetbit added bug Something isn't working documentation Improvements or additions to documentation area:cli prosa CLI scope:cli prosa CLI commands, flags, rendering, setup, and scheduled sync scope:docs README, docs, examples, and agent-facing guidance severity:medium Latent bug, inconsistent contract, brittle pattern priority:P1 Important reliability, usability, workflow, or audit follow-up source:audit Created from an audit report or validation pass labels Jun 27, 2026
@upsetbit upsetbit merged commit f72dd3d into master Jun 27, 2026
4 checks passed
@upsetbit upsetbit deleted the codex/fix-timeline-json-schema branch June 27, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:cli prosa CLI bug Something isn't working documentation Improvements or additions to documentation priority:P1 Important reliability, usability, workflow, or audit follow-up scope:cli prosa CLI commands, flags, rendering, setup, and scheduled sync scope:docs README, docs, examples, and agent-facing guidance severity:medium Latent bug, inconsistent contract, brittle pattern source:audit Created from an audit report or validation pass

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timeline --json schema does not match documented jq examples

1 participant