trustgraph/trustgraph-flow/trustgraph
cybermaggedon f04f7fa154
fix: ontology extractor reads .objects, not .object, from PromptResult (#842)
The extract-with-ontologies prompt is a JSONL prompt, which means the
prompt service returns a PromptResult with response_type="jsonl" and
the parsed items in `.objects` (plural).  The ontology extractor was
reading `.object` (singular) — the field used for response_type="json"
— which is always None for JSONL prompts.

Effect: the parser received None on every chunk, hit its "Unexpected
response type: <class 'NoneType'>" branch, returned no ExtractionResult,
and extract_with_simplified_format returned []. Every extraction
silently produced zero triples.

Graphs populated only with the seed ontology schema (TBox) and
document/chunk provenance — no instance triples at all.  The e2e test
threshold of >=100 edges per collection was met by schema + provenance
alone, so the failure mode was invisible until RAG queries couldn't
find any content.

Regression introduced in v2.3 with the token-usage work (commit
56d700f3 / 14e49d83) when PromptClient.prompt() began returning a
PromptResult wrapper instead of the raw text/dict/list.  All other
call sites of .prompt() across retrieval/, agent/, orchestrator/ were
already reading the correct field for their prompt's response_type;
ontology extraction was the sole stranded caller.

Also adds tests/unit/test_extract/test_ontology/test_extract_with_simplified_format.py
covering:
  - happy path: populated .objects produces non-empty triples
  - production failure shape: .objects=None returns [] cleanly
  - empty .objects returns [] without raising
  - defensive: do not silently fall back to .object for a JSONL prompt
2026-04-22 12:05:47 +01:00
..
agent fix: replace deprecated datetime.utcnow() with timezone-aware datetime.now(timezone.utc) (#816) 2026-04-16 10:16:11 +01:00
chunking fix: repair deferred imports to preserve module-level names for test patching (#831) 2026-04-18 11:43:21 +01:00
config/service refactor: use one fanout exchange per topic instead of shared topic exchange (#827) 2026-04-17 18:01:35 +01:00
cores refactor: use one fanout exchange per topic instead of shared topic exchange (#827) 2026-04-17 18:01:35 +01:00
decoding fix: repair deferred imports to preserve module-level names for test patching (#831) 2026-04-18 11:43:21 +01:00
direct Fix Cassandra schema and graph filter semantics (#680) 2026-03-10 12:52:51 +00:00
embeddings Better proc group logging and concurrency (#810) 2026-04-15 14:52:01 +01:00
external Implement logging strategy (#444) 2025-07-30 23:18:38 +01:00
extract fix: ontology extractor reads .objects, not .object, from PromptResult (#842) 2026-04-22 12:05:47 +01:00
flow Fix library queue lifecycle (#838) 2026-04-21 21:30:19 +01:00
gateway fix: api-gateway evicts cached dispatchers when a flow stops (#841) 2026-04-22 12:05:24 +01:00
librarian feat: implement retry logic and exponential backoff for S3 operations (#829) 2026-04-18 12:05:37 +01:00
metering Processor group implementation: dev wrapper (#808) 2026-04-14 15:19:04 +01:00
model feat: standardize LLM rate-limiting and exception handling (#835) 2026-04-21 16:15:11 +01:00
processing Fix/startup failure (#445) 2025-07-30 23:42:11 +01:00
prompt Expose LLM token usage across all service layers (#782) 2026-04-13 14:38:34 +01:00
query fix: replace deprecated asyncio.iscoroutinefunction with inspect.iscoroutinefunction (#819) 2026-04-16 10:57:39 +01:00
retrieval fix: replace deprecated datetime.utcnow() with timezone-aware datetime.now(timezone.utc) (#816) 2026-04-16 10:16:11 +01:00
rev_gateway Messaging fabric plugins (#592) 2025-12-17 21:40:43 +00:00
storage Better proc group logging and concurrency (#810) 2026-04-15 14:52:01 +01:00
tables Better proc group logging and concurrency (#810) 2026-04-15 14:52:01 +01:00
template Feature/prompts jsonl (#619) 2026-01-26 17:38:00 +00:00
tool_service Tool services - dynamically pluggable tool implementations for agent frameworks (#658) 2026-03-04 14:51:32 +00:00
__init__.py Feature/pkgsplit (#83) 2024-09-30 19:36:09 +01:00