|
| 1 | +# Changelog |
| 2 | + |
| 3 | +All notable changes to this project will be documented in this file. |
| 4 | + |
| 5 | +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), |
| 6 | +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). |
| 7 | + |
| 8 | +## [2.7.0] - 2026-01-07 |
| 9 | + |
| 10 | +### Added |
| 11 | +- **GitRepositoryService.save()**: Introduced a polymorphic persistence method that automatically delegates to the appropriate low-level operation based on the entity type (Blob, Tree, or Commit). |
| 12 | +- **Commit Lifecycle Guide**: Created `docs/COMMIT_LIFECYCLE.md`, a step-by-step tutorial covering manual graph construction and persistence. |
| 13 | + |
| 14 | +### Changed |
| 15 | +- **Documentation Overhaul**: Updated `README.md` with enhanced security details and prominent links to the new lifecycle guide. |
| 16 | +- **Process Isolation**: Hardened shell runners with strict environment variable whitelisting and support for per-call overrides. |
| 17 | +- **Runtime Optimization**: Updated `ByteMeasurer` to use `Buffer.byteLength` where available and pinned Deno to 2.6.3 in development environments. |
| 18 | +- **Improved Validation**: Enhanced `GitRefSchema` to strictly follow Git's naming rules, including better handling of control characters and '@' symbol sequences. |
| 19 | + |
| 20 | +### Fixed |
| 21 | +- **Node.js Shell Stability**: Resolved a critical bug in `NodeShellRunner` where processes were killed immediately if no timeout was specified. |
| 22 | +- **Backoff Logic**: Fixed an off-by-one error in `ExecutionOrchestrator` that caused incorrect delay calculations during retries. |
| 23 | +- **Type Safety**: Added type validation to `CommandSanitizer` to prevent `TypeError` when receiving non-string arguments. |
| 24 | +- **Object Mapping**: Fixed a bug in `GitObjectType` where delta types were incorrectly mapped to strings instead of integers. |
| 25 | +- **CI/CD Reliability**: Fixed GitHub Actions workflow by adding missing Node.js setup and dependency installation steps to the multi-runtime test job. |
| 26 | +- **Persistence Accuracy**: Fixed incorrect tree entry type detection in `GitPersistenceService` that could cause tree corruption. |
| 27 | + |
| 28 | +## [2.5.0] - 2026-01-05 |
| 29 | + |
| 30 | +### Added |
| 31 | +- **GitCommandBuilder Fluent API**: Added static factory methods for all whitelisted Git commands (e.g., `.hashObject()`, `.catFile()`, `.writeTree()`) and fluent flag methods (e.g., `.stdin()`, `.write()`, `.pretty()`) for a more expressive command-building experience. |
| 32 | + |
| 33 | +### Changed |
| 34 | +- **GitPlumbing DI Support**: Updated the constructor to accept optional `sanitizer` and `orchestrator` instances, enabling full Dependency Injection for easier testing and customization of core logic. |
| 35 | + |
| 36 | +## [2.4.0] - 2026-01-03 |
| 37 | + |
| 38 | +### Added |
| 39 | +- **GitErrorClassifier**: Extracted error categorization logic from the orchestrator into a dedicated domain service. Uses regex and exit codes (e.g., 128) to identify lock contention and state issues. |
| 40 | +- **ProhibitedFlagError**: New specialized error thrown when restricted Git flags (like `--work-tree`) are detected, providing remediation guidance and documentation links. |
| 41 | +- **Dynamic Command Registration**: Added `CommandSanitizer.allow(commandName)` to permit runtime extension of the allowed plumbing command list. |
| 42 | + |
| 43 | +### Changed |
| 44 | +- **Dependency Injection (DI)**: Refactored `CommandSanitizer` and `ExecutionOrchestrator` into injectable class instances, improving testability and modularity of the `GitPlumbing` core. |
| 45 | +- **Sanitizer Memoization**: Implemented an internal LRU-ish cache in `CommandSanitizer` to skip re-validation of identical repetitive commands, improving performance for high-frequency operations. |
| 46 | +- **Enhanced Deno Shim**: Updated the test shim to include `beforeEach`, `afterEach`, and other lifecycle hooks for full parity with Vitest. |
| 47 | + |
| 48 | +## [2.3.0] - 2026-01-01 |
| 49 | + |
| 50 | +### Changed |
| 51 | +- **Validation Unification**: Completed the migration from `ajv` to `zod` for the entire library, reducing bundle size and unifying the type-safety engine. |
| 52 | +- **Security Hardening**: Expanded the `EnvironmentPolicy` whitelist to include `GIT_AUTHOR_TZ`, `GIT_COMMITTER_TZ`, and localization variables (`LANG`, `LC_ALL`, etc.) to ensure identity and encoding consistency. |
| 53 | +- **Universal Testing**: Updated the multi-runtime test suite to ensure 100% test parity across Node.js, Bun, and Deno, specifically adding missing builder and environment tests. |
| 54 | + |
| 55 | +### Added |
| 56 | +- **EnvironmentPolicy**: Extracted environment variable whitelisting into a dedicated domain service used by all shell runners. |
| 57 | + |
| 58 | +## [2.2.0] - 2025-12-28 |
| 59 | + |
| 60 | +### Added |
| 61 | +- **ExecutionOrchestrator**: Extracted command execution lifecycle (retry, backoff, lock detection) into a dedicated domain service to improve SRP compliance. |
| 62 | +- **Binary Stream Support**: Refactored `GitStream.collect()` to support raw `Uint8Array` accumulation, preventing corruption of non-UTF8 binary data (e.g., blobs, compressed trees). |
| 63 | +- **GitRepositoryLockedError**: Introduced a specialized error for repository lock contention with remediation guidance. |
| 64 | +- **CommandRetryPolicy**: Added a new value object to encapsulate configurable retry strategies and backoff logic. |
| 65 | +- **Custom Runner Registration**: Added `ShellRunnerFactory.register()` to allow developers to inject custom shell execution logic (e.g., SSH, WASM). |
| 66 | +- **Environment Overrides**: `GitPlumbing.createDefault()` and `ShellRunnerFactory.create()` now support explicit environment overrides. |
| 67 | +- **Repository Factory**: Added `GitPlumbing.createRepository()` for single-line high-level service instantiation. |
| 68 | +- **Workflow Recipes**: Created `docs/RECIPES.md` providing step-by-step guides for low-level Git workflows (e.g., 'Commit from Scratch'). |
| 69 | + |
| 70 | +### Changed |
| 71 | +- **Memory Optimization**: Enhanced `GitStream.collect()` to use chunk-based accumulation with `Uint8Array.set()`, reducing redundant string allocations during collection. |
| 72 | +- **Runtime Performance**: Optimized `ByteMeasurer` to use `Buffer.byteLength()` in Node.js and Bun, significantly improving performance for large string measurements. |
| 73 | +- **Development Tooling**: Upgraded `vitest` to version 3.0.0 for improved testing capabilities and performance. |
| 74 | + |
| 75 | +## [2.1.0] - 2025-12-20 |
| 76 | + |
| 77 | +### Added |
| 78 | +- **GitRepositoryService**: Extracted high-level repository operations (`revParse`, `updateRef`, `deleteRef`) into a dedicated domain service. |
| 79 | +- **Resilience Layer**: Implemented exponential backoff retry logic for Git lock contention (`index.lock`) in `GitPlumbing.execute`. |
| 80 | +- **Telemetric Trace IDs**: Added automatic and manual `traceId` correlation across command execution for production traceability. |
| 81 | +- **Performance Monitoring**: Integrated latency tracking for all Git command executions. |
| 82 | +- **Secure Runtime Adapters**: Implemented "Clean Environment" isolation in Node, Bun, and Deno runners, preventing sensitive env var leakage. |
| 83 | +- **Resource Lifecycle Management**: Enhanced `GitStream` with `FinalizationRegistry` and `destroy()` for deterministic cleanup of shell processes. |
| 84 | + |
| 85 | +### Changed |
| 86 | +- **Entity Unification**: Refactored `GitTreeEntry` to use object-based constructors, standardizing the entire domain entity API. |
| 87 | +- **Hardened Sanitizer**: Strengthened `CommandSanitizer` to block configuration overrides (`-c`, `--config`) globally and expanded the plumbing command whitelist. |
| 88 | +- **Enhanced Verification**: `GitPlumbing.verifyInstallation` now validates both the Git binary and the repository integrity of the current working directory. |
| 89 | + |
| 90 | +### Fixed |
| 91 | +- **Deno Resource Leaks**: Resolved process leaks in Deno by ensuring proper stream consumption across all test cases. |
| 92 | +- **Node.js Stream Performance**: Optimized async iteration in `GitStream` using native protocols. |
| 93 | + |
| 94 | +## [2.0.0] - 2025-12-10 |
| 95 | + |
| 96 | +### Added |
| 97 | +- Initial release of the plumbing library. |
0 commit comments