trustgraph/tests/unit
cybermaggedon 153ae9ad30
Split Analysis into Analysis+ToolUse and Observation, add message_id (#747)
Refactor agent provenance so that the decision (thought + tool
selection) and the result (observation) are separate DAG entities:

  Question ← Analysis+ToolUse ← Observation ← ... ← Conclusion

Analysis gains tg:ToolUse as a mixin RDF type and is emitted
before tool execution via an on_action callback in react().
This ensures sub-traces (e.g. GraphRAG) appear after their
parent Analysis in the streaming event order.

Observation becomes a standalone prov:Entity with tg:Observation
type, emitted after tool execution. The linear DAG chain runs
through Observation — subsequent iterations and the Conclusion
derive from it, not from the Analysis.

message_id is populated on streaming AgentResponse for thought
and observation chunks, using the provenance URI of the entity
being built. This lets clients group streamed chunks by entity.

Wire changes:
- provenance/agent.py: Add ToolUse type, new
  agent_observation_triples(), remove observation from iteration
- agent_manager.py: Add on_action callback between reason() and
  tool execution
- orchestrator/pattern_base.py: Split emit, wire message_id,
  chain through observation URIs
- orchestrator/react_pattern.py: Emit Analysis via on_action
  before tool runs
- agent/react/service.py: Same for non-orchestrator path
- api/explainability.py: New Observation class, updated dispatch
  and chain walker
- api/types.py: Add message_id to AgentThought/AgentObservation
- cli: Render Observation separately, [analysis: tool] labels
2026-03-31 17:51:22 +01:00
..
test_agent Split Analysis into Analysis+ToolUse and Observation, add message_id (#747) 2026-03-31 17:51:22 +01:00
test_base Embeddings API scores (#671) 2026-03-09 10:53:44 +00:00
test_chunking Fix ontology RAG pipeline + add query concurrency (#691) 2026-03-12 11:34:42 +00:00
test_cli Fix/tests (#647) 2026-02-23 22:01:47 +00:00
test_clients Embeddings API scores (#671) 2026-03-09 10:53:44 +00:00
test_concurrency Updated test suite for explainability & provenance (#696) 2026-03-13 14:27:42 +00:00
test_config Structure data mvp (#452) 2025-08-07 20:47:20 +01:00
test_cores Remove redundant metadata (#685) 2026-03-11 10:51:39 +00:00
test_decoding Add universal document decoder with multi-format support (#705) 2026-03-23 12:56:35 +00: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 Updated test suite for explainability & provenance (#696) 2026-03-13 14:27:42 +00:00
test_gateway fix(gateway): accept raw utf-8 text in text-load (#729) 2026-03-30 17:00:10 +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 Split Analysis into Analysis+ToolUse and Observation, add message_id (#747) 2026-03-31 17:51:22 +01:00
test_query Knowledge core processing updated for embeddings interface change (#681) 2026-03-10 13:28:16 +00:00
test_rdf Updated test suite for explainability & provenance (#696) 2026-03-13 14:27:42 +00:00
test_reliability Updated test suite for explainability & provenance (#696) 2026-03-13 14:27:42 +00:00
test_retrieval Enhance retrieval pipelines: 4-stage GraphRAG, DocRAG grounding (#697) 2026-03-16 12:12:13 +00:00
test_rev_gateway Fix tests (#593) 2025-12-19 08:53:21 +00:00
test_storage Remove redundant metadata (#685) 2026-03-11 10:51:39 +00:00
test_structured_data Updated test suite for explainability & provenance (#696) 2026-03-13 14:27:42 +00:00
test_text_completion Fix OpenAI compatibility issues for newer models and Azure config (#727) 2026-03-28 11:19:45 +00: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 Structured data 2 (#645) 2026-02-23 15:56:29 +00:00