Skip to content

fix(migrate): keep sequence lifelines off inherited occurrence member names - #2132

Open
devin-ai-integration[bot] wants to merge 9 commits into
developfrom
fix/sequence-lifeline-self
Open

devin-ai-integration[bot] wants to merge 9 commits into
developfrom
fix/sequence-lifeline-self

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

What and why

A SysML v1 interaction migrated as an occurrence def could declare a lifeline usage named after a member every occurrence inherits, e.g. ref part self : X;, which hides Occurrence::self and draws warning[name-conflict]: Duplicate of inherited member name 'self' from Occurrence.

Where self comes from: the name is the source's own, not one the migrator made up. The Interaction owns a uml:Property literally named self (private, typed by a block, no aggregation, no stereotype), and an unnamed uml:Lifeline represents it. scenario.lifeline takes the represented property's name through nameFor. The interaction-scoped name set scenario.used started empty, so nothing reserved the inherited names. Activity and state bodies already reserve theirs (inheritedActionNames, inheritedStateNamesSet).

Fix: scenario now seeds its name set with every member name of Occurrences::Occurrence and its supertypes, read from the bundled standard library once and cached (inheritedOccurrenceNames). This covers both the occurrence-def and the occurrence-usage form. A clashing lifeline, message, step, parameter or interaction-use name is then renamed by the existing freshIn rule (self → self2). The represented property's migrated name follows its lifeline, so message ends (endRef) and DiagramLayout::Layout about … references all write the same name. The migration report gives the rename as "since an occurrence inherits a member named self".

Expressions that read a renamed interaction member resolve against the source name and are rewritten to the migrated one, so a default such as portionOfLife + 1 keeps working once its parameter becomes portionOfLife2. This covers qualified paths, forward references to later parameters, and reads through a lifeline's represented property. The cached name set is keyed by the active library index, so a library override in the same process reserves its own names.

Specification basis

  • The represented property is an ordinary interaction-owned property that happens to be called self. In UML 2.5.1 §17.3.4, self has a meaning only as a Lifeline's name keyword, where it stands for the object of the classifier that owns the interaction. These lifelines are unnamed, and the property is typed by the context's general classifier rather than by the context itself.
  • The inherited Occurrence::self is the occurrence itself: here, the interaction's own occurrence (KerML 1.0, Occurrences library). It is not a block instance. So pointing the lifeline at the inherited self, or redefining it, would change the meaning. Keeping the participant as its own usage under a distinct name keeps the source semantics.
  • No compliance row moves.

How it was verified

  • tests/migrate/sequence_names_test.go builds a block-owned interaction with a property self, an unnamed lifeline representing it, a second lifeline and a message. On develop it fails (sequence declares the inherited name self, plus the name-conflict warning). With the fix it passes, and it checks the message end and the Layout reference. interaction_names_internal_test.go covers the derived set, suffixing, and that the cached set is never mutated. Further sequence_names_test.go cases cover expressions that read renamed parameters and lifeline properties: defaults, forward and qualified references, and message arguments. sequence_library_names_test.go migrates under the bundled library and then two overrides in one process.
  • TMT-2024x (-migrate sysml -strict, then -validate):
    • develop: 33,108 mapped / 12,132 approximated / 6,161 unmapped; 0 errors; 17 name-conflict, 57 bound-feature-types, 3 subsetting-multiplicity.
    • this branch: 33,091 / 12,149 / 6,161; 0 errors; 57 bound-feature-types, 3 subsetting-multiplicity.
    • The 17 renamed properties move from mapped to approximated, because the existing rename reporting records a renamed element as approximated.
    • The .sysml diff is exactly 17 lines: ref part self → ref part self2.
  • Default migration with -layout (MTIP): the same count movement and 34 changed lines, which are the 17 declarations plus their 17 Layout about self → Layout about self2.
  • go build ./..., go vet ./..., gofmt, make lint and the full go test ./... (corpora provisioned) all pass. TestPSSMSuiteMigration passes, and no migration baseline moved.

Checklist

  • make test and make lint pass locally
  • 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 (compliance rows need nothing: the census is counted at docs build)
  • No internal work-item labels (waves, slices, F4, K5) in the body, docs, or changelog

Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/31010346b7e149fdaf7a6cdf176173cf
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/31010346b7e149fdaf7a6cdf176173cf?variant=devin
Requested by: @HuiJun


🟢 Devin Review found nothing to fix · View findings · Follow Devin's work

Devin Review

devin-ai-integration Bot and others added 2 commits November 11, 2026 07:48
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

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 marked this pull request as ready for review November 11, 2026 08:23
devin-ai-integration Bot and others added 2 commits November 11, 2026 08:31
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Devin Review found 2 findings. Devin automatically fixed all 2 findings.

Fixed by Devin (2)
  • Renamed roots strand sequence member references — Real: a root renamed to OccurrencesModel stopped the member rewrite, leaving ...Sequence::portionOfLife (type error). Root and member spellings are now computed together from the source references. Regression: TestSequenceExpressionThroughRenamedRoot.
  • Typed local reads retain inherited names — Real: {in x : Sequence; x.'self'.amount} kept 'self' (unresolved member). Typed locals are now followed through their declared type and member spans are rewritten, without renaming the local itself. Regression: TestSequenceExpressionTypedLocalMember.

View findings in Devin Review · Follow Devin's work

Devin Review

Co-Authored-By: jason.han <hanhuijun@gmail.com>
@devin-ai-integration devin-ai-integration Bot added the ci:full Run the full CI tier on this pull request, draft or not label Nov 11, 2026
@devin-ai-integration devin-ai-integration Bot removed the ci:full Run the full CI tier on this pull request, draft or not label Nov 11, 2026

This branch has not been deployed

No deployments
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