Skip to content

chore: remove convention dead code - #207

Merged
rorybyrne merged 1 commit into
mainfrom
chore/remove-convention-dead-code
Aug 14, 2026
Merged

chore: remove convention dead code#207
rorybyrne merged 1 commit into
mainfrom
chore/remove-convention-dead-code

Conversation

@rorybyrne

Copy link
Copy Markdown
Contributor

First of three PRs implementing #180. Pure deletion — no behaviour change — so the
Convention removal itself lands as a smaller, more reviewable diff.

Everything here was verified unreachable before deleting:

Removed Evidence
get_source_staging_dir / get_source_output_dir / _conv_id (both storage adapters) The only convention-keyed storage paths in the codebase, and zero callers in osa/ or tests/. Not on any port. The live ingest layout is keyed on ingest_run_id (infrastructure/storage/layout.py).
FeatureTable value object Exported from domain/feature/model/__init__.py, never constructed — grep "FeatureTable(" matches only the class definition.
ConventionRepository.exists() + impl No call sites; DepositionService.create null-checks get() instead.
ConventionService.node_domain Injected by the DI provider, never read in the service.
ResourceType.conv Never constructed.

Because none of the storage paths were ever written to, no blob migration is
required
when Convention goes.

Notes

  • uv.lock picks up a stale version sync (0.0.70.0.11). Not incidental —
    the ty pre-commit hook regenerates it and aborts the commit otherwise.
  • The WorkerPool cron scaffolding (_build_schedules_from_conventions, a stub
    returning []) is deliberately left in place. It's dead today, but PR 2
    rewires it to the new ingester registry rather than deleting and re-adding it.

Verification

  • 1529 unit tests pass (unchanged from baseline).
  • ruff check and ty check osa clean.

Refs #180

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Code Coverage

Package Line Rate Complexity Health
. 83% 0
application 100% 0
application.api 100% 0
application.api.mcp 80% 0
application.api.mcp.tools 89% 0
application.api.rest 76% 0
application.api.v1 88% 0
application.api.v1.routes 68% 0
application.api.v1.routes.data 93% 0
application.api.v1.routes.data.serializers 99% 0
application.event 100% 0
application.workflow 95% 0
domain 100% 0
domain.auth 100% 0
domain.auth.command 90% 0
domain.auth.event 100% 0
domain.auth.model 93% 0
domain.auth.port 99% 0
domain.auth.query 93% 0
domain.auth.service 91% 0
domain.auth.util 100% 0
domain.auth.util.di 79% 0
domain.curation 100% 0
domain.curation.adapter 100% 0
domain.curation.command 100% 0
domain.curation.event 100% 0
domain.curation.model 100% 0
domain.curation.port 100% 0
domain.curation.query 100% 0
domain.curation.service 100% 0
domain.data 100% 0
domain.data.model 97% 0
domain.data.port 100% 0
domain.data.query 93% 0
domain.data.service 83% 0
domain.data.util 100% 0
domain.data.util.di 89% 0
domain.deposition 100% 0
domain.deposition.adapter 100% 0
domain.deposition.command 91% 0
domain.deposition.event 100% 0
domain.deposition.model 94% 0
domain.deposition.port 100% 0
domain.deposition.query 87% 0
domain.deposition.service 97% 0
domain.deposition.util.di 95% 0
domain.feature 100% 0
domain.feature.event 0% 0
domain.feature.model 100% 0
domain.feature.port 100% 0
domain.feature.service 97% 0
domain.feature.util 100% 0
domain.feature.util.di 100% 0
domain.ingest 100% 0
domain.ingest.command 100% 0
domain.ingest.event 100% 0
domain.ingest.model 100% 0
domain.ingest.port 100% 0
domain.ingest.query 100% 0
domain.ingest.service 98% 0
domain.metadata 100% 0
domain.metadata.event 100% 0
domain.metadata.handler 100% 0
domain.metadata.model 0% 0
domain.metadata.port 100% 0
domain.metadata.service 93% 0
domain.metadata.util 100% 0
domain.metadata.util.di 100% 0
domain.record 100% 0
domain.record.adapter 100% 0
domain.record.command 100% 0
domain.record.event 100% 0
domain.record.model 100% 0
domain.record.port 100% 0
domain.record.query 100% 0
domain.record.service 66% 0
domain.semantics 100% 0
domain.semantics.command 94% 0
domain.semantics.event 100% 0
domain.semantics.handler 100% 0
domain.semantics.model 100% 0
domain.semantics.port 100% 0
domain.semantics.query 90% 0
domain.semantics.service 100% 0
domain.semantics.util 100% 0
domain.semantics.util.di 93% 0
domain.shared 96% 0
domain.shared.authorization 86% 0
domain.shared.model 92% 0
domain.shared.port 100% 0
domain.validation 100% 0
domain.validation.adapter 100% 0
domain.validation.command 98% 0
domain.validation.event 100% 0
domain.validation.model 97% 0
domain.validation.port 100% 0
domain.validation.query 100% 0
domain.validation.service 91% 0
domain.validation.util.di 94% 0
infrastructure 80% 0
infrastructure.auth 56% 0
infrastructure.data 35% 0
infrastructure.event 78% 0
infrastructure.http 92% 0
infrastructure.ingest 85% 0
infrastructure.k8s 77% 0
infrastructure.messaging 100% 0
infrastructure.oci 55% 0
infrastructure.persistence 70% 0
infrastructure.persistence.adapter 79% 0
infrastructure.persistence.mappers 62% 0
infrastructure.persistence.repository 38% 0
infrastructure.s3 39% 0
infrastructure.storage 100% 0
infrastructure.telemetry 100% 0
sdk 100% 0
util 100% 0
util.di 71% 0
Summary 80% (9913 / 12322) 0

@greptile-apps

greptile-apps Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Removes unreachable Convention-related code and its obsolete tests.

  • Removes the unused convention repository exists contract and implementation, along with the calling integration tests.
  • Deletes unused convention-keyed storage helpers, the FeatureTable value object, the Convention SRN resource type, and the unused service dependency.
  • Synchronizes the editable package version in uv.lock.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
server/osa/domain/deposition/port/convention_repository.py Removes the unused exists method from the repository protocol; the previously reported test callers have also been removed.
server/osa/infrastructure/persistence/repository/convention.py Removes the corresponding unused PostgreSQL repository implementation consistently with the port.
server/tests/integration/persistence/test_convention_repo.py Removes both obsolete exists tests, resolving the previous thread's test failure.
server/osa/domain/deposition/service/convention.py Removes the unread node_domain service dependency.
server/osa/domain/deposition/util/di/provider.py Updates dependency injection consistently with the simplified convention service.
server/osa/infrastructure/persistence/adapter/storage.py Deletes unused convention-keyed filesystem path helpers.
server/osa/infrastructure/s3/storage.py Deletes the equivalent unused convention-keyed S3 path helpers.
server/osa/domain/shared/model/srn.py Removes the unused Convention resource enum member.
server/uv.lock Synchronizes the editable OSA package version without changing resolved dependencies.

Reviews (2): Last reviewed commit: "chore: remove convention dead code" | Re-trigger Greptile

Comment on lines 20 to 23
self, *, limit: int | None = None, offset: int | None = None
) -> "List[Convention]": ...

@abstractmethod
async def exists(self, id: ConventionSlug) -> bool: ...

@abstractmethod

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Repository integration test calls removed method

When the convention repository integration tests run, they call repo.exists(...) after this method and its PostgreSQL implementation have been removed, causing both assertions to fail with AttributeError.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive — this PR's own diff removes those tests: test_exists_true and test_exists_false are deleted in the server/tests/integration/persistence/test_convention_repo.py hunk of this same PR (the two assertions this comment refers to). Verified on the branch head: git grep '\.exists(' over server/ finds no remaining caller of ConventionRepository.exists in source or tests — the only repository-exists caller left is ontology_repo.exists (osa/domain/semantics/service/schema.py:37), a different port this PR doesn't touch. No change needed.

Scaffolding that no code path reaches, removed ahead of the Convention
removal itself (#180) so the real change is smaller:

- `get_source_staging_dir` / `get_source_output_dir` / `_conv_id` in both
  storage adapters — the only convention-keyed storage paths, with zero
  callers. The live ingest layout is keyed on `ingest_run_id`.
- `FeatureTable` value object — exported, never constructed.
- `ConventionRepository.exists()` — no call sites; `DepositionService.create`
  null-checks `get()` instead.
- `ConventionService.node_domain` — injected, never read.
- `ResourceType.conv` — never constructed.

`uv.lock` picks up the stale version sync the pre-commit hook regenerates.

No behaviour change.
@rorybyrne
rorybyrne force-pushed the chore/remove-convention-dead-code branch from d0a651f to 075d526 Compare August 3, 2026 16:58
@rorybyrne
rorybyrne merged commit 66becd6 into main Aug 14, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant