Skip to content

feat: add command to export and share chat logs (RES-537)#91

Open
madeleinesong wants to merge 6 commits intomainfrom
res-537-export-share-chat-logs
Open

feat: add command to export and share chat logs (RES-537)#91
madeleinesong wants to merge 6 commits intomainfrom
res-537-export-share-chat-logs

Conversation

@madeleinesong
Copy link
Copy Markdown
Collaborator

Summary

  • Add gpd.core.chat_export module with functions to list sessions and export chat logs to Markdown or JSON
  • Add /gpd:export-chat command spec and wire gpd export-chat sessions + gpd export-chat run CLI subcommands
  • Sanitize sensitive data (API keys, home directory paths) by default for safe sharing
  • Support filtering by session ID, phase/plan traces, and last-N events

Details

The export collects events from two sources:

  • Observability sessions (GPD/observability/sessions/*.jsonl) -- session lifecycle, workflow events
  • Execution traces (GPD/traces/*.jsonl) -- file reads/writes, checkpoints, assertions

Output formats:

  • Markdown: Human-readable with timestamps, command grouping, and event summaries
  • JSON: Machine-readable structured export with metadata for programmatic analysis

CLI usage:

gpd export-chat sessions                          # list available sessions
gpd export-chat run                               # export all as markdown
gpd export-chat run --format json                 # export as JSON
gpd export-chat run --session <id>                # specific session
gpd export-chat run --no-traces --last 50         # last 50 session events only
gpd export-chat run --phase 01 --plan setup       # filter traces
gpd export-chat run --no-sanitize                 # keep sensitive data (self-debug only)

Test plan

  • 24 tests covering session listing, Markdown/JSON export, sanitization, trace filtering, error handling, output paths
  • Updated help.md command count (61 -> 62)
  • Updated README command table, help workflow, and repo graph contract counts
  • Added export-chat to workflow-exempt command set in test_prompt_wiring.py
  • All existing tests pass (pre-existing paper compiler failures excluded)

🤖 Generated with Claude Code

Implement gpd.core.chat_export with functions to list available
observability sessions and export chat logs to Markdown or JSON format.
Features include sensitive data sanitization (API keys, home paths),
configurable session/trace filtering, and sharing-friendly metadata.

Closes RES-537
Define the /gpd:export-chat command as a markdown spec with support for
Markdown and JSON output formats, session filtering, and trace inclusion.

RES-537
Add 'gpd export-chat sessions' to list available sessions and
'gpd export-chat run' to export chat logs with format, session,
trace, and sanitization options.

RES-537
Cover session listing, Markdown/JSON export, sensitive data sanitization,
trace filtering, error handling, and output path configuration.

RES-537
Bump help.md command count from 61 to 62, add export-chat to the
workflow-exempt command set, and update repo graph contract counts.

RES-537
Update the public README and both help prompt surfaces (command +
workflow) to include the new /gpd:export-chat command.

RES-537
@madeleinesong madeleinesong force-pushed the res-537-export-share-chat-logs branch from 94e06d6 to 76fe781 Compare April 6, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant