Skip to content

fix(semantic): three wrong GetElementProperties answers (filtered imports, qualified targets, decision branches) - #2496

Merged
HuiJun merged 8 commits into
developfrom
fix/element-properties-reader-findings
Nov 21, 2026
Merged

HuiJun merged 8 commits into
developfrom
fix/element-properties-reader-findings

Conversation

@HuiJun

@HuiJun HuiJun commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

What and why

Three wrong answers of the symbol-backed GetElementProperties reader, each found by review of #2494 and each reproduced with a failing test before its fix.

Chained on #2494 (head c39536f), so until that merges this diff also shows its three commits. The change itself is the last five commits.

Model Before After
package Both { private import P::*[@Safety]; private import P::*[@Security]; } both imports import one filter package; Both.importedMembership = [P__A_om] a filter package each; [P__A_om, P__B_om]
transition qualified first a then S::b; the succession's target is a synthetic chain …_pend1_pchain the state P__S__b
decide d; if true then b; else c; the branch succession's target end owns no ReferenceSubsetting one, with referencedFeature = b (and c)

Specification basis

  • KerML 8.2.5.4 and SysML.xtext FilterPackage: each filtered import owns its own Package. filterPackageOf built both with the same key, so the structure collapsed them into one handle.
  • SysML.xtext TransitionSuccession: only a . step makes a feature chain. dottedTargetChain chained on every segment, :: included.
  • SysML.xtext TargetSuccession: the target end refers to the branch's target. successionEndReference had no case for a decision's branch.

It moves no row of docs/project/spec-compliance/.

How it was verified

Each test failed before its fix:

element_properties_filtered_imports_test.go:51: Both imports [P__A_om], want P__A_om and P__B_om
element_properties_filtered_imports_test.go:58: the two imports import [P__Both___400_fp P__Both___400_fp], want a filter package each
element_properties_qualified_target_test.go:20: the qualified target is [P__S__qualified_succession_pend1_pchain], want the state P__S__b
element_properties_decision_branch_test.go:39: P__Act___405_succession_pend1 owns reference subsettings [], want one

Try it: go test -count=1 ./internal/frontend/grpc -run 'TestElementPropertiesReadEachFilteredImportOfANamespace|TestElementPropertiesReadAQualifiedTransitionTarget|TestElementPropertiesReadADecisionBranchTargetEnd'

Baselines moved by their recorders only; every count moves toward agreement and no row is new:

  • Structure differential (-update-structure-differential), symbol reader against the written graph, examples root: Feature::ownedReferenceSubsetting different 93 → 0, Type::ownedSpecialization 100 → 7, Element::ownedRelationship 166 → 73, Type::feature 408 → 335.

  • Agreement ratchet (-update-agreement-ratchet): 4 rows removed; ReferenceSubsetting::@id 105 → 4, ReferenceUsage::ownedReferenceSubsetting 103 → 2, ReferenceUsage::member 228 → 151.

  • Derived census (derived-census -update -recorded-pilot): our element count rises toward the pilot's on four roots, for example examples 53774 → 53867 against the pilot's 57526.

The export is untouched, so the api-json differential and the convert goldens do not move.

Gate

All exit 0: go build ./..., go vet ./..., go vet -C tools ./..., gofmt -l on tracked files (empty), make lint, go test -count=1 ./... with the training, pilot and spec-example corpora required (140 packages ok), go test -C tools ./..., and -check of pilot-diff, derived-census -recorded-pilot, doc-counts, hideo-suite and pilot-apijson-diff.

Not run: -race, and the PSSM, reference-FMU and pilot-library-XMI gates beyond what go test ./... runs locally.

Not in this PR

  • A decision written without a name (then decide;) still has no element of its own, so its branches' successions answer no source.

Checklist

  • make test and make lint pass locally (make lint and go test ./... pass; the -race run of make test was not run)
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (see CONTRIBUTING.md)
  • Changelog entry added as changes/unreleased/<slug>.<section>.md, not as an edit to CHANGELOG.md
  • baselines regenerated and make docs-counts run if a gate count moved (doc-counts -check is current)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

Software Factory opened this PR for Jason
Implemented in session Fix the cross-MDK regression in #2042
Review with Devin · Open in Devin Desktop


devin-ai-integration Bot and others added 8 commits November 21, 2026 02:50
…orders them

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…lden for the pilot's flow order

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ential for the pilot's flow order

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…er package

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…t names, not a feature chain

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ferenceSubsetting

Co-Authored-By: jason.han <hanhuijun@gmail.com>
…for the three reader fixes

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@HuiJun
HuiJun added this pull request to the merge queue Nov 21, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to invalid changes in the merge commit Nov 21, 2026
@HuiJun
HuiJun added this pull request to the merge queue Nov 21, 2026
@devin-ai-integration devin-ai-integration Bot changed the title SWF(bug): fix three wrong GetElementProperties answers (filtered imports, qualified targets, decision branches) fix(semantic): three wrong GetElementProperties answers (filtered imports, qualified targets, decision branches) Nov 21, 2026
Merged via the queue into develop with commit f17bc5d Nov 21, 2026
62 of 64 checks passed
@HuiJun
HuiJun deleted the fix/element-properties-reader-findings branch November 21, 2026 16:03
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