Skip to content

fix(semantics): classify a transition's effect that is named effect - #2326

Merged
NicolasRouquette merged 1 commit into
fix/declared-end-feature-membership-nativefrom
fix/transition-effect-named-effect
Nov 16, 2026
Merged

NicolasRouquette merged 1 commit into
fix/declared-end-feature-membership-nativefrom
fix/transition-effect-named-effect

Conversation

@devin-ai-integration

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

Copy link
Copy Markdown
Contributor

What and why

Follow-up to #2274, addressing the review finding "Effects named effect retain old classification".

symbols/builder.go defineTransitionEffect returned at its existing-name guard (scope.LookupLocal("effect")) before reaching effectActionKind. A declared effect was therefore left a plain ActionUsage whenever the transition already had a member named effect:

  • transition t first a do action effect : A then b; — the effect itself is named effect;
  • transition t first a accept effect : Sig do action e then b; — another member (the trigger payload) is named effect.

The same effect under any other name is a PerformActionUsage. The kind is now set before the name is considered; the role name effect is still defined only when it is free, and a statement effect (do send …) still builds no role symbol when the name is taken, so no second symbol is created.

Base branch. #2274 was merged into fix/declared-end-feature-membership-native (the head of #2268), not into develop, so the code this corrects is not on develop yet. This PR is based on that branch so its diff is only the fix. Merge order: this PR into fix/declared-end-feature-membership-native, then that stack into develop; or retarget this PR to develop once the stack has landed.

Specification basis

SysML v2.1 §8.2.2.18.3: EffectBehaviorUsage : ActionUsage = … | TransitionPerformActionUsage | …, with TransitionPerformActionUsage : PerformActionUsage = PerformActionUsageDeclaration ( '{' ActionBodyItem* '}' )?. The metaclass follows from the production, not from the name the declaration gives the usage. No compliance row moves: the row "A transition's trigger, guard and effect are its owned features through TransitionFeatureMemberships" stays ⚠️ Approximate for the residuals its limitation text already names.

How it was verified

Regression cases, failing on the base branch (… is a actionUsage, want performActionUsage) and passing here:

  • internal/semantic/symbols/action_node_kind_test.go TestBuildClassifiesTransitionEffectsByTheirDeclaration — cases t7 (effect named effect) and t8 (trigger payload named effect).
  • internal/semantic/semantics/reflective_transition_ends_test.go TestTransitionReflectsItsEffectMetaclassAndEnds — cases t9 and t10, the same two shapes through the reflective effectAction metaclass, with source and target.

Run locally on this head: gofmt -l . (empty), go build ./..., go vet ./..., go test ./internal/semantic/..., go test ./tests/hygiene ./tests/export, make changelog-check — all passing. No export golden or baseline moved. The full go test ./..., make lint, the corpus sweep and the api-json differential were not re-run locally; CI covers them.

No new changelog fragment: the behaviour is the one changes/unreleased/transition-effect-perform-action.fixed.md (unreleased, from #2274) already describes.

Checklist

  • make test and make lint pass locally (not run in full locally; see above)
  • Tests added or updated for the change
  • Documentation extended where it already covers the surface (none covers it)
  • Changelog entry: covered by the existing unreleased fragment
  • No baseline or gate count moved
  • No internal work-item labels in the body, docs, or changelog

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


🟢 Devin Review found nothing to fix · View findings

Devin Review

defineTransitionEffect returned at the existing-name guard before giving a
declared effect the kind its declaration writes, so `do action effect : A`,
and a declared effect beside any other member named `effect`, stayed a plain
ActionUsage where the same effect under another name is a PerformActionUsage
(SysML v2.1 §8.2.2.18.3 EffectBehaviorUsage). The kind is now set before the
name is considered; the role name is still defined only when it is free.

Co-Authored-By: Nicolas Rouquette <nicolas.f.rouquette@jpl.nasa.gov>
@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 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: No Issues Found

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

Devin Review

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