generated from coulomb/repo-seed
Governed asset registry slice with asset creation, representations, metadata, lifecycle transitions, policy authorization, fail-closed denial, audit events, and version records
This commit is contained in:
54
src/kontextual_engine/ports/repositories.py
Normal file
54
src/kontextual_engine/ports/repositories.py
Normal file
@@ -0,0 +1,54 @@
|
||||
"""Repository ports for governed asset registry state."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Protocol
|
||||
|
||||
from kontextual_engine.core import (
|
||||
Actor,
|
||||
AssetRepresentation,
|
||||
AssetVersion,
|
||||
AuditEvent,
|
||||
KnowledgeAsset,
|
||||
LifecycleState,
|
||||
MetadataRecord,
|
||||
RepresentationKind,
|
||||
)
|
||||
|
||||
|
||||
class AssetRegistryRepository(Protocol):
|
||||
def save_actor(self, actor: Actor) -> Actor: ...
|
||||
def get_actor(self, actor_id: str) -> Actor: ...
|
||||
|
||||
def save_asset(self, asset: KnowledgeAsset) -> KnowledgeAsset: ...
|
||||
def get_asset(self, asset_id: str) -> KnowledgeAsset: ...
|
||||
def list_assets(
|
||||
self,
|
||||
*,
|
||||
lifecycle: LifecycleState | None = None,
|
||||
asset_type: str | None = None,
|
||||
) -> list[KnowledgeAsset]: ...
|
||||
|
||||
def save_representation(self, representation: AssetRepresentation) -> AssetRepresentation: ...
|
||||
def get_representation(self, representation_id: str) -> AssetRepresentation: ...
|
||||
def list_representations(
|
||||
self,
|
||||
*,
|
||||
asset_id: str | None = None,
|
||||
kind: RepresentationKind | None = None,
|
||||
) -> list[AssetRepresentation]: ...
|
||||
|
||||
def save_metadata_record(self, asset_id: str, record: MetadataRecord) -> MetadataRecord: ...
|
||||
def list_metadata_records(self, asset_id: str) -> list[MetadataRecord]: ...
|
||||
|
||||
def save_version(self, version: AssetVersion) -> AssetVersion: ...
|
||||
def list_versions(self, asset_id: str) -> list[AssetVersion]: ...
|
||||
|
||||
def save_audit_event(self, event: AuditEvent) -> AuditEvent: ...
|
||||
def list_audit_events(
|
||||
self,
|
||||
*,
|
||||
target: str | None = None,
|
||||
correlation_id: str | None = None,
|
||||
) -> list[AuditEvent]: ...
|
||||
|
||||
Reference in New Issue
Block a user