# Changelog

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

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.5.1] - 2026-01-27

### Fixed
- **Critical**: Added `__main__.py` for proper `python -m cleave` execution
- **Critical**: Fixed 6 test failures in report module due to parameter mismatch in `_generate_calibration_insight()`
  - Tests now use `systems_count` (int) instead of `systems_detected` (list)
  - Tests mock settings to use workspace naming mode for backwards compatibility
- CLI `config set` command now supports `backend` parameter with validation
- Test suite now passes cleanly (310/310 tests)

### Added
- Backend selection via `cleave config set backend <backend>` with validation
  - Valid backends: `claude`, `ollama`, `openai`, `vllm`, `llamacpp`

### Documentation
- Comprehensive CHANGELOG entry for v0.5.0 documenting all features and limitations
- TUI installation instructions in README with keyboard shortcuts
- Backend configuration guide in README
- Settings management examples

### Changed
- CLI validation now includes backend selection

This patch release addresses critical issues identified in the adversarial review of v0.5.0, ensuring the package works correctly after installation.

## [0.5.0] - 2026-01-27

### Added
- **Interactive Terminal UI** - Full TUI implementation with retro CRT purple theme
  - Textual-based terminal interface for task decomposition
  - Claude Agent SDK integration with live streaming
  - Multi-line chat input with history navigation (Up/Down arrows)
  - Session management with persistent history
  - CALF file support for directive management
  - Tool use display with syntax highlighting
  - Session export to markdown
  - Keyboard shortcuts: Ctrl+L (clear), Escape (cancel), Shift+Enter (newline)
- **Intelligent Assessment Infrastructure**
  - `probe` module: Socratic interrogation with codebase-aware questions
  - `metrics` module: Feedback loop for tracking assessment accuracy
  - `report` module: Session reports with calibration insights (`.cloven.md`)
  - `settings` module: Configuration management via `~/.cleave/settings.yaml`
  - `file_utils` module: Atomic file write operations
- **Backend Abstraction Layer** (preparation for multi-model support)
  - Abstract `Backend` interface for LLM providers
  - `ClaudeBackend` implementation wrapping Claude Agent SDK
  - `OpenAICompatBackend` for Ollama, vLLM, llama.cpp, OpenAI
  - Backend configuration in settings with per-backend options
- **New CLI Commands**
  - `cleave tui [directory]` - Launch interactive TUI
  - `cleave probe --directive "..."` - Pre-decomposition codebase interrogation
  - `cleave metrics --workspace .` - View assessment accuracy and calibration
  - `cleave config show|set|path` - Manage settings
- **Enhanced Core Modules**
  - Assessment: Added `probe_questions` to all 7 patterns for context-aware interrogation
  - Reunify: Auto-extract effort metrics from task results, generate `.cloven.md` reports
  - Conflicts: Enhanced 4-step conflict detection with file overlap analysis
  - Workspace: Simplified task file generation
  - Permissions: Enhanced permission inference
- **Optional Dependencies** for flexible installation
  - `[tui]` - TUI with Claude backend (Textual + Claude SDK)
  - `[claude]` - Claude SDK only
  - `[local]` - Local inference via OpenAI-compatible APIs
  - `[tui-local]` - TUI with local inference only (no Claude SDK)
  - `[full]` - All features
- **Comprehensive Test Suite** - 48 test files covering all modules
- **Visual Theme** - Retro CRT aesthetic with purple accents (#a855f7), heavy borders, ASCII art

### Changed
- Version bumped to 0.5.0 reflecting major feature additions
- Report naming now configurable via settings (`descriptor`, `timestamp`, or `workspace`)
- Backend selection prepared for multi-model support (Claude, Ollama, vLLM, llama.cpp)

### Fixed
- History property conflict in TextArea (renamed to `input_history`)

### Installation
```bash
pip install styrene-cleave[tui]      # TUI with Claude backend
pip install styrene-cleave[full]     # All features
pip install styrene-cleave           # Core only (no TUI)
```

### Limitations
- TUI requires optional dependencies (`textual>=0.47.0`)
- Backend authentication only checks credential file existence, not validity
- No integration tests for TUI end-to-end functionality
- Multi-model backend support prepared but not fully tested with local models

### Documentation
- Added comprehensive PR documentation (#1)
- TUI keyboard shortcuts and usage documented in release notes

## [0.3.0] - 2026-01-26

### Added
- **Windows 11 cross-platform compatibility** - Full support for Windows 11 operations
- **Version tracking for directory copies** - Automatic detection and update of stale installations
- **Long path validation** - Pre-validation for Windows MAX_PATH (260 char) limit with helpful errors
- **Symlink fallback mechanism** - Graceful fallback to directory copy when symlink privileges unavailable
- **Partial copy cleanup** - Automatic cleanup of failed partial directory copies
- **MCP dependency checking** - Programmatic validation for Sequential Thinking MCP server requirement
- Comprehensive Windows compatibility test suite (12 new tests)
- `WINDOWS_COMPAT.md` documentation for cross-platform considerations

### Fixed
- **Critical**: Path separator bug causing "Path escapes home directory" error on Windows
- **Critical**: Stale directory copies not updating after package upgrades
- **Critical**: Partial file remnants after failed copy operations
- **High**: Missing validation for Windows long path support
- Cross-platform path comparison now uses `Path.is_relative_to()` instead of string concatenation

### Changed
- `InstallResult` dataclass now includes `used_copy` field to track installation method
- `install_skill()` function now validates path length before attempting installation
- Directory copy installations now include `.version` file for upgrade tracking

### Security
- Enhanced path traversal protection with cross-platform path resolution

## [0.2.0] - 2026-01-25

### Added
- Initial public release
- `cleave install-skill` command for skill installation
- Automatic skill discovery via symlink to `~/.claude/skills/`
- Support for editable installs and various package managers (pip, pipx, poetry)

## [0.1.0] - 2026-01-24

### Added
- Initial development release
- Core task decomposition functionality
- Complexity assessment with fast-path pattern matching
- Workspace initialization and management
- Reunification with conflict detection
- Adaptive interrogation system
- Permission inference for fire-and-forget execution
- TDD workflow support

[0.5.1]: https://github.com/styrene-lab/cleave/compare/v0.5.0...v0.5.1
[0.5.0]: https://github.com/styrene-lab/cleave/compare/v0.3.0...v0.5.0
[0.3.0]: https://github.com/styrene-lab/cleave/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/styrene-lab/cleave/compare/v0.1.0...v0.2.0
[0.1.0]: https://github.com/styrene-lab/cleave/releases/tag/v0.1.0
