docs(standards): vendor template into MCP bundle; add component tools + start_app prompt
This commit is contained in:
25
standards/mcp/templates/app/pipelines/shared/ports.py
Normal file
25
standards/mcp/templates/app/pipelines/shared/ports.py
Normal file
@@ -0,0 +1,25 @@
|
||||
"""# Summary
|
||||
|
||||
Shared pipeline ports — the contracts every pipeline family reuses.
|
||||
|
||||
A port is an abstract stage contract. Concrete families pin their implementations
|
||||
on a root's annotated slots; the DI library instantiates the tree.
|
||||
"""
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Any
|
||||
|
||||
|
||||
class FinalizePort(ABC):
|
||||
"""Terminal stage — turn normalized records into persisted resources."""
|
||||
|
||||
@abstractmethod
|
||||
async def finalize(self, records: list[dict[str, Any]]) -> list[Any]:
|
||||
"""Persist records and return the created resources."""
|
||||
|
||||
|
||||
class RegistryPort(ABC):
|
||||
"""Resolve a pattern / rule fragment by key."""
|
||||
|
||||
@abstractmethod
|
||||
def resolve(self, key: str) -> dict[str, Any]:
|
||||
"""Return the fragment registered under ``key``."""
|
||||
Reference in New Issue
Block a user