-
Notifications
You must be signed in to change notification settings - Fork 4
Development: Reuse compliance analysis across languages via snippet mapping
#2470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 31 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
76c5d6e
feat(ai): map translated compliance issues instead of re-analyzing ta…
ge94zec 9adc3e9
updated openapi
ge94zec 7946480
refactor: code
ge94zec 7433eeb
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec 5579180
updates:
ge94zec 97f4653
Merge remote-tracking branch 'origin/chore/2346-enhance-performance-f…
ge94zec bd80f96
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec 2d02039
updates:
ge94zec 23549fd
Merge remote-tracking branch 'origin/chore/2346-enhance-performance-f…
ge94zec 102ac7b
chore: update OpenAPI spec and generated client
github-actions[bot] b0c19fb
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec 8d001be
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec ee463f7
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec b7e0862
change requests
ge94zec 11e553a
chore: update OpenAPI spec and generated client
github-actions[bot] 26f3cbd
updated client
ge94zec 702dd6c
added AiServiceTest for analyze and map
ge94zec 3aa2f39
Merge remote-tracking branch 'origin/main' into chore/2346-enhance-pe…
ge94zec dced024
\`Bugfix\`: Restore full entity graph on findByIdWithCompliance
az108 9f21677
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec 630a36f
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec ba210c9
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec a035c0d
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec 71a0b76
feat: replace second compliance analysis with snippet mapping for tra…
ge94zec 8820354
ffix server test
ge94zec d8d704b
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec 48f651c
fix: improve compliance issue mapping for translated job descriptions
ge94zec 860c930
chore: update OpenAPI spec and generated client
github-actions[bot] ba889b1
fix client test
ge94zec ca5d5cc
Merge remote-tracking branch 'origin/chore/2346-enhance-performance-f…
ge94zec 62be17d
removed tests
ge94zec b757097
- changed Analyze prompt to original
ge94zec 520103a
chore: update OpenAPI spec and generated client
github-actions[bot] c046f8d
Merge branch 'main' into chore/2346-enhance-performance-for-compliance
ge94zec ad2aa73
- fix empty-value serialization
ge94zec 7c3b5ab
Merge remote-tracking branch 'origin/chore/2346-enhance-performance-f…
ge94zec 617f7d3
- avoid unnecessary null initialization
ge94zec 66c54e0
- fix empty-value serialization
ge94zec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/java/de/tum/cit/aet/ai/dto/MapComplianceIssuesRequestDTO.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| package de.tum.cit.aet.ai.dto; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import de.tum.cit.aet.ai.domain.ComplianceIssue; | ||
| import jakarta.validation.constraints.NotBlank; | ||
| import jakarta.validation.constraints.NotNull; | ||
| import java.util.List; | ||
| import java.util.UUID; | ||
|
|
||
| @JsonInclude | ||
| public record MapComplianceIssuesRequestDTO( | ||
|
ge94zec marked this conversation as resolved.
|
||
| String toLang, | ||
| UUID jobId, | ||
|
ge94zec marked this conversation as resolved.
Outdated
|
||
| @NotBlank String translatedText, | ||
| @NotNull List<ComplianceIssue> complianceIssues | ||
| ) {} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package de.tum.cit.aet.ai.util; | ||
|
|
||
| /** | ||
| * Validates mapped compliance snippets against the translated target text. | ||
| */ | ||
| public final class SnippetMatcher { | ||
|
|
||
| private SnippetMatcher() {} | ||
|
|
||
| /** | ||
| * Checks whether a non-empty candidate occurs verbatim in the target text. | ||
| * Matching is case-sensitive because the model copies the phrase verbatim and | ||
| * the client searches for that exact phrase in the editor. | ||
| * | ||
| * @param targetText translated job description | ||
| * @param candidate mapped compliance snippet | ||
| * @return {@code true} when the candidate is non-empty and occurs verbatim | ||
| */ | ||
| public static boolean isVerbatim(String targetText, String candidate) { | ||
| return candidate != null && !candidate.isEmpty() && targetText.contains(candidate); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JsonIncludewithout a value defaults toInclude.ALWAYS, which is Jackson's built-in default — so this annotation is a no-op and doesn't actually omit anything. It's also the only valueless@JsonIncludein the repo; the other 124 all carry an explicit value.Please use the documented default:
Per
server-development.mdx:104,NON_EMPTYis preferred;NON_NULLis only for when empty collections or strings are meaningful and should be sent. MatchesAssignSlotRequestDTOandBookSlotRequestDTO.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NON_EMPTY does not work here though because an empty complianceIssues list means “clear all issues for this language.” Omitting it makes the field null, causing @NotNull to return 400. The corresponding AiResourceTest reproduces this behavior.
This is the exception described in server-development.mdx: empty collections are meaningful and must be sent. I therefore switched to @JsonInclude(JsonInclude.Include.NON_NULL). I can also remove the annotation entirely if preferred for request DTOs.