docs(cron): drop stale mirror-scope wording left by the home lane

- `_target_matches_origin` docstring still claimed fan-out targets are
  "deliberately NOT mirrored" and mirroring is origin-only; that has been
  false since origin_fallback landed and is doubly so with the home lane.
  Point to `_target_mirror_eligible` for the policy instead.
- cron.md DM-only bullet said "origin DM session"; the config comment in
  the same change already says "target DM". Align.
- Remove two `_expand_routing_tokens` unit assertions bolted into the
  eligibility test; the `" ALL , slack "` parametrize covers expansion
  end-to-end through `_resolve_delivery_targets`.
This commit is contained in:
kshitijk4poor
2026-09-10 15:24:16 +05:30
committed by kshitij
parent 22356075f1
commit 4a76e99f87
3 changed files with 5 additions and 10 deletions
+3 -3
View File
@@ -112,9 +112,9 @@ def _cron_mirror_delivery_enabled(job: dict, cfg: Optional[dict] = None) -> bool
def _target_matches_origin(origin: dict, platform_name: str, chat_id: str,
thread_id: Optional[str]) -> bool:
"""True when a delivery target is the job's own origin conversation. Mirroring is scoped to
the origin session (guaranteed to exist); fan-out targets are broadcasts, deliberately NOT
mirrored. A pinned origin thread_id must match — a target without it is a different lane."""
"""True when a delivery target is the job's own origin conversation. A pinned origin
thread_id must match — a target without it is a different lane. Mirror eligibility for
non-origin targets is decided by ``_target_mirror_eligible``."""
if (
not origin
or str(origin.get("platform", "")).lower() != str(platform_name).lower()
@@ -64,11 +64,6 @@ class TestMirrorEligibilityResolution:
job = {"deliver": "all", "origin": None}
targets = _resolve_delivery_targets(job)
assert targets, "home channel should expand from 'all'"
from cron.scheduler_delivery import _expand_routing_tokens
# Expansion is string-only routing, independent of mirror eligibility.
assert "slack" in _expand_routing_tokens("ALL")
assert _expand_routing_tokens("slack") == ["slack"]
for t in targets:
assert not _target_mirror_eligible(job, t, global_mirror=True)
assert not _target_mirror_eligible(
+2 -2
View File
@@ -589,8 +589,8 @@ Behaviour is **thread-preferred**, scoped to the job's own conversation:
recurring job (e.g. a daily brief) opens a fresh thread per run, keeping each
delivery's follow-up discussion isolated.
- **DM-only platforms** (WhatsApp, Signal, SMS): no threads exist, so the brief
is mirrored into the origin DM session instead — the DM itself is the
continuation surface.
is mirrored into the target DM session instead (the origin DM, or the home DM
for fallback and bare-platform jobs) — the DM itself is the continuation surface.
Only the job's **own conversation** is ever touched: