Radio footer, rules page, schedules editor (System timers and Claude tasks through signed runner jobs), account usage bar, usage explorer with a streamed usage.jsonl, queue Controls tab and override, running tasks on the board, stale task prune with the generic dial, greyed card stamps, commit-tree diffs from the runner preview, VS Code path links, expired asks and decisions that stay as EXPIRED cards (asks keyed by a call digest; an async PostToolUse hook closes those answered in the terminal), the Match refresh hourglass, attachments by paste, drop and paperclip in every text field (page CSP gains img-src blob: for the thumbnails) and the limits board with profiles and a passkey to loosen. Fixes: one red accept on a red-gate commit and no release while a risk is open, the send bar footer segments share one height, the mic button survives a redraw, new Match cards queue before the release card. E2E specs were still running at commit time (operator order); their failures follow as separate fixes. 🎯 Fix: 88 % 💥 Break: 8 % 💸 Tokens: – ⏱️ Velocity: – 🛡️ Security: 100 % 🏆 Score: 81 🚦 Gate: ⛔ fix 88 % < 90, break 8 % > 5 (committed on the operator's word) Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
54 lines
2.5 KiB
Python
54 lines
2.5 KiB
Python
from __future__ import annotations
|
|
|
|
import json
|
|
import unittest
|
|
|
|
from hub_case import HubCase
|
|
from kvb_orchestrator import settings
|
|
|
|
|
|
class TestHubMatchRefresh(HubCase):
|
|
def save(self, payload: dict) -> tuple[int, bytes]:
|
|
status, _, body = self.post_json("/api/settings", {**payload, "proof": None}, self.guard(self.host))
|
|
return status, body
|
|
|
|
def refresh(self) -> int:
|
|
return self.snapshot()["settings"]["match"]["refresh"]
|
|
|
|
def test_the_match_refresh_defaults_to_2_s_and_is_stored_in_and_read_from_the_hub_settings(self):
|
|
self.assertEqual(settings.SETTINGS["match"], {"refresh": 2})
|
|
self.assertEqual(self.refresh(), 2)
|
|
status, body = self.save({**self.snapshot()["settings"], "match": {"refresh": 10}})
|
|
self.assertEqual(status, 200, body)
|
|
self.assertEqual(json.loads(body)["settings"]["match"], {"refresh": 10})
|
|
self.assertEqual(self.refresh(), 10)
|
|
stored = json.loads((self.state / "settings.json").read_text(encoding="utf-8"))
|
|
self.assertEqual(stored["match"], {"refresh": 10})
|
|
self.assertEqual(settings.Settings(self.state / "settings.json").get()["match"], {"refresh": 10})
|
|
|
|
def test_a_page_without_the_match_section_keeps_the_saved_interval(self):
|
|
self.assertEqual(self.save({**self.snapshot()["settings"], "match": {"refresh": 7}})[0], 200)
|
|
older = {key: value for key, value in self.snapshot()["settings"].items() if key != "match"}
|
|
self.assertEqual(self.save(older)[0], 200)
|
|
self.assertEqual(self.refresh(), 7)
|
|
|
|
def test_the_interval_takes_whole_seconds_from_1_to_60_only(self):
|
|
for good in (1, 60):
|
|
with self.subTest(good=good):
|
|
status, body = self.save({**self.snapshot()["settings"], "match": {"refresh": good}})
|
|
self.assertEqual(status, 200, body)
|
|
self.assertEqual(self.refresh(), good)
|
|
for bad in (0, 61, -1, 2.5, True, "10", None):
|
|
with self.subTest(bad=bad):
|
|
status, body = self.save({**self.snapshot()["settings"], "match": {"refresh": bad}})
|
|
self.assertEqual((status, body), (400, b"match.refresh must be whole seconds from 1 to 60\n"))
|
|
self.assertEqual(self.refresh(), 60)
|
|
for broken in ({}, {"refresh": 5, "extra": 1}, 5):
|
|
with self.subTest(broken=broken):
|
|
self.assertEqual(self.save({**self.snapshot()["settings"], "match": broken})[0], 400)
|
|
self.assertEqual(self.refresh(), 60)
|
|
|
|
|
|
if __name__ == "__main__":
|
|
unittest.main()
|