refactor: address PR #851 review round 5 (ingest transport)

- _clear_vector_sync_state also nulls shutdown_event / scanner_wake_event on
  shutdown, symmetric with the stream/producer fields (the next startup rebinds
  them via _wire_vector_sync_state).
- Comment that the "DocumentTask" string subscript in LocalTransport is
  intentional (TYPE_CHECKING-only class; anyio ignores the runtime type arg).
- Move app.py's annotation-only IngestTransport / TaskProducer imports under
  TYPE_CHECKING (the module uses `from __future__ import annotations`), keeping
  only build_transport at runtime.

Refs: Deck #196

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chris Coutinho
2026-06-04 20:49:17 +02:00
co-authored by Claude Opus 4.8
parent c4401af9c6
commit bf84db35b4
2 changed files with 14 additions and 6 deletions
@@ -153,6 +153,9 @@ class LocalTransport(IngestTransport):
"""
def __init__(self, max_buffer_size: float):
# "DocumentTask" as a string (not the symbol): the class is
# TYPE_CHECKING-only here, and anyio ignores the runtime value of the
# type argument — so the string is intentional, not a typo.
send_stream, receive_stream = anyio.create_memory_object_stream["DocumentTask"](
max_buffer_size=max_buffer_size
)