feat(view): render GeneralView requirement, definition, package and use case graphs - #886
devin-ai-integration[bot] wants to merge 50 commits into
Conversation
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>
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>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…aphs Co-Authored-By: jason.han <hanhuijun@gmail.com>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…erpts typographically Co-Authored-By: jason.han <hanhuijun@gmail.com>
|
End-to-end check through the
The first run found two rendering issues, fixed in b2bb8b1: PlantUML showed boxed
The LSP was covered only by its unit and integration tests. |
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…graphs Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/pilot-differential-baseline.json
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…graphs 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>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
|
End-to-end testing of the GeneralView case route passed on d1bdea6, through the CLI, the REPL, real Mermaid/Graphviz/PlantUML conversion and the pilot validator. The later 71c6c7a change only moves a comment. GeneralView case diagramsBoth demo views render as case diagrams in all four forms. The usage diagram shows the subject, actors, objective and both includes. The definition diagram shows
Equivalence, regression and refusal checks
Recording of the session: https://nasa-jpl-demo.devinenterprise.com/sessions/f27da938b63c4728b79cc2ce04d15c17 |
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…at/general-view-graphs
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…at/general-view-graphs
…graphs Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # .agents/skills/testing-pilot-corpora-gate/SKILL.md # .agents/skills/testing-pilot-differential/SKILL.md # .agents/skills/testing-pilot-execution-referee/SKILL.md # .agents/skills/testing-pilot-xpect/SKILL.md # README.md # docs/internals/architecture.md # docs/project/pilot-differential-baseline.json # docs/project/pilot-differential.md
…mixed Co-Authored-By: jason.han <hanhuijun@gmail.com>
…graphs Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # README.md # docs/manual/authoring.md # docs/project/spec-compliance.md # docs/project/view-rendering-forms.md # docs/reference/cli.md # docs/reference/lsp.md # docs/reference/repl-commands.md # internal/frontend/repl/meta.go # internal/ir/view/form.go # internal/ir/view/links_test.go # packaging/man/man1/sysml.1
…mixed Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…mixed Co-Authored-By: jason.han <hanhuijun@gmail.com>
…graphs Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # docs/project/pilot-differential-baseline.json
… import query Co-Authored-By: jason.han <hanhuijun@gmail.com>
|
This branch now conflicts with
To resolve: merge current Planned merge order for the view and docs PRs: #889 → #881 → #871 → #882 → #884 → #885 → #886. Each needs these files regenerated again after the one before it merges. Re-run the full gate ( |
…mixed Co-Authored-By: jason.han <hanhuijun@gmail.com>
…graphs Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # internal/workspace/libs/stdlib.snapshot
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…mixed Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
…at/general-view-graphs Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # .agents/skills/testing-pilot-corpora-gate/SKILL.md # .agents/skills/testing-pilot-differential/SKILL.md # .agents/skills/testing-pilot-execution-referee/SKILL.md # .agents/skills/testing-pilot-xpect/SKILL.md # README.md # docs/internals/architecture.md # docs/manual/authoring.md # docs/project/pilot-differential-baseline.json # docs/project/pilot-differential.md # docs/project/spec-compliance.md # docs/project/view-rendering-forms.md # docs/reference/cli.md # docs/reference/lsp.md # docs/reference/repl-commands.md # internal/ir/view/d2_test.go # internal/ir/view/links_test.go # internal/workspace/libs/stdlib.snapshot
…graphs Co-Authored-By: jason.han <hanhuijun@gmail.com> # Conflicts: # .agents/skills/testing-pilot-corpora-gate/SKILL.md # .agents/skills/testing-pilot-differential/SKILL.md # .agents/skills/testing-pilot-execution-referee/SKILL.md # .agents/skills/testing-pilot-xpect/SKILL.md # README.md # docs/internals/architecture.md # docs/project/pilot-differential-baseline.json # docs/project/pilot-differential.md
|
Hold on pushes: please don't push to this branch, including |
Depends on #871. This branch merges
feature/view-case-mixedand draws the case diagram with its case kind and writers; merge #871 first.What and why
A
GeneralViewis drawn as a containment tree only, whileStandardViewDefinitionsdescribes its typical rendering as a graph of nodes and edges, specialised by the view's element filters. This renders three of those specialisations as graphs:KindRequirement): requirement and concern definitions/usages as nodes, with short name/ID and a text excerpt; edges for satisfy, verify, derive, refine, allocate, specialization and typing.KindDefinition): definitions and usages with specialization, typing, and composition/reference edges (a usage feature drawn to its type, filled or hollow diamond by compositeness).KindPackage): packages, package containment and package imports.All three are written by the text, Mermaid, DOT, PlantUML and D2 writers, with the existing palettes and the Pilot/Cameo drawing styles (Cameo frames
req,bdd,pkg). In D2 the relationships take the class-diagram notation as classes (specialization, dashedtyping,composition/referencediamonds and acontainmentcircle at the owner, a dasheddependencyfor import, satisfy, verify, derive, refine and allocate). A case or mixed rendering has no D2 form, as ondevelop; asking for one is refused with the usual wrong-form error.Which filters select which graph
A
GeneralViewis drawn as a graph only when everyfiltermember (and every filteredexpose) compiles to a direct@Metaclass/@@Metaclasstest on a SysML/KerML metaclass, or anorof such tests. The metaclass and its library supertypes decide the graph:RequirementDefinition/RequirementUsage(and concern) select a requirement graph,Packagea package graph,Definition/Usagea definition graph; relationship metaclasses (Specialization,FeatureTyping,SatisfyRequirementUsage, …) select none on their own.CaseDefinition/CaseUsageselect a case diagram (below). When several are named, requirement wins over package, package over case, and case over definition. An unfilteredGeneralView, and any filter outside these shapes (conjunctions, negations, metadata or feature tests, anorwith such an operand), keeps the containment tree byte for byte. The mapping is documented indocs/project/view-rendering-forms.md#generalview-graphs.Use case diagrams through a GeneralView
A
GeneralViewwhose filter namesCaseDefinition,CaseUsageor a specialization —UseCaseDefinition,UseCaseUsage, the analysis and verification cases — returnsKindCaseand is drawn by #871's case writers, with no second writer, using only the standard library:CaseView(OpenSysMLRenderings) is the shorter way to write the same view; mixed diagrams still needMixedView.general_case_test.gorenders a filtered GeneralView and aCaseViewexposing the same elements and compares their text, Mermaid, DOT and PlantUML output with source links. Every byte matches except the provenance line, which names how each view got its kind:view def GeneralView, filter @UseCaseUsagefor the GeneralView,render asCaseDiagramfor the CaseView. The test checks that this line is the only difference. The route works on the CLI, REPL, LSP and in documents; averdictsoverlay on it is refused like on any non-requirement kind. Example:examples/general-views-demo/use-cases.sysml.docs/project/view-rendering-forms.mdalso gains a "Standard views first" section: each rendering's route, marked standard (GeneralView filters, GridView matrix) or extension (MixedView, theDocumentQueriesverdicts overlay, layout), with run renderings CLI/REPL only.Verdict overlay (opt-in)
Without an overlay a requirement graph is purely structural and deterministic. With the
verdictsoverlay, the verification cases verifying each drawn requirement are run and the requirement is labelled and coloured by its worst verdict (pass < inconclusive < fail < error, Okabe–Ito colours); each case and its detail are listed in the node detail. Surfaces:-render-overlay verdicts(with-render/-render-all)%render <view> [form …] verdictsopensysml/renderparameteroverlay, advertised asopenSysmlRenderOverlays; node data carriesverdictDiagram::overlay(optional attribute inOpenSysML Libraries/DocumentQueries.sysml; no new library)An overlay on any other kind is refused. The verdicts run in a typed runtime: the REPL's session runtime, an LSP runtime built through
modelrtfrom a detached reading (sointernal/workspace/modelstill does not import the runtime), and in documents the query context's runtime or its typed declared reader (queryexec.Context.Verifier). The view package does not import the runtime;runtime.RequirementVerdictsadapts verdicts toview.Verdicts.Source links
The graphs carry the source links of
-render-link, REPLlink=<template>and LSPlinkTemplatethe way every other kind does: each requirement, definition, usage and package node, and each relationship edge with a declaration, links to it in Mermaid (click), DOT (URL/tooltip) and PlantUML ([[…]]). A link template combines with theverdictsoverlay; in the LSP both are drawn from one read of the workspace (Reading.LinkSites). Linked goldens:internal/ir/view/testdata/links-general-*.golden.The requirements table was not added: the existing table kind and the in-flight GridView relationship matrix cover it.
Specification basis
SysML v2
StandardViewDefinitions::GeneralView(Systems Library) — its documented package, definition-and-usage and requirement specialisations by element filter. Adds a row todocs/project/spec-compliance.md.How it was verified
internal/ir/view/testdata/general*.golden), Pilot and Cameo styles; verdict overlay goldens from a deterministic verification run.GeneralViews are compared against the tree rendering; no existing golden changed.expose.examples/general-views-demo/vehicle.sysmland the two view fixtures validate with the pinned pilot validator with 0 errors.examples/general-views-demo/use-cases.sysmlandinternal/ir/view/testdata/general-case.sysmlvalidate with 0 errors with only the pilot's standard library (noOpenSysML Librariesfolder).d20.9.0 (OPENSYSML_D2), andTestD2GeneralGraphNotationfor the edge notation.go build ./...,go vet ./...,gofmt -l .,make docs-check,make docs-counts,make man-check,make stdlib-snapshot-check.Regenerated artifacts, all from the added example or library attribute: the pilot differential baseline and the counts derived from it (384 files, 346 fully agreeing), the RDF/API-JSON corpus round-trip expectations (two new stable files), the embedded stdlib snapshot, the self-model
ViewEnginekinds (13 recognised, 11 supported, with #871's two), and the man page.Renderings of the example
Requirement graph with verdicts (DOT, Okabe–Ito):
Requirement graph (Mermaid):
Definition/usage graph (DOT, Cameo style):
Definition/usage graph (DOT):
Definition/usage graph (Mermaid; a flowchart has no diamond head, so composition and reference lead their label with ◆ and ◇):
Requirement graph (PlantUML):
Package graph (PlantUML):
Use case diagram through
GeneralView+filter @SysML::UseCaseUsage;(Mermaid, DOT, PlantUML):D2 (definition and package graphs, requirement graph with verdicts and source links), compiled with
d20.9.0:Checklist
make testandmake lintpass locally —go test ./...passes locally;make lintwas not run locally, CI runs itchanges/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 changelog