From 6cd1ed2e78cf273ec30657993975d6d423c6c7cc Mon Sep 17 00:00:00 2001 From: Ben Barclay Date: Thu, 20 Aug 2026 20:13:29 +1000 Subject: [PATCH] test(relay): rename misnamed precedence test; document the flat-key fallback nuance test_flat_key_wins_over_subblock asserted the OPPOSITE of its name (the sub-block wins, matching _relay_slack_extra). Rename to what it proves. Also note in _resolve_cron_surface_mode why its fallback differs from _relay_slack_extra's all-or-nothing sub-dict: the flat key is the legacy staging shape, and a flat knob applies to every fronted platform, gated only by the per-platform D6 capability check. --- cron/scheduler.py | 9 +++++++++ tests/relay/test_relay_inchannel_continuable.py | 7 ++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/cron/scheduler.py b/cron/scheduler.py index 77bc1385e9..f45eb66d81 100644 --- a/cron/scheduler.py +++ b/cron/scheduler.py @@ -1510,6 +1510,15 @@ def _resolve_cron_surface_mode(pconfig, logical_platform_name: str) -> str: scoped to its logical platform so a ``slack:`` block cannot leak onto another fronted platform. + Precedence nuance vs _relay_slack_extra: that helper is all-or-nothing + (a sub-dict REPLACES the flat extra entirely), while this one falls back + to the flat key when the sub-block exists but omits the knob. The + difference is deliberate — the flat key is the legacy staging shape and + must keep working — but note a flat ``cron_continuable_surface`` then + applies to EVERY platform this relay fronts; only the per-platform D6 + capability gate contains it. Scope the knob under the sub-block on + multi-platform relays. + Field gap (2026-08-18): the scheduler read only the flat key, so on the relay lane — where pconfig is platforms.relay — operators had NO working location for the knob and briefs always threaded. diff --git a/tests/relay/test_relay_inchannel_continuable.py b/tests/relay/test_relay_inchannel_continuable.py index 213a012331..6cd6592666 100644 --- a/tests/relay/test_relay_inchannel_continuable.py +++ b/tests/relay/test_relay_inchannel_continuable.py @@ -169,9 +169,10 @@ class TestSurfaceKnobResolution: pconfig = SimpleNamespace(extra={}) assert _resolve_cron_surface_mode(pconfig, "slack") == "thread" - def test_flat_key_wins_over_subblock(self): - """Legacy-fallback precedence mirrors _relay_slack_extra: an explicit - flat key keeps working when both are present.""" + def test_subblock_wins_over_flat_key(self): + """Sub-block precedence: the per-logical-platform sub-block is the + documented relay shape and wins when both are present — matches + _relay_slack_extra (sub-dict preferred over flat extra).""" pconfig = SimpleNamespace( extra={ "cron_continuable_surface": "thread",