Accept, assignment, perform, if, while and for actions are reported as plain `ActionUsage`, and a succession flow as plain `FlowUsage`

オープン
#2,008 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go, python

調査の方向性

Start with internal/semantic/symbols/symbol.go for the Symbol kind vocabulary, then trace how parsed action and flow declarations receive their query metaclasses and symbol kinds. Use the reproductions in the issue and the C20/B20 cases in test-suite/data/models/C20.sysml and B20.sysml to check each action and succession flow. Done means the query API reports the expected metaclasses and the Symbol API reports matching kinds.

索引モデルが issue の本文から書いたものです。

説明

bug spec compliance

This issue was written with AI help. The model and the reproduction were run against the version below.

What happened

#1985 reported that a send action is reported as a plain ActionUsage, and #1992 fixes that for SendActionUsage. The same happens to every other kind of action node, and to succession flows. Both the Symbol API and the query API report the generic kind:

package P {
    private import ScalarValues::*;
    attribute def Sig;
    item def Fuel;
    port def SigPort;
    part def Tank { out item fuelOut : Fuel; }
    part def Engine { in item fuelIn : Fuel; }
    action def Notify;
    action def A {
        in sig : Sig;
        in p : SigPort;
        attribute count : Integer;
        action sendIt send sig via p;
        action acceptIt accept s : Sig via p;
        action assignIt assign count := 1;
        perform action performIt : Notify;
        action ifIt if count > 0 { action body1; }
        action whileIt while count < 3 { action body2; }
        action forIt for i : Integer in (1, 2, 3) { action body3; }
    }
    part def Vehicle {
        part tank : Tank;
        part engine : Engine;
        flow f of Fuel from tank.fuelOut to engine.fuelIn;
        succession flow sf of Fuel from tank.fuelOut to engine.fuelIn;
    }
}
import opensysml
m = opensysml.loads(SRC)            # m.ok is True, no diagnostics
types = {e.id: e.type for e in m.query({"@type": "Query"})}
for n in ["A::sendIt", "A::acceptIt", "A::assignIt", "A::performIt",
          "A::ifIt", "A::whileIt", "A::forIt", "Vehicle::f", "Vehicle::sf"]:
    qn = "P::" + n
    print(qn, m.get(qn).kind, types[qn])
P::A::sendIt     actionUsage  ActionUsage     (#1985)
P::A::acceptIt   actionUsage  ActionUsage
P::A::assignIt   actionUsage  ActionUsage
P::A::performIt  actionUsage  ActionUsage
P::A::ifIt       actionUsage  ActionUsage
P::A::whileIt    actionUsage  ActionUsage
P::A::forIt      actionUsage  ActionUsage
P::Vehicle::f    flowUsage    FlowUsage
P::Vehicle::sf   flowUsage    FlowUsage

A client therefore cannot tell an accept from an assignment or a loop, or a succession flow from an ordinary flow. The Symbol kind vocabulary in internal/semantic/symbols/symbol.go has no entry for any of these kinds. The results are the same in an action def body and in an action usage nested in a part def.

Expected
declaration metaclass
action acceptIt accept s : Sig via p; AcceptActionUsage
action assignIt assign count := 1; AssignmentActionUsage
perform action performIt : Notify; PerformActionUsage
action ifIt if count > 0 { ... } IfActionUsage
action whileIt while count < 3 { ... } WhileLoopActionUsage
action forIt for i : Integer in (...) { ... } ForLoopActionUsage
succession flow sf of Fuel from ... to ...; SuccessionFlowUsage

The query @type should be the metaclass. The Symbol kind should be the matching name in its own vocabulary (acceptActionUsage, ..., successionFlowUsage), as #1992 adds sendActionUsage.

This issue is about the kind only. #1985 also asked for the send's payload, sender and receiver. The matching reads here (accept payload and receiver, assignment referent, loop and if conditions, the performed action) are a follow-up and can be raised separately once the kinds exist.

For comparison, the SysML v2 Pilot Implementation (0.64.0-SNAPSHOT, commit 378a8700c) and sysml-toolkit (v0.11.3) report each metaclass above.

Version

OpenSysML develop at 1a8e4927dc (2026-11-05), built locally: sysml-grpc nightly-153-g1a8e4927dc, Python client from client/python. The Go API (client/opensysml) reports the same kinds.

Related
  • #1985, and its fix #1992: the same bug for SendActionUsage.
  • #2001: accept as a state's entry/do/exit action is a syntax error. This issue is about accept actions that do parse.
Found by

The test suite at https://github.com/hideo67/sysmlv2-tests, matrices C20 (kinds of action) and B20 (flows). Models: test-suite/data/models/C20.sysml and B20.sysml. Failing cases:

  • C20-007/008, 010/011, 013/014, 016/017, 019/020, 022/023: accept, assign, perform, if, while and for, read in an action def and in an action usage owned by a part def. (C20-001..005 are the send cases of #1985. Every third case is read through a typing usage and fails because of #1961 instead.)
  • B20-007, B20-010: succession flow with end depths 1 and 2, read in the part def. (B20-008/009/011/012 read them through usages and fail because of #1961 instead.)
主要言語
Go
スター
56
フォーク
17
平均マージ
12時間 31分
マージ済み PR(30日)
909

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Open-MBEE/OpenSysML のほかの issue

Open-MBEE/OpenSysML の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。