Keep Starting Gear v2.0.4 - Healthcare-Grade Testing Infrastructure
The cure for gear fear. This release implements formal invariant documentation and comprehensive unit testing for the restoration algorithm, enabling provable correctness of the core business logic.
What’s New
Pure Algorithm Extraction
The restoration algorithm has been extracted into a pure, dependency-free implementation that can be unit tested
without SPT/BepInEx. This enables healthcare-grade verification of the core logic.
Comprehensive Unit Tests (31 new tests)
41 total tests passing (31 new + 10 existing serialization tests)
Formal Invariant Documentation (ADR-003)
Five inviolable invariants are now formally documented:
- Equipment container is NEVER removed
- SecuredContainer slot is ALWAYS preserved
- Parent chain traversal terminates within 50 iterations
- null vs empty IncludedSlotIds distinction is preserved
- All Equipment container IDs are checked
Defensive Assertions
Debug.Assert statements added throughout critical paths to catch invariant violations during development.
Previous Fixes (v2.0.1-2.0.3)
This release builds on recent critical fixes:
- Issue #18: Fixed all looted items being kept after death
- Issue #17: Fixed unprotected weapon slots preserving items
- Forge report: Fixed secure container disappearing after multiple deaths
- LINUS-001: Fixed Lazy initialization race condition
- LINUS-002: Implemented atomic file writes
- LINUS-003: Added ThreadLocal assumption validation
- LINUS-004: Fixed exception swallowing
- LINUS-005: Documented volatile usage policy
Installation
Extract directly into your SPT root folder (where SPT.Server.exe is located).
Compatibility
- SPT 4.0.x (tested on 4.0.11)
- SVM: Compatible (disable Softcore Mode & Safe Exit)
- FIKA: Not compatible
Full Changelog
See https://github.com/Blackhorse311/KeepStartingGear/blob/main/CHANGELOG.md for complete version history.