Skip to content

feat: add --log=interleaved|labeled|grouped modes#266

Merged
branchseer merged 6 commits intomainfrom
log-modes
Mar 20, 2026
Merged

feat: add --log=interleaved|labeled|grouped modes#266
branchseer merged 6 commits intomainfrom
log-modes

Conversation

@branchseer
Copy link
Member

@branchseer branchseer commented Mar 18, 2026

Summary

  • Add --log flag with three output modes: interleaved (default), labeled, grouped
  • Refactor reporter system into three mode reporters + a SummaryReporter decorator
  • Remove all_ancestors_single_node graph topology tracking — stdio inheritance is now mode-based
  • Add E2E snapshot tests covering all stdio cases for each mode

--log=interleaved (default)

Streams output directly. Uncached tasks inherit stdio (TTY), cached tasks pipe for capture/replay.

--log=labeled

Prefixes each output line with [pkg#task]. Always piped.

--log=grouped

Buffers all output per task and prints as a block on completion. Always piped.

Test plan

  • 27 unit tests (reporters, writers)
  • E2E snapshot tests: interleaved-stdio (8 cases), labeled-stdio (7 cases), grouped-stdio (7 cases)
  • Cross-platform clippy (just lint-linux, just lint-windows)

🤖 Generated with Claude Code

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@branchseer branchseer changed the title docs: add stdio plan for --log flag feat: three --log modes Mar 18, 2026
@branchseer branchseer changed the title feat: three --log modes feat: add --log=interleaved|labeled|grouped modes Mar 19, 2026
branchseer and others added 6 commits March 20, 2026 12:54
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove stdio-detection, stdin-inheritance, and stdio-graph-criteria
fixtures. Replace with interleaved-stdio, labeled-stdio, and
grouped-stdio fixtures that systematically cover all stdio cases
for each --log mode.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add three output modes controlled by the --log flag:
- interleaved (default): streams output directly, inherits stdio for uncached tasks
- labeled: prefixes each line with [pkg#task], always piped
- grouped: buffers output per task, prints as a block on completion

Refactor reporter system:
- Remove all_ancestors_single_node from reporter traits and execution
- Rename LabeledReporter to InterleavedReporter (it was always interleaved)
- Add new LabeledReporter with line-prefixing LabeledWriter
- Add GroupedReporter with buffering GroupedWriter
- Extract SummaryReporter as a decorator that wraps any mode reporter
- Add Clone to CacheStatus and related types for summary tracking

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@branchseer branchseer requested a review from fengmk2 March 20, 2026 04:57
@branchseer branchseer marked this pull request as ready for review March 20, 2026 04:57
@branchseer branchseer merged commit a7b0d0a into main Mar 20, 2026
17 of 19 checks passed
@branchseer branchseer deleted the log-modes branch March 20, 2026 05:16
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.

2 participants