train-guard 0.4.0
Train Guard supervises one named long-running job on a laptop. It selects
full, gentle or stop from power source, charge and available battery
temperature, while tracking the process changes it owns.
Version 0.4.0 adds bounded-adversarial analysis for recorded traces:
- replay reports exact marginal objective envelopes for user-supplied
temperature and charge intervals; - replay reports the minimum normalized binary64 distance to an action-sequence
change, with the first critical divergence context; - sweep reports a conservative outer enclosure of policies that cannot be
certainly dominated from their objective boxes; - the optional
TGS 1native path accelerates bounded sweep analysis and is
accepted only after comparison with the Python reference.
Install
pipx install "train-guard==0.4.0"
train-guard doctorStart with the
Getting Started
guide and a disposable job.
Verification
Release commit: 80c2665358a2643b6818fb3b402a68e6898d4dcb
- main CI: https://github.com/fus3r/train-guard/actions/runs/31623470103
- tag CI: https://github.com/fus3r/train-guard/actions/runs/31624609733
- PyPI publication workflow: https://github.com/fus3r/train-guard/actions/runs/31633194741
- real Mac gate: scripted live-supervision scenarios on a MacBook Pro
(Apple M4 Pro, macOS 15.7.7, Python 3.13.7): AC supervision, detach,
gentle-to-fullrestoration, recovery after a killed supervisor,
stop --killescalation, and an unplug/replug cycle, each preserving
process identities and leaving no residual state - independent reviews: three candidate reviews and two post-release onboarding
reviews completed with no openrequired nowfinding
The CI matrix covers Ubuntu, macOS and Windows on Python 3.9 and 3.13. These
checks raise confidence; they do not prove the absence of bugs.
Limits
Train Guard is a workload policy, not a hardware safety controller. Sensor
availability depends on the machine and driver. gentle is a scheduling hint,
not a power cap.
Replay and sweep hold the recorded observations fixed. Their metrics and
sensitivity boxes do not predict battery life, temperature, energy use or
throughput under another policy. The interval front is a conservative outer
enclosure, not an exact robust Pareto front. Action-change distance is exact
only on the declared finite binary64 representative domain for the current
stateful threshold policy.
Links
- Documentation: https://train-guard.readthedocs.io/en/latest/
- PyPI: https://pypi.org/project/train-guard/0.4.0/
- Source: https://github.com/fus3r/train-guard/tree/v0.4.0
- Changelog: https://github.com/fus3r/train-guard/blob/v0.4.0/CHANGELOG.md
- Hardware report: https://github.com/fus3r/train-guard/issues/new?template=hardware-report.yml