feat: add node coverage and improve investigation presentation
This commit is contained in:
@@ -37,6 +37,18 @@ def test_unknown_node_state_is_rejected():
|
||||
InvestigationDiagramNodeRef(node_id="A", label="查询", status="blocked")
|
||||
|
||||
|
||||
def test_class_attached_nodes_are_valid_declarations_without_accepting_partial_ids():
|
||||
payload = {"request_id": uuid4(), "source_session_id": "session-1", "progress": {
|
||||
"summary": "核查", "diagram": {"title": "路线", "mermaid": "flowchart TD\nQUERY:::running --> REVIEW:::pending",
|
||||
"node_refs": [{"node_id": "QUERY", "label": "核查", "status": "running"},
|
||||
{"node_id": "REVIEW", "label": "复核", "status": "pending"}]},
|
||||
}}
|
||||
assert AgentArtifactsCommand.model_validate(payload).progress.diagram.node_refs[0].status == "running"
|
||||
payload["progress"]["diagram"]["node_refs"][0]["node_id"] = "QUER"
|
||||
with pytest.raises(ValidationError, match="QUER"):
|
||||
AgentArtifactsCommand.model_validate(payload)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("artifact", ["progress", "report"])
|
||||
def test_artifact_write_rejects_node_refs_missing_from_mermaid(artifact):
|
||||
diagram = {
|
||||
|
||||
Reference in New Issue
Block a user