refactor: harden daemon architecture and improve standards compliance #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR transitions
git-pulsarfrom a prototype script to a robust system service. It standardizes file locations, type-checks configuration, and implements atomic file operations to prevent data corruption during power loss or concurrent access.Key Changes
1. 📂 XDG Base Directory Compliance
~and into~/.local/state/git-pulsar/(or$XDG_STATE_HOME).src/constants.py,src/service.py.2. 🛡️ Typed Configuration
CONFIGwithdataclasses(CoreConfig,LimitsConfig, etc.).KeyErrorrisks at runtime and provides structural validation on load.src/daemon.py.3. 📜 Standard Logging Implementation
log()function and file rotation logic.loggingmodule with:RotatingFileHandlerfor atomic log rotation.stdoutfor interactive mode,stderrfor systemd/launchd capture.src/daemon.py.4. ⚛️ Atomic Registry Operations
prune_registry.src/daemon.py.5. 🧪 Test Suite Updates
test_daemon.pyto mock the newCONFIGobject, isolating tests from the host machine's configuration.test_properties.pyrelated to newline handling in registry files.Verification
uv run pytest).