Skip to content

The agent that grows with you

docs(gateway): drop references to the deleted AST sweep and gate-proof tests

kshitijk4poor9056bfb5a45f
diff --git a/gateway/platforms/helpers.py b/gateway/platforms/helpers.py
index 3ae4b9ba2cc..478f990bc09 100644
--- a/gateway/platforms/helpers.py
+++ b/gateway/platforms/helpers.py
@@ -165,8 +165,7 @@ class ThreadParticipationTracker:
"""Mark *thread_id* as participated and persist.
Blocking: ends in ``atomic_json_write`` -> ``os.replace``. Coroutines
- must use :meth:`mark_async` instead; a lexical AST sweep in
- ``tests/gateway/test_thread_tracker_mark_off_loop.py`` enforces that.
+ must use :meth:`mark_async` instead.
"""
if self._remember(thread_id):
self._save()
diff --git a/gateway/sticker_cache.py b/gateway/sticker_cache.py
index 24c71b20dc9..a9e1d98e2f9 100644
--- a/gateway/sticker_cache.py
+++ b/gateway/sticker_cache.py
@@ -63,10 +63,7 @@ def cache_sticker_description(
"""
entry = {"description": description, "emoji": emoji, "set_name": set_name,
"cached_at": time.time()}
- # ``atomic_json_write`` makes each WRITE atomic, not the load/mutate/save
- # TRIPLE. The inline call used to be serialized by the event loop itself;
- # the async form below runs on a worker thread, so without this lock two
- # concurrently described stickers lose one of the two descriptions.
+ # The lock makes the load/mutate/save triple atomic across worker threads.
with _CACHE_LOCK:
_save_cache({**_load_cache(), file_unique_id: entry})
diff --git a/tests/gateway/test_sticker_cache_off_loop.py b/tests/gateway/test_sticker_cache_off_loop.py
index abb0e9b907d..2243725ec90 100644
--- a/tests/gateway/test_sticker_cache_off_loop.py
+++ b/tests/gateway/test_sticker_cache_off_loop.py
@@ -6,11 +6,9 @@ unbounded under filesystem pressure. Its only production caller is Telegram's
missed the cache paid that rename inline on the loop, stalling every other
adapter and every in-flight turn in the process.
-These tests use no wall-clock thresholds. The witness is ORDERING: the rename
-is held open on a barrier released only by a background timer, and the sibling
-task must have ticked BEFORE that release. A companion gate-proof drives the
-identical barrier through the synchronous form and asserts the loop DOES
-starve, so the liveness assertion cannot pass vacuously.
+These tests pin the two invariants of the off-loop form: the write runs on a
+worker thread, and the lock keeps two concurrent load/merge/save triples from
+losing an entry in the DURABLE file.
"""
import asyncio
import json
diff --git a/tests/gateway/test_thread_tracker_mark_off_loop.py b/tests/gateway/test_thread_tracker_mark_off_loop.py
index 495b46a4cda..0bcaae00f8b 100644
--- a/tests/gateway/test_thread_tracker_mark_off_loop.py
+++ b/tests/gateway/test_thread_tracker_mark_off_loop.py
@@ -14,13 +14,9 @@ call sites await it. ``mark`` keeps its exact synchronous contract for the
non-loop callers and tests.
These tests are about OBSERVABLE BEHAVIOUR -- can the loop keep running while
-the persist is in its slow path -- not about which API was called. There are no
-wall-clock thresholds: the rename is held open on a real barrier for as long as
-the assertion needs, and a companion gate-proof forces the pre-fix inline shape
-and asserts the very same barrier DOES starve the loop, so the liveness test
-cannot pass vacuously.
+the persist is in its slow path -- not about which API was called.
-They also pin the property the off-loop move would otherwise silently break.
+They pin the property the off-loop move would otherwise silently break.
Moving the persist to a worker thread removes the accidental serialization the
event loop used to provide, so the check/insert/trim/write sequence can now
interleave across two marks and lose an entry. ``atomic_json_write`` makes each