Expose queue context in GroundRecall review data
This commit is contained in:
parent
7a80bb352a
commit
51678fb790
|
|
@ -331,11 +331,17 @@ def _build_import_review_payload(session: ReviewSession, import_dir: Path) -> di
|
||||||
source_root=resolved_source_root,
|
source_root=resolved_source_root,
|
||||||
)
|
)
|
||||||
artifact_by_id = {item["artifact_id"]: item for item in artifacts}
|
artifact_by_id = {item["artifact_id"]: item for item in artifacts}
|
||||||
|
queue_by_candidate_id = {
|
||||||
|
str(item.get("candidate_id", "")): item
|
||||||
|
for item in queue_payload.get("items", [])
|
||||||
|
if item.get("candidate_type") == "concept"
|
||||||
|
}
|
||||||
|
|
||||||
concept_reviews: list[dict[str, Any]] = []
|
concept_reviews: list[dict[str, Any]] = []
|
||||||
for concept in session.draft_pack.concepts:
|
for concept in session.draft_pack.concepts:
|
||||||
full_concept_id = f"concept::{concept.concept_id}" if not concept.concept_id.startswith("concept::") else concept.concept_id
|
full_concept_id = f"concept::{concept.concept_id}" if not concept.concept_id.startswith("concept::") else concept.concept_id
|
||||||
concept_claims = claims_by_concept.get(full_concept_id, [])
|
concept_claims = claims_by_concept.get(full_concept_id, [])
|
||||||
|
queue_entry = queue_by_candidate_id.get(full_concept_id, {})
|
||||||
claim_payloads: list[dict[str, Any]] = []
|
claim_payloads: list[dict[str, Any]] = []
|
||||||
has_citation_support = False
|
has_citation_support = False
|
||||||
for claim in concept_claims[:25]:
|
for claim in concept_claims[:25]:
|
||||||
|
|
@ -380,6 +386,10 @@ def _build_import_review_payload(session: ReviewSession, import_dir: Path) -> di
|
||||||
"grounded_claim_count": sum(1 for item in concept_claims if item.get("grounding_status") == "grounded"),
|
"grounded_claim_count": sum(1 for item in concept_claims if item.get("grounding_status") == "grounded"),
|
||||||
"warning_count": len(findings_by_target.get(full_concept_id, [])),
|
"warning_count": len(findings_by_target.get(full_concept_id, [])),
|
||||||
"has_citation_support": has_citation_support,
|
"has_citation_support": has_citation_support,
|
||||||
|
"review_priority": int(queue_entry.get("priority", 50)),
|
||||||
|
"triage_lane": str(queue_entry.get("triage_lane", "knowledge_capture")),
|
||||||
|
"finding_codes": list(queue_entry.get("finding_codes", [])),
|
||||||
|
"graph_codes": list(queue_entry.get("graph_codes", [])),
|
||||||
"top_claims": claim_payloads,
|
"top_claims": claim_payloads,
|
||||||
"notes": list(concept.notes),
|
"notes": list(concept.notes),
|
||||||
}
|
}
|
||||||
|
|
@ -392,6 +402,7 @@ def _build_import_review_payload(session: ReviewSession, import_dir: Path) -> di
|
||||||
"queue_length": queue_payload.get("queue_length", 0),
|
"queue_length": queue_payload.get("queue_length", 0),
|
||||||
"source_adapter": manifest.get("source_adapter", ""),
|
"source_adapter": manifest.get("source_adapter", ""),
|
||||||
"graph_summary": graph_payload.get("summary", {}),
|
"graph_summary": graph_payload.get("summary", {}),
|
||||||
|
"top_queue_items": queue_payload.get("items", [])[:10],
|
||||||
},
|
},
|
||||||
"review_guidance": {
|
"review_guidance": {
|
||||||
"overview": (
|
"overview": (
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,13 @@ def test_review_workspace_populates_and_persists_citation_reviews(tmp_path: Path
|
||||||
assert any(item["citation_review_id"] == citation_review_id for item in review_data["citation_reviews"])
|
assert any(item["citation_review_id"] == citation_review_id for item in review_data["citation_reviews"])
|
||||||
assert "graph_diagnostics" in review_data
|
assert "graph_diagnostics" in review_data
|
||||||
assert "graph_summary" in review_data["import_context"]
|
assert "graph_summary" in review_data["import_context"]
|
||||||
|
assert "top_queue_items" in review_data["import_context"]
|
||||||
assert review_data["graph_diagnostics"]["summary"]["concept_count"] >= 1
|
assert review_data["graph_diagnostics"]["summary"]["concept_count"] >= 1
|
||||||
|
concept_review = next(item for item in review_data["concept_reviews"] if item["concept_id"] == "learning-theory")
|
||||||
|
assert "review_priority" in concept_review
|
||||||
|
assert "triage_lane" in concept_review
|
||||||
|
assert "finding_codes" in concept_review
|
||||||
|
assert "graph_codes" in concept_review
|
||||||
|
|
||||||
|
|
||||||
def test_review_workspace_resolves_citation_metadata_from_bibtex(tmp_path: Path) -> None:
|
def test_review_workspace_resolves_citation_metadata_from_bibtex(tmp_path: Path) -> None:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue