Skip to content

Commit 05ed82f

Browse files
Update documentation for v1.1.0 release: enhance README, RELEASE_NOTES, architecture, and copilot instructions; include new features like solid compression, recovery records, and multi-threading.
1 parent 1e32059 commit 05ed82f

File tree

11 files changed

+184
-1137
lines changed

11 files changed

+184
-1137
lines changed

.github/copilot-instructions.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
TechCompressor is a **production-ready (v1.1.0)** modular Python compression framework with three algorithms (LZW, Huffman, DEFLATE), AES-256-GCM encryption, TCAF v2 archive format with recovery records, CLI, and GUI. Development is complete with 152 passing tests (2 skipped).
66

7+
**Target**: Python 3.10+ | **Status**: Production/Stable | **License**: MIT
8+
79
## New in v1.1.0
810
- **Dictionary Persistence**: Solid compression mode now preserves LZW dictionaries between files for 10-30% better ratios
911
- **Recovery Records**: PAR2-style Reed-Solomon error correction for archive repair (configurable 0-10% redundancy)
@@ -121,10 +123,21 @@ Standalone performance testing script with multiple data types:
121123
- **Output format**: Pretty-printed tables with size/time comparisons
122124
- Run directly: `python bench.py` (no CLI integration needed)
123125

126+
### Recovery Module (`techcompressor/recovery.py`) - v1.1.0
127+
PAR2-style error correction for archive repair:
128+
- **Reed-Solomon Implementation**: `ReedSolomonSimple` class with XOR-based parity
129+
- **Block-based Recovery**: 64KB blocks with configurable parity (0-10% redundancy)
130+
- **Archive Integration**: Recovery footer appended to TCAF v2 archives (TCRR marker)
131+
- **Functions**: `generate_recovery_records()`, `apply_recovery()`, `verify_recovery()`
132+
- **Critical**: Can recover from single-block corruption; multi-block requires more parity
133+
124134
### GUI (`techcompressor/gui.py`)
125135
Tkinter multi-tab interface with **background threading** (lines 23-32):
126136
- Uses `ThreadPoolExecutor` + `queue.Queue` for non-blocking operations
127137
- Progress polling via `_poll_progress()` method (updates UI without freezing)
138+
- **Thread-safety rule**: ALL widget updates MUST use `.after(0, callback)` - never modify widgets from worker threads
139+
- Progress callbacks: GUI expects `(percent: float, message: str)` format, archiver provides `(current: int, total: int)` - GUI adapts these
140+
- Keyboard shortcuts: Ctrl+Shift+C (compress), Ctrl+Shift+E (extract)
128141
## TechCompressor — AI contributor quick guide
129142

130143
This repository is a production Python compression tool (LZW, Huffman, DEFLATE) with
@@ -164,6 +177,52 @@ When changing behavior, follow this checklist:
164177
4. If adding new archive format or magic bytes, register a unique 4-byte header and add tests.
165178
5. Update `techcompressor/__init__.py` and `pyproject.toml` together when bumping versions.
166179

180+
## ⚠️ CRITICAL: Release Documentation Checklist
181+
182+
**BEFORE suggesting a release or running build_release.ps1, ALWAYS update these files:**
183+
184+
1. **README.md**:
185+
- Version badge (line 3): `[![Version](https://img.shields.io/badge/version-X.X.X-blue.svg)]`
186+
- Test count badge (line 6): `[![Tests](https://img.shields.io/badge/tests-XXX%20passed-brightgreen.svg)]`
187+
- Feature descriptions (add new v1.X.X features under "✨ Features")
188+
- Python API examples (update function signatures with new parameters)
189+
- Comparison table (update with new features vs competitors)
190+
191+
2. **RELEASE_NOTES.md**:
192+
- Update version in title: `# TechCompressor vX.X.X Release Notes`
193+
- Update release date: `**Release Date**: Month DD, YYYY`
194+
- Add "What's New in vX.X.X" section with all new features
195+
- Update "Migration from vX.Y.Z to vX.X.X" section
196+
- Update "Recommended Usage" section with new parameters/features
197+
- Update code examples with new function signatures
198+
199+
3. **CHANGELOG.md**:
200+
- Add new version section at top with release date
201+
- List all Added/Changed/Fixed items in detail
202+
- Include performance metrics if applicable
203+
- Reference related issue numbers if available
204+
205+
4. **pyproject.toml**:
206+
- Update `version = "X.X.X"` (line 7)
207+
208+
5. **techcompressor/__init__.py**:
209+
- Update `__version__ = "X.X.X"`
210+
- Update `__all__` exports if new public functions added
211+
212+
6. **tests/test_release_smoke.py**:
213+
- Update version assertion: `assert techcompressor.__version__ == "X.X.X"`
214+
215+
7. **.github/copilot-instructions.md** (this file):
216+
- Update "Project Overview" version number
217+
- Update "New in vX.X.X" section
218+
- Update API signatures in examples
219+
220+
**DO NOT:**
221+
- Suggest building or releasing without updating ALL documentation first
222+
- Tell user "ready for release" until all markdown files are updated
223+
- Skip updating comparison tables or feature lists
224+
- Forget to update test count badges after adding new tests
225+
167226
Files to inspect first for most tasks: `techcompressor/core.py`, `archiver.py`, `crypto.py`,
168227
`cli.py`, `gui.py`, `utils.py`, `bench.py`, `build_release.ps1`, and `tests/`.
169228

README.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# TechCompressor
22

3-
[![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)](https://github.com/DevaanshPathak/TechCompressor)
3+
[![Version](https://img.shields.io/badge/version-1.1.0-blue.svg)](https://github.com/DevaanshPathak/TechCompressor)
44
[![Python](https://img.shields.io/badge/python-3.10+-green.svg)](https://www.python.org/downloads/)
55
[![License](https://img.shields.io/badge/license-MIT-orange.svg)](LICENSE)
6-
[![Tests](https://img.shields.io/badge/tests-137%20passed-brightgreen.svg)](#testing)
6+
[![Tests](https://img.shields.io/badge/tests-152%20passed-brightgreen.svg)](#testing)
77

8-
**TechCompressor** is a production-ready, modular Python compression framework featuring multiple algorithms, military-grade encryption, and both CLI and GUI interfaces. Built for performance, security, and ease of use.
8+
**TechCompressor** is a production-ready, modular Python compression framework featuring multiple algorithms, military-grade encryption, solid compression with dictionary persistence, PAR2-style recovery records, and both CLI and GUI interfaces. Built for performance, security, and RAR-competitive features.
99

1010
---
1111

@@ -15,6 +15,13 @@
1515
- **LZW (Lempel-Ziv-Welch)**: Fast dictionary-based compression, ideal for repetitive data
1616
- **Huffman Coding**: Optimal for data with non-uniform frequency distributions
1717
- **DEFLATE**: Industry-standard hybrid (LZ77 + Huffman), best overall compression
18+
- **STORED**: Automatic detection and direct storage of incompressible files
19+
20+
### 🔗 Advanced Archive Features (v1.1.0)
21+
- **Solid Compression**: Dictionary persistence across files for 10-30% better ratios
22+
- **Recovery Records**: PAR2-style Reed-Solomon error correction (0-10% redundancy)
23+
- **Multi-threaded**: Parallel per-file compression for 2-4x faster archives
24+
- **Smart AUTO mode**: Entropy detection and algorithm selection heuristics
1825

1926
### 🔒 Military-Grade Encryption
2027
- **AES-256-GCM**: Authenticated encryption with integrity verification
@@ -23,11 +30,12 @@
2330
- No backdoors or recovery mechanisms
2431

2532
### 📦 Archive Management
26-
- **TCAF Format**: Custom TechCompressor Archive Format
33+
- **TCAF v2 Format**: Custom TechCompressor Archive Format with backward compatibility
2734
- Compress entire folders with metadata preservation
2835
- Supports both per-file and single-stream compression
2936
- Path traversal protection and security validation
3037
- Preserves timestamps, permissions, and relative paths
38+
- Recovery records for archive repair and corruption detection
3139

3240
### 💻 Dual Interface
3341
- **CLI**: Full-featured command-line with benchmarking and verification
@@ -101,7 +109,10 @@ create_archive(
101109
archive_path="backup.tc",
102110
algo="DEFLATE",
103111
password="secret",
104-
per_file=False # Single-stream for best compression
112+
per_file=False, # Single-stream for best compression
113+
persist_dict=True, # NEW v1.1.0: Solid compression
114+
recovery_percent=5.0, # NEW v1.1.0: 5% recovery records
115+
max_workers=4 # NEW v1.1.0: Parallel compression
105116
)
106117

107118
# Extract archive
@@ -131,12 +142,15 @@ How does TechCompressor compare to ZIP, RAR, and 7-Zip? Here's a comprehensive b
131142
| **Compression Algorithms** | LZW, Huffman, DEFLATE | DEFLATE | RAR (proprietary) | LZMA, LZMA2, DEFLATE |
132143
| **Best Compression Ratio** | ★★★★☆ (99%+ on repetitive) | ★★★☆☆ | ★★★★★ (industry best) | ★★★★★ |
133144
| **Compression Speed** | ★★★★☆ (3-6 MB/s) | ★★★★☆ | ★★☆☆☆ (slow) | ★★★☆☆ |
145+
| **Solid Compression** | ✅ v1.1.0 (10-30% better) ||||
146+
| **Recovery Records** | ✅ v1.1.0 (PAR2-style) ||||
147+
| **Multi-threading** | ✅ v1.1.0 (per-file) | ⚠️ Limited |||
134148
| **Encryption** | AES-256-GCM (100K iterations) | AES-256 (ZipCrypto weak) | AES-256 | AES-256 |
135149
| **Smart Storage Mode** | ✅ Auto-detects incompressible | ❌ Always compresses |||
136150
| **Archive Metadata** | Timestamps, permissions | Timestamps | Full metadata | Full metadata |
137151
| **Python API** | ✅ Native | ⚠️ Via zipfile || ⚠️ Via py7zr |
138152
| **GUI Included** | ✅ Cross-platform | ❌ OS-dependent | ✅ Commercial ||
139-
| **Format Compatibility** | TCAF (custom) | Universal | Universal | Universal |
153+
| **Format Compatibility** | TCAF v2 (custom) | Universal | Universal | Universal |
140154
| **Multi-algorithm Choice** | ✅ 3 algorithms + AUTO | ❌ DEFLATE only | ❌ RAR only | ✅ Multiple |
141155
| **Use Case** | Development, scripting, automation | General purpose | Maximum compression | Open-source alternative |
142156

RELEASE_NOTES.md

Lines changed: 70 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# TechCompressor v1.0.0 Release Notes
1+
# TechCompressor v1.1.0 Release Notes
22

3-
**Release Date**: October 25, 2025
3+
**Release Date**: October 27, 2025
44
**Status**: Production/Stable
55

66
## Overview
77

8-
TechCompressor v1.0.0 is a production-ready, modular Python compression framework that brings together three powerful compression algorithms, military-grade encryption, and intuitive interfaces—all in a single package. Whether you're compressing large datasets, securing sensitive archives, or building compression into your applications, TechCompressor provides the tools you need with a clean, well-tested API.
8+
TechCompressor v1.1.0 brings RAR-competitive features to the production framework: solid compression with dictionary persistence for 10-30% better compression ratios, PAR2-style recovery records for archive repair, and multi-threaded compression support. This release maintains the robust foundation of three compression algorithms, military-grade encryption, and intuitive interfaces while adding advanced archive features that rival commercial tools.
99

1010
## Highlights
1111

@@ -28,15 +28,39 @@ The custom **TCAF** (TechCompressor Archive Format) supports both per-file and s
2828
### ⚡ Production-Ready
2929
All 137 tests pass. Comprehensive test coverage includes algorithm correctness, encryption validation, archive security, integration workflows, and performance regression checks. The codebase uses modern Python 3.10+ features with full type hints and extensive documentation.
3030

31-
## What's New in v1.0.0
31+
## What's New in v1.1.0
3232

33-
This is the initial production release, consolidating the project's development history:
34-
- ✅ Complete algorithm implementations (LZW, Huffman, DEFLATE)
35-
- ✅ Full encryption and security features
36-
- ✅ Archive format with metadata preservation
37-
- ✅ CLI and GUI interfaces with progress tracking
38-
- ✅ Comprehensive testing and benchmarking
39-
- ✅ Documentation and developer guides
33+
### 🔗 Solid Compression Mode (Dictionary Persistence)
34+
Archive creation now supports persistent LZW dictionaries across multiple files, achieving **10-30% better compression ratios** on archives with similar content:
35+
- Global dictionary state maintained between files with `persist_dict=True`
36+
- `reset_solid_compression_state()` function to clear state between archives
37+
- Automatic dictionary resets prevent memory overflow
38+
- Ideal for source code repositories, log archives, and document collections
39+
40+
### 🛡️ Recovery Records (PAR2-Style Error Correction)
41+
Archives can now include **Reed-Solomon parity blocks** for automatic corruption repair:
42+
- Configurable redundancy: 0-10% of archive size
43+
- XOR-based block encoding with 64KB block size
44+
- `generate_recovery_records()` and `apply_recovery()` functions in new `recovery.py` module
45+
- Recovery footer with `RCVR` marker for backward compatibility
46+
- Repairs bit rot, transmission errors, and partial media failures
47+
48+
### ⚡ Multi-Threaded Compression
49+
Parallel per-file compression support via `ThreadPoolExecutor`:
50+
- `max_workers` parameter in `create_archive()` function
51+
- 2-4x faster compression on multi-core systems
52+
- Automatic worker count based on CPU cores when `max_workers=None`
53+
- Thread-safe progress tracking and error handling
54+
55+
### 📊 API Enhancements
56+
- **STORED mode** (algorithm ID 0): Direct storage for incompressible files (no expansion)
57+
- Enhanced AUTO mode: Smart heuristics skip slow algorithms on large files
58+
- Entropy detection: Automatically detects already-compressed data
59+
- Updated function signatures maintain backward compatibility
60+
61+
## Breaking Changes
62+
63+
**None** - v1.1.0 is fully backward compatible with v1.0.0. Existing archives decompress correctly, and all v1.0.0 API calls work unchanged.
4064

4165
## Getting Started
4266

@@ -47,8 +71,8 @@ pip install -r requirements.txt
4771
# Quick compress
4872
techcompressor compress input.txt output.tc --algo DEFLATE
4973

50-
# Create encrypted archive
51-
techcompressor create my_folder/ backup.tc --algo DEFLATE --password mypassword
74+
# Create encrypted archive with recovery records
75+
techcompressor create my_folder/ backup.tc --algo DEFLATE --password mypassword --recovery-percent 5
5276

5377
# Extract archive
5478
techcompressor extract backup.tc restored/ --password mypassword
@@ -57,9 +81,30 @@ techcompressor extract backup.tc restored/ --password mypassword
5781
techcompressor-gui
5882
```
5983

60-
## Migration Notes
84+
## Migration from v1.0.0 to v1.1.0
85+
86+
**API Changes**: None required - all v1.0.0 code works unchanged.
87+
88+
**New Features** (optional adoption):
89+
```python
90+
from techcompressor import compress, reset_solid_compression_state
91+
from techcompressor.archiver import create_archive
92+
from techcompressor.recovery import generate_recovery_records
93+
94+
# Use solid compression for better ratios
95+
create_archive("source/", "output.tc", persist_dict=True)
96+
97+
# Add recovery records (5% redundancy)
98+
create_archive("source/", "output.tc", recovery_percent=5.0)
99+
100+
# Parallel compression
101+
create_archive("source/", "output.tc", max_workers=4)
102+
103+
# Reset state between archives
104+
reset_solid_compression_state()
105+
```
61106

62-
**Not applicable** - this is the initial release. Future versions will maintain backward compatibility with the v1.0.0 API and archive format.
107+
**Archive Format**: TCAF v2 is backward compatible with v1 archives. Old archives decompress correctly. New features (STORED mode, recovery records) are only used in newly created archives.
63108

64109
## Known Issues
65110

@@ -76,13 +121,19 @@ techcompressor-gui
76121
**Algorithm Selection**:
77122
- **General purpose**: DEFLATE (best overall compression)
78123
- **Speed-critical**: LZW (fastest, lowest memory)
79-
- **Text/source code**: DEFLATE with single-stream mode
124+
- **Text/source code**: DEFLATE with single-stream mode + solid compression
80125
- **Mixed content**: LZW with per-file mode
81-
- **Media files**: Skip re-compression (already compressed formats)
126+
- **Media files**: STORED mode automatically used for incompressible data
82127

83128
**Archive Modes**:
84-
- **Per-file mode**: Better for random access, selective extraction, and mixed content types
85-
- **Single-stream mode**: Better compression ratio for similar files (e.g., source code)
129+
- **Per-file mode** (`per_file=True`): Better for random access, selective extraction, mixed content
130+
- **Single-stream mode** (`per_file=False`): Better compression ratio for similar files
131+
- **Solid compression** (`persist_dict=True`): 10-30% better ratios, use with per_file=True
132+
133+
**Recovery Records**:
134+
- Use 2-5% redundancy for normal archives
135+
- Use 5-10% for critical backups or unreliable media
136+
- Recovery records add minimal overhead but enable corruption repair
86137

87138
**Security**:
88139
- Use strong passwords (12+ characters, mixed case, numbers, symbols)

build_release.ps1

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ Write-Host ""
3737
Write-Host "[2/6] Cleaning previous builds..." -ForegroundColor Yellow
3838
if (Test-Path "build") { Remove-Item -Recurse -Force "build" }
3939
if (Test-Path "dist") { Remove-Item -Recurse -Force "dist" }
40-
if (Test-Path "release") { Remove-Item -Recurse -Force "release" }
4140
Write-Host "✓ Cleaned" -ForegroundColor Green
4241

4342
# Run tests
@@ -77,19 +76,22 @@ if (Test-Path $exePath) {
7776
exit 1
7877
}
7978

80-
# Create release package
79+
# Create release ZIP package
8180
Write-Host ""
82-
Write-Host "[6/6] Creating release package..." -ForegroundColor Yellow
83-
New-Item -ItemType Directory -Force -Path "release" | Out-Null
81+
Write-Host "[6/6] Creating release ZIP..." -ForegroundColor Yellow
82+
83+
# Create temporary staging directory
84+
$tempDir = "dist\temp_release"
85+
New-Item -ItemType Directory -Force -Path $tempDir | Out-Null
8486

8587
# Copy executable
86-
Copy-Item $exePath "release\"
88+
Copy-Item $exePath "$tempDir\"
8789

8890
# Copy documentation
89-
Copy-Item "README.md" "release\"
90-
Copy-Item "LICENSE" "release\"
91-
Copy-Item "CHANGELOG.md" "release\"
92-
Copy-Item "SECURITY.md" "release\"
91+
Copy-Item "README.md" "$tempDir\"
92+
Copy-Item "LICENSE" "$tempDir\"
93+
Copy-Item "CHANGELOG.md" "$tempDir\"
94+
Copy-Item "SECURITY.md" "$tempDir\"
9395

9496
# Create release README
9597
$releaseReadme = @"
@@ -136,16 +138,16 @@ MIT License - Free for personal and commercial use
136138
Copyright (c) 2025 Devaansh Pathak
137139
"@
138140

139-
$releaseReadme | Out-File -FilePath "release\README_RELEASE.txt" -Encoding UTF8
140-
141-
Write-Host "✓ Release package created in: release\" -ForegroundColor Green
141+
$releaseReadme | Out-File -FilePath "$tempDir\README_RELEASE.txt" -Encoding UTF8
142142

143143
# Create ZIP for distribution
144-
Write-Host ""
145-
Write-Host "Creating ZIP archive for GitHub release..." -ForegroundColor Yellow
146144
$zipName = "TechCompressor-v$VERSION-Windows-x64.zip"
147145
$zipPath = "dist\$zipName"
148-
Compress-Archive -Path "release\*" -DestinationPath $zipPath -Force
146+
Compress-Archive -Path "$tempDir\*" -DestinationPath $zipPath -Force
147+
148+
# Clean up temp directory
149+
Remove-Item -Recurse -Force $tempDir
150+
149151
if (Test-Path $zipPath) {
150152
$zipSize = (Get-Item $zipPath).Length / 1MB
151153
Write-Host "✓ Release ZIP created: $zipPath ($($zipSize.ToString('F2')) MB)" -ForegroundColor Green
@@ -162,8 +164,7 @@ Write-Host "================================" -ForegroundColor Cyan
162164
Write-Host ""
163165
Write-Host "Release files:" -ForegroundColor White
164166
Write-Host " • Standalone EXE: dist\TechCompressor.exe" -ForegroundColor White
165-
Write-Host " • Release package: release\" -ForegroundColor White
166-
Write-Host " • GitHub release: $zipPath" -ForegroundColor White
167+
Write-Host " • GitHub release ZIP: $zipPath" -ForegroundColor White
167168
Write-Host ""
168169
Write-Host "Next steps:" -ForegroundColor Yellow
169170
Write-Host " 1. Test the executable: dist\TechCompressor.exe" -ForegroundColor White

0 commit comments

Comments
 (0)