Skip to content

refactor(tms): remove dead port interfaces and their unused mocks - #566

Open
emoss08 wants to merge 1 commit into
masterfrom
claude/dead-ports-b1j99m
Open

refactor(tms): remove dead port interfaces and their unused mocks#566
emoss08 wants to merge 1 commit into
masterfrom
claude/dead-ports-b1j99m

Conversation

@emoss08

@emoss08 emoss08 commented Aug 31, 2026

Copy link
Copy Markdown
Owner

Description

Removes seven port interfaces with no production consumer, verified by a full-repo reachability sweep of all 308 interfaces in core/ports/services and core/ports/repositories:

  • JurisdictionRuleCacheRepository — zero references anywhere, not even a mock.
  • TenantSyncService, VersionService, BankReceiptWorkItemService, DataRetentionCacheRepository, JournalReversalService, ManualJournalService — each referenced only by its own generated mock, and none of those mocks are used by any test. The handlers/resolvers for these features inject the concrete service types directly (the resolver fields that share these names hold *journalreversalservice.Service etc., not the ports), so behavior is unchanged.

All request/response structs stay — the concrete services and handlers consume them.

Kept deliberately:

  • EDIDocumentRepository — dead in production but a load-bearing test aggregate: its mock backs the ediservice and edihandler suites (one mock assigned into all eight repo fields).
  • TenantSyncDelta and the controlplane TenantSyncer chain — the unwired tenant-sync feature is activated separately in feat(tms): wire the control-plane tenant syncer into the app lifecycle #568.
  • .mockery.yamlall: true needs no per-interface edits; deleted interfaces simply won't regenerate.

Related Issue or Discussion

Follow-up from the codebase audit driving PRs #557#564 (dead TMS ports slice).

Type of Change

  • Bug fix
  • Feature
  • Documentation
  • Refactor
  • Tests
  • Build, CI, or infrastructure

Scope

  • 7 interface removals across internal/core/ports/services/ and internal/core/ports/repositories/
  • 6 unused mock files deleted from internal/testutil/mocks/
  • −2,638 lines, no additions beyond import cleanup

Validation

  • cd services/tms && go build ./... && go vet ./internal/core/ports/... ./internal/testutil/... — clean
  • go test ./internal/core/services/... ./internal/api/... — all pass
  • gofmt -l clean on touched packages
  • cd client && pnpm build / pnpm lint — not run; no client changes

Deployment Notes

Pure dead-code removal; no runtime behavior, API surface, or configuration changes.

Checklist

  • I kept the change focused and reviewable.
  • I followed AGENTS.md, CLAUDE.md, and existing repository patterns.
  • I added or updated tests for behavior changes, or explained why tests are not applicable.
  • I updated relevant documentation, examples, migrations, or configuration.
  • I did not include secrets, credentials, private customer data, unrelated refactors, or placeholder code.

🤖 Generated with Claude Code

https://claude.ai/code/session_015houJkqb8SuqPW4YpLoWCq


Generated by Claude Code

Seven port interfaces had no production consumer: nothing implemented
them via fx.As or compile-time assertion, and nothing injected them.
JurisdictionRuleCacheRepository had zero references anywhere; the other
six (TenantSyncService, VersionService, BankReceiptWorkItemService,
DataRetentionCacheRepository, JournalReversalService,
ManualJournalService) were referenced only by their own generated mocks,
none of which any test used. Handlers and resolvers for these features
inject the concrete service types directly, so behavior is unchanged;
all request/response structs stay because the concrete services and
handlers consume them.

Kept deliberately: EDIDocumentRepository (a test-fixture aggregate whose
mock backs the ediservice and edihandler suites), TenantSyncDelta and
the controlplane TenantSyncer chain (the unwired tenant-sync feature is
a separate build-or-remove decision), and the .mockery.yaml config
(all: true needs no per-interface edits).

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015houJkqb8SuqPW4YpLoWCq
@cloudflare-workers-and-pages

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
trenova-dash f6fcc7d Aug 31 2026, 08:38 PM

@cloudflare-workers-and-pages

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
trenova f6fcc7d Aug 31 2026, 08:38 PM

@coderabbitai

coderabbitai Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 59 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: f8eb4557-6e68-4d68-afb6-e7260e4fba16

📥 Commits

Reviewing files that changed from the base of the PR and between 4851f67 and f6fcc7d.

📒 Files selected for processing (13)
  • services/tms/internal/core/ports/repositories/dataretention.go
  • services/tms/internal/core/ports/repositories/permit.go
  • services/tms/internal/core/ports/services/bankreceiptworkitem.go
  • services/tms/internal/core/ports/services/journalreversal.go
  • services/tms/internal/core/ports/services/manualjournal.go
  • services/tms/internal/core/ports/services/platform.go
  • services/tms/internal/core/ports/services/version.go
  • services/tms/internal/testutil/mocks/mock_BankReceiptWorkItemService.go
  • services/tms/internal/testutil/mocks/mock_DataRetentionCacheRepository.go
  • services/tms/internal/testutil/mocks/mock_JournalReversalService.go
  • services/tms/internal/testutil/mocks/mock_ManualJournalService.go
  • services/tms/internal/testutil/mocks/mock_TenantSyncService.go
  • services/tms/internal/testutil/mocks/mock_VersionService.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

emoss08 commented Aug 31, 2026

Copy link
Copy Markdown
Owner Author

Standing down on the Workers Builds failures (trenova, trenova-dash): this PR only deletes Go interfaces and mocks in services/tms — nothing the Cloudflare client deploys build or consume. The same checks have failed on every recent commit regardless of content (Go-only PRs #557#564 included), a pre-existing environment issue whose logs are only visible in the Cloudflare dashboard, so no fix can be ported from here.


Generated by Claude Code

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.

2 participants