Skip to content

fix: correctness + reliability follow-ups across the intent generation stack#6267

Merged
delchev merged 1 commit into
masterfrom
fix/intent-generation-review-followups
Jul 12, 2026
Merged

fix: correctness + reliability follow-ups across the intent generation stack#6267
delchev merged 1 commit into
masterfrom
fix/intent-generation-review-followups

Conversation

@delchev

@delchev delchev commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

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 raw IllegalStateException, reaching REST as a 500. New SDK type org.eclipse.dirigible.sdk.db.ValidationException, mapped to 400 once in ControllerInvoker (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.
  • generates sourceStatus: no stale-snapshot clobber. 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. Now flips only the status column via the targeted updateProperty primitive and reloads for the -transitioned payload.
  • 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.
  • Classloader leak. 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. Now invalidated explicitly on each SessionFactory rebuild.
  • Harmonia where label resolution. 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; now that one value is fetched by id (preserves the /search perf). Also coerces a boolean /search filter value server-side.
  • immutable: true 404-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).
  • Report filter == normalization no longer corrupts a value literal containing == (normalized only outside single-quoted strings).
  • My-shell config.js identity corrected (was a verbatim copy of the application shell's).
  • Docs: finish the immutableInimmutableWhen / documentStatusfunction: EntityStatus renames left half-done (README broken TOC anchor, assistant guide, module CLAUDE.md); fix the coverage overstatement.

Tests / verification

  • New IntentEngineIT render checks: the resumable posting handler and the targeted generates status flip.
  • Tightened IntentEmissionCoverageIT check assertions to exact 400.
  • New ControllerInvoker mapping unit test (ValidationException → 400).
  • Verified: IntentEmissionCoverageIT, engine-intent unit tests, formatter:validate, and release-profile javadoc all pass.

🤖 Generated with Claude Code

…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>
@delchev delchev merged commit d90b053 into master Jul 12, 2026
10 checks passed
@delchev delchev deleted the fix/intent-generation-review-followups branch July 12, 2026 06:25
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.

1 participant