Skip to content

Let a module opt out of the redundant stated IsA policy - #2

Open
dionmcm wants to merge 1 commit into
developfrom
ext/redundant-isa-core-module
Open

Let a module opt out of the redundant stated IsA policy#2
dionmcm wants to merge 1 commit into
developfrom
ext/redundant-isa-core-module

Conversation

@dionmcm

@dionmcm dionmcm commented Aug 28, 2026

Copy link
Copy Markdown
Member

Redundantly-stated IsA is an editorial policy, and not every edition has adopted it.

AMT and AU clinical content state redundant IsA relationships because they do not follow the proximal primitive modelling pattern - this has been discussed many times, there are pros and cons and it is a design choice.

Currently the rules don't enable this design choice, reporting it as failures.

Change

The rule fires for every module except those listed under redundant-isa-exempt-modules in the test resources.

Behaviour is unchanged for any module not listed in this resource. This allows extensions to optionally opt out of this rule for just their module content while still allowing the rule to run where it should.

Depends on isInNamedSet

The rule needs a way to read a set of module ids from reference data. Rules can currently reach that store only through isSemanticTagCompatibleWithinHierarchy, which extracts a semantic tag from a term first, so a module id cannot go through it.

isInNamedSet on DescriptionService is the companion change. It is defaulted so implementations outside the project keep compiling, and the default answers false so this rule keeps firing everywhere on any implementation that has not adopted it.

This means the rule cannot be merged before a release carrying isInNamedSet. A rule calling a method the deployed engine does not have fails at KieBase build, which takes down the whole rule set rather than this one rule.

Verification

722,404-concept edition, rule sets common-authoring,au-authoring, same reference data both times except for the one added line:

findings
key absent 352,500 byte-identical to unmodified rules
redundant-isa-exempt-modules=32506021000036107 346,263 6,237 dropped, 0 added

Every one of the 6,237 is on the module named in the key. The 287 findings on inherited international core-module concepts are all still reported.

The dropped set is identical to the set the core-module version dropped, so the change in mechanism costs nothing in outcome for this edition.

Test cases

The rule directory's test-cases.json had empty assertConceptsPass and assertConceptsFail arrays so no coverage. Added a fixture - a grandparent, a parent stated under it, and a concept on an extension module stating both.

  • With no redundant-isa-exempt-modules key, the rule fires. That is the safety property, tested.
  • Add the module to the key in the test resources and the rule goes quiet, and the fixture reports "a concept from the assertConceptsFail set actually passed". Proves opt-out works.

RulesTestManual runs 109 rule directories, all pass with this change.

This needs TestDescriptionService.isInNamedSet, which is part of the engine PR - without it the rig only ever sees the interface default and no named-set rule can be tested configured.

@dionmcm
dionmcm force-pushed the ext/redundant-isa-core-module branch from f6f7a97 to e2b1b6a Compare August 29, 2026 05:20
@dionmcm dionmcm changed the title Scope the redundant stated IsA rule to the modules whose policy it is Let a module opt out of the redundant stated IsA policy Aug 29, 2026
@dionmcm
dionmcm changed the base branch from master to develop August 29, 2026 05:41
Redundantly-stated IsA is an editorial policy, and not every edition has adopted
it. AMT and AU clinical content state both an AMT parent and the international
top parent it sits under, deliberately. It is not confined to the drug
hierarchy, so a semantic-tag exemption is the wrong shape for it.

The rule now fires for every module except those listed under
redundant-isa-exempt-modules in the test resources. An edition that lists
nothing - which is every edition until it chooses otherwise - gets exactly the
behaviour this rule had before the key existed. An extension whose maintainers
do want the policy keeps it, which scoping the rule to core modules would have
taken away from them.

Requires isInNamedSet on DescriptionService.

Measured over a 722,404-concept edition, rule sets common-authoring,au-authoring:

  key absent   352,500 findings, byte-identical to unmodified rules
  key = AU     346,263 findings, 6,237 dropped, 0 added

Every one of the 6,237 is on the module named in the key. The 287 findings on
inherited international core-module concepts are all still reported.
@dionmcm
dionmcm force-pushed the ext/redundant-isa-core-module branch from e2b1b6a to d116d13 Compare August 29, 2026 06:46
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