From 7ef6f4dc3f71dd5f11ffe4c83f392f4a6333e41f Mon Sep 17 00:00:00 2001 From: welsberr Date: Mon, 27 Apr 2026 14:58:54 -0400 Subject: [PATCH] Add relation context to GroundRecall query bundles --- src/groundrecall/query.py | 3 +++ tests/test_groundrecall_query.py | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/groundrecall/query.py b/src/groundrecall/query.py index a1c29e2..98b78cf 100644 --- a/src/groundrecall/query.py +++ b/src/groundrecall/query.py @@ -155,6 +155,7 @@ def build_query_bundle_for_concept(store_dir: str | Path, concept_ref: str) -> d if payload is None: return None claims = payload["claims"] + relations = payload["relations"] contradictions = [item for item in claims if item.get("contradicts_claim_ids")] supersessions = [item for item in claims if item.get("supersedes_claim_ids")] return { @@ -162,7 +163,9 @@ def build_query_bundle_for_concept(store_dir: str | Path, concept_ref: str) -> d "query_type": "concept", "concept": payload["concept"], "relevant_claims": claims, + "relations": relations, "supporting_observations": payload["supporting_observations"], + "source_artifacts": payload["source_artifacts"], "related_concepts": payload["related_concepts"], "review_candidates": payload["review_candidates"], "contradictions": contradictions, diff --git a/tests/test_groundrecall_query.py b/tests/test_groundrecall_query.py index d2e5276..e235227 100644 --- a/tests/test_groundrecall_query.py +++ b/tests/test_groundrecall_query.py @@ -171,6 +171,8 @@ def test_build_query_bundle_for_concept_is_assistant_neutral(tmp_path: Path) -> assert payload is not None assert payload["bundle_kind"] == "groundrecall_query_bundle" assert payload["concept"]["concept_id"] == "concept::channel-capacity" + assert len(payload["relations"]) == 1 + assert payload["source_artifacts"][0]["artifact_id"] == "ia_001" assert len(payload["review_candidates"]) == 2 assert isinstance(payload["suggested_next_actions"], list) forbidden = {"assistant", "codex", "claude", "prompt_text"}