Commit Graph

5 Commits

Author SHA1 Message Date
rcourtman
dd6107406f fix: Add execute permissions to shell scripts 2025-12-13 15:44:51 +00:00
rcourtman
5c2379b4b4 fix(sensor-proxy): eliminate race in migration script
Stop pulse-sensor-proxy service before modifying config.yaml to prevent
races with the running daemon or concurrent CLI commands.

The migration script now:
1. Stops service if running
2. Updates config atomically (temp + rename in same directory)
3. Restarts service if it was running

This achieves complete architectural isolation - ALL config file writers
are now coordinated (either through Phase 2 CLI locking or by ensuring
the service is stopped during modification).

Addresses final Codex review feedback.
2025-11-19 11:04:58 +00:00
rcourtman
0177e438e5 fix(sensor-proxy): ensure migrate script atomic write is same-filesystem
Create temp file in same directory as config.yaml to ensure mv is truly
atomic (won't degrade to copy+unlink on different filesystems).

Added comments noting this is a legacy migration script with minor race
risk (no file locking) that should be deprecated once all users upgrade
to v4.32+.
2025-11-19 11:02:14 +00:00
rcourtman
d6084e29dd fix(sensor-proxy): fix remaining unsafe config writers
1. Self-heal script: Add BINARY_PATH variable so CLI migration actually runs
   - Previously logged "Binary not available" and skipped migration

2. migrate-sensor-proxy-control-plane.sh: Use atomic write (temp + rename)
   - Prevents partial writes if script is interrupted
   - Reduces race window with running service

These were the remaining gaps identified by Codex review.

NOTE: migrate-sensor-proxy-control-plane.sh still uses Python manipulation
instead of the Phase 2 CLI, but as a one-time migration script for upgrades
from v4.31, the atomic write provides sufficient protection. Future versions
can deprecate this script entirely.
2025-11-19 10:59:54 +00:00
rcourtman
47d5c14aef Improve temperature proxy control-plane flow 2025-11-15 21:49:51 +00:00