docs(project): record the protocol state-machine design - #464
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
|
Confirmed, and it is worse than "not reported": with the machine on the part ( Corrected in 9d768d3: the table row and gap now distinguish the direct-injection path ( |
Document the current protocol-state-machine capabilities and limitations.\nAdd the design record to project documentation and navigation. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Point the record's Track E link at the landed roadmap heading.\nKeep the documentation site link checker green. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
9d768d3 to
0ad8505
Compare
What and why
The roadmap's protocol-state-machines item left one piece of work: a design record settling whether SysML v2 has a standard construct for what UML 2.5.1 §14.4 calls a protocol state machine, and whether OpenSysML already runs it. This PR adds that record,
docs/project/protocol-state-machines.md, and re-words the roadmap section and thespec-compliance.mdbullet to its conclusion. No runtime change.The record's language finding: there is no SysML v2 counterpart to
ProtocolStateMachine, and none is needed for the half of the idea the language can express. The legal order of receptions on a port or part is an ordinary exhibited behavior state machine (§7.18.4,accept … via§7.17.8; KerMLStatePerformance.acceptable/accepted/deferrable), which the runtime lowers, starts with the exhibiting object and fires in the declared order on parts as the OMG corpora write it (ServerSequenceRealization-2.sysml; conformancestate_transition_accept_via_port). What SysML v2 cannot spell — gating operation calls by state, post-conditions,ProtocolConformance, static sequence checking — is a UML feature the language dropped, not an OpenSysML gap.The record's runtime finding, from two probes reproduced in it: the declared order is enforced only for events a debugger injects directly (
StateExecutor.SendSignal→ dispatched, dropped,AdvanceReport.Dropped; the REPL's%sendrefuses one by machine and state). A message a model sends that the active state neither accepts nor defers is not dropped — it stays on the context-wide bus (state_executor.go:takesMessage) and is taken by the first later state that accepts it, soRead, Open, Readsent to a machine inclosedends withreads = 2and nothing reported. A machine exhibited by a port definition runs and answers the debugger's messages to the port object, but does not take a model's messages routed to that port.Recommendation: keep the item open with the follow-up the record specifies — a message addressed to a performer whose started machines all refuse it is taken off the bus and dispatched as a non-firing dispatch (so it is reported as the direct path reports it, the UML/PSSM discard rule); a port definition's machine takes the messages routed to its port; optionally an opt-in policy that makes the drop a typed error. No IR change; proof fixtures written in the record; two routing points to settle first. The compliance bullet is re-worded to say the notation runs and its order is enforced only for debugger-injected events. The corpus search (374 files) found no
exhibitinside aport def/interface def, noProtocol, andHappensBefore/HappensDuringonly in library and occurrence examples.How it was verified
Documentation only.
go build ./...,go vet ./...,gofmt -l .empty,go test ./...green,make docs-check(links, doc-ids, figures, changelog fragment) clean, and the corpus gates with the corpora at their pin:OPENSYSML_REQUIRE_TRAINING_CORPUS=1 OPENSYSML_REQUIRE_PILOT_CORPORA=1 go test -count=1 ./tests/corpus -run 'TestTrainingExamples|TestPilotCorpora'ok. The probes in the record were run against this tree: the port-definition probe throughbin/sysml, the model-send probe through a throwaway runtime test (Context.Instantiate,Context.Advance,Context.PendingMessages) that is not committed.Checklist
make testandmake lintpass locallychanges/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved (no count moved)F4,K5) in the body, docs, or changelog