fix: correctness + reliability follow-ups across the intent generation stack#6267
Merged
Merged
Conversation
…n stack A review of the recent intent-DSL generation work surfaced several defects; each is fixed here at the outermost layer and covered by a test. - checks: document-level checks (itemsMin/itemsSumEqual) and the roll-up capacity guard threw a raw IllegalStateException, reaching REST as HTTP 500. Introduce the SDK type org.eclipse.dirigible.sdk.db.ValidationException and map it to 400 once in ControllerInvoker (framework-wide; the repository layer stays web-free). The generated Repository throws it; the emission IT now asserts an exact 400 (a 500 regression can no longer hide behind >=400). - generates (sourceStatus hook): the source status was flipped with a full-row updateWithoutEvent() merge of a snapshot loaded before the target + items were created, silently reverting concurrent writes to the source row. Flip only the status column via the targeted updateProperty primitive and reload for the -transitioned payload (matches the process-trigger write-back). - postings: the handler wrote target + items non-atomically and skipped on any existing target, so a mid-loop failure left a permanent half-post and concurrent redelivery could double-post. Make it idempotent + resumable (cloud-native: no cross-step transaction) - a complete post is a no-op, a half-post rebuilds its items; concurrent de-dup is best-effort until a UNIQUE back-reference key lands with schema constraint emission, and a genuinely failed post is unwound by a compensation action. - data-store-java: staleGenerationViews was a WeakHashMap whose value strongly references its key (the caller class), so entries were never collected and every republish pinned a retired ClientClassLoader. Invalidate the cache explicitly on each SessionFactory rebuild instead. - Harmonia where: header/manage dropdowns loaded only the filtered /search set into the option list used for label resolution, so an existing value outside the filter rendered blank on edit. Fetch that one value by id (preserves the /search perf). Also coerce a boolean /search filter value server-side so a boolean where: matches. - EntityController: a PUT to a non-existent immutable:true record returned 409 instead of 404 (the status-gated variant and delete were already correct). - report filter: the blunt "=="->"=" replace corrupted a value literal containing "=="; normalize only outside single-quoted string literals. - My shell config.js was a verbatim copy of the application shell's identity (projectName/basePath/aggregateReports); correct it to the personal shell. - docs: finish the immutableIn->immutableWhen / documentStatus->function:EntityStatus renames left half-done in README (broken TOC anchor), the assistant guide, and the module CLAUDE.md; correct the coverage overstatement. Tests: new IntentEngineIT render checks for the resumable posting and the targeted generates status flip; tightened IntentEmissionCoverageIT check assertions; a ControllerInvoker mapping unit test. Verified: emission IT, engine-intent unit tests, formatter:validate, and release-profile javadoc all pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A review of the recent intent-DSL generation work surfaced several defects. Each is fixed at the outermost layer and covered by a test.
Fixes
checks→ HTTP 400 (was 500). Document-level checks (itemsMin/itemsSumEqual) and the roll-up capacity guard threw a rawIllegalStateException, reaching REST as a 500. New SDK typeorg.eclipse.dirigible.sdk.db.ValidationException, mapped to 400 once inControllerInvoker(framework-wide; the repository layer stays web-free). The emission IT now asserts an exact 400 so a 500 regression can't hide behind>=400.generatessourceStatus: no stale-snapshot clobber. The source status was flipped with a full-rowupdateWithoutEvent()merge of a snapshot loaded before the target + items were created, silently reverting concurrent writes. Now flips only the status column via the targetedupdatePropertyprimitive and reloads for the-transitionedpayload.postings: idempotent + resumable. The handler wrote target+items non-atomically and skipped on any existing target → a mid-loop failure left a permanent half-post, and concurrent redelivery could double-post. Cloud-native fix (no cross-step transaction): a complete post is a no-op, a half-post rebuilds its items; concurrent de-dup is best-effort until a UNIQUE back-reference key lands with schema constraint emission, and a genuinely failed post is unwound by a compensation action.staleGenerationViewswas aWeakHashMapwhose value strongly references its key (the caller class), so entries were never collected and every republish pinned a retiredClientClassLoader. Now invalidated explicitly on eachSessionFactoryrebuild.wherelabel resolution. Header/manage dropdowns loaded only the filtered/searchset into the option list used for label resolution, so an existing value outside the filter rendered blank on edit; now that one value is fetched by id (preserves the/searchperf). Also coerces a boolean/searchfilter value server-side.immutable: true404-vs-409. A PUT to a non-existent append-only record returned 409 instead of 404 (delete and the status-gated variant were already correct).==normalization no longer corrupts a value literal containing==(normalized only outside single-quoted strings).config.jsidentity corrected (was a verbatim copy of the application shell's).immutableIn→immutableWhen/documentStatus→function: EntityStatusrenames left half-done (README broken TOC anchor, assistant guide, module CLAUDE.md); fix the coverage overstatement.Tests / verification
IntentEngineITrender checks: the resumable posting handler and the targetedgeneratesstatus flip.IntentEmissionCoverageITcheck assertions to exact 400.ControllerInvokermapping unit test (ValidationException → 400).IntentEmissionCoverageIT, engine-intent unit tests,formatter:validate, and release-profile javadoc all pass.🤖 Generated with Claude Code