OPT-09: the weights parameter nothing ever passed, and what it cannot do
checks / unit (pull_request) Successful in 6m19s

`allocator.plan()` has taken a `weights` argument since ALLOC-01 and NOTHING
had ever passed one - main.py called `resolve()` without it and the arbiter
defaulted it to 1.0 per unit - so the site target was split 50/50 regardless
of what either pack could do. Two things now feed it, and they are different
kinds of thing:

  * a `pack` UNIT claim at P_SAFETY that CLOSES a unit's envelope at its own
    `bms_soc_floor` or at 100 % - a PERMISSION, obeyed absolutely, so an empty
    pack is not asked to discharge and its share goes to the sibling;
  * SoC-aware weights by ENERGY headroom in kWh - a PREFERENCE, which
    `_fill()`'s last-resort pass will override the moment the sibling saturates.

Measured (test_packshare.py part 8): at a load one pack cannot cover, the
weighted arm and the shipped arm command the IDENTICAL watts into an empty pack
and deliver the IDENTICAL watts. Only the envelope stops the ask, and what it
buys is not delivery - it is a reported `unmet_w` where the record used to read
impeccable. Weights are a comfort choice for STABILITY and NOT for DELIVERY.

Also: an optional per-entry `capacity_kwh` (schema change, all-or-nothing across
the roster, rule 9 refuses a partial one); per-pack arbitrage sizing, with the
sell side's no-op stated rather than hidden; and a 0 W trade refused by name,
because a 0 W arbitrage claim is a park order that outranks the loop.

SAFETY-42 and this card meet at one hazard from opposite sides - OPT-09 stops
the site ASKING a pack whose SoC says it cannot deliver, SAFETY-42 alarms when a
pack that said it could does not - and its end-to-end fixture moved as a result.
Its finding is unchanged and is now stated on the two quantities its rejected
discriminator actually reads.

Not filed at all at a roster of one: at N=1 every source routes to the site, so
the interval would bound the SITE TARGET, and SAFETY-25's decided Option A
stands untouched on the live install.

⚠️ INVERTER B DOES NOT EXIST. Its 4600 W / 20.48 kWh / 10 % are FROM DATASHEET
AND SERIAL, and `sim/plantsim.py`'s INVERTER_B is inverter A copied
(`measured=False`), so every two-inverter figure here is arithmetic or two
copies of A. No hardware was touched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BwRLw7eKYj2byVdwB6kbjU
This commit is contained in:
glenn schrooyen
2026-09-06 21:38:40 +02:00
co-authored by Claude Opus 5
parent 3368231048
commit 8123e261ce
20 changed files with 2313 additions and 81 deletions
+26
View File
@@ -108,6 +108,25 @@ options:
# EVERY entry and names the one it refuses. The flat key below is unchanged and
# is the single-inverter shape's own cut-out.
#
# ⚠️ OPT-09: `capacity_kwh` IS PER ENTRY AND IS OPTIONAL, WHICH IS THE
# OPPOSITE CHOICE TO `bms_soc_floor` ABOVE AND IS MADE FOR THE SAME REASON.
# It is THAT pack's usable capacity in kWh, and it is read for exactly one
# purpose: weighting the SPLIT of the site target between packs by ENERGY
# headroom rather than by power rating. The two packs here are asymmetric in
# OPPOSITE directions - 5000 W / 15.36 kWh against 4600 W / 20.48 kWh, from
# the datasheet and the serials - so a split by rating and a split by energy
# hand the work to DIFFERENT packs, and the energy one is the question ("which
# pack can sustain its share for the hour"). A missing cut-out would have to be
# DEFAULTED, and one default for two batteries protects the shallower pack with
# the deeper pack's number; a missing capacity has an honest answer instead -
# this add-on then has NO OPINION about the split and every unit weighs 1.0,
# which is exactly what shipped before this card. ⚠️ IT IS ALL OR NOTHING
# ACROSS THE ROSTER: state it on every entry or on none, because a pack
# weighted in kWh against a sibling weighing a dimensionless 1.0 is not a
# comparison. There is deliberately NO flat `capacity_kwh` - at one inverter
# there is no split to weight, so the key would be one an operator can set and
# nothing reads.
#
# ⚠️ AND THE FLAT `setpoint_entity` MUST THEN BE BLANK. Leaving it set while a
# roster is declared is two config sites aimed at actuators, one of which
# nothing writes; if it names an entity an entry also names, SAFETY-28's
@@ -621,6 +640,12 @@ schema:
# enforced per entry, a missing required key names the key, a scalar where the
# list belongs is refused, and the UI renders it as a repeatable section.
#
# ⚠️ AND OPT-09's `capacity_kwh` IS DECLARED OPTIONAL (`?`), UNLIKE
# `bms_soc_floor`, WHICH IS THE ARGUMENT IN THE OPTIONS BLOCK ABOVE: an
# optional cut-out is a defaulted one and a default is one number for two
# batteries, whereas an absent capacity has an honest answer - no opinion
# about the split, every unit weighs 1.0, which is what shipped.
#
# ⚠️ THREE KEYS ARE REQUIRED PER ENTRY AND THAT IS DELIBERATE. An entry with
# no `name` has no Store namespace and would share another unit's SAFETY-02
# latch; one with no `setpoint_entity` is a unit nothing can command; one with
@@ -642,6 +667,7 @@ schema:
soc_entity: str?
batt_entity: str?
batt_invert: bool?
capacity_kwh: float(0.1,200)?
estop_fitted: bool