Deploy 0.13.0 to master #166

Merged
admin merged 161 commits from deploy-0.13.0 into master 2026-10-02 15:26:47 +02:00
2 changed files with 7 additions and 9 deletions
Showing only changes of commit e5a0ba23d7 - Show all commits
+4 -8
View File
@@ -11,6 +11,8 @@ has the record. Drives the REAL Controller through tools/safety79_identity.py.
3. The bill and the reports still use the real cap.
4. Each call site in main.py passes the value its side needs.
5. The setting: default, range, refusals in plain words.
Mutations (MUTATION.md, purged copies) are listed in the pull request.
"""
import ast
@@ -219,14 +221,8 @@ check("test_aim_w: `peak_aim_w()` is cap - margin, and the forecast sizing "
print("\n5. the setting")
def _cfg_pair(key):
"""(default, schema) lines for `key` at two spaces in config.yaml."""
with open(os.path.join(HERE, "config.yaml"), encoding="utf-8") as f:
hits = re.findall(rf"^ {key}:\s*(\S+)", f.read(), re.M)
return hits
_hits = _cfg_pair("peak_margin_w")
with open(os.path.join(HERE, "config.yaml"), encoding="utf-8") as f:
_hits = re.findall(r"^ peak_margin_w:\s*(\S+)", f.read(), re.M)
print(f" config.yaml: {_hits}")
check("config.yaml ships 50, int(0,500), and the in-code mirror matches",
_hits == ["50", "int(0,500)"]
+3 -1
View File
@@ -1175,7 +1175,9 @@ def wired_over_limit(db, want_floor_w, opts=None, store=None, batt_w=0.0,
int(now.timestamp() // QUARTER_S) * QUARTER_S, timezone.utc)
span = int((now - blk).total_seconds())
remaining = max(1.0, QUARTER_S - (now - blk).total_seconds())
net_w = CAP_W + want_floor_w * remaining / QUARTER_S
# SAFETY-79: sized against what the guard aims at, cap - margin.
net_w = (CAP_W - ctl.peak_margin_w
+ want_floor_w * remaining / QUARTER_S)
for i in range(0, span + 1, 5):
ctl.p1.submit(sample(blk + timedelta(seconds=i), net_w))
# ⚠️ AND ONE TELEGRAM AT `now` ITSELF. The averager credits a sample's