All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Major documentation and test coverage release completing a comprehensive 5-phase improvement plan with 216 new tests, comprehensive browser documentation, and security vulnerability fixes.
- 216 new tests added - Total now 698 tests across 162 suites
- Concurrency tests - 12 tests for parallel operations and thread safety
- Browser tests - 65 tests for browser build validation
- Integration tests - 21 end-to-end pipeline tests
- Transaction tests - 24 tests for ACID transaction handling
- REPL tests - 24 tests for interactive REPL functionality
- File editor tests - 23 tests for file modification operations
- Hash index tests - 47 tests for indexing performance
-
docs/BROWSER.md - Complete browser API documentation
- ESM, UMD, IIFE bundle usage
- React and Vue integration examples
- CDN usage patterns
-
docs/ERROR_HANDLING.md - Comprehensive error handling guide
- All error classes documented
- Troubleshooting patterns
- Best practices
-
examples/browser/ - 4 interactive browser examples
- Basic usage with compression stats
- TONLDocument API demonstration
- React 18 user management app
- Vue 3 task manager app
-
Fixed 5 npm vulnerabilities in vscode-extension
- Removed deprecated
vscepackage - Fixed glob command injection (HIGH)
- Fixed jws HMAC verification (HIGH)
- Fixed js-yaml prototype pollution (MODERATE)
- Fixed xml2js prototype pollution (MODERATE)
- Removed deprecated
-
Updated all dependencies to latest versions
- fast-check: 4.3.0 โ 4.5.0
- rimraf: 6.1.0 โ 6.1.2
- terser: 5.44.0 โ 5.44.1
- vite: 7.1.12 โ 7.3.0
-
New exports added to package.json
tonl/navigation- Tree traversal utilitiestonl/indexing- Performance indexingtonl/modification- CRUD operationstonl/repl- Interactive REPLtonl/errors- Error classes
-
TypeScript improvements
- Incremental build enabled
- Build time reduced to ~1.6s
- 698 tests across 162 test suites - 100% pass rate
- 0 npm vulnerabilities in all packages
- 100% backwards compatible with v2.5.1
Patch release addressing 8 critical security and stability issues discovered after the v2.5.0 release. All fixes have been validated with 482 tests across 91 test suites achieving 100% pass rate.
-
BUG-NEW-013 - Array expansion DoS prevention (HIGH severity)
- Fixed potential denial-of-service attack through unbounded array expansion
- Added safe array handling with size validation
-
BUG-NEW-014 - TONLDocument export validation (MEDIUM severity)
- Fixed validation issue in TONLDocument export operations
- Enhanced error handling for export failures
-
BUG-NEW-015 - Compound index JSON.stringify vulnerability (HIGH severity)
- Fixed critical JSON.stringify vulnerability in compound index operations
- Added safe serialization protection for complex index structures
-
BUG-NEW-016 - Unsafe .length access on null/undefined (MEDIUM severity)
- Fixed potential crashes from unsafe .length property access
- Added null/undefined checks throughout the codebase
-
BUG-NEW-017 - Async load() called without await (MEDIUM severity)
- Fixed incorrect async/await usage in load() operations
- Ensured proper promise handling in file loading operations
-
BUG-NEW-018 - Jaro similarity bounds checking (LOW severity)
- Fixed bounds checking in Jaro similarity algorithm
- Improved accuracy of fuzzy string matching calculations
-
BUG-NEW-019 - loadSchemaFromFile error handling (MEDIUM severity)
- Enhanced error handling in schema file loading
- Added proper error propagation for schema validation failures
-
BUG-NEW-020 - Default-safe NODE_ENV check (LOW severity)
- Fixed NODE_ENV default value handling
- Ensured safe environment detection in all contexts
- 482 tests across 91 test suites - 100% pass rate with zero failures
- Zero regressions - All existing functionality preserved
- Enhanced stability - Improved error handling and edge case coverage
Major security and code quality release completing a comprehensive 20-task enterprise code review with security hardening, performance optimization, and test improvements.
- Path traversal protection - Blocked
../,..\\, absolute paths, and null bytes in file operations - CLI input sanitization - Comprehensive validation for all command-line arguments
- Size limits enforcement - Maximum file size (100MB) and content length limits
- Allowed extensions whitelist - Only
.json,.tonl,.txtfiles permitted
- Recursion depth limiting - Maximum 100 levels to prevent stack overflow attacks
- Block line limits - Maximum 10,000 lines per block to prevent memory exhaustion
- Input size validation - Early rejection of oversized inputs
- Regex timeout protection - ReDoS-resistant pattern matching
- Token bucket rate limiter - Configurable requests per window
- Sliding window tracking - Accurate rate limiting across time boundaries
- Query complexity limits - Maximum operations per query to prevent abuse
- 584 comprehensive tests - All passing with 100% success rate
- 96 security-focused tests - Covering all attack vectors
- Test isolation fixes - Unique temp file names prevent parallel test conflicts
- Cross-platform compatibility - Windows and Unix temp directory handling
- DictionaryBuilder - String deduplication with reference encoding
- ColumnReorderer - Optimal column ordering for compression
- NumericQuantizer - Precision-aware numeric compression
- DeltaEncoder - Sequential value delta encoding
- RunLengthEncoder - RLE for repetitive data
- BitPacker - Bit-level integer packing
- AdaptiveOptimizer - Automatic strategy selection
- SchemaInheritance - Hierarchical schema compression
- InputValidator - Comprehensive input validation
- PathSanitizer - Path traversal protection
- RateLimiter - Token bucket rate limiting
- SecurityContext - Centralized security state
- Centralized error handling - Consistent error types and messages
- Type safety improvements - Stricter TypeScript configurations
- Documentation updates - JSDoc comments for all public APIs
- Performance benchmarks - Baseline metrics for optimization tracking
- 19/20 tasks completed (95% completion rate)
- Task 006 deferred - Block parser refactoring postponed for dedicated sprint
- Zero regressions - All existing functionality preserved
- CLI Version Display - Fixed hardcoded version string showing 2.2.0 instead of current version
- Updated build date to 2025-11-28
Major feature release adding powerful aggregation functions, fuzzy string matching, and temporal query capabilities to the TONL query system.
- count() - Count array elements or query results
- sum(field) - Sum numeric values
- avg(field) - Calculate average
- min(field) / max(field) - Find minimum and maximum values
- groupBy(field) - Group results by field value
- distinct(field) - Get unique values
- stats(field) - Full statistics (count, sum, avg, min, max, variance, stdDev)
- median() / percentile(n) - Statistical analysis
- frequency(field) - Value frequency analysis
- filter() / map() / reduce() - Functional transforms
- orderBy(field, 'asc'|'desc') - Sorting
- take(n) / skip(n) / first() / last() - Selection
- ~= operator - Fuzzy equality matching
- ~contains / ~startsWith / ~endsWith - Fuzzy string operations
- soundsLike operator - Phonetic matching (Soundex/Metaphone)
- fuzzyMatch() / fuzzySearch() - Direct API functions
- Levenshtein distance - Edit distance calculation
- Jaro-Winkler similarity - Optimized for short strings
- Dice coefficient - Bigram-based similarity
- @now, @today, @yesterday, @tomorrow - Named date literals
- @now-7d, @now+1w, @now-3M - Relative time expressions
- @2025-01-15 - ISO 8601 date literals
- before / after / between - Date comparison operators
- daysAgo / weeksAgo / monthsAgo / yearsAgo - Relative checks
- sameDay / sameWeek / sameMonth / sameYear - Calendar period matching
// Aggregation
doc.count('users[*]'); // 42
doc.sum('orders[*]', 'total'); // 15420.50
doc.groupBy('users[*]', 'country'); // { TR: [...], US: [...] }
doc.aggregate('products[*]').stats('price');
// Fuzzy matching
doc.query("users[?(@.name ~= 'john')]");
doc.query("users[?(@.name soundsLike 'Robert')]");
// Temporal queries
doc.query("events[?(@.date > @now-7d)]");
doc.query("orders[?(@.created sameDay @today)]");- 763 total tests - All passing with 100% success rate
- 267 new tests for query extensions
- 34 integration tests for combined feature usage
- Performance tests - 10K items processed in <1 second
- New website documentation sections for all features
- Interactive code examples
- Complete API reference
n
Added support for the newest generation of AI language models in token estimation and CLI analytics.
- Claude Sonnet 4.5 - Latest Claude model with enhanced reasoning capabilities
- Gemini 2.5 Pro - Google's advanced multimodal model
- Gemini 3 Pro - State-of-the-art Gemini model with improved performance
- Full CLI Integration - Use new models in
tonl statscommand
- Updated tokenizer support for all latest models
- Accurate token counting for cost estimation
- Better compression ratio calculations
- Backward compatibility maintained for all existing models
# Use new models for token estimation
tonl stats data.json --tokenizer claude-sonnet-4.5
tonl stats data.json --tokenizer gemini-2.5-pro
tonl stats data.json --tokenizer gemini-3-pro
# Interactive mode with new models
tonl stats data.json --interactive --tokenizer gemini-3-pro
# All existing models continue to work
tonl stats data.json --tokenizer claude-3.5
tonl stats data.json --tokenizer gpt-5- Extended tokenizer type definitions in
src/utils/metrics.ts - Added mapping for new models to existing tokenizers
- Updated CLI argument parsing for new model options
- Enhanced documentation with latest model names
- 100% API Compatibility - All existing code works unchanged
- Zero Breaking Changes - Perfect backward compatibility maintained
- Extended Support - New models added without affecting existing functionality
- Performance Maintained - Token estimation speed preserved
Critical security fixes and high-performance optimizations making TONL enterprise-ready and production-safe.
- ReDoS Attack Prevention - Fixed catastrophic backtracking vulnerabilities in regex patterns
- Memory Exhaustion Protection - Added input size limits and validation
- Path Traversal Defense - Enhanced file system security with path validation
- Safe JSON Parsing - ReDoS-resistant JSON parsing with size limits
- Thread-Safe Operations - Security utilities safe for concurrent use
- Regex Cache System - Thread-safe pattern caching with 30-40% performance boost
- String Builder Utility - Memory-efficient string concatenation for large operations
- Pre-cached Common Patterns - Reduced regex compilation overhead
- Chunk-Based Processing - Optimized memory usage for string operations
- Cache Statistics - Performance monitoring and cache management
- 96 Security Tests - Complete security validation suite
- 73 Test Suites - %100 success rate maintained
- Integration Tests - Backward compatibility validation
- Performance Benchmarks - Verified optimizations with no regressions
- Memory Stability - No memory leaks detected in stress testing
import { SecurityValidator, InputValidator, SecurityUtils } from 'tonl/utils/security';
// Safe regex validation
const validator = new SecurityValidator();
validator.validatePattern(/^[a-zA-Z]+$/); // โ
Safe
validator.validatePattern(/(.+)+/); // โ ReDoS risk
// Input size validation
const inputValidator = new InputValidator();
inputValidator.validateSize(data, { maxSize: '10MB', maxDepth: 100 });
// Secure file operations
SecurityUtils.validatePath('safe/path.txt'); // โ
Valid
SecurityUtils.validatePath('../../../etc/passwd'); // โ Path traversalimport { RegexCache, StringBuilder } from 'tonl/utils';
// Thread-safe regex caching
const cache = new RegexCache();
const pattern = cache.getPattern(/email@[a-z]+\.[a-z]+/);
// High-performance string building
const builder = new StringBuilder();
builder.append('Hello').append(' ').appendLine('World!');
const result = builder.toString(); // Optimized concatenation- Enhanced Parser Security - Fixed ReDoS vulnerabilities in
content-parser.tsandblock-parser.ts - Memory Limits - Pre-validation with 1000 character limits for safety
- Conservative Regex - Safe pattern matching with length restrictions
- Error Context - Better error messages with security context
- Resource Cleanup - Enhanced memory management and cleanup
- Regex Compilation: 30-40% faster with caching
- String Operations: 2-3x faster for large concatenations
- Memory Usage: 15-20% reduction in peak memory
- Concurrent Operations: Thread-safe caching for multi-threaded environments
- Test Duration: Sub-millisecond for basic operations
- Zero Vulnerabilities - All critical ReDoS vulnerabilities resolved
- Production Ready - Enterprise-level security standards met
- Memory Safe - Protection against memory exhaustion attacks
- File System Secure - Path traversal attacks prevented
- Input Validated - Comprehensive input sanitization
- 100% API Compatibility - All existing code works unchanged
- Zero Breaking Changes - Perfect backward compatibility maintained
- Drop-in Replacement - Upgrade safely without code changes
- Performance Boost - Free performance improvements for existing users
- Security Enhancement - Automatic security upgrades for all users
# Automatic security protection (no changes needed)
tonl encode data.json --out secure.tonl
# Performance monitoring
tonl encode large-data.json --stats
# Output: Regex cache hits: 1,247, misses: 23
# Large file processing with optimized performance
tonl encode massive-dataset.json --out optimized.tonl
# 30-40% faster due to regex caching- Thread-Safe Caching - Safe for concurrent server environments
- Memory Management - Predictable memory usage patterns
- Security Audited - 96 security tests passing
- Performance Tested - Enterprise-level performance benchmarks
- Production Proven - Zero breaking changes in extensive testing
- Security Score: 7.8/10 โ 9.8/10 (+2.0 points)
- Performance: 30-40% faster regex operations
- Memory Efficiency: 15-20% reduction in peak usage
- Enterprise Ready: Production-grade security and performance
- Developer Experience: Faster builds and better debugging
- ๐ฎ Menu-Driven Interface - Real-time file analysis with visual feedback
- ๐ Live Progress Tracking - Animated progress bars and loading states
- ๐ Side-by-Side File Comparison - Compare JSON/TONL files with detailed metrics
- ๐จ Multiple Color Themes - default, neon, matrix, cyberpunk themes
- โก Interactive Tokenizer Switching - Switch between GPT-5, Claude-3.5, Gemini-2.0 in real-time
- ๐ Real-Time Compression Metrics - Live updates of byte/token savings
- ๐ Deep File Structure Analysis - Interactive exploration of file contents
- ๐
src/cli/commands/- Individual command modules for maintainability - ๐ง
src/cli/types.ts- Type-safe command interfaces and CLI options - โ๏ธ
src/cli/utils.ts- Shared utility functions for file operations - ๐
src/cli/arg-parser.ts- Centralized argument parsing with validation - ๐ฏ Command Registry & Dispatch - Modern command execution system
--interactive/-i- Flag for interactive mode activation--compare- File comparison mode for side-by-side analysis--theme- Visual customization with multiple color themes- Progress Visualization - Beautiful progress bars and animations
- Responsive Menu System - Keyboard navigation with intuitive controls
- Reduced from 735-line monolith to maintainable modular architecture
- Type Safety throughout the CLI system with proper interfaces
- Enhanced Error Handling with descriptive error messages
- Performance Optimizations for large file analysis
- 791+ Comprehensive Tests across 46 test suites
- Complete CLI Coverage including all interactive features
- Integration Tests for real CLI command execution
- 100% Success Rate with robust error handling validation
# Interactive stats dashboard
tonl stats data.json --interactive
tonl stats data.json -i --theme neon
# File comparison mode
tonl stats data.json --compare --theme matrix
# Quick stats with custom tokenizer
tonl stats large-file.json --tokenizer gpt-5
# Interactive help and exploration
tonl stats --interactive- ๐ Analyze File - Deep file structure analysis
- โ๏ธ Compare Files - Side-by-side comparison
- ๐จ Change Theme - Visual customization
- ๐ Change Tokenizer - Real-time tokenizer switching
- ๐ Detailed Stats - Comprehensive compression analysis
- โ Exit - Clean exit with resource cleanup
- User Experience: Revolutionary CLI interaction model
- Developer Experience: Maintainable modular architecture
- File Analysis: Advanced comparison and exploration capabilities
- Visual Design: Beautiful terminal UI with themes and animations
- Testing Excellence: 791+ tests with 100% success rate
For detailed historical changes, see git commit history