Conversation
Moves fuzzing/tui/ to top-level tui/ package to better reflect architectural boundaries. TUI is a presentation layer that depends on the fuzzing core, not part of the fuzzing package itself. Changes: - Move fuzzing/tui/*.go to tui/ - Update import in cmd/fuzz.go - Fix formatting with prettier (CLAUDE.md, docs/src/cli/fuzz.md) This improves separation of concerns and makes the codebase structure more intuitive.
Remove unused tuiLogWriter parameter from NewFuzzer signature. The parameter was never used - TUI mode is controlled by config.Fuzzing.EnableTUI, and the log buffer is set separately via SetLogBuffer() after fuzzer creation. Changes: - Remove io.Writer parameter from NewFuzzer signature - Update all callers (cmd/fuzz.go, tests) - Update API documentation - Remove unused "io" import This restores the original API and maintains full backwards compatibility with existing code.
The logBuffer field in Fuzzer was stored but never retrieved.
The TUI manages its own logBuffer directly, so storing a copy
in Fuzzer was redundant.
Removed:
- logBuffer field from Fuzzer struct
- SetLogBuffer() and LogBuffer() methods
- fuzzer.SetLogBuffer() call in cmd/fuzz.go
This eliminates the interface{} type and simplifies the code
without any functional changes. The TUI continues to work
exactly as before.
TUI is a presentation/logging concern rather than a fuzzing concern. Moving it to LoggingConfig improves logical organization of settings. Changes: - Move EnableTUI field from FuzzingConfig to LoggingConfig - Update all code references (cmd/, fuzzing/) - Move documentation from fuzzing_config.md to logging_config.md - Update CLI documentation link No functional changes - TUI works exactly the same.
Unified the two functions into a single printMetricsLoop that: - Monitors test limit in both TUI and non-TUI modes - Prints metrics to console only when TUI is disabled - Uses ticker for consistent 3-second intervals - Properly handles context cancellation Benefits: - Eliminates code duplication - Cleaner separation of concerns - Consistent behavior across modes - Single monitoring loop for both scenarios Removed monitorTestLimit function entirely as it's now integrated into printMetricsLoop.
Major architectural changes to simplify TUI integration: 1. Eliminate tui/ package entirely 2. Move fuzzer_tui.go to fuzzing/ package (TUI is first-class fuzzing concern) 3. Move utilities (log_buffer_writer, formatters, styles) to logging/ package 4. Centralize all TUI/logging setup in NewFuzzer() - no signature changes 5. Integrate TUI into Fuzzer.Start() with transparent mode dispatching 6. Simplify cmd/fuzz.go - removed all TUI orchestration logic Changes by file: - cmd/fuzz.go: Removed TUI setup logic, simplified to just NewFuzzer() → Start() - fuzzing/fuzzer.go: Added TUI fields, early Fuzzer creation, Start() dispatcher - fuzzing/fuzzer_tui.go: Moved from tui/, updated to use logging utilities - logging/formatters.go: Moved from tui/, capitalized functions for public export - logging/log_buffer_writer.go: Moved from tui/ to logging/ - logging/styles.go: Moved from tui/, capitalized variables/functions - tui/*: Deleted entire package (no longer exists) - flake.nix: Updated vendorHash for new package structure Benefits: - Cleaner separation: cmd/ is pure orchestration - Simpler API: NewFuzzer() → Start() works for both TUI and non-TUI modes - No split logic: All TUI setup centralized in fuzzing package - Better layering: fuzzing/ → logging/ (no circular dependencies) All tests passing, build successful. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Resolve merge conflicts and fix critical issues found in code review: - Add nil check for tuiModel in startWithTUI() - Make error channel send non-blocking to avoid goroutine leak - Return defensive copy from Workers() to prevent race conditions - Add timeout handling with proper f.Stop() call on TUI exit Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The merge from master brought in new charmbracelet dependencies (bubbles, bubbletea, lipgloss) for the TUI feature, requiring an updated vendorHash. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…erns Moves TUI implementation from fuzzing/fuzzer_tui.go into a new tui package with interface-based decoupling. The Fuzzer now exposes methods through a FuzzerDataProvider interface, allowing the TUI to operate independently. Key changes: - Created tui package with interface.go, tui.go, dashboard.go, and views.go - Removed TUI fields and logic from Fuzzer struct - Moved TUI lifecycle management to cmd layer - Deleted fuzzing/fuzzer_tui.go (1170 lines) This improves testability, maintainability, and enables alternative UI implementations without modifying the fuzzing engine. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
4 tasks
|
Resolved conflicts by: - Preserving test limit check from pr-719 in fuzzer.go - Integrating master's improved metrics logging with formatted duration and aligned output - Adopting master's refactored shrinking algorithm in fuzzer_worker_shrinking.go - Preserving TUI-required Activity() and WorkerMetrics() methods in fuzzer_worker.go - Adding activity field and initialization for worker activity tracking The merge brings in master's improvements while maintaining TUI functionality.
anishnaik
commented
Feb 5, 2026
| // is encountered or the fuzzing operation has completed. Its execution can be cancelled using the Stop method. | ||
| // Returns an error if one is encountered. | ||
| func (f *Fuzzer) Start() error { | ||
| func (f *Fuzzer) startNormal() error { |
Collaborator
Author
There was a problem hiding this comment.
TODO: need to remove this function
anishnaik
commented
Feb 5, 2026
| return &fw.fuzzer.metrics.workerMetrics[fw.workerIndex] | ||
| } | ||
|
|
||
| // WorkerMetrics returns the fuzzerWorkerMetrics for this specific worker (public accessor for TUI). |
Collaborator
Author
There was a problem hiding this comment.
add back fw.activity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR refactors the Terminal User Interface (TUI) implementation into a separate `tui` package, building on PR #719. This architectural improvement separates UI concerns from the fuzzing engine core.
What Changed
Architecture Improvements
New Package Structure
```
tui/
├── interface.go # FuzzerDataProvider interface definitions
├── tui.go # Main TUI model and bubbletea integration
├── dashboard.go # Dashboard rendering (stats, test cases, workers)
└── views.go # Specialized views (trace, logs, error, exit)
```
Files Modified
Benefits
✅ Better Testability: TUI can be tested independently with mock providers
✅ Improved Maintainability: Clear boundaries between components
✅ Enhanced Flexibility: Easy to add alternative UIs without modifying fuzzing code
✅ Cleaner Architecture: UI concerns separated from fuzzing engine logic
TUI Features (from original PR #719)
All original TUI functionality is preserved:
Keyboard Controls
Testing
✅ All tests pass (`go test -v ./...`)
✅ Clean build with no errors
✅ TUI functionality verified (all features working)
Related
🤖 Generated with Claude Code