Skip to content

feat: Add --output flag to debate command#191

Merged
ducks merged 1 commit intomainfrom
feature/debate-output
Feb 8, 2026
Merged

feat: Add --output flag to debate command#191
ducks merged 1 commit intomainfrom
feature/debate-output

Conversation

@ducks
Copy link
Owner

@ducks ducks commented Feb 8, 2026

Summary

Adds ability to save debate transcripts to a markdown file for later reference.

Changes

  • Add --output/-o flag to Debate command in main.rs
  • Create DebateOutput struct with summary and markdown fields
  • Capture round content during debate execution
  • Build markdown transcript with metadata (date, topic, participants)
  • Write to file if --output provided

Usage

lok debate "Should we use async or sync?" --output transcript.md

Output includes:

  • Date and topic
  • Participants (backends)
  • All rounds with each backend's position
  • Final outcome (consensus/no consensus)

Closes #183

Test plan

  • Compiles cleanly
  • Manual testing of --output flag

🤖 Generated with Claude Code

Adds ability to save debate transcripts to a file for later reference.

- Add --output/-o flag to Debate command
- Create DebateOutput struct with summary and markdown fields
- Capture round content during debate execution
- Build markdown transcript with metadata (date, topic, participants)
- Write to file if --output provided

Usage:
  lok debate "topic" --output transcript.md

Closes #183

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ducks
Copy link
Owner Author

ducks commented Feb 8, 2026

lok Review (Claude + Codex + Gemini consensus)

Verdict: APPROVE

Clean implementation following project patterns. All three reviewers approve with suggestions around UX polish (missing terminal output on consensus), edge case handling (single participant outcome), and code quality improvements (derive Clone, add tests).

Critical: None

Important: - Missing print_positions call after consensus reached (src/debate.rs:103-110): When consensus is achieved, users don't see final positions in terminal, only the markdown transcript contains them

  • Missing explicit outcome for single/zero participant runs (src/debate.rs:66): When positions.len() < 2, build_markdown passes None for outcome, yielding no Outcome: line in the markdown
  • File overwrite behavior without warning (src/main.rs:503): tokio::fs::write overwrites existing files silently, risking accidental data loss

Minor: - Manual Position cloning is verbose (src/debate.rs:65-71, 93-99): Consider adding #[derive(Clone)] to Position struct

  • Unconditional transcript collection even when --output not provided adds unnecessary memory/CPU overhead
  • Participant headings uppercased may mangle branded names (src/debate.rs:108)
  • Hardcoded 'Responses' for all rounds after first could be differentiated
  • No automated tests for build_markdown function
  • Possibly unused std::path::Path import (src/debate.rs:7)
  • Inconsistent markdown newlines if stance already ends with whitespace (src/debate.rs:173-174)

Automated review by lok review-pr workflow

@ducks ducks merged commit 10af48b into main Feb 8, 2026
3 checks passed
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.

Add --output flag to debate command

1 participant