Repository navigation
docs(self-model): write the architecture document's prose as Markdown bodies with value runs - #1562
Merged
Merged
Conversation
… bodies with value runs 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)".
|
…re-record the examples-root referee baselines Co-Authored-By: jason.han <hanhuijun@gmail.com>
…nverter A second document, OpenSysMLAsciiDoc::MarkupNote, written as rep language "asciidoc" bodies with sysml:value runs, <<xref>> cross-references and a heading-opened section; its converter-gated test renders Markdown, HTML and AsciiDoc and runs in the PDF toolchain job. Referee baselines re-recorded for the ninth examples file. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Re-records the API-JSON and pilot differential baselines on top of the 2026-09 pilot pin: the examples root carries the self-model's Markdown bodies and its new AsciiDoc note, every other root is develop's. Co-Authored-By: jason.han <hanhuijun@gmail.com>
…kip prose whose converter is absent A model in a subdirectory of an example directory layers onto the model above it, so TestExamplesAnalyseCleanly opens the enclosing directories' files with it. An example whose only errors are a missing markup converter skips unless OPENSYSML_REQUIRE_PDF_TOOLCHAIN is set; the PDF toolchain job sets it and now runs the test with the converter installed. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Contributor
Author
There was a problem hiding this comment.
🔍 Devin Review: 1 flag
Not posted on this PR by your GitHub settings — view it in Devin Review. (Configure)
…ot table and the run totals The per-root table's examples row and ours-missing column and the prose totals for unkeyed references, extension annotations and unkeyable pilot elements now state the recorded baseline's figures. Co-Authored-By: jason.han <hanhuijun@gmail.com>
Re-records the API-JSON and pilot differential baselines on top of develop's re-pinned libraries: the examples root carries the self-model's Markdown bodies and its AsciiDoc note, every other root is develop's. Co-Authored-By: jason.han <hanhuijun@gmail.com>
6 tasks done
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
examples/self-model/document.sysmlwrote the architecture document's prose as onepart : Paragraphper paragraph, each a string literal (:>> text = "…"), although the document generator now expands Markdown bodies in place, opens sections from headings and reads model values into prose ([](sysml:value:…)). The self-model is meant to show OpenSysML's own idioms, so this PR rewrites its document with them — the same rendered document, with the figures the model already carries read from the model instead of being retyped.rep language "markdown"body at the same position, so the section structure and the tables/figures between the bodies are unchanged. The one named paragraph that was already a Markdown body (reading) stays named.passRegistry.tierCount/passCount), the nested-calculation budget's default and environment variable (runtime.calcDepth.defaultBound/envVar), the released and WebAssembly command counts (opensysml.releasedCommandCount/wasmCommandCount), the MCP server's tool groups, HTTP path and token variable (opensysml.mcp.toolGroups/httpPath/tokenEnv), the release asset (opensysml.wasm.releaseAsset) and the AsciiDoc parser's language and converter variable (documentPipeline.asciidocProse.markupLanguage/toolEnv).[label](sysml:…)refs point the prose at the pass, rendering-kind and markup tables.OpenSysMLPipeline::Runtimedeclares eightBudgetparts and thebudgetExhaustionview draws eight exhaustion states, so the caption now says eight.Counts in
document.sysml, base → head:part : Paragraph20 → 1 (reading), string-literal paragraphs 19 → 0, Markdown bodies 2 → 21, value runs 0 → 12, tables 8 → 8, figures 23 → 23.The AsciiDoc note
The other markup the planner accepts is exercised by a second, smaller document,
OpenSysMLAsciiDoc::MarkupNoteinexamples/self-model/asciidoc/markup.sysml: threerep language "asciidoc"bodies carrying 9sysml:value[…]runs (the markup languages, content kinds, run kinds and immutable-plan flag ofdocumentPipeline.plans, the converter script, its environment variable, the Go package and theneedsExternalToolflag ofdocumentPipeline.asciidocProse, the Markdown parser's language), onesysml:ref[…],<<parsers>>/<<converter>>/<<languages>>cross-references, a[[converter]]+== The converterheading that opens a section, a bulleted list, emphasis, strong text, code spans and aNOTE:admonition, plus aTableover theMarkupLanguagesquery.It lives in its own directory because an AsciiDoc body needs the external converter (
scripts/asciidoc/asciidoctor-json.js, found throughOPENSYSML_ASCIIDOCTORor asasciidoctor-jsononPATH) and a document with such a body does not plan without it. The architecture document,make self-model,-render-documentsoverexamples/self-model/*.sysmlandTestSelfModelDocumentRenderstherefore stay converter-free — verified with the variable unset.TestSelfModelAsciiDocNoteRendersInstalled(new fileexamples/self_model_asciidoc_test.go, 184 lines) analyses the eight self-model files plus the note with the real converter, renders it as Markdown, HTML and AsciiDoc, and pins every value run against the model's attribute, the heading-opened section, the anchors and links, the list items, emphasis/strong text and the query table. Without a converter it skips withOPENSYSML_ASCIIDOCTOR is unset and asciidoctor-json is not on PATH: run ./scripts/download-doc-pdf-toolchain.sh and point OPENSYSML_ASCIIDOCTOR at build/doc-pdf/asciidoctor/asciidoctor-json.js; withOPENSYSML_REQUIRE_PDF_TOOLCHAINset it fails instead.TestSelfModelAsciiDocNoteSource(converter-free) pins the note's shape: 3 AsciiDoc bodies, 0 Markdown bodies, 9 value runs, 1 ref, the three xrefs, the heading-opened section, and that no file matched byexamples/self-model/*.sysmlcarries an AsciiDoc body.TestExamplesAnalyseCleanly(internal/workspace/model) grouped an example's files by directory only, so it analysed the note without the self-model it layers onto and reported unresolved references. It now opens the enclosing example directories' files with a nested example — the same grouping the README's render command uses — and, when an example's only errors are a missing markup converter (document-plan-markup-tool-missing), skips with that message unlessOPENSYSML_REQUIRE_PDF_TOOLCHAINis set, in which case it fails, the policy the converter-dependent docplan and PDF tests already follow. Verified in all three modes: skip without the converter, pass with it, fail with the variable set and no converter..github/workflows/pr.yml: the full tier'sPDF toolchain testsjob, which already provisions the converter and setsOPENSYSML_ASCIIDOCTORandOPENSYSML_REQUIRE_PDF_TOOLCHAIN=1, now also runs./examplesand./internal/workspace/modelwith-run 'Installed|TestExamplesAnalyseCleanly', so both the converter-backed render and the example analysis run (not skip) in CI. No other shard provisions the converter.examples/self-model/README.mdlists the file, the install/export/render commands and a transcript of the rendered AsciiDoc;changes/unreleased/self-model-asciidoc-note.added.mdrecords it.Rendered-document diff (develop → head), Markdown form
./bin/sysml examples/self-model/*.sysml -render-documents <dir>at bare develop4235cadc8(clean worktree) and at head,diffofOpenSysMLDocument-ArchitectureDocument.md: 9 hunks, 8272 → 8278 lines, every one accounted for (identical to the diff against the original base2c0f1750e; develop did not touch the document between the two):4tiers and66passes frompassRegistry, and links the table below<a id="checking-passes"></a>— the passes table became a ref target10000andOPENSYSML_MAX_CALC_DEPTHfromruntime.calcDepth5released and9WebAssembly commands fromopensysmllsp, runtime, session,/mcp,OPENSYSML_MCP_TOKEN,sysml-wasm.wasmasciidoc/OPENSYSML_ASCIIDOCTOR<a id="documents-kinds">,<a id="documents-prose">— the two tables became ref targetsNothing was removed: with the value runs and refs stripped, every paragraph's text is the base text verbatim (the mechanical conversion alone rendered byte-identical Markdown).
How it was verified
At head (repo root, after
make build):./bin/sysml examples/self-model/*.sysml -validate— every package ✓, no errorsgo test -count=1 ./examples/okgo test -race -count=1 ./examples/okgo test -run 'AsciiDocNote|SelfModelDocument' ./examples/withOPENSYSML_ASCIIDOCTORpointed at the pinned converter: 5 passed, none skipped; with it unset: the converter-backed test skips with the reason above, the rest passmake self-model— 40 views intobuild/self-model/(34.mmd, as on develop; the README's "forty views" holds)./bin/sysml examples/self-model/*.sysml -render-documents build/self-modeland the README's-render-document … -doc-form html -doc-toccommand: every table filled, 349,882 bytes of HTML4235cadc8from a clean worktree (unchanged after thee7506f764merge) (36 at the original base2c0f1750e) — the page count moved on develop between the two, so the README now says thirty-fourgofmt -l .empty,go vet ./...clean,go test ./tests/hygiene/ok (self_model_test.go1,789 lines,self_model_asciidoc_test.go184, both under the cap)make docs-countscurrent after the re-record below;python3 scripts/changelog.py checkokNew test
TestSelfModelDocumentProseReadsTheModelpins the document's shape (onlyreadingis a namedParagraph, no string-literal paragraphs, 21 Markdown bodies, 12 value runs), that the rendering has no unexpandedsysml:run, and that each run reads the model's value: the tier/pass counts and command counts from the attributes inpipeline.sysml/surfaces.sysml, the MCP strings and converter variable likewise, the calc-depth default and the AsciiDoc language from the rows of the budgets and markup tables in the same rendering.Develop merges and baseline movement
The branch merges
origin/developtwice, at4235cadc8(the2026-09pilot pin, #1529) and ate7506f764(the re-pinned extension libraries and thetoleratefilters of #1577, the restatedapi-json-differential.mdof #1580). Each time the conflicting baselines and report were taken from develop and regenerated on the merged tree with the standard tools (oracles re-provisioned at the pin first); the only hand edits are the figure lines the referee doc tests pin to the baselines. Every movement below is against develop's own files ate7506f764.pilot-apijson-diff -update(docs/project/api-json-differential-baseline.json): only theexamplesroot moved — files 52 → 53, matched 27002 → 26937, pilot-only 15079 → 15045, ours-only 6046 unchanged,pilotLibraryElements14020 → 15571. Two causes: the Markdown bodies (−114 matched = 6 elements × 19 literal paragraphs) and the newmarkup.sysml(+49 matched and the whole +1551 inpilotLibraryElements). The other eight roots are identical to develop's, byte for byte, including their input digests; totals 931 → 932 files, matched 92491 → 92426, pilot-only 37775 → 37741.pilot-diff -update(docs/project/pilot-differential-baseline.json): onlyself-model/asciidoc/markup.sysmlis new —examplesroot 52 → 53 files, one ours-onlyunresolved-reference(the typed converter-missing error the oracle run reports without a converter, line 16) and one pilot-onlykind-mismatchwarning (line 40, the enumeration-valuedredefines rootbinding the pilot flags on every self-model document); totals 920 → 921 files, 518 fully agreeing unchanged, 359 → 360 ours-only, 2461 → 2462 pilot-only, 1468 → 1469 / 3570 → 3571 diagnostics. Thedocument.sysmlrows moved only in line number.pilot-reject -check: no movement (349 cases, 339 both reject, 10 ours-only).tests/corpus/testdata/{corpus,api_json}_roundtrip_expected.txt): committed files 52 → 53,stable self-model/asciidoc/markup.sysml.docs/project/api-json-differential.md(the 49 pinned figures, the per-root table'sexamplesrow and the run totals for unkeyed references, extension annotations and unkeyable pilot elements in the prose),docs/project/pilot-differential.md(the headline, theexamplesand Total rows, the twoexamplescategory sentences, the movement tables) and the fivetesting-pilot-*skills' headline figures: numbers only, asTestRecordStatesTheBaselinesFigures,TestPilotDifferentialDocumentCountsMatchBaselineandTestW6FSkillDocumentCountsMatchBaselinepin them;make docs-countsis current.Checklist
make testandmake lintpass locally (the self-model gate above; CI runs the suite)changes/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count movedLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/d5353612aa7c41efb51a447c3f61bb90
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/d5353612aa7c41efb51a447c3f61bb90?variant=devin
Requested by: @HuiJun