Skip to content

feat(cli): add 'terminal-agent export' command for Markdown and HTML Proof-of-Done certificates #13

Description

@Kaap10

Problem Statement

The Proof of Done audit details, test metrics, and failure recovery traces are currently stored as raw JSON inside .terminal_agent/sessions/<id>.json. There is no command to export these results into a formatted GitHub pull request description or HTML report for CI pipelines and code reviews.

Proposed Architecture & Solution

  1. Export Command (src/terminal_agent/cli/commands/export.py):
    • Command syntax:
      terminal-agent export [SESSION_ID] [--format markdown|html|json] [--output path]
    • If SESSION_ID is omitted, automatically defaults to the latest session.
  2. Report Contents:
    • Task Contract Summary: Goal, constraints, and success criteria.
    • Verification Results Table: Tests executed, tests passed/failed, assertion checklist.
    • Git Diff & Files Changed: Summary statistics and file modification breakdown.
    • Autonomous Recovery Timeline: Failures classified and repair hypotheses applied.
    • Tamper-Evident Proof of Done Certificate: Session ID, timestamp, and verification badge.
  3. HTML / Markdown Templates:
    • Markdown format optimized for direct copy-pasting into GitHub PR descriptions and issue summaries.
    • HTML format styled with a clean dark/light theme suitable for CI artifacts.

Files to Modify / Create

  • src/terminal_agent/cli/commands/export.py (New)
  • src/terminal_agent/cli/main.py (Register export command)
  • src/terminal_agent/session/manager.py (Add report synthesis helper)
  • tests/unit/test_export_command.py (New)

Acceptance Criteria

  • terminal-agent export generates valid GitHub-flavored Markdown by default.
  • terminal-agent export --format html --output report.html writes a standalone HTML report.
  • Missing or invalid session IDs output an informative error message and exit cleanly.
  • Unit tests verify Markdown and HTML output structure and contents.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions