Skip to content

Optimise spares: warn about blocks that are never repaired - #379

Merged
danyill merged 3 commits into
mainfrom
feat/spares-unrepairable-warning
Nov 27, 2026
Merged

danyill merged 3 commits into
mainfrom
feat/spares-unrepairable-warning

Conversation

@danyill

@danyill danyill commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

Closes #378.

  • unrepairable_warnings(rbd, names) in raptor/api/optimise/spares.py gives one line per pool that serves never-repaired blocks (repair distribution None).
  • A pool where every member is never repaired is left out of the search, since stock there cannot change the result. If no pool is left, the error says why rather than just "no finite spare pool with demand".
  • A shared pool is still searched with its full demand (the engine does draw stock for those failures), and the result names the blocks.
  • The result gains warnings. The Optimise Spares dialog shows them on their own line above the recommendation; the Copy text and the MCP tool's markdown include them.

Checked with a screenshot of the dialog on a model whose pool serves one repairable and one never-repaired block. Three new tests in tests/unit/scenarios/test_spares_optimise.py; the optimiser, MCP and dialog tests pass.

The engine takes a spare from stock when such a block fails (CheckForSpare
runs first) and then leaves it down, so stock spent on it brings nothing
back. A pool that serves only such blocks is left out of the search (and
if none is left the error says why); a shared pool is searched, and the
result names the blocks. The dialog, the MCP tool and its markdown show
the warnings.
@danyill
danyill merged commit 5a56b8f into main Nov 27, 2026
24 checks passed
@danyill
danyill deleted the feat/spares-unrepairable-warning branch November 27, 2026 21:13
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.

Optimise spares should warn when a pool's blocks are never repaired

1 participant