batless 0.4.0

A non-blocking, LLM-friendly code viewer inspired by bat
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
# Changelog

All notable changes to this project will be documented in this file.

## [0.4.0] - 2026-01-08

### ๐ŸŽฏ Major Features

- **๐ŸŒฒ Multi-Language AST Support**: Added Abstract Syntax Tree summarization for 4 programming languages
  - **Rust**: Functions, structs, enums, traits, impls, constants (already supported, now comprehensive)
  - **Python**: Functions, classes, decorators, async/await, imports, type annotations
  - **JavaScript**: Functions, classes, arrow functions, exports, imports, async/await
  - **TypeScript**: Interfaces, type aliases, enums, generics, decorators (all JS features + TS-specific)
  - Three-level summary depth: Minimal, Standard (default), Detailed
  - Smart extraction preserves code structure and context
  - Zero performance overhead: 5ms execution time maintained across all modes

### ๐Ÿš€ Performance & Quality

- **โšก Performance Excellence**: Comprehensive benchmarking validates design goals
  - Consistent 5ms execution time across all modes (plain, highlight, JSON, summary)
  - AST parsing adds zero measurable overhead
  - Performance maintained on files from 200 bytes to 1KB+
  - 8-10x better than original <50ms target
- **โœ… Test Coverage**: Expanded test suite ensures reliability
  - 325 total tests (98 new tests added in v0.4.0)
  - 28 comprehensive AST tests covering all 4 languages
  - 23 CLI documentation tests prevent documentation drift
  - 15 JavaScript/TypeScript tests
  - 12 Python tests
  - Zero test failures, 100% pass rate

### ๐Ÿ”ง Bug Fixes & Improvements

- **๐Ÿ“š Documentation Accuracy**: Fixed critical CLAUDE.md documentation mismatches
  - Line numbers now correctly documented as requiring --plain mode
  - Removed references to non-existent --pattern flag (exits with error)
  - Removed references to non-existent --list flag (exits with error)
  - Removed references to non-existent -r/--range flag (never existed)
  - Added 23 automated tests to prevent future documentation drift
- **๐ŸŽฏ Context Truncation Tracking**: Enhanced JSON output for AI workflows
  - Added `truncated_by_context` boolean field to JSON output
  - Distinguishes context-based truncation from line/byte limits
  - Improves AI assistant awareness of truncated content

### ๐Ÿ“ฆ Dependencies

- **tree-sitter** (0.26.3) - AST parsing framework
- **tree-sitter-rust** (0.24.0) - Rust grammar support
- **tree-sitter-python** (0.23.6) - Python grammar support
- **tree-sitter-javascript** (0.25.0) - JavaScript grammar support
- **tree-sitter-typescript** (0.23.2) - TypeScript grammar support

### ๐Ÿ—๏ธ Technical Architecture

- **AST Module**: New `src/ast_summarizer.rs` with language-specific extractors
- **Consistent Pattern**: Parser โ†’ Query โ†’ Cursor โ†’ BTreeSet โ†’ sorted output
- **Memory Efficient**: Streaming architecture maintained with AST parsing
- **Language Detection**: Automatic language detection via syntect integration
- **Query-Based Extraction**: Tree-sitter queries for precise code structure matching

### ๐Ÿ“– Documentation

- **CLAUDE.md**: Fixed all documentation/CLI mismatches, comprehensive examples
- **RELEASE_CHECKLIST_v0.4.0.md**: Complete release preparation guide
- **Performance Data**: Documented benchmarking methodology and results
- **AST Usage**: Examples for all supported languages and summary levels

### ๐Ÿ” Security & Stability

- All 325 tests passing with zero failures
- No new security vulnerabilities introduced
- Pre-commit hooks enforce code quality (formatting, clippy, security)
- Comprehensive integration testing across all AST features

### ๐ŸŽจ Developer Experience

- Language-specific AST extraction available via library API
- Three summary levels configurable: Minimal, Standard, Detailed
- Works seamlessly with existing --mode=summary and --mode=json flags
- JSON output includes `summary_lines` field when --summary flag used

### ๐Ÿ“Š Metrics

- **Test Count**: 227 โ†’ 325 tests (+98 tests, +43%)
- **Language Support**: 1 โ†’ 4 AST languages (+300%)
- **Performance**: 5ms maintained (no regression)
- **Code Quality**: Zero clippy warnings, zero security issues

### ๐Ÿ™ Contributors

Special thanks to the tree-sitter team for their excellent parsing libraries that made multi-language AST support possible.

---

## [0.3.2] - 2025-10-29

### Bug Fixes

- **๐Ÿ”ง CI/CD Pipeline Fixes**: Resolved critical workflow issues blocking automated builds
  - Fixed YAML syntax errors in quality.yml (heredoc delimiter issues)
  - Fixed performance benchmark workflow hyperfine installation
  - Resolved heredoc delimiter compatibility between bash and YAML
- **๐Ÿ› ๏ธ Workflow Stability**: All CI/CD pipelines now passing consistently
  - Unified CI/CD Pipeline operational
  - Code Quality & Security checks passing
  - Performance benchmarks restored

### Maintenance

- **๐Ÿ“ฆ Dependency Updates**: Updated to latest stable versions
  - clap: 4.5.49 โ†’ 4.5.50
  - is-terminal: 0.4.16 โ†’ 0.4.17 (cleaner dependency tree)
  - proptest: 1.8.0 โ†’ 1.9.0 (removed lazy_static dependency)
- **๐Ÿ”„ GitHub Actions Updates**: Updated across 12 workflow files
  - actions/upload-artifact: v4 โ†’ v5 (Node v24 support)
  - actions/download-artifact: v5 โ†’ v6
  - actions/setup-node: v4 โ†’ v6
  - codecov/codecov-action: v4 โ†’ v5 (standardized)
  - github/codeql-action: v3 โ†’ v4
  - EmbarkStudios/cargo-deny-action: v1 โ†’ v2
  - dawidd6/action-homebrew-bump-formula: v3 โ†’ v5
- **๐Ÿงน Repository Cleanup**: Pruned stale branches and references
  - Removed 4 obsolete Dependabot branches
  - Cleaned up local and remote branch references

### Documentation

- **๐Ÿ“š Roadmap Update**: Updated [ROADMAP.md]ROADMAP.md with 2025-2026 timeline
  - Marked v0.3.1 achievements
  - Set realistic targets for v0.4.0 through v1.0.0
  - Updated success metrics to reflect current progress
- **๐Ÿค Community Infrastructure**: Established contributor ecosystem
  - Enabled GitHub Discussions for community Q&A
  - Created 3 "good first issue" items for new contributors
  - Added labels: `good first issue`, `help wanted`, `documentation`

### Infrastructure

- **โœ… Quality Verification**: Comprehensive testing and validation
  - Verified Rust beta channel compatibility (1.92.0-beta.1)
  - All 188 unit tests passing
  - Clippy clean on both stable and beta channels
  - Code formatting verified
- **๐Ÿ” Security**: All security audits passing
  - Dependabot security updates applied
  - CodeQL analysis passing
  - No known vulnerabilities

### Contributors

Special thanks to Dependabot for automated dependency updates and to the community for issue reports.

---

## [0.3.1] - 2025-10-17

### User Experience Improvements

- **โœจ Helpful Error Messages**: Added friendly, actionable error messages when users try unsupported features
  - `--pattern` flag now suggests using `grep` or `rg` instead
  - `--list` flag now suggests using `ls`, `find`, or `fd` instead
  - `--range` flag now suggests using `sed` or `--lines` instead
  - Each error includes working examples and explains the design philosophy
  - Dramatically reduces user confusion and learning curve

### Maintenance

- **๐Ÿ“ฆ Dependency Updates**: Updated 50+ dependencies to latest versions
  - clap 4.5.47 โ†’ 4.5.49
  - syntect 5.2.0 โ†’ 5.3.0
  - serde 1.0.225 โ†’ 1.0.228
  - proptest 1.7.0 โ†’ 1.8.0
  - Plus many transitive dependency updates with security patches

### Documentation

- **๐Ÿ“š Enhanced Documentation**: Major README cleanup and improvements
  - Reduced README from 2,949 to 439 lines (85% reduction)
  - Eliminated massive duplication (same sections repeated 21 times)
  - Added comprehensive CLI options reference
  - Added detailed usage examples for all use cases
  - Added AI assistant integration guides
  - Better structured with logical flow
- **๐Ÿ“– Philosophy Guide**: Added [docs/PHILOSOPHY_AND_SCOPE.md]docs/PHILOSOPHY_AND_SCOPE.md
- **๐Ÿ”ง CI/CD Strategy**: Added [docs/GITHUB_ACTIONS_UPDATE_STRATEGY.md]docs/GITHUB_ACTIONS_UPDATE_STRATEGY.md

### CI/CD Optimization

- **โšก Pipeline Performance**: 40% speed improvement (26min โ†’ <15min average)
  - Enhanced concurrency controls with intelligent cancellation
  - Parallel test execution across 3-7 concurrent jobs
  - Advanced caching with Swatinem/rust-cache@v2
  - Build optimizations (CARGO_INCREMENTAL=0, target-cpu=native)
- **๐Ÿ“Š Monitoring & Auto-Recovery**: Comprehensive health check system
  - `pipeline-health-check.sh` - automated health assessment
  - `ci-health-check.sh` - quick status checker
  - `workflow-performance-monitor.sh` - performance analysis
  - Real-time metrics tracking and reporting
- **๐Ÿ”„ New Workflows**: Added optimized CI/CD workflows
  - `ci-optimized.yml` - ultra-fast validation
  - `performance-optimized.yml` - aggressive parallelization

### Quality

- **โœ… Tests**: 188+ tests passing with zero failures
- **๐Ÿ”’ Security**: All security audits passing, zero vulnerabilities
- **๐Ÿงน Code Quality**: Zero clippy warnings, clean builds
- **๐Ÿ“ˆ CI/CD Health**: All workflows passing consistently

## [0.3.0] - 2024-08-27

### Major Architecture Improvements

- **๐Ÿ—๏ธ Technical Debt Remediation**: Comprehensive refactoring addressing critical stability and maintainability issues
- **๐Ÿ“ฆ Module Extraction**: Split large config.rs (1,366โ†’1,054 lines) into focused modules:
  - `src/summary.rs` - SummaryLevel enum with Copy trait optimization
  - `src/profile.rs` - CustomProfile with optimized getter methods
  - `src/traits.rs` - Dependency inversion interfaces
  - `src/processor_builder.rs` - Configurable processing with dependency injection
  - `src/formatters/` - Modular output formatting architecture
  - `src/performance.rs` - Caching, metrics, and optimization utilities
  - `src/debt_prevention.rs` - Quality gates and automated debt prevention

### Code Quality & Performance

- **๐Ÿ”ง Error Handling**: Eliminated 7 unwrap() calls in production code with proper error propagation
- **โšก Performance**: Reduced clone() operations from 54โ†’49, added Copy traits where applicable
- **๐Ÿงน Code Quality**: Zero clippy warnings, comprehensive validation with quality gates
- **๐Ÿ”’ Security**: All cargo audit vulnerabilities addressed

### CI/CD Optimization

- **๐Ÿš€ Workflow Consolidation**: Streamlined from 12โ†’3 focused workflows (62% reduction in YAML)
  - `test-consolidated.yml` - Comprehensive testing across platforms
  - `quality-consolidated.yml` - Linting, security, and quality checks
  - `release-consolidated.yml` - Automated releases with proper artifacts
- **โ™ป๏ธ Reusable Actions**: Created modular GitHub Actions in `.github/actions/`
- **๐Ÿ“Š Enhanced Testing**: 247+ tests with improved coverage and reliability

### Developer Experience

- **๐ŸŽฏ Dependency Inversion**: Trait-based architecture enabling better testability and modularity
- **๐Ÿ› ๏ธ Builder Pattern**: Configurable processors with clean dependency injection
- **๐Ÿ“‹ Quality Gates**: Automated checks preventing future technical debt accumulation
- **๐Ÿ“ ADR Templates**: Architecture Decision Record system for documenting design choices

### Bug Fixes

- **โœ… Test Reliability**: Fixed 7 failing CLI integration tests
- **๐Ÿ”ง Schema Validation**: Added proper "$schema" fields to all JSON outputs
- **๐Ÿš Shell Completion**: Fixed PowerShell completion generation
- **โš ๏ธ Validation**: Enhanced error messages with "validation" keywords for better UX

## [0.2.5] - 2024-12-19

### Added

- `--lines=START:END` flag for selecting specific line ranges
  - Supports formats: `10:50` (lines 10-50), `100:` (from line 100), `:50` (up to line 50), `42` (from line 42)
  - Works with all output modes (plain, json, summary)
  - Combines with `--max-lines` for additional control
  - Maintains streaming architecture for memory efficiency

### Fixed

- Performance baseline stabilization (3 consecutive green CI runs achieved)
- CLI documentation mismatch with CLAUDE.md resolved

### Documentation

- Added line range examples to README
- Updated CLI help text with range format examples
- Fixed CLAUDE.md to reflect actual CLI capabilities

## [0.2.4] - 2025-08-15

