trustgraph/trustgraph-base/trustgraph
cybermaggedon f11c0ad0cb
Processor group implementation: dev wrapper (#808)
Processor group implementation: A wrapper to launch multiple
processors in a single processor

- trustgraph-base/trustgraph/base/processor_group.py — group runner
  module. run_group(config) is the async body; run() is the
  endpoint. Loads JSON or YAML config, validates that every entry
  has a unique params.id, instantiates each class via importlib,
  shares one TaskGroup, mirrors AsyncProcessor.launch's retry loop
  and Prometheus startup.
- trustgraph-base/pyproject.toml — added [project.scripts] block
  with processor-group = "trustgraph.base.processor_group:run".

Key behaviours:
- Unique id enforced up front — missing or duplicate params.id fails
  fast with a clear error, preventing the Prometheus Info label
  collision we flagged.
- No registry — dotted class path is the identifier; any
  AsyncProcessor descendant importable at runtime is packable.
- YAML import is lazy — only pulled in if the config file ends in
  .yaml/.yml, so JSON-only users don't need PyYAML installed.
- Single Prometheus server — start_http_server runs once at
  startup, before the retry loop, matching launch()'s pattern.
- Retry loop — same shape as AsyncProcessor.launch: catches
  ExceptionGroup from TaskGroup, logs, sleeps 4s,
  retries. Fail-group semantics (one processor dying tears down the
  group) — simple and surfaces bugs, as discussed.

Example config:

  processors:
    - class: trustgraph.extract.kg.definitions.extract.Processor
      params:
        id: kg-extract-definitions
    - class: trustgraph.chunking.recursive.Processor
      params:
        id: chunker-recursive

Run with processor-group -c group.yaml.
2026-04-14 15:19:04 +01:00
..
api Add agent explainability instrumentation and unify envelope field naming (#795) 2026-04-13 16:16:42 +01:00
base Processor group implementation: dev wrapper (#808) 2026-04-14 15:19:04 +01:00
clients Add agent explainability instrumentation and unify envelope field naming (#795) 2026-04-13 16:16:42 +01:00
i18n Feat: TrustGraph i18n & Documentation Translation Updates (#781) 2026-04-14 12:08:32 +01:00
knowledge Subgraph provenance (#694) 2026-03-13 11:37:59 +00:00
messaging Add agent explainability instrumentation and unify envelope field naming (#795) 2026-04-13 16:16:42 +01:00
objects Feature/pkgsplit (#83) 2024-09-30 19:36:09 +01:00
provenance Add agent explainability instrumentation and unify envelope field naming (#795) 2026-04-13 16:16:42 +01:00
schema Add agent explainability instrumentation and unify envelope field naming (#795) 2026-04-13 16:16:42 +01:00
exceptions.py Librarian (#304) 2025-02-11 16:01:03 +00:00
log_level.py Pub/sub abstraction: decouple from Pulsar (#751) 2026-04-01 20:16:53 +01:00
rdf.py Remove schema:subjectOf edges from KG extraction (#695) 2026-03-13 12:11:21 +00:00