Skip to content

V2 benchfixes - #19

Open
dvaschenko wants to merge 3 commits into
v2from
v2-benchfixes
Open

V2 benchfixes#19
dvaschenko wants to merge 3 commits into
v2from
v2-benchfixes

Conversation

@dvaschenko

Copy link
Copy Markdown

Предложения по фиксам в скиллы по результатам прогона на GLM 5.2

dvaschenko and others added 3 commits July 10, 2026 16:28
Split the overloaded jmix-create-resource-role — which covered the access
model, resource roles AND row-level roles under one misleading name — into:

- jmix-role-based-access (new umbrella): the access model (resource roles are
  additive/no-deny; row-level roles are restrictive), security scope (UI/API),
  the mandatory ui.loginToUi login invariant, and DEBUG-logging diagnostics for
  silent access denials. Read before creating any role.
- jmix-create-resource-role: resource roles only; adds minimum-policy mapping
  (an action like confirm/approve = READ+UPDATE, not ALL), a gotcha against
  hand-rolling role checks via a raw GrantedAuthority (use AccessManager with
  CrudEntityContext/EntityAttributeContext), and a non-admin login self-check.
- jmix-create-row-level-role (new): @RowLevelRole with JPQL and predicate
  policies, incl. per-row write gating — previously buried under the
  resource-role name and hard to discover.

Why: when driving an LLM agent to build apps on the pack, domain-only roles
repeatedly could not log into the UI (generic "Login failed") because
ui.loginToUi / the built-in ui-minimal role was never mentioned — the single
most commonly missed defect. The umbrella now states it as a mandatory
invariant with a self-check. Identifiers verified against Jmix 2.8.2 jars.

AGENTS.md skill routing and .studio/skills-manifest.json updated accordingly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…view

Each item is a general framework-idiom gap or an inaccurate claim, verified
against Jmix 2.8.2 jars/sources:

- jmix-create-list-view: a column on a reference attribute needs the reference
  added to the fetch plan (this is an N+1/loading concern — defer the exact
  rules to jmix-configure-fetch-plan; it is NOT a "reference throws unfetched"
  crash, which is the local-attribute-in-a-partial-plan case). list_create /
  list_edit require an existing <Entity>.detail view (else NoSuchViewException
  on first click). Added a menu.xml <item> registration example.
- jmix-create-entity: a plain @manytoone needs an explicit fetch = LAZY (JPA
  defaults to EAGER); @column(unique = true) alone does not create the
  constraint (Liquibase builds the schema).
- jmix-create-liquibase-changelog: added an <addUniqueConstraint> example; the
  composition-child FK cascade now depends on the delete mode — soft-deleted
  entities cascade at the app layer (@onDelete, no DB onDelete), hard-deleted
  entities MUST declare onDelete="CASCADE" on the FK or the delete FK-violates
  (soft delete is NOT global — it applies only to Soft-Delete-trait entities).
- jmix-create-service: use .optional() for finders that may not match; added a
  gotcha that calling save() twice on one reference without reassigning the
  returned instance throws OptimisticLockException (stale @Version).
- jmix-create-detail-view: corrected the entityComboBox-bound-to-enum failure
  wording (it requires an entity Range, not an enumeration).

Why: surfaced by repeatedly building the same CRUD app with an LLM agent on the
pack — these are the defects the agent hit that compile and pass a green test
but fail (or degrade) at runtime.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@dvaschenko
dvaschenko requested review from Fedoseew and KartnDev July 10, 2026 13:41
## Row-Level roles
## Row-level roles

Row-level roles are a separate first-class concept from resource roles: a resource

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

is it fine deletion - just refactor im ok

- `@PredicateRowLevelPolicy(entityClass = ..., actions = {...})` is tested per
instance and covers ANY of `READ`, `CREATE`, `UPDATE`, `DELETE` — this is how you
gate WRITE operations per row (e.g. read all rows but UPDATE/DELETE only owned
ones). The method returns a `RowLevelPredicate` / `RowLevelBiPredicate`; use it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Probably we should mention here about performance issues for this mechanism?

.query("select e from Customer e where e.active = true")
.list();

// Finder that may not match: .one() throws when there is no match (or more than one).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

do we need this comment here?

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.

3 participants