Repository navigation
Expand file tree
/
Copy pathsurfaces.sysml
More file actions
709 lines (621 loc) · 31.2 KB
/
Copy pathsurfaces.sysml
File metadata and controls
709 lines (621 loc) · 31.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
// What sits on top of the pipeline: the interactive surfaces, the client
// libraries that reach the service, and the artifacts the tool writes out.
package OpenSysMLSurfaces {
private import ScalarValues::*;
private import OpenSysMLArtifacts::*;
private import OpenSysMLPipeline::*;
abstract part def Interface :> CodeUnit {
attribute entrypoint : String;
attribute protocol : String;
port pipeline : RequestPort;
}
// A surface that asks questions of the model puts every one through the
// analysis framework, choosing the engines and the width of the fleet.
abstract part def AskingInterface :> Interface {
attribute engineSelector : String;
attribute jobsSetting : String;
attribute engineListing : String;
port questions : RequestPort;
}
#Surface part def Repl :> AskingInterface {
attribute :>> goPackage = "internal/frontend/repl";
attribute :>> entrypoint = "cmd/sysml";
attribute :>> protocol = "terminal";
attribute :>> engineSelector = "%engine";
attribute :>> jobsSetting = "%jobs";
attribute :>> engineListing = "%engines";
attribute stateful : Boolean = true;
attribute adoptsInstancesOnReanalysis : Boolean = true;
}
// Every capability the server announces in its initialize result. The
// standard ones are the protocol's; the experimental ones are the extension
// the VS Code client speaks: rendering a view or a document, applying a
// model edit, reading a bundled library file, debugging a run, laying a
// diagram out across documents, and the palette, forms and styles it draws with.
#Surface part def LanguageServer :> Interface {
attribute :>> goPackage = "internal/frontend/lsp";
attribute :>> entrypoint = "cmd/sysml-lsp";
attribute :>> protocol = "lsp-stdio";
attribute incrementalSync : Boolean = true;
attribute saveNotifications : Boolean = true;
attribute workspaceFolders : Boolean = true;
attribute publishesQuickFixes : Boolean = true;
attribute identityCodeActions : Boolean = true;
attribute hover : Boolean = true;
attribute definition : Boolean = true;
attribute findReferences : Boolean = true;
attribute documentSymbols : Boolean = true;
attribute workspaceSymbols : Boolean = true;
attribute completion : Boolean = true;
attribute formatting : Boolean = true;
attribute rangeFormatting : Boolean = true;
attribute rename : Boolean = true;
attribute prepareRename : Boolean = true;
attribute semanticTokens : Boolean = true;
attribute experimentalRendering : Boolean = true;
attribute experimentalDocuments : Boolean = true;
attribute experimentalModelEdits : Boolean = true;
attribute experimentalStdlibContent : Boolean = true;
attribute experimentalDebug : Boolean = true;
attribute experimentalCrossDocumentLayout : Boolean = true;
attribute experimentalRenderPalette : Boolean = true;
attribute experimentalRenderForms : Boolean = true;
attribute experimentalRenderStyles : Boolean = true;
in item findings : Diagnostic;
out item tokens : SemanticToken;
out item fixes : QuickFix;
}
// The schema every transport and every client is generated from. Only the
// Go stubs are checked in beside it; the other stubs live with their clients.
part def ApiSchema :> CodeUnit {
attribute :>> goPackage = "api/proto";
attribute schemaFile : String = "api/proto/sysml.proto";
attribute service : String = "SysMLService";
attribute rpcCount : Integer = 25;
attribute rpcs : String = "GetServerInfo, ParseFile, ParseSources, GetSymbol, GetDiagnostics, Evaluate, Instantiate, ExecuteAction, ExecuteState, Convert, Migrate, ApplyEdits, VerifyConstraint, VerifyRequirement, VerifySatisfaction, ValidateInstance, EvaluateCalc, RunAnalysis, RunSweep, ListEngines, Query, RunDocumentQuery, RenderDocument, RenderView, ExportGraphs";
attribute generatedGo : String = "api/proto/sysml.pb.go, api/proto/sysml_grpc.pb.go, api/proto/protoconnect/sysml.connect.go";
attribute generator : String = "buf";
}
// One hand-written service behind two generated transports: gRPC over
// HTTP/2 with reflection, and Connect over plain HTTP for browsers.
#Surface part def ModelService :> AskingInterface {
attribute :>> goPackage = "internal/frontend/grpc";
attribute :>> entrypoint = "cmd/sysml-grpc";
attribute :>> protocol = "grpc, connect";
attribute :>> engineSelector = "engine";
attribute :>> jobsSetting = "OPENSYSML_JOBS";
attribute :>> engineListing = "ListEngines";
attribute enginesCapability : String = "engines";
attribute reflectionEnabled : Boolean = true;
attribute handWrittenService : Boolean = true;
attribute connectAdapter : String = "internal/frontend/grpc/connect.go";
attribute stdioTransport : String = "internal/frontend/stdiorpc";
part schema : ApiSchema;
}
// The same service over a pipe: a process that embeds the binary talks to
// it without a network listener.
#Surface part def StdioService :> Interface {
attribute :>> goPackage = "internal/frontend/stdiorpc";
attribute :>> entrypoint = "cmd/sysml-grpc";
attribute :>> protocol = "stdio";
}
// The non-interactive side of the REPL binary: convert, migrate, query, render.
#Surface part def CommandLine :> AskingInterface {
attribute :>> goPackage = "internal/frontend/repl";
attribute :>> entrypoint = "cmd/sysml";
attribute :>> protocol = "flags";
attribute :>> engineSelector = "-engine";
attribute :>> jobsSetting = "-jobs";
attribute :>> engineListing = "-engines";
attribute exitStatusIsContract : Boolean = true;
}
// A client library: hand-written idiomatic code over stubs generated from
// the schema, the stubs checked in at generatedStubs — or, where no
// protobuf toolchain is at hand, JSON over HTTP against the Connect-JSON
// surface, decoded by the rules of docs/reference/wire-contract.md.
abstract part def Client :> CodeUnit {
attribute implementationLanguage : String;
attribute generatedFrom : String = "api/proto";
attribute generatedStubs : String;
attribute generatedCode : Boolean default = true;
port service : RequestPort;
}
part def PythonClient :> Client {
attribute :>> goPackage = "client/python";
attribute :>> implementationLanguage = "python";
attribute :>> generatedStubs = "client/python/opensysml/proto";
}
part def NodeClient :> Client {
attribute :>> goPackage = "client/node";
attribute :>> implementationLanguage = "typescript";
attribute :>> generatedStubs = "client/node/src/generated";
}
part def RustClient :> Client {
attribute :>> goPackage = "client/rust";
attribute :>> implementationLanguage = "rust";
attribute :>> generatedStubs = "client/rust/opensysml/src/proto";
}
part def JavaClient :> Client {
attribute :>> goPackage = "client/java";
attribute :>> implementationLanguage = "java";
attribute :>> generatedStubs = "client/java/opensysml-client/src/main/java/org/openmbee/opensysml/proto";
}
part def JuliaClient :> Client {
attribute :>> goPackage = "client/julia";
attribute :>> implementationLanguage = "julia";
attribute :>> generatedStubs = "docs/reference/wire-contract.md";
attribute :>> generatedCode = false;
}
// Runs in MATLAB and in GNU Octave.
part def MatlabClient :> Client {
attribute :>> goPackage = "client/matlab";
attribute :>> implementationLanguage = "matlab";
attribute :>> generatedStubs = "docs/reference/wire-contract.md";
attribute :>> generatedCode = false;
}
// In the same process by default, over the wire on request: the Go client
// wraps the generated Go stubs rather than being generated itself, and the
// three commands build for WebAssembly as well as natively.
part def GoClient :> Client {
attribute :>> goPackage = "client/opensysml";
attribute :>> implementationLanguage = "go";
attribute :>> generatedStubs = "api/proto";
attribute inProcess : Boolean = true;
attribute buildsForWasm : Boolean = true;
}
part def VsCodeExtension :> CodeUnit {
attribute :>> goPackage = "editors/vscode";
attribute speaksTo : String = "sysml-lsp";
port languageClient : RequestPort;
}
// A modelling tool reaching the service through the Java client: Cameo as
// a plugin, SysON as a backend over its Spring and GraphQL APIs with the
// explorer action, operation dialog and mapped run results in its frontend.
abstract part def ToolIntegration :> CodeUnit {
attribute speaksTo : String = "sysml-grpc";
attribute overClient : String = "client/java";
port serviceClient : RequestPort;
}
part def OpenSysMLMDK :> ToolIntegration {
attribute :>> goPackage = "editors/mdk";
}
part def SysonIntegration :> ToolIntegration {
attribute :>> goPackage = "editors/syson";
}
// --- What an editor reaches ------------------------------------------
// Semantic-token classes, in the order the LSP legend lists them.
part def Highlighter :> CodeUnit {
attribute :>> goPackage = "internal/semantic/highlight";
attribute tokenClasses : Integer = 15;
in item tree : SyntaxTree;
out item tokens : SemanticToken;
}
// A fix carries the edit that applies it and points at the diagnostic it
// answers; a diagnostic with no unambiguous repair offers none.
part def QuickFixer :> CodeUnit {
attribute :>> goPackage = "internal/syntax/diag";
attribute editsAttached : Boolean = true;
in item findings : Diagnostic;
out item fixes : QuickFix;
}
// The nearest declared names for one that did not resolve.
part def Suggester :> CodeUnit {
attribute :>> goPackage = "internal/semantic/suggest";
attribute rankedByDistance : Boolean = true;
in item findings : Diagnostic;
}
// Span-based rewriting of source text. The result is re-parsed and
// re-analysed, and an edit that would leave the model unreadable is refused.
part def SourceEditor :> CodeUnit {
attribute :>> goPackage = "internal/check/edit";
attribute operations : String = "set value, rename, add member, delete, add connection, move, set layout, add satisfy, add requirement constraint, add transition, add verify, add metadata, add metadata prefix, add sequence, add import, add documentation, add comment, add note";
attribute preservesUntouchedText : Boolean = true;
attribute reanalysesResult : Boolean = true;
in item text : SourceText;
out item edits : SourceEdit;
}
// Re-indents the token stream, so comments and error nodes survive a save.
part def Formatter :> CodeUnit {
attribute :>> goPackage = "internal/syntax/format";
attribute worksOnTokens : Boolean = true;
in item text : SourceText;
}
// A document name and a span, carried from a declaration to whatever is
// derived from it; a synthetic artifact carries the unlocated origin.
part def Provenance :> CodeUnit {
attribute :>> goPackage = "internal/semantic/symbols";
attribute keyedByDocumentAndSpan : Boolean = true;
attribute consumers : String = "internal/doc/docir, internal/ir/view, internal/ir/queryplan";
out item origins : SourceSpan;
}
// Diagnostics feed fixes and suggestions; edits go back in as source text.
part def EditorPipeline {
part highlighter : Highlighter;
part fixes : QuickFixer;
part suggestions : Suggester;
part editor : SourceEditor;
part formatter : Formatter;
port findingsIn : DiagnosticPort;
port textOut : ArtifactPort;
flow of Diagnostic from fixes.findings to suggestions.findings;
flow of SourceEdit from editor.edits to formatter.text;
}
// --- What the tool writes out ----------------------------------------
// A rendering kind the standard view definitions name.
part def RenderingKind {
attribute kind : String;
attribute supported : Boolean default = true;
}
// Every rendering kind the implementation recognizes is modelled here.
part def ViewEngine :> CodeUnit {
attribute :>> goPackage = "internal/ir/view";
attribute recognizedKinds : Integer = 14;
attribute supportedKinds : Integer = 12;
part tree : RenderingKind { attribute :>> kind = "tree"; }
part interconnection : RenderingKind { attribute :>> kind = "interconnection"; }
part stateDiagram : RenderingKind { attribute :>> kind = "state"; }
part actionDiagram : RenderingKind { attribute :>> kind = "action"; }
part textual : RenderingKind {
attribute :>> kind = "textual";
attribute :>> supported = false;
}
part table : RenderingKind { attribute :>> kind = "table"; }
part matrix : RenderingKind { attribute :>> kind = "matrix"; }
part sequence : RenderingKind { attribute :>> kind = "sequence"; }
part caseDiagram : RenderingKind { attribute :>> kind = "case"; }
part mixedDiagram : RenderingKind { attribute :>> kind = "mixed"; }
part requirementGraph : RenderingKind { attribute :>> kind = "requirement"; }
part definitionGraph : RenderingKind { attribute :>> kind = "definition"; }
part packageGraph : RenderingKind { attribute :>> kind = "package"; }
part geometry : RenderingKind {
attribute :>> kind = "geometry";
attribute :>> supported = false;
}
in item types : TypeTable;
in item origins : SourceSpan;
out item diagram : DocumentTree;
}
part def QueryCompiler :> CodeUnit {
attribute :>> goPackage = "internal/ir/queryplan";
attribute immutablePlans : Boolean = true;
}
part def QueryExecutor :> CodeUnit {
attribute :>> goPackage = "internal/doc/queryexec";
attribute orderedRows : Boolean = true;
out item rows : QueryRows;
}
// A document is written in the notation, not in a template language: the
// planner compiles a document definition into an immutable plan holding
// compiled query programs.
part def DocumentPlanner :> CodeUnit {
attribute :>> goPackage = "internal/ir/docplan";
attribute libraryFile : String =
"internal/workspace/libs/stdlib/OpenSysML Libraries/DocumentQueries.sysml";
attribute immutablePlans : Boolean = true;
attribute contentKinds : String = "section, paragraph, table, list, definitions, formula, diagram, image";
attribute runKinds : String = "span, link, ref";
in item rows : QueryRows;
out item plan : DocumentPlan;
}
// Evaluating a plan gives one tree, carrying provenance on every node and
// knowing nothing about the backend that will write it out.
part def DocumentIR :> CodeUnit {
attribute :>> goPackage = "internal/doc/docir";
attribute backendAgnostic : Boolean = true;
attribute provenancePerNode : Boolean = true;
attribute resolvesCrossDocumentRefs : Boolean = true;
in item plan : DocumentPlan;
in item origins : SourceSpan;
out item tree : DocumentTree;
}
part def MarkdownBackend :> CodeUnit {
attribute :>> goPackage = "internal/doc/docrender";
attribute form : String = "markdown";
attribute needsExternalTool : Boolean = false;
in item tree : DocumentTree;
}
// One self-contained page with the stylesheet in it; its diagrams are
// Mermaid sources a script the page loads draws, so nothing runs here.
part def HtmlBackend :> CodeUnit {
attribute :>> goPackage = "internal/doc/docrender";
attribute form : String = "html";
attribute needsExternalTool : Boolean = false;
attribute diagramsDrawnByPage : Boolean = true;
in item tree : DocumentTree;
}
// The only stage that leaves the process: the tree becomes prepared
// Markdown, its diagrams become images, and a converter makes the PDF.
part def PdfBackend :> CodeUnit {
attribute :>> goPackage = "internal/doc/docpdf";
attribute form : String = "pdf";
attribute engines : String = "weasyprint, pandoc, prince";
attribute diagramTool : String = "mmdc";
attribute needsExternalTool : Boolean = true;
attribute reportsMissingTool : Boolean = true;
in item tree : DocumentTree;
}
// A SysML v1 model read from XMI — as Eclipse UML2 writes it or in a mdzip
// archive — and written as SysML v2 notation under its own verb, migrated
// rather than converted, with what each v1 element became reported; an
// MTIP export lays the migrated views out, and a results sidecar lets a
// migrated run configuration be compared with the runs its tool stored.
part def Migrator :> CodeUnit {
attribute :>> goPackage = "internal/translate/migrate";
attribute reader : String = "internal/translate/xmi/sysmlv1";
attribute layoutSource : String = "internal/translate/mtip";
attribute resultsSchema : String = "internal/exec/simresults";
attribute verb : String = "-migrate";
attribute rpc : String = "Migrate";
attribute reportFlag : String = "-migration-report";
attribute resultsFlag : String = "-migration-results";
attribute layoutFlag : String = "-layout";
attribute comparisonFlag : String = "-compare-results";
attribute reportsEveryElement : Boolean = true;
}
// A calc def compiled to a native source file rather than interpreted;
// notation outside the compiled subset is named, never silently interpreted.
part def CodeGenerator :> CodeUnit {
attribute :>> goPackage = "internal/translate/codegen";
attribute targets : String = "c, go";
attribute flag : String = "-compile";
attribute namesUnsupportedNotation : Boolean = true;
}
// Textual notation both ways, the experimental RDF and API element form,
// SysML v1 XMI read and migrated, and FMI model descriptions imported as
// calc defs. Five formats, twelve names: kerml and text are the notation,
// turtle and rdf are Turtle, api-json and json are the API's element form,
// uml is XMI as Eclipse UML2 writes it, mdzip is XMI in a zip archive and
// fmu is an FMI package.
part def Exporter :> CodeUnit {
attribute :>> goPackage = "internal/translate/export";
attribute formats : String = "api-json, fmu, sysml, ttl, xmi";
attribute formatNames : String = "api-json, fmu, json, kerml, mdzip, rdf, sysml, text, ttl, turtle, uml, xmi";
attribute roundTrips : Boolean = true;
out item graph : RdfGraph;
}
part def OslcQuery :> CodeUnit {
attribute :>> goPackage = "internal/semantic/query";
attribute dialect : String = "oslc";
}
// The document path, from a query in the model to a rendered artifact.
// One plan, one tree, three backends: the form is chosen at the end, so
// Markdown, HTML and PDF cannot disagree about the document's content.
part def DocumentPipeline {
part provenance : Provenance;
part views : ViewEngine;
part queries : QueryCompiler;
part rows : QueryExecutor;
part plans : DocumentPlanner;
part ir : DocumentIR;
part markdown : MarkdownBackend;
part html : HtmlBackend;
part pdf : PdfBackend;
port modelIn : ArtifactPort;
port artifactOut : ArtifactPort;
flow of SourceSpan from provenance.origins to views.origins;
flow of SourceSpan from provenance.origins to ir.origins;
flow of QueryRows from rows.rows to plans.rows;
flow of DocumentPlan from plans.plan to ir.plan;
flow of DocumentTree from ir.tree to markdown.tree;
flow of DocumentTree from ir.tree to html.tree;
flow of DocumentTree from ir.tree to pdf.tree;
flow of DocumentTree from views.diagram to pdf.tree;
}
// One document rendered, and the one branch in it: the form.
action def RenderDocument {
attribute form : String = "markdown";
attribute toolsPresent : Boolean = true;
in item model : SourceText;
out item artifact : DocumentTree;
first start;
action runQueries;
action compilePlan;
action evaluatePlan;
action writeMarkdown;
action writeHtml;
action renderDiagrams;
action convertPdf;
action reportMissingTool;
succession first start then runQueries;
succession first runQueries then compilePlan;
succession first compilePlan then evaluatePlan;
succession first evaluatePlan then formGate;
decide formGate;
if form == "markdown" then writeMarkdown;
if form == "html" then writeHtml;
else renderDiagrams;
// A missing converter is reported, never a half-written document.
succession first renderDiagrams then toolGate;
decide toolGate;
if toolsPresent then convertPdf;
else reportMissingTool;
}
requirement def DocumentsCarryTheirProvenance {
doc /* Every rendered node can be traced back to the element it came from,
* and both backends read the same tree. */
subject documents : DocumentPipeline;
require constraint {
documents.ir.provenancePerNode and documents.ir.backendAgnostic
and documents.plans.immutablePlans
}
}
// --- Conformance oracles ---------------------------------------------
// Harnesses that referee this implementation against a reference; each
// holds a committed baseline that must move deliberately. An advisory
// oracle reports drift; a gating one fails the build on it.
abstract part def ConformanceOracle :> CodeUnit {
attribute reference : String;
attribute baseline : String;
attribute gating : Boolean default = false;
}
#Oracle part def RejectionOracle :> ConformanceOracle {
attribute :>> goPackage = "tools/referee/reject";
attribute :>> reference = "pilot validator";
attribute :>> baseline = "docs/project/pilot-rejection-baseline.json";
}
#Oracle part def DifferentialOracle :> ConformanceOracle {
attribute :>> goPackage = "tools/referee/diff";
attribute :>> reference = "pilot validator";
attribute :>> baseline = "docs/project/pilot-differential-baseline.json";
}
#Oracle part def XpectOracle :> ConformanceOracle {
attribute :>> goPackage = "tools/referee/xpect";
attribute :>> reference = "pilot Xpect suites";
attribute :>> baseline = "docs/project/pilot-xpect-baseline.json";
}
#Oracle part def ExecutionReferee :> ConformanceOracle {
attribute :>> goPackage = "tools/referee/exec";
attribute :>> reference = "pilot expression evaluator";
attribute :>> baseline = "docs/project/pilot-execution-referee.md";
}
// The two behavior referees: OMG's PSSM test suite for state machines and
// ModelDriven's fUML reference implementation for actions, each translated
// by rule into the notation and run here, the suite's own outputs the oracle.
#Oracle part def PssmReferee :> ConformanceOracle {
attribute :>> goPackage = "tools/referee/pssm";
attribute :>> reference = "OMG PSSM test suite";
attribute :>> baseline = "docs/project/pssm-referee-baseline.json";
}
#Oracle part def FumlReferee :> ConformanceOracle {
attribute :>> goPackage = "tools/referee/fuml";
attribute :>> reference = "fUML reference implementation";
attribute :>> baseline = "docs/project/fuml-referee-baseline.json";
}
// The pilot validator's constraint names, re-extracted from the pinned jar
// and held against the census document, its probes and the negative corpus.
#Oracle part def ValidationCensus :> ConformanceOracle {
attribute :>> goPackage = "tools/census/validation";
attribute :>> reference = "pilot validator";
attribute :>> baseline = "docs/project/validation-constraints-baseline.json";
}
#Oracle part def GrammarCoverage :> ConformanceOracle {
attribute :>> goPackage = "tools/census/grammar";
attribute :>> reference = "OMG Xtext grammars";
attribute :>> baseline = "docs/project/grammar-coverage-baseline.json";
}
#Oracle part def DocCounts :> ConformanceOracle {
attribute :>> goPackage = "tools/census/doccounts";
attribute :>> reference = "the measured repository";
attribute :>> baseline = "docs/project/spec-compliance.md";
}
// The bundled standard library must parse clean; the gate is in the suite.
#Oracle part def StdlibConformanceGate :> ConformanceOracle {
attribute :>> goPackage = "internal/workspace/libs";
attribute :>> reference = "OMG standard library release";
attribute :>> baseline = "internal/workspace/libs/stdlib";
attribute :>> gating = true;
}
// The committed library snapshot must be the one a fresh build writes.
#Oracle part def StdlibSnapshotGate :> ConformanceOracle {
attribute :>> goPackage = "tools/gen/snapshot";
attribute :>> reference = "the bundled library files";
attribute :>> baseline = "internal/workspace/libs/stdlib.snapshot";
attribute :>> gating = true;
}
// The language-independent contract between the service and its clients:
// scenarios that are data, run by a reference runner that builds and starts
// the service itself, and ported by every client in another language.
#Oracle part def ConformanceSuite :> ConformanceOracle {
attribute :>> goPackage = "tools/cmd/conformance";
attribute :>> reference = "the running service";
attribute :>> baseline = "conformance";
attribute :>> gating = true;
attribute protocols : String = "grpc, connect, connect-json";
}
// What the oracles lean on: a pinned reference, an errata overlay for the
// defects in OMG-published material, and the census the status page reads.
part def OraclePin :> CodeUnit {
attribute :>> goPackage = "tools/oracle/baseline";
attribute recordsPin : Boolean = true;
attribute recordsBridgeSource : Boolean = true;
attribute recordsCorpusProvenance : Boolean = true;
}
part def Errata :> CodeUnit {
attribute :>> goPackage = "tools/oracle/errata, internal/workspace/libs/errata";
attribute overlaysPublishedMaterial : Boolean = true;
}
part def StatusCensus :> CodeUnit {
attribute :>> goPackage = "tools/census/doccounts";
attribute countsStatusMarkers : Boolean = true;
}
part def ConformanceInfrastructure {
part pins : OraclePin;
part errata : Errata;
part census : StatusCensus;
}
// --- The whole tool ---------------------------------------------------
part def Toolchain {
part pipeline : AnalysisPipeline;
part documents : DocumentPipeline;
part editing : EditorPipeline;
part repl : Repl;
part lsp : LanguageServer;
part service : ModelService;
part stdio : StdioService;
part cli : CommandLine;
part goClient : GoClient;
part python : PythonClient;
part node : NodeClient;
part rust : RustClient;
part java : JavaClient;
part julia : JuliaClient;
part matlab : MatlabClient;
part vscode : VsCodeExtension;
part mdk : OpenSysMLMDK;
part syson : SysonIntegration;
part exporter : Exporter;
part migrator : Migrator;
part codegen : CodeGenerator;
part oslc : OslcQuery;
part rejection : RejectionOracle;
part differential : DifferentialOracle;
part xpect : XpectOracle;
part execution : ExecutionReferee;
part pssm : PssmReferee;
part fuml : FumlReferee;
part validation : ValidationCensus;
part grammar : GrammarCoverage;
part counts : DocCounts;
part stdlib : StdlibConformanceGate;
part snapshotGate : StdlibSnapshotGate;
part suite : ConformanceSuite;
part conformance : ConformanceInfrastructure;
connection replDrives : ArtifactChannel connect repl.pipeline to pipeline.textIn;
connection lspDrives : ArtifactChannel connect lsp.pipeline to pipeline.textIn;
connection serviceDrives : ArtifactChannel connect service.pipeline to pipeline.textIn;
connection cliDrives : ArtifactChannel connect cli.pipeline to pipeline.textIn;
connection replAsks : RequestChannel connect repl.questions to pipeline.questionsIn;
connection serviceAsks : RequestChannel connect service.questions to pipeline.questionsIn;
connection cliAsks : RequestChannel connect cli.questions to pipeline.questionsIn;
connection goCalls : ArtifactChannel connect goClient.service to service.pipeline;
connection pythonCalls : ArtifactChannel connect python.service to service.pipeline;
connection nodeCalls : ArtifactChannel connect node.service to service.pipeline;
connection rustCalls : ArtifactChannel connect rust.service to service.pipeline;
connection javaCalls : ArtifactChannel connect java.service to service.pipeline;
connection juliaCalls : ArtifactChannel connect julia.service to service.pipeline;
connection matlabCalls : ArtifactChannel connect matlab.service to service.pipeline;
connection editorSpeaksLsp : ArtifactChannel connect vscode.languageClient to lsp.pipeline;
connection mdkUsesJava : ArtifactChannel connect mdk.serviceClient to java.service;
connection sysonUsesJava : ArtifactChannel connect syson.serviceClient to java.service;
connection documentsRead : ArtifactChannel connect pipeline.textIn to documents.modelIn;
connection findingsToEditors : DiagnosticChannel connect pipeline.diagnosticsOut to editing.findingsIn;
connection editsBack : ArtifactChannel connect editing.textOut to pipeline.textIn;
}
part opensysml : Toolchain;
requirement documentsAreTraceable : DocumentsCarryTheirProvenance {
subject documents = opensysml.documents;
}
requirement def ViewsSayWhatTheyCannotRender {
doc /* Every rendering kind is recognized, and the ones not produced
* say so instead of being drawn as something else. */
subject views : ViewEngine;
require constraint {
views.recognizedKinds == 14 and views.supportedKinds == 12
and not views.textual.supported and not views.geometry.supported
and views.sequence.supported and views.matrix.supported
}
}
requirement viewsAreHonest : ViewsSayWhatTheyCannotRender {
subject views = opensysml.documents.views;
}
}