feat(edit): author state transitions, sub-states and behavior parameters - #616
Merged
Merged
Conversation
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…sition Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Contributor
Author
|
End-to-end test of 5d0dfd3: the worktree Python client against a freshly built
|
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration Bot
added a commit
that referenced
this pull request
Sep 26, 2026
Co-Authored-By: jason.han <hanhuijun@gmail.com>
6 tasks
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
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.
What and why
Covers the authoring gaps still open after #609 and #611.
AddTransitionEdit add_transition = 9operation, gated by the newtransition_authoringcapability (appended to the capability list), writestransition [name] first <source> [accept <trigger>] [if <guard>] [do <effect>] then <target>;or, with
initial, the entry transitionentry; then <target>;. It is a separate operation rather than new fields onAddConnectionEditbecause an older service would silently drop the extra fields. Trigger, guard and effect are free text, so the written transition is parsed on its own first. It must be exactly oneTransitionMemberwhose name, source, target, trigger, guard and effect source text match the request exactly. Anything else (e.g.X; part p,X then idle, a stray}) is refused withInvalidValue. The edit is refused for owners that are not state bodies, for KerML sources, and for a second entry action.TransitionUsage/TargetTransitionUsageproductions admit at most oneaccept,ifanddoclause, in that order.parseTransitionTailreports a repeated clause (a transition has at most one 'if' clause) and an out-of-order one at its keyword. Before this, a secondifsilently replaced the first guard.state x;inside a state body parses asSubstateMember, and it could not be used as an add or move owner (OwnerNotNamespaceError). It is now accepted as an owner with the state-usage body context, and the edit opens its body when needed.add_transition(owner, source, target, name=None, trigger=None, guard=None, effect=None)andadd_entry_transition(owner, target). Go addsAddTransitionandAddEntryTransition, and Java addsEdit.AddTransition. All three check fortransition_authoringbefore sending.add_calc_defandadd_calcacceptinputs=[(name, type)],return_typeandreturn_expression(an expression requires a return type).add_action_defandadd_actionacceptinputsandoutputs. Each expands into the existingadd_member/add_parameter/add_returnoperations in the same batch. The result isin ref x : T;andreturn : T = expr;; they never writereturn <expr>;.develop: a top-levelattribute :>> tempo = Tempo::operative;already exportssysml:redefinesandsysml:valuein Turtle. This PR adds a regression test for it.Closes #602. Closes #604. Closes #605. Closes #88.
Specification basis
Pinned pilot grammar (SysML.xtext):
TransitionUsage:TransitionUsageKeyword (UsageDeclaration? 'first')? TransitionSourceMember … (TriggerActionMember)? (GuardExpressionMember)? (EffectBehaviorMember)? 'then' TransitionSuccessionMember, withTriggerFeatureKind: 'accept'.EntryActionMemberwith an empty action, followed byEntryTransitionMember, givesentry; then <target>;.StateBodyPartadmits nested state usages and transitions.ReturnParameterMemberis'return' UsageElement. There is noreturn <expression>form.Always writing
first <source>avoids the unnamed form, in which a leading identifier would be read as the source. No spec-compliance row moves.How it was verified
sysml-grpcfor the toaster state machine (nested sub-state, entry transition, twoaccepttransitions), the Editor API: add_calc_def should support inputs and return expression #604DeliveredEnergycalculation and the Editor API: add_action / add_action_def should support parameters, sequencing, nested actions #605BreadHandlingaction. Each reloads with no diagnostics (127 passed, 0 skipped).add_transitionscenario.make build-grpc,make lint docs-check proto-lint proto-breaking,python3 scripts/changelog.py check, and the OMG training and pilot corpus gates.Checklist
make testandmake lintpass locally (lint and targeted suites run locally; full suite in CI)changes/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)Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/ee3f85506c5d4cb88bc8da2e0de696c0
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/ee3f85506c5d4cb88bc8da2e0de696c0?variant=devin
Requested by: @HuiJun