trustgraph/tests/unit
cybermaggedon 9f84891fcc
Flow service lifecycle management (#822)
feat: separate flow service from config service with explicit queue
lifecycle management

The flow service is now an independent service that owns the lifecycle
of flow and blueprint queues. System services own their own queues.
Consumers never create queues.

Flow service separation:
- New service at trustgraph-flow/trustgraph/flow/service/
- Uses async ConfigClient (RequestResponse pattern) to talk to config
  service
- Config service stripped of all flow handling

Queue lifecycle management:
- PubSubBackend protocol gains create_queue, delete_queue,
  queue_exists, ensure_queue — all async
- RabbitMQ: implements via pika with asyncio.to_thread internally
- Pulsar: stubs for future admin REST API implementation
- Consumer _connect() no longer creates queues (passive=True for named
  queues)
- System services call ensure_queue on startup
- Flow service creates queues on flow start, deletes on flow stop
- Flow service ensures queues for pre-existing flows on startup

Two-phase flow stop:
- Phase 1: set flow status to "stopping", delete processor config
  entries
- Phase 2: retry queue deletion, then delete flow record

Config restructure:
- active-flow config replaced with processor:{name} types
- Each processor has its own config type, each flow variant is a key
- Flow start/stop use batch put/delete — single config push per
  operation
- FlowProcessor subscribes to its own type only

Blueprint format:
- Processor entries split into topics and parameters dicts
- Flow interfaces use {"flow": "topic"} instead of bare strings
- Specs (ConsumerSpec, ProducerSpec, etc.) read from
  definition["topics"]

Tests updated
2026-04-16 17:19:39 +01:00
..
test_agent Fix tests broken by the recent RabbitMQ/Cassandra async fixes (#815) 2026-04-16 10:00:18 +01:00
test_base Flow service lifecycle management (#822) 2026-04-16 17:19:39 +01:00
test_chunking Fix RabbitMQ request/response race and chunker Flow API drift (#779) 2026-04-11 01:29:38 +01:00
test_cli Fix/tests (#647) 2026-02-23 22:01:47 +00:00
test_clients Pub/sub abstraction: decouple from Pulsar (#751) 2026-04-01 20:16:53 +01:00
test_concurrency Subscriber resilience and RabbitMQ fixes (#765) 2026-04-07 14:51:14 +01:00
test_config Structure data mvp (#452) 2025-08-07 20:47:20 +01:00
test_cores Flow service lifecycle management (#822) 2026-04-16 17:19:39 +01:00
test_decoding RabbitMQ pub/sub backend with topic exchange architecture (#752) 2026-04-02 12:47:16 +01:00
test_direct Updated test suite for explainability & provenance (#696) 2026-03-13 14:27:42 +00:00
test_embeddings Updated test suite for explainability & provenance (#696) 2026-03-13 14:27:42 +00:00
test_extract Expose LLM token usage across all service layers (#782) 2026-04-13 14:38:34 +01:00
test_gateway Flow service lifecycle management (#822) 2026-04-16 17:19:39 +01:00
test_knowledge_graph Remove schema:subjectOf edges from KG extraction (#695) 2026-03-13 12:11:21 +00:00
test_librarian Add universal document decoder with multi-format support (#705) 2026-03-23 12:56:35 +00:00
test_provenance Add agent explainability instrumentation and unify envelope field naming (#795) 2026-04-13 16:16:42 +01:00
test_pubsub Refactor: Derive consumer behaviour from queue class (#772) 2026-04-09 09:55:41 +01:00
test_query Fix tests broken by the recent RabbitMQ/Cassandra async fixes (#815) 2026-04-16 10:00:18 +01:00
test_rdf Pub/sub abstraction: decouple from Pulsar (#751) 2026-04-01 20:16:53 +01:00
test_reliability Pub/sub abstraction: decouple from Pulsar (#751) 2026-04-01 20:16:53 +01:00
test_retrieval Fix tests broken by the recent RabbitMQ/Cassandra async fixes (#815) 2026-04-16 10:00:18 +01:00
test_rev_gateway Fix tests (#593) 2025-12-19 08:53:21 +00:00
test_storage Fix tests broken by the recent RabbitMQ/Cassandra async fixes (#815) 2026-04-16 10:00:18 +01:00
test_structured_data Updated test suite for explainability & provenance (#696) 2026-03-13 14:27:42 +00:00
test_tables Fix tests broken by the recent RabbitMQ/Cassandra async fixes (#815) 2026-04-16 10:00:18 +01:00
test_text_completion Feat: Auto-pull missing Ollama models (#757) 2026-04-06 11:10:53 +01:00
test_translators Fix Metadata/EntityEmbeddings schema migration tail and add regression tests (#777) 2026-04-10 20:43:45 +01:00
__init__.py Test suite executed from CI pipeline (#433) 2025-07-14 14:57:44 +01:00
test_prompt_manager.py Feature/prompts jsonl (#619) 2026-01-26 17:38:00 +00:00
test_prompt_manager_edge_cases.py Update to enable knowledge extraction using the agent framework (#439) 2025-07-21 14:31:57 +01:00
test_python_api_client.py Add agent explainability instrumentation and unify envelope field naming (#795) 2026-04-13 16:16:42 +01:00