NA: NA Ingest out of the Tracks Mac's MIDI session in auto-fix hours (rehearsals, services); back after

User 2026-10-26: Ingest's notes did odd things in Ableton; the link is needed for programming only. An
automatic switch (bypass auto autofix_hours, names_only so ProdDash Lighting on the same Mac stays) takes it
out and keeps it out, and puts it back when the hours end. bypass_tick now takes turns over every switch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-26 12:00:37 -04:00
co-authored by Claude Opus 5.5
parent 06dce6dffc
commit 412b0413c0
4 changed files with 72 additions and 6 deletions
+30
View File
@@ -2674,6 +2674,36 @@ class TestSwitches(unittest.TestCase):
self.assertNotIn("ableset", [w for _, k, w, _ in engine.fix_plan("apps", snap)])
sp.bypass_apply(CONFIG, engine.tiles["ableset"], True, engine.bypass["ableset"], None, (set(), set())) # nothing to hand over
def test_ingest_out_of_tracks_midi_in_auto_fix_hours(self):
"""NA, 2026-10-26: NA Ingest's notes did odd things in Ableton - in auto-fix's hours it is taken out of
the Tracks Mac's MIDI session (and kept out), and put back when they end."""
engine = sp.Engine(CONFIG)
flips = []
engine.start_bypass_job = lambda tid, on, entry, comp: flips.append((tid, on))
sunday_8am, monday = datetime(2026, 10, 11, 8, 0).timestamp(), datetime(2026, 10, 12, 9, 0).timestamp()
engine.bypass_tick(None, monday)
self.assertNotIn("trk_ingest_off", engine.bypass) # outside the hours: left as it is
engine.bypass_tick(None, sunday_8am)
self.assertIn("trk_ingest_off", engine.bypass)
self.assertEqual(flips[0], ("trk_ingest_off", True))
self.assertIn("NA Ingest", engine.bypass_names()[0]) # its MIDI check is green meanwhile
engine.bypass_last = 0
engine.bypass_tick(None, sunday_8am + 30) # re-taken every 10 s
self.assertEqual(flips[-1], ("trk_ingest_off", True))
dropped = []
orig = sp.midi_sessions, sp.midi_peer
sp.midi_sessions = lambda cfg, host: {"NA Tracks": {"peers": [{"name": "NA Ingest", "address": "10.1.1.1:5009"},
{"name": "ProdDash Lighting", "address": "10.1.1.1:5006"}]}}
sp.midi_peer = lambda cfg, host, verb, sess, peer, *a, **k: dropped.append((verb, peer)) or ("asked", None)
try:
sp.bypass_apply(CONFIG, engine.tiles["trk_ingest_off"], True, {"dropped": []}, None, engine.bypass_names())
finally:
sp.midi_sessions, sp.midi_peer = orig
self.assertEqual(dropped, [("disconnect", "NA Ingest")]) # ProdDash Lighting, same Mac, stays
engine.bypass_tick(None, sunday_8am + 7 * 3600) # 15:00: the hours are over
self.assertNotIn("trk_ingest_off", engine.bypass)
self.assertEqual(flips[-1], ("trk_ingest_off", False))
def test_a_bypass_key_needs_its_peers(self):
import schema
bad = json.loads(json.dumps(self.cfg))