diff --git a/server/osa/domain/deposition/port/convention_repository.py b/server/osa/domain/deposition/port/convention_repository.py index e4c30731..6e44b9b5 100644 --- a/server/osa/domain/deposition/port/convention_repository.py +++ b/server/osa/domain/deposition/port/convention_repository.py @@ -20,9 +20,6 @@ async def list( self, *, limit: int | None = None, offset: int | None = None ) -> "List[Convention]": ... - @abstractmethod - async def exists(self, id: ConventionSlug) -> bool: ... - @abstractmethod async def list_with_source(self) -> "List[Convention]": """Return conventions that have a source defined (SQL-level filter).""" diff --git a/server/osa/domain/deposition/service/convention.py b/server/osa/domain/deposition/service/convention.py index bd7c21c7..4b8727e6 100644 --- a/server/osa/domain/deposition/service/convention.py +++ b/server/osa/domain/deposition/service/convention.py @@ -15,7 +15,6 @@ from osa.domain.shared.model.source import IngesterDefinition from osa.domain.shared.model.srn import ( ConventionSlug, - Domain, LocalId, SchemaId, SchemaIdentifier, @@ -32,7 +31,6 @@ class ConventionService(Service): metadata_service: MetadataService # TODO: replace with a port? hook_registry: HookRegistryService outbox: Outbox - node_domain: Domain async def deploy( self, diff --git a/server/osa/domain/deposition/util/di/provider.py b/server/osa/domain/deposition/util/di/provider.py index 8cf64381..3cfba6b3 100644 --- a/server/osa/domain/deposition/util/di/provider.py +++ b/server/osa/domain/deposition/util/di/provider.py @@ -57,7 +57,6 @@ def get_convention_service( metadata_service: MetadataService, hook_registry: HookRegistryService, outbox: Outbox, - config: Config, ) -> ConventionService: return ConventionService( convention_repo=convention_repo, @@ -65,7 +64,6 @@ def get_convention_service( metadata_service=metadata_service, hook_registry=hook_registry, outbox=outbox, - node_domain=Domain(config.domain), ) @provide(scope=Scope.APP) diff --git a/server/osa/domain/feature/model/__init__.py b/server/osa/domain/feature/model/__init__.py index f12cc813..e69de29b 100644 --- a/server/osa/domain/feature/model/__init__.py +++ b/server/osa/domain/feature/model/__init__.py @@ -1,3 +0,0 @@ -from osa.domain.feature.model.feature import FeatureTable - -__all__ = ["FeatureTable"] diff --git a/server/osa/domain/feature/model/feature.py b/server/osa/domain/feature/model/feature.py deleted file mode 100644 index f7e0f40e..00000000 --- a/server/osa/domain/feature/model/feature.py +++ /dev/null @@ -1,18 +0,0 @@ -"""Feature table value object — represents a physical SQL table for hook features.""" - -from osa.domain.shared.model.hook import ColumnDef -from osa.domain.shared.model.value import ValueObject - - -class FeatureTable(ValueObject): - """Describes a physical SQL table for storing hook-derived features. - - Deterministically derived from convention ID + hook manifest. - Not stored on Convention — computed by FeatureStore. - """ - - convention_id: str # todo: use a NewType - hook_name: str # possibly use a NewType? - pg_schema: str # possibly use a NewType? - table_name: str # possibly use a NewType? - columns: list[ColumnDef] diff --git a/server/osa/domain/shared/model/srn.py b/server/osa/domain/shared/model/srn.py index 261f7810..f7982826 100644 --- a/server/osa/domain/shared/model/srn.py +++ b/server/osa/domain/shared/model/srn.py @@ -130,7 +130,6 @@ class ResourceType(str, Enum): dep = "dep" schema = "schema" onto = "onto" - conv = "conv" snap = "snap" evt = "evt" val = "val" diff --git a/server/osa/infrastructure/persistence/adapter/storage.py b/server/osa/infrastructure/persistence/adapter/storage.py index d628fc6c..a8003a1f 100644 --- a/server/osa/infrastructure/persistence/adapter/storage.py +++ b/server/osa/infrastructure/persistence/adapter/storage.py @@ -13,7 +13,7 @@ from osa.domain.deposition.port.storage import FileStoragePort from osa.domain.shared.error import InfrastructureError from osa.domain.shared.model.provenance import RunRef -from osa.domain.shared.model.srn import ConventionSlug, DepositionSRN +from osa.domain.shared.model.srn import DepositionSRN from osa.domain.validation.model.batch_outcome import ( BatchRecordOutcome, HookRecordId, @@ -211,19 +211,6 @@ async def delete_files_for_deposition( if dep_dir.exists(): shutil.rmtree(dep_dir) - def _conv_id(self, convention_id: ConventionSlug) -> str: - return convention_id.root - - def get_source_staging_dir(self, convention_id: ConventionSlug, run_id: str) -> Path: - staging = self.base_path / "sources" / self._conv_id(convention_id) / "staging" / run_id - staging.mkdir(parents=True, exist_ok=True) - return staging - - def get_source_output_dir(self, convention_id: ConventionSlug, run_id: str) -> Path: - output = self.base_path / "sources" / self._conv_id(convention_id) / "runs" / run_id - output.mkdir(parents=True, exist_ok=True) - return output - async def move_source_files_to_deposition( self, staging_dir: Path, diff --git a/server/osa/infrastructure/persistence/repository/convention.py b/server/osa/infrastructure/persistence/repository/convention.py index 72764706..0944706f 100644 --- a/server/osa/infrastructure/persistence/repository/convention.py +++ b/server/osa/infrastructure/persistence/repository/convention.py @@ -90,11 +90,6 @@ async def list( result = await self.session.execute(stmt) return [_row_to_convention(dict(r)) for r in result.mappings().all()] - async def exists(self, id: ConventionSlug) -> bool: - stmt = select(conventions_table.c.id).where(conventions_table.c.id == id.root) - result = await self.session.execute(stmt) - return result.first() is not None - async def list_with_source(self) -> List[Convention]: stmt = ( select(conventions_table) diff --git a/server/osa/infrastructure/s3/storage.py b/server/osa/infrastructure/s3/storage.py index a7f4dfcf..12085469 100644 --- a/server/osa/infrastructure/s3/storage.py +++ b/server/osa/infrastructure/s3/storage.py @@ -16,7 +16,7 @@ from osa.domain.deposition.port.storage import FileStoragePort from osa.domain.shared.error import InfrastructureError, NotFoundError from osa.domain.shared.model.provenance import RunRef -from osa.domain.shared.model.srn import ConventionSlug, DepositionSRN +from osa.domain.shared.model.srn import DepositionSRN from osa.domain.validation.model.batch_outcome import ( BatchRecordOutcome, HookRecordId, @@ -48,9 +48,6 @@ def __init__(self, s3: S3Client, data_mount_path: str) -> None: def _safe_id(self, srn: DepositionSRN) -> str: return f"{srn.domain.root}_{srn.id.root}" - def _conv_id(self, convention_id: ConventionSlug) -> str: - return convention_id.root - def _dep_prefix(self, deposition_id: DepositionSRN) -> str: return f"depositions/{self._safe_id(deposition_id)}" @@ -123,22 +120,6 @@ async def delete_files_for_deposition( # ── Ingester storage ────────────────────────────────────────────── - def get_source_staging_dir(self, convention_id: ConventionSlug, run_id: str) -> Path: - """Return path for PVC subpath computation (no I/O).""" - return ( - Path(self._data_mount_path) - / "sources" - / self._conv_id(convention_id) - / "staging" - / run_id - ) - - def get_source_output_dir(self, convention_id: ConventionSlug, run_id: str) -> Path: - """Return path for PVC subpath computation (no I/O).""" - return ( - Path(self._data_mount_path) / "sources" / self._conv_id(convention_id) / "runs" / run_id - ) - async def move_source_files_to_deposition( self, staging_dir: Path, diff --git a/server/tests/integration/persistence/test_convention_repo.py b/server/tests/integration/persistence/test_convention_repo.py index c39be0c9..f6aea231 100644 --- a/server/tests/integration/persistence/test_convention_repo.py +++ b/server/tests/integration/persistence/test_convention_repo.py @@ -163,18 +163,6 @@ async def test_list_with_limit_and_offset(self, pg_session: AsyncSession): page = await repo.list(limit=2, offset=1) assert len(page) == 2 - async def test_exists_true(self, pg_session: AsyncSession): - repo = PostgresConventionRepository(pg_session) - conv = _make_convention() - await repo.save(conv) - await pg_session.commit() - - assert await repo.exists(conv.id) is True - - async def test_exists_false(self, pg_session: AsyncSession): - repo = PostgresConventionRepository(pg_session) - assert await repo.exists(ConventionSlug.parse("nope-nope")) is False - async def test_convention_without_ingester(self, pg_session: AsyncSession): """Ingester is optional — should be None on retrieval when not set.""" repo = PostgresConventionRepository(pg_session) diff --git a/server/tests/integration/test_bulk_publish_dual_write.py b/server/tests/integration/test_bulk_publish_dual_write.py index 6d214107..bb57be50 100644 --- a/server/tests/integration/test_bulk_publish_dual_write.py +++ b/server/tests/integration/test_bulk_publish_dual_write.py @@ -79,7 +79,6 @@ async def _register_convention( metadata_service=metadata_service, hook_registry=HookRegistryService(registry=PostgresHookRegistry(pg_session)), outbox=AsyncMock(), - node_domain=Domain("localhost"), ) # Bundled deploy: schema + typed metadata table + convention, one txn. # Use the slug for both the convention and its schema so the typed table is diff --git a/server/tests/unit/domain/deposition/test_convention_service.py b/server/tests/unit/domain/deposition/test_convention_service.py index f1433ef4..7ed28acd 100644 --- a/server/tests/unit/domain/deposition/test_convention_service.py +++ b/server/tests/unit/domain/deposition/test_convention_service.py @@ -21,7 +21,6 @@ ) from osa.domain.shared.model.srn import ( ConventionSlug, - Domain, SchemaId, SchemaIdentifier, ) @@ -90,7 +89,6 @@ def _make_service( metadata_service=AsyncMock(), hook_registry=hook_registry or AsyncMock(), outbox=outbox or AsyncMock(), - node_domain=Domain("localhost"), ) diff --git a/server/tests/unit/domain/deposition/test_convention_service_v2.py b/server/tests/unit/domain/deposition/test_convention_service_v2.py index 41194b5c..96342e80 100644 --- a/server/tests/unit/domain/deposition/test_convention_service_v2.py +++ b/server/tests/unit/domain/deposition/test_convention_service_v2.py @@ -21,7 +21,6 @@ from osa.domain.shared.model.source import IngesterDefinition from osa.domain.shared.model.srn import ( ConventionSlug, - Domain, SchemaId, SchemaIdentifier, ) @@ -101,7 +100,6 @@ def _make_service( metadata_service=AsyncMock(), hook_registry=hook_registry or AsyncMock(), outbox=outbox or AsyncMock(), - node_domain=Domain("localhost"), ) diff --git a/server/uv.lock b/server/uv.lock index e2312a34..266236f1 100644 --- a/server/uv.lock +++ b/server/uv.lock @@ -1188,7 +1188,7 @@ wheels = [ [[package]] name = "osa" -version = "0.0.7" +version = "0.0.11" source = { editable = "." } dependencies = [ { name = "aiodocker", marker = "(platform_machine == 'arm64' and sys_platform == 'darwin') or (platform_machine == 'aarch64' and sys_platform == 'linux') or (platform_machine == 'x86_64' and sys_platform == 'linux')" },