feat(control): optional single-battery scope for manual hold - #608
feat(control): optional single-battery scope for manual hold#608frahlg wants to merge 2 commits into
Conversation
9e95e08 to
a315acd
Compare
a315acd to
9480208
Compare
Resolves the control-tick conflict in go/cmd/ftw/main.go: master added per-tick telemetry persistence to the blocked-dispatch branch while this branch added the manual-hold release. Both belong there. The release runs first because persistTelemetryTick snapshots ctrl, so the stored tick has to show the hold already cleared rather than one the blocked tick never executed. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
|
Rebased onto current One real conflict, in the control tick.
Still a draft, and I have deliberately left it that way. It changes the control path, it has no review, and the safety-relevant question is a judgement call rather than a mechanical one: a scoped hold binds to the driver's hardware ID and stops online sibling batteries at 0 W, so the review that matters is whether cancelling on hardware-identity mismatch covers every way the name can move. That is worth a proper read rather than a green tick. |
Summary
manual_holdendpoint with an optionaldriverscope.driveron the existing pool path.Closes #607.
Relation to battery boost
This is not a battery-boost lease. Battery boost grants one loadpoint a short right to use the home battery pool and keeps the state needed for safe restart. This change adds a short service hold for one home battery and stores it only in memory. The two features share the core safety path. An active battery manual hold stops battery boost with the existing
battery_holdreason.API
POST /api/battery/manual_hold{ "direction": "charge", "power_w": 5000, "hold_s": 900, "driver": "bat_a" }Omit
driverfor the old pool behavior. The endpoint still limitshold_sto 1–1800 seconds.DELETE /api/battery/manual_holdstill stops the hold.Safety review
Automated tests
go test ./internal/control -run BatteryManualHold -count=1go test ./internal/api -run BatteryHold -count=1go test ./cmd/ftw -run 'Battery|DispatchBlock|SiteDispatchFreshness|StaleSiteDefault' -count=1npm test— 67 passedmake verifyafter rebasemake verify-all, including Linux ARM64, Linux AMD64, and Windows AMD64 buildsThe Go tests cover target scope, immediate sibling standdown with slew enabled, missing and changed hardware identity, unavailable targets, core power and reserve limits, and stale-site cancellation.
Field checklist
battery_hold.Keep this PR in draft until the field checks pass.