### Added (0.2.4)

- feat: Add --version-json flag for machine-readable version/build metadata (includes git hash & build timestamp)
- feat: Add --json-pretty flag to toggle pretty vs compact JSON output
- docs: Add Architecture Overview (docs/ARCHITECTURE.md)
- ci: Enhanced performance regression workflow with JSON summary & PR comments
- ux: Wizard profile listing now shows total count and latest update timestamp
- docs: README performance claim refined (<50ms โ†’ <5ms typical) with methodology note

### Notes

- Performance guard integrated; baseline stabilization ongoing (target: 3 consecutive green main runs post-release)

### Maintenance

- deps: Bump clap from 4.5.42 to 4.5.43 and clap_complete from 4.5.55 to 4.5.56
- deps: Bump toml from 0.8.23 to 0.9.5 (major version update, fully backward compatible)
- chore: Update shell completions with latest CLI options
- fix: Resolve Docker and cross-platform validation issues
- fix: Add gcc to Dockerfile for musl cross-compilation

## [0.2.3] - 2025-08-07

### Added (0.2.3)

- Enhanced interactive configuration wizard with more comprehensive options
- Improved error handling & user experience (clearer messages, better suggestions)
- Centralized configuration logic & architectural refactor for maintainability
- Expanded integration & monitoring documentation (AI & Editor Integration Guide, release monitoring)
- Additional integration & property tests increasing overall coverage

### Changed (0.2.3)

- Major refactor: reduced duplication, cleaner separation of concerns
- Documentation & TODO cleanup after 0.2.2 release
- CI/CD stability improvements
- docs: Correct v0.2.2 status - features complete but not yet released (1df3e83)
- docs: Clean up TODO.md header formatting after v0.2.2 release (684d543)
- ci/docs: Fix pipeline issues & clippy warnings (22bca40)

### Fixed (0.2.3)

- Resolved clippy format string/interpolation warnings
- Addressed minor documentation inconsistencies

## [0.2.2] - 2025-08-03

### Added (0.2.2)

- Complete cat replacement functionality with -n/--number & -b/--number-nonblank flags
- Exact compatibility with system cat line numbering format (6-character right-aligned + tab)
- Perfect newline handling to match cat/less output exactly
- Enhanced PAGER / cat compatibility flags & behaviors (--plain, compatibility flags)
- Comprehensive AI & Editor Integration Guide (13+ CLI AI tools, 5+ web AI platforms)

### Changed (0.2.2)

- Standardized output using consistent println formatting
- Modernized format strings to resolve uninlined-format-args warnings
- Simplified conditional logic in main.rs (removed if-same-then-else patterns)
- Improved CI/CD pipeline reliability and stability

### Fixed (0.2.2)

- Critical newline bug causing shell "%" indicators
- Test failures in CI (e.g. test_max_lines_limit)
- Clippy warnings (format strings, conditional logic)
- Truncation message formatting for better test compatibility

## [0.2.1] - 2025-08-02

### Summary

Enhanced Features & milestone completion: PAGER compatibility and comprehensive streaming improvements.

This release completes the v0.2.1 milestone with PAGER compatibility and comprehensive streaming features for handling large files efficiently.

#### ๐Ÿ†• New Features

- **๐Ÿ”ง PAGER Compatibility**: Use batless as a drop-in replacement for cat/less
  - `--plain`: Plain text output mode equivalent to `--mode plain`
  - `--unbuffered`, `--number`: Compatibility flags (ignored for compatibility)
  - Stdin support: Read from pipes and redirects (`echo "content" | batless --plain`)
  - GitHub CLI integration: `PAGER="batless --plain" gh pr view 46`
  - Automatic color disabling in plain mode for better PAGER compatibility

- **๐ŸŒŠ Enhanced JSON Output**: Complete streaming and resumable processing
  - `--streaming-json`: Enable streaming mode for large file processing
  - `--streaming-chunk-size <SIZE>`: Configure chunk size (default: 1000 lines)
  - `--enable-resume --checkpoint <FILE>`: Resume processing from saved checkpoint
  - Stdin support for streaming operations (pipelines and PAGER usage)
  - JSON schema versioning with backwards compatibility
  - Comprehensive streaming validation and error handling

- **๐ŸŒŠ Streaming JSON Output**: Process very large files efficiently with streaming
  - `--streaming-json`: Enable streaming mode for large file processing
  - `--streaming-chunk-size <SIZE>`: Configure chunk size (default: 1000 lines)
  - Schema versioning with JSON output versioned as "2.1"
  - Chunk-based processing with metadata and checksums
- **โฏ๏ธ Resume Capability**: Checkpoint and resume interrupted processing
  - `--enable-resume`: Enable checkpoint-based resuming
  - `--checkpoint <FILE>`: Specify checkpoint file location
  - Configuration compatibility validation for safe resuming
- **๐Ÿง™ Interactive Configuration Wizard**: User-friendly profile setup
  - `--configure`: Launch interactive configuration wizard
  - `--list-profiles`: Display all available custom profiles
  - `--edit-profile <PATH>`: Edit existing profiles interactively
  - Comprehensive profile management with timestamps and validation
- **๐Ÿ” Debug Mode**: Detailed processing information for troubleshooting
  - `--debug`: Enable debug output with timing and processing details
  - File statistics, processing time, and configuration details
  - Helpful for performance tuning and issue diagnosis

#### Enhanced

- **๐Ÿ“Š JSON Schema System**: Added streaming chunk schema support
  - New `streaming_chunk` schema for validating streaming output
  - Enhanced error messages with field-level validation
  - Schema version tracking for compatibility
- **โš™๏ธ Configuration System**: Extended with new streaming and debug options
  - Support for streaming configuration in custom profiles
  - Debug mode configuration persistence
  - Enhanced validation for streaming parameters

#### Developer Experience

- **๐ŸŽฏ Comprehensive CLI**: All new features fully integrated into help system
- **๐Ÿ“ Enhanced Documentation**: Complete CLI help for all new options
- **๐Ÿงช Test Coverage**: 162 tests covering all new functionality
- **๐Ÿ”’ Security**: Full security audit passed with no vulnerabilities
- **โšก Performance**: Optimized for large file processing with streaming

#### Technical Details

- Added `streaming.rs` module for streaming JSON functionality
- Added `wizard.rs` module for interactive configuration management
- Extended configuration system with streaming and debug support
- Enhanced JSON schema validation with streaming support
- Added chrono dependency for timestamp management
- Maintained full backward compatibility with existing features

<!-- (Removed duplicate placeholder subsections for 0.2.0) -->

<!-- (Trimmed duplicated historical sections below; canonical history retained above) -->

<!-- (Removed secondary duplicate placeholder group) -->

## [0.1.0] - 2025-07-22

### Added

- ๐ŸŽฏ **Core batless functionality** - non-blocking code viewer for AI and automation
- ๐ŸŽจ **Syntax highlighting** for 100+ programming languages via syntect
- ๐Ÿ“Š **Multiple output modes**: plain, highlight, JSON, and summary
- ๐Ÿค– **AI-optimized features**:
  - Summary mode extracts functions, classes, imports
  - Token extraction for LLM context processing
  - JSON output with metadata and structure
- โšก **Performance features**:
  - Smart file limiting by lines and bytes
  - Memory-efficient streaming architecture
  - Cached syntax definitions for fast startup
- ๐Ÿ”’ **Enterprise-grade security**:
  - Comprehensive test coverage with property-based testing
  - Daily vulnerability scanning and dependency auditing
  - Supply chain security with SBOM generation
  - Memory safety validation and fuzz testing
- ๐Ÿ“ฆ **Professional distribution**:
  - Cross-platform binaries (Linux, macOS, Windows)
  - Homebrew tap integration
  - Docker containerization
  - GitHub Actions CI/CD pipeline

### Features for AI Assistants

- Always non-blocking output (never hangs or waits for input)
- Clean, predictable output format
- JSON mode for structured data extraction
- Safe defaults for automated workflows
- No decorations or interactive elements

### Features for CI/CD

- Guaranteed streaming output
- Configurable color control for different environments
- Error handling that doesn't break pipelines
- Memory efficient for large codebases
- Single binary with no external dependencies

### Technical Details (0.1.0)

- Built with Rust for performance and safety
- Uses syntect for syntax highlighting
- Clap for CLI argument parsing
- Supports all major operating systems
- Release binary size: ~2MB
- Fast startup time with lazy loading

### Comparison with `bat`

- โœ… Never blocks (unlike `bat` which can use `less`)
- โœ… JSON output mode (not available in `bat`)
- โœ… Byte limiting support (not in `bat`)
- โœ… AI/automation focused design
- โŒ No Git integration (by design)
- โŒ No line numbers (by design for clean output)
- โŒ No file headers (by design for minimal output)

<!-- Link references intentionally removed since trimmed history above covers 0.1.0 only -->