feat: mark wf builtins as platform sources
This commit is contained in:
@@ -33,6 +33,7 @@ from wf_platform import (
|
||||
CapabilityBuckets,
|
||||
CapabilitySource,
|
||||
SourcePermissions,
|
||||
SourcePolicy,
|
||||
SourceVisibility,
|
||||
)
|
||||
|
||||
@@ -170,6 +171,7 @@ def builtin_sources() -> dict[str, CapabilitySource]:
|
||||
admin_dashboard=True,
|
||||
),
|
||||
permissions=SourcePermissions(safe_for_workflow=True),
|
||||
policy=SourcePolicy(platform=True, binding_required=False),
|
||||
description="Workflow standard-library nodes.",
|
||||
),
|
||||
RECIPE_SOURCE_ID: CapabilitySource(
|
||||
@@ -182,6 +184,7 @@ def builtin_sources() -> dict[str, CapabilitySource]:
|
||||
admin_dashboard=True,
|
||||
),
|
||||
permissions=SourcePermissions(safe_for_workflow=True),
|
||||
policy=SourcePolicy(platform=True, binding_required=False),
|
||||
description="First-party workflow recipes composed from standard nodes.",
|
||||
),
|
||||
}
|
||||
|
||||
@@ -518,6 +518,15 @@ def test_source_catalog_finds_local_documentation_resource_directly(
|
||||
assert result.uri == test_resource.uri
|
||||
|
||||
|
||||
def test_broker_local_sources_are_platform_sources(tmp_path: Path) -> None:
|
||||
service = WfMcpService(store=FileStore(tmp_path / "platform_sources"))
|
||||
|
||||
wf_recipes = service.capability_sources["wf.recipes"]
|
||||
|
||||
assert wf_recipes.policy.platform is True
|
||||
assert wf_recipes.policy.binding_required is False
|
||||
|
||||
|
||||
def test_source_catalog_uses_catalog_store_only(tmp_path: Path) -> None:
|
||||
catalog_store = FileCatalogStore(tmp_path / "catalog")
|
||||
service = SourceCatalogService(
|
||||
|
||||
@@ -150,3 +150,12 @@ def test_local_static_server_has_no_source_registry_admin(tmp_path) -> None:
|
||||
server = build_local_static_workflow_server(tmp_path / "store")
|
||||
|
||||
assert server.source_registry_admin is None
|
||||
|
||||
|
||||
def test_local_static_builtins_are_platform_sources(tmp_path) -> None:
|
||||
server = build_local_static_workflow_server(tmp_path)
|
||||
|
||||
wf_std = server.context.specs.capability_sources["wf.std"]
|
||||
|
||||
assert wf_std.policy.platform is True
|
||||
assert wf_std.policy.binding_required is False
|
||||
|
||||
Reference in New Issue
Block a user