General: Align compliance rules and stabilize generation workflow - #2631
General: Align compliance rules and stabilize generation workflow#2631ge94zec wants to merge 13 commits into
General: Align compliance rules and stabilize generation workflow#2631Conversation
- load compliance rules via aiService and inject dynamically into analyze/generateDraft
Not up to standards ⛔🔴 Issues
|
| Category | Results |
|---|---|
| UnusedCode | 1 medium |
| ErrorProne | 1 medium |
| Security | 1 high |
| Complexity | 1 medium |
🟢 Metrics 32 complexity
Metric Results Complexity 32
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
📊 Client Test Coverage Too Low 🔍 View coverage locally: pnpm run test:ci
open build/test-results/vitest/coverage/index.html🌐 View coverage from GitHub: |
General: Modularize compliance rules
|
📊 Client Test Coverage Too Low 🔍 View coverage locally: pnpm run test:ci
open build/test-results/vitest/coverage/index.html🌐 View coverage from GitHub: |
|
🤖 No OpenAPI or client changes needed. |
General: Modularize compliance rules General: Update compliance rules in generation
…-rules-across-prompts' into chore/2535-modularize-compliance-rules-across-prompts
|
🤖 No OpenAPI or client changes needed. |
- add AiRun to centralize AbortController ownership and stale workflow detection - cancel active analysis and translation requests before starting generation -> prioritize generation - scope backend AI cancellation by job ID to avoid affecting other jobs or users - pass the job ID through generation and translation requests - return analysis score and compliance issues directly through JobAnalysisDTO - prevent persistence entities from leaking through the analysis API - add a dedicated streaming editor update method - remove redundant frontend score polling and additional job reloads - remove redundant analyze rules in AnalyzeComplianceText.st - add tests for cancellation, streaming, and editor behavior
|
📊 Client Test Coverage Too Low 🔍 View coverage locally: pnpm run test:ci
open build/test-results/vitest/coverage/index.html🌐 View coverage from GitHub: |
|
🤖 OpenAPI spec and client code auto-updated and committed. |
|
🤖 No OpenAPI or client changes needed. |
General: Update compliance rules in generationGeneral: Align compliance rules and stabilize generation workflo
General: Align compliance rules and stabilize generation workfloGeneral: Align compliance rules and stabilize generation workflow
…-rules-across-prompts' into chore/2535-modularize-compliance-rules-across-prompts
|
🤖 No OpenAPI or client changes needed. |
|
🤖 No OpenAPI or client changes needed. |
Checklist
General
Server
Motivation and Context
Translation, compliance analysis, and generation requests could overlap and finish out of order. A stale analysis or translation could then update the UI or the persisted job state after a newer generation had already completed, most visibly in the compliance score, which could briefly show the value belonging to an olderjob description.
The root cause on the server was that compliance analysis used a blocking
.call(), which could not be cancelled once started; on the client, nothing invalidated callbacks belonging to superseded runs.Description
Overall, these changes make the Generate → Translate → Analyze → Score workflow more deterministic. New generations take priority over outdated background work, stale results are discarded, and the displayed compliance score now corresponds to the latest analyzed version of the job description.
AiPriorityServicewithforeground(jobId, flux)/background(jobId, flux),scoped per job. Generation is foreground; translation and compliance analysis are
background. Starting a generation cancels ongoing background work for the same job.
.call()to.stream()so it can actually becancelled mid-flight; the response is reassembled and parsed via
BeanOutputConverter.AbortControllerfor generation,takeUntilfor the analysis request.POST /ai/jobs/analyzenow returnsJobAnalysisDTO(score + issues) instead ofComplianceIssue[]. Regenerate the API client.translateTextStreamtakes an additionaljobId.Steps for Testing
Prerequisites:
Review Progress
Code Review
Manual Tests
Screenshots
Test Coverage
Client
Server
Last updated: 2026-08-17 09:25:44 UTC