simplest categorical addition

This commit is contained in:
lda
2026-05-16 17:53:42 +07:00 Verified
parent 1140a7ccdd
commit 7dcfad92c1
6 changed files with 42 additions and 3 deletions
+14
View File
@@ -22,6 +22,7 @@ def test_create_workflow_artifact_from_plan_derives_boundary_schemas() -> None:
)
assert artifact.id == "echo"
assert artifact.kind == "workflow"
assert artifact.version == 1
assert artifact.title == "Echo"
assert artifact.input_schema["properties"]["text"]["type"] == "string"
@@ -32,6 +33,19 @@ def test_create_workflow_artifact_from_plan_derives_boundary_schemas() -> None:
assert artifact.created_from_catalog_version == "catalog-1"
def test_create_workflow_artifact_from_plan_accepts_wrapper_kind() -> None:
artifact = create_workflow_artifact_from_plan(
artifact_id="normalize_status",
version=1,
title="Normalize Status",
plan=_plan(),
outcomes=("done",),
kind="wrapper",
)
assert artifact.kind == "wrapper"
def test_create_workflow_artifact_from_plan_rejects_missing_boundary_schema() -> None:
plan = _plan()
plan.pop("output_schema")
+18
View File
@@ -38,6 +38,7 @@ def test_workflow_artifact_serializes_required_capability_contract() -> None:
dumped = artifact.model_dump(mode="json")
assert dumped["id"] == "summarize_docs"
assert dumped["kind"] == "workflow"
assert dumped["version"] == 1
assert dumped["outcomes"] == ["done", "failed"]
required = dumped["required_capabilities"]["context7.query-docs"]
@@ -45,6 +46,23 @@ def test_workflow_artifact_serializes_required_capability_contract() -> None:
assert required["input_schema_hash"] == "sha256:input"
def test_workflow_artifact_can_be_marked_as_wrapper_intent() -> None:
artifact = WorkflowArtifact(
id="normalize_status",
version=1,
title="Normalize Status",
kind="wrapper",
input_schema={"type": "object", "properties": {}},
output_schema={"type": "object", "properties": {}},
outcomes=("done", "needs_input"),
plan={"name": "normalize_status", "nodes": [], "edges": []},
)
dumped = artifact.model_dump(mode="json")
assert dumped["kind"] == "wrapper"
def test_workflow_deployment_binds_logical_sources_to_concrete_sources() -> None:
deployment = WorkflowDeployment(
id="summarize_docs.personal",