VibeCoding / src /modules /skill /ports /repository.py
dellweb3's picture
Deploy verified conversational workbench and isolated Java application previews
caf8059 verified
Raw History Blame Contribute Delete
687 Bytes
"""Persistence port; SQL dialect and connection management belong to adapters."""
from typing import Protocol, ContextManager
class Transaction(Protocol):
def get(self, tenant: str, kind: str, key: str) -> dict | None: ...
def listing(self, tenant: str, kind: str) -> list[dict]: ...
def create(self, tenant: str, kind: str, key: str, body: dict) -> dict: ...
def update(self, tenant: str, kind: str, key: str, body: dict, expected_revision: int) -> dict: ...
def audit(self, tenant: str, user: str, action: str, target: str, digest: str): ...
class SkillRepository(Protocol):
def transaction(self, *, write: bool = False) -> ContextManager[Transaction]: ...