Repository navigation
fix(metamodel): type a change trigger's argument wrapper by its metaclass, not the trigger's node - #2432
Merged
Conversation
The payload a trigger names (`accept x : Sig`) was two symbols: the one the transition's scope declares and a ReferenceUsage synthesized for the accept. OwningMembership(x) answered the synthesized one's membership, whose member is not x, and x read as an ItemUsage the transition owned. The accept's payload parameter is now the declared symbol: a ReferenceUsage the accept owns through its ParameterMembership. Co-Authored-By: jason.han <hanhuijun@gmail.com>
The payload reads as a ReferenceUsage, which takes no implicit [1..1] by metaclass, so the conversion stopped writing the Multiplicity it owns. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…pt-payload-owning-membership
…ger payload Co-Authored-By: jason.han <hanhuijun@gmail.com>
The payload is declared as an item usage, so it took Items::Item as a type beside the one it declares (`accept x : ScalarValues::Integer`). Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ayload Co-Authored-By: jason.han <hanhuijun@gmail.com>
…lass, not the trigger's node Co-Authored-By: jason.han <hanhuijun@gmail.com>
…-argument-implied-type
…-argument-implied-type
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
devin-ai-integration
Bot
removed this pull request from the merge queue due to a manual request
Nov 20, 2026
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Chained behind #2425. This branch contains
refs/pull/2425/head09a230b (the accept-payload fixes ahead of it in the baseline lane) andorigin/develop8ec712f (where #2002 merged); one merge base.Refs #2002.
What and why
#2002 typed an expression declaring no typing by the function it invokes, and resolved a trigger's function from its syntax node:
*ast.TimeEvent→Triggers::TriggerAt/TriggerAfter,*ast.ChangeEvent→Triggers::TriggerWhen(structureExpressionFunctionininternal/semantic/metamodel/structure_implied_types.go). A change trigger's argument wrapper — theFeatureReferenceExpressionover the condition thataccept when readyowns throughin0/a0, as the pilot writes it (ExpressionChangeWrapperininternal/semantic/semantics/reflective_expression_parts.go) — shares the trigger'sChangeEventnode, so a structure that hands the wrapper out with that node had it typed as the trigger:Feature::typeandExpression::functionansweredTriggers::TriggerWhenwhere the wrapper, like the condition it refers to, evaluatesPerformances::Evaluation.structureExpressionFunctionnow resolves a trigger function only for an element that reflects as aTriggerInvocationExpression(structureIsTriggerInvocation, through the structure's metaclass); a part sharing the node falls to the base its own metaclass implies.Specification basis
KerML 1.1 Beta 2 §8.4.4.7 Expressions: an expression's
functionis its single result-typing Function; aFeatureReferenceExpressioninvokes none and specializesPerformances::evaluations, so its type isPerformances::Evaluation. SysML v2 §8.3.16TriggerInvocationExpression: only the invocation itself is typed byTriggers::TriggerWhen/TriggerAt/TriggerAfter. No compliance row moves.How it was verified
TestSymbolStructureChangeTriggerArgumentIsNotTypedAsTheTrigger(internal/semantic/metamodel/structure_change_trigger_test.go), written first and failing on the parent commit withargument wrapper's implied types = [TriggerWhen Evaluation], want [Evaluation]: walksaccept when readythrough the symbol-backed structure (the trigger types byTriggerWhen, the wrapper and the condition byEvaluation), then hands the wrapper and the trigger to a structure with the sharedChangeEventnode and checksstructureImpliedFeatureTypeson each.TestAPIJSONChangeTriggerArgumentIsNotTypedAsTheTrigger(internal/translate/export/api_json_change_trigger_bases_test.go): the element form of the same model types theTriggerInvocationExpressionbyTriggers::TriggerWhenand bothFeatureReferenceExpressions (the wrapper and the condition) byPerformances::Evaluation,functionalike.SymbolStructure.ElementFor, the graph structure), so the structure differential,derived-census -check -require-exporter,pilot-apijson-diff -check,pilot-diff -check, the convert goldens and the gRPC library table reproduce unchanged; nothing was re-recorded,training_examples_expected.txtuntouched.OPENSYSML_REQUIRE_TRAINING_CORPUS,_PILOT_CORPORA,_SPEC_EXAMPLES,_PILOT_LIBRARY_XMI,_PSSM_SUITE):go build,go vet(root and tools),gofmt -lempty,make lint,make extension-libraries-pin-check,make changelog-check,SPEC_COMPLIANCE_PAGE=forbid make spec-compliance-check,make docs-counts,go test -C tools ./...,go test ./tests/hygiene,go test ./....Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (compliance rows need nothing: the census is counted at docs build)F4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/c507b405abda4b6fb7b63448eca5b9c7
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/c507b405abda4b6fb7b63448eca5b9c7?variant=devin
Requested by: @HuiJun
🟢 Devin Review found nothing to fix · View findings