fix(doc): render every migrated document — multi-valued cells, positioned figures in every form, partial sets, same-named documents - #568
Merged
Conversation
A computed column reading a feature or parameter now keeps every value the row binds, bounded by the declared multiplicity, so a [0..*] attribute renders as its ordered values and an unbound optional one as an empty cell; a scalar declaration still fails the column, naming the declared bound. Co-Authored-By: jason.han <hanhuijun@gmail.com>
A view some DiagramLayout::Layout positions was thinned to its placed members only by the DOT writer; the Mermaid and PlantUML forms drew the whole exposed tree, so a figure exposing an unplaced package expanded into the package's contents and tripped the Mermaid workload bound. One placement classification now serves every graph form: the placed nodes and the edges between them by default, every node under UnplacedStrip, each accounted for in the form's comment syntax. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…s apart -render-documents stopped at the first document whose queries failed and wrote nothing; it now compiles and evaluates each document on its own, writes the ones that rendered, stands a page carrying the error in for each that did not so links to it resolve, reports every failure with the document's qualified name and exits 3. File names are planned by the collision tagger -render-all uses, moved to internal/translate/filename, so names meeting under case folding, device stems and over-long names get the tagged form and cross-document links point at it. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
…ent null as an empty cell A set's page for a document that could not be rendered now carries a paragraph under each anchor the other documents link into it by, so a link into one of its blocks lands on the page rather than on a fragment that does not exist. A column expression of null, alone or as the default of ??, declares an empty cell; the query cookbook and the changelog fragment say so and a test pins it. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…mes in every frontend The LSP's opensysml/renderDocument and the gRPC RenderDocument rendered a document without the set's file plan, so a cross-document link pointed at the untagged name where -render-documents writes a tagged one. The planner now lives in workspace/model as DocumentFiles, and the REPL, LSP and gRPC renderers all link through it. 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.
What and why
A Cameo/SysML v1 model migrated with
-convert sysml -layoutcarries its DocGen documents asDocumentQueries::Documentdefinitions. Four generic defects in the document, query and view layers kept some of them from rendering; each is fixed at its root.1. A table column over a multi-valued feature failed the whole document.
queryexecdemanded exactly one value per cell, so a column readingattribute tCalibNB : Real[0..*]bound as(69.0, 98.0)stopped the document with "produced 2 values, expected one". The query planner (internal/ir/queryplan) now carries each column expression's declared multiplicity (MultiplicityonRowProperty/Parameteroperations, inferred throughsemantics.Model.GoverningMultiplicityOf), andevaluateColumnCelladmits as many values as that multiplicity allows.docircells were already[]Value; the Markdown and HTML backends (and PDF through HTML) write them in order,,-joined, and an optional feature with no value is an empty cell. A column declared[1]still refuses zero or several values (the error now names the bound:expected [1]), and every scalar place — captions,Refs, comparison operands — still takes one value.2. A positioned view drawn in Mermaid or PlantUML ignored its
Layoutand drew the whole exposed tree. Omitting unplaced nodes lived in the DOT writer alone, so the other forms expanded exposed packages into thousands of nodes and tripped the Mermaid workload bound.internal/ir/view/placement.gonow makes one placement decision for every graph form (Rendering.settleUnplaced): the placed members and the edges between them by default, every member under-render-unplaced strip, with the accounting comment in each form's syntax (// not represented: …,%% not represented: …,' not represented: …). Since this happens on theRenderingbefore any writer runs,-render,-render-all, document figures, the LSP and gRPC share it. The Mermaid bound and its message are unchanged. DOT output is byte-identical todevelop(verified on every figure of the TMT How-to document).3.
-render-documents <dir>aborted the set on one failing document.docir.EvaluateSetnow returns oneEvaluatedoutcome per document andRenderDocumentSet*compiles, evaluates and renders each on its own. Pages that render are written; each document that does not gets a stub page stating This document could not be rendered. and the error, so links to it from other pages resolve to an explanation rather than dangle (chosen over omitting the link, becausedocrenderalready resolves a cross-documentRefto a file and the reader should learn why the target is missing). Each failure is reported on stderr asdocument <qualified name> could not be rendered: <reason>, and the run exits with the new status3(exitPartial):0every document written,2nothing written,3written in part.4. Same-named documents.
-render-document <short name>when ambiguous was already refused with every candidate's qualified name (AmbiguousNameErrorininternal/frontend/repl/lookup.go, verified ondevelopwith the TMT model); a CLI test now pins that. Set file names were already qualified, but a case-only collision stopped the run and device stems / over-long names were not handled. The collision planner-render-allused is extracted intointernal/translate/filename(Fit,DeviceStem,CaseFolded,Plan) and both-render-alland-render-documentsplan their destinations with it: names participating in a case-folded collision are tagged~<hash>until every destination is distinct, device stems are escaped, and over-long names are cut at their own encoding's escape boundary. Cross-document links are rendered from the planned (final) file names, in a set and for a single document rendered on its own.-render-allfile names are unchanged.Migration output is untouched: the migrator is not modified and the three migration artifacts of the TMT model are byte-identical between the
developand branch builds.How it was verified
Tests beside the code:
queryexec/computed_test.go(collection,[1],[0..1], scalar places),docrender/{markdown,html}_test.goovertestdata/collection_report.sysml(a multi-valued and an empty cell),view/placement_test.go(mermaid and plantuml omitting/stripping unplaced nodes with the accounting comment, DOT unchanged),cmd/sysml/render_documents_test.go(TestRenderDocumentsPartialSetin Markdown and HTML,TestRenderDocumentsSameShortName,TestRenderDocumentsCaseCollidingNames,TestRenderDocumentAmbiguousName),docir/crossdoc_test.goanddocrender/crossdoc_test.go(links to tagged names),translate/filename/filename_test.go. Gates:go build ./... && go vet ./... && gofmt -l . && go test ./..., the training/pilot corpus gates with their require variables,make man-check,make docs-check,python3 scripts/changelog.py check, and the PDF tests with the doc toolchain present.Acceptance on the migrated TMT model (48,721 elements, 0 validation errors, 103
Documentdefinitions)develop.sysml, report, results)develop-validate-compare-results … -seed 1develop-render-documents(Markdown, default Mermaid)-render-documents -doc-form html-render-documentM1CS results documenttCalibNBcell69, 98-diagram-form dot// not represented: 3358 node(s) without a position, left undrawndevelop-render-all(2,641.mmd+ 100.md)TMT Overview.mmd15,867,176 → 9,037 bytes)L1 TMT to L2 APS,L3 APT to L2 APS-html-theme nasa -doc-title-page -doc-toc -doc-number-sectionsbuild/doc-pdf)No document fails on the branch, so no stub page and no exit
3occur on TMT; that path is covered byTestRenderDocumentsPartialSet. The 103 pages are 103 distinct files (38 of them tagged~<hash>because the qualified name exceeds a 255-byte component). The migrated TMT documents carry no cross-document references, so the intra-set link check passes vacuously; link resolution to tagged names is covered by the cross-document tests.M1CS results table, Markdown (the
tCalibNBcolumn is the multi-valued one;Realvalues are written as the scalar backends already wrote them, so69.0appears as69):How-to document, figure 2 (
Template Observatory Workflow 2,render Views::asTreeDiagram) — the same 60 node ids and 28 edges in both forms:Mermaid (this branch;
developrefused it):DOT (unchanged):
Checklist
make testandmake lintpass locallychanges/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