Skip to content

Conversation

@dfuchss
Copy link
Member

@dfuchss dfuchss commented Dec 11, 2025

Now it shall be ensured that CacheParameters are used correctly.

Copilot AI review requested due to automatic review settings December 11, 2025 15:33
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the caching architecture to use a type-safe CacheParameter interface pattern instead of string arrays. The changes ensure that cache parameters are used correctly and consistently across the codebase through new ArchUnit tests that enforce architectural constraints.

Key Changes

  • Introduced CacheParameter interface with concrete implementations (ClassifierCacheParameter, EmbeddingCacheParameter) to replace string array parameters
  • Moved ClassifierCacheKey and EmbeddingCacheKey to dedicated subpackages (classifier and embedding)
  • Added comprehensive ArchUnit tests to enforce that CacheKey implementations use CacheParameter correctly and that CacheParameter implementations include all fields

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/cache/CacheParameter.java New interface defining the contract for cache parameters with a parameters() method
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/cache/classifier/ClassifierCacheParameter.java New record implementing CacheParameter for classifier caching, with backward compatibility for temperature
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/cache/embedding/EmbeddingCacheParameter.java New record implementing CacheParameter for embedding caching
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/cache/classifier/ClassifierCacheKey.java Moved to classifier subpackage and updated to use ClassifierCacheParameter in static factory method
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/cache/embedding/EmbeddingCacheKey.java Moved to embedding subpackage and updated to use EmbeddingCacheParameter in static factory method
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/cache/CacheKey.java Updated imports to reflect moved cache key classes
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/cache/CacheManager.java Simplified API to accept CacheParameter instead of string arrays; removed unused getCache(Path, boolean) method
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/classifier/ChatLanguageModelProvider.java Changed getCacheParameters() to return ClassifierCacheParameter instead of string array
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/classifier/SimpleClassifier.java Updated to use new cacheParameters() method and ClassifierCacheKey.of() with CacheParameter
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/classifier/ReasoningClassifier.java Updated to use new cacheParameters() method and ClassifierCacheKey.of() with CacheParameter
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/preprocessor/SummarizePreprocessor.java Updated to use new cacheParameters() method and ClassifierCacheKey.of() with CacheParameter
src/main/java/edu/kit/kastel/sdq/lissa/ratlr/embeddingcreator/CachedEmbeddingCreator.java Updated to use EmbeddingCacheParameter throughout and in EmbeddingCacheKey.of() calls
src/test/java/edu/kit/kastel/sdq/lissa/ratlr/ArchitectureTest.java Added two new ArchUnit rules to enforce CacheKey and CacheParameter implementation contracts

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings December 11, 2025 15:56

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings January 4, 2026 16:01

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as outdated.

@dfuchss dfuchss requested a review from DanielDango January 4, 2026 16:36
Copilot AI review requested due to automatic review settings January 4, 2026 16:39
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 4, 2026

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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