Repository navigation
feat(documents): read OpenSysML-generated documents next to named views - #39
Open
devin-ai-integration[bot] wants to merge 5 commits into
Open
devin-ai-integration[bot] wants to merge 5 commits into
devin-ai-integration[bot] wants to merge 5 commits into
Conversation
Add the studio_render_document_v1 overlay (ListDocuments/RenderDocument over docplan, docir and docrender) to the pinned OpenSysML wasm, list document definitions in the Explorer, render the engine HTML read-only in a sanitized Document pane with click-to-source, mount native view renderers for Diagram blocks, re-render on apply, surface typed planning/evaluation failures in Issues, and add the inspection-rover report with docs and tests. Co-Authored-By: jason.han <hanhuijun@gmail.com>
devin-ai-integration
Bot
requested review from
HuiJun and
rororowyourboat
as code owners
November 11, 2026 22:31
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Regenerated on the CI runner (baseline-compatible fonts) from the PR's visual run: every changed capture differs only by the Explorer's Documents group, the Document representation tab, report.sysml and the seven-file status in the inspection-rover project. Co-Authored-By: jason.han <hanhuijun@gmail.com>
… renders After apply, undo or redo the Document pane announced the chooser hint until the engine returned the re-rendered document. The pane now shows a status message naming the document being re-rendered instead. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…group The requirement hierarchy, model exploration, assembly exploration and rover guided scenarios capture more than one screenshot; the earlier run stopped at their first. These captures come from the CI runner and differ only by the Explorer's Documents group, the Document tab and report.sysml. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…ocuments group Third capture of the rover guided scenario, taken from the CI runner; it differs only by the Explorer's Documents group, the Document tab and report.sysml. 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.
Change
A project can now open and read the documents the embedded OpenSysML engine generates, next to its named views. Source stays authoritative; the surface is read-only.
studio_render_document_v1(engine-bridge/opensysml/render_document.go→ enginestudio_document.go):ListDocuments {modelHash}resolvespart defspecializations ofDocumentQueries::Documentthroughdocplan.IsDocumentDefinitionwith their declaring origins;RenderDocument {modelHash, document, form}runsdocplan.Compile→docir.EvaluateLinked(sibling plans, runtime query context) →docrender.HTML/Markdownand returns a versioned envelope:content,references(everydata-elementqualified name with its origin),contents(everydata-nameblock path with its declaring part and embedded view) anddiagnosticstyped by stage (planning/evaluation/rendering) and kind (unknownQuery,missingBinding,bindingType,missingViewSource, …) with file/line. Field names mirror the upstreamRenderDocumentprotojson (modelHash,document,form) so the local bridge can be swapped for the RPC later.validated_document.go(combined) refuses revisions with validation errors before planning, like the view bridge. Graphviz is unavailable in wasm; HTML requests the DOT diagram form because the Mermaid HTML path callsos.Getwd(unimplemented on js); Markdown keeps Mermaid fences. The browser never shows either: everysysml-diagramfigure is replaced by the native renderer or a notice.ModelSnapshot.documents(optional) is listed duringparse; newdocumentworker operation;createSemanticEngineimplementsDocumentEngine.renderDocumentwith stale-hash rejection in the worker andvalidateRenderedDocumenton reply.workspace/documents, framework/engine independent): rendered-document TypeBox contract,documentEntries(Explorer grouping),documentSourceTarget(UTF‑8 origin → UTF‑16 editor range in the exact applied file, with explained library/draft/unknown cases),documentDiagnostics.createWorkspacegainsrenderedDocumentstate,openDocument,closeDocumentand the non-publishingpreviewViewused by embedded diagrams; document diagnostics join the revision'sdiagnosticsso Issues navigation works unchanged.DocumentPanerebuilds the engine HTML through an allowlist (document-html.ts: no scripts, styles, media, forms, event handlers or non-sysml-classes;data-*attributes and ids kept) and delegates clicks:data-element→ element declaration, headings/paragraphs/blocks → theirdata-namepath in the document definition, reusingsetFile/setFocusRange/selection.figure.sysml-diagram[data-view]blocks mountDiagramin a newembeddedmode (no header, read-only) with Open as named view; undrawable/undeclared views show the engine's notice/diagnostics. Documents re-render after apply/undo/redo together with the open view, showing a "Re-rendering document" status meanwhile; a pane is never left blank on failure (typed diagnostics are shown and listed in Issues).examples/inspection-rover/report.sysml(RoverReport::InspectionReport: a section per subsystem with a query-backed parts table, a requirements table, aDiagramblock embeddingRoverViews::architecture, an inlineRef); catalog/index/README updated (seven files). README,docs/capabilities.md,docs/architecture/README.md,docs/next-steps.md(follow-ups: inline text editing via Toolkit transactions, PDF export, Flexo publication, upstream RPC swap) andengine-bridge/README.mdprovenance.report.sysmland the seven-file status.Evidence
Node 26.3.1, Go 1.27.3 (prepared under
sandbox/opensysml-012).New bridge tests:
TestStudioListDocuments,TestStudioRenderDocumentHTML,TestStudioRenderDocumentMarkdown,TestStudioRenderDocumentUnknown(unknown document, unknown form, stale model, non-document),TestStudioRenderDocumentPlanningError(validation gate + typedmissingQuerywith file/line),TestStudioRenderDocumentInvalidModel.gofmt -l engine-bridge/opensysml/empty.New unit tests:
src/lib/workspace/documents/documents.test.ts(explorer grouping, click-to-source mapping incl. UTF‑8/UTF‑16 offsets and refusal cases, envelope validation, typed diagnostics).tests/e2e/documents.spec.ts(@critical): opens the rover report through the real engine, checks the article'sdata-document, anEnergyheading, thebattery/RoverComponents::Batteryand requirement documentation table cells, that noscript/style/img/iframeor diagram fences survive, that the embeddedRoverViews::architectureblock isdata-state="rendered"with the nativepart battery : Batterygroup and Open as named view, clicks the inlineroverreference and asserts the source selectionpart rover : InspectionRover;insystem.sysml, a row click (part battery : Battery;), a heading click (themobility : Sectiondeclaration inreport.sysml), and the named-view handoff. The second scenario applies a title change and sees the re-rendered heading, then removes a table's query and asserts the typedreferences no queryissue with areport.sysmlline link while the last document is retained.rover.spec.ts/shell-entry.spec.tsfile-count assertions updated 6 → 7.Baselines: the first CI run failed 34 comparisons; because several scenarios capture more than one screenshot, three further runs exposed 14 second/third captures. Every failing comparison was inspected from the CI artifacts (
*-diff.png): the differences are the new Documents group (shifting Views/Model), the Document tab,report.sysmland "7 files"; no diagram, dialog or form pixels changed. The CI-actual.pngcaptures were committed as the new baselines (local Linux fonts on the development VM differ from the runner's — even the untouched landing page shows 15 px of drift there — so none were generated locally).Remaining failure on the latest run:
requirement hierarchy and declared satisfaction in dark at 768(requirements-dark-768.png, 1,849 px). The light variant of the same capture failed on the previous run and both passed on the two runs before with identical application code (those runs differ only by PNG baselines). The diff is a sub-pixel shift of the whole requirement diagram aftercenterRequirementCard's real middle-button drag, i.e. a pre-existing capture race in that scenario, so that baseline was deliberately left unchanged rather than re-recorded.Manual/agent UI run against the production build with the real pinned engines: report/table rendering, exact source reveal by reference, row, heading and paragraph, Tab/Enter on a reference, native embedded diagram and named-view handoff, title apply/undo/redo, missing-query rejection with retained report and Issues navigation (
report.sysml:60), exact draft discard, busy-state tab disabling, HTML-like source text rendered inert, 1440/768 px in light and dark.Not covered: Firefox/WebKit; hostile engine responses beyond the allowlist unit tests (the browser check used HTML-like source text through the real engine).
Compatibility
report.sysml(bundle now seven files).version1);ModelSnapshot.documentsis an optional runtime field, not persisted.scripts/prepare-opensysml.mjschange the recordedpatchHash; capabilitystudio_render_document_v1added. Planning errors the pinned checks also report as model diagnostics are gated before rendering, so a document with such an error makes the revision invalid for views as well (existing behavior).Link to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/386f45b0cec7434dbd9f894844bd8efd
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/386f45b0cec7434dbd9f894844bd8efd?variant=devin
Requested by: @HuiJun