Skip to content

fix(control): preserve live fuse relief - #926

Merged
frahlg merged 4 commits into
masterfrom
agent/fix-fuse-saver-live-baseline-p0
Aug 16, 2026
Merged

fix(control): preserve live fuse relief#926
frahlg merged 4 commits into
masterfrom
agent/fix-fuse-saver-live-baseline-p0

Conversation

@frahlg

@frahlg frahlg commented Aug 16, 2026

Copy link
Copy Markdown
Member

What changed

The deadband and holdoff fuse-saver now starts from each controllable battery's live power instead of an artificial 0 W target.

This closes a post-v1.15 safety regression. With a battery already discharging at about -5 kW and one phase at 18 A on a 16 A fuse, the old early-exit path replaced the live output with about -1.38 kW. That raised the worst phase to about 23.25 A. The new path adds the required relief to the live target, yielding about -6.38 kW and reducing the phase to 16 A.

Mode Idle still sends real 0 W hold targets. A deadband or holdoff tick that needs no relief remains silent and does not update LastDispatch.

Evidence

  • The regression test fails on exact parent f0c9ad2: live -5 kW becomes about -1.38 kW.
  • The fixed tree keeps discharge monotonic, reduces a live charge by only the required relief, and stays silent with safe live charge or discharge.
  • Focused safety tests passed 100 times and 100 times with the race detector.
  • go test -race ./internal/control ./internal/telemetry ./cmd/ftw passed.
  • Two independent full make verify runs passed, including 167 optimizer tests, all Go and driver packages, external optimizer E2E, Compose migration, boundaries, vet, and build.
  • An independent read-only review found no remaining P0 or P1.

Order and ownership

This PR intentionally goes before #769. That PR has prior ownership of dispatch.go, but the fault is already on master and blocks the 2.0 candidate. The release owner explicitly approved both this fuse fix and the separate #816 slew fix. After this lands, rebase #769, rebuild its synthetic stack base, then restack #887 and #888. Merge-tree checks against all three heads are conflict-free.

This is a draft until normal CODEOWNER or human review is complete. It is not approval to publish a stable release.

@frahlg

frahlg commented Aug 16, 2026

Copy link
Copy Markdown
Member Author

@miravoss26 could you review this P0 safety fix on exact head 5ef2d3e?

The old deadband/holdoff path can replace a live -5 kW discharge with about -1.38 kW while a phase is overloaded. The new path starts from live battery power and adds relief from there. Focused tests passed 100 times with race, full package race passed, two full make verify runs passed, and an independent read-only safety review found no remaining P0/P1.

This draft is intentionally ordered before #769. It will not merge without normal human/CODEOWNER review.

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5ef2d3eb5f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread go/internal/control/dispatch.go Outdated
@frahlg
frahlg force-pushed the agent/fix-fuse-saver-live-baseline-p0 branch from 5ef2d3e to 6d05571 Compare August 16, 2026 13:50
@frahlg

frahlg commented Aug 16, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6d0557130a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread go/internal/control/dispatch.go Outdated
@frahlg
frahlg force-pushed the agent/fix-fuse-saver-live-baseline-p0 branch from 6d05571 to efe9b50 Compare August 16, 2026 14:32
@frahlg

frahlg commented Aug 16, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: efe9b508a8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@frahlg
frahlg marked this pull request as ready for review August 16, 2026 17:37
@frahlg
frahlg force-pushed the agent/fix-fuse-saver-live-baseline-p0 branch from efe9b50 to 8a98fae Compare August 16, 2026 18:23
@frahlg
frahlg requested a review from miravoss26 August 16, 2026 18:24
@frahlg

frahlg commented Aug 16, 2026

Copy link
Copy Markdown
Member Author

Rebased this P0 fuse-relief fix onto current master 098a0951; new exact head is 8a98faeca404f21701e72b19fb38c7be0cb29a09 (old head efe9b508a8c5867726a142340c0b20014157970e). The one-commit patch is unchanged by range-diff. Focused fuse/deadband tests passed 100x, go test -race ./internal/control passed, and make verify passed. Could you refresh the safety/CODEOWNER review on this exact head? @miravoss26

@frahlg

frahlg commented Aug 16, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8a98faeca4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread go/internal/control/dispatch.go
@frahlg

frahlg commented Aug 16, 2026

Copy link
Copy Markdown
Member Author

Exact head 9ee92e9867ff9e4118f68969357c2da974c3fbd6 addresses the final P2: only the command-safe capped batteries needed for quantified fuse relief receive a target; others remain uncontrolled. All local safety checks pass, including focused x100, race, full control/cmd race and make verify. @codex review\n\n@miravoss26 please refresh the control/CODEOWNER review on this exact head.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9ee92e9867

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread go/internal/control/dispatch.go Outdated
@frahlg
frahlg force-pushed the agent/fix-fuse-saver-live-baseline-p0 branch from 9ee92e9 to cff14ed Compare August 16, 2026 19:04
@frahlg

frahlg commented Aug 16, 2026

Copy link
Copy Markdown
Member Author

@codex review

@miravoss26 please refresh review on exact head cff14ed2. Both discrete cap selection and the final fuse allocation now honor the export ceiling; independent review found no P0/P1/P2, and focused repeat/race, full package race, and make verify are green.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cff14ed26d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread go/internal/control/dispatch.go Outdated
@frahlg

frahlg commented Aug 16, 2026

Copy link
Copy Markdown
Member Author

@codex review Exact head 53e4774 closes the last subset/headroom finding. Independent review is GO; focused repeated tests, race tests, full control race, and make verify are green.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53e4774633

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread go/internal/control/dispatch.go Outdated
@frahlg
frahlg force-pushed the agent/fix-fuse-saver-live-baseline-p0 branch from 53e4774 to c3c82ee Compare August 16, 2026 19:38
@frahlg

frahlg commented Aug 16, 2026

Copy link
Copy Markdown
Member Author

@codex review Exact head c3c82ee adds the bounded multi-cap path requested in the last P2. Independent review is GO; targeted x1000, race x100, full control race, and make verify are green.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Bravo.

Reviewed commit: c3c82eeced

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@frahlg
frahlg merged commit 203434a into master Aug 16, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant