feat(docs): run the real sysml REPL in the browser with walkthroughs; make the landing diagram editable - #869
Merged
Conversation
… make the landing diagram editable The CLI page's toy shell over sysml-engine is replaced by cmd/sysml built for js/wasm with -tags sysml_prod, hosted by docs/assets/sysml-repl.js on an in-memory filesystem holding the runtime-showcase models. Seven guided walkthroughs type their commands into the prompt; Up/Down history persists across visits and Tab completes through Session.Complete, exposed to the page as sysmlReplComplete. TestBrowserREPLWalkthroughs runs every walkthrough through the page host and pins its output. The landing diagram's source opens in an editor: the engine re-parses and re-instantiates the model as you type and redraws parts and interfaces, keeping the last good diagram while a parse error is shown. 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)".
|
Contributor
Author
…kill Co-Authored-By: jason.han <hanhuijun@gmail.com>
HuiJun
marked this pull request as ready for review
October 3, 2026 22:22
…e landing editor 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
The landing page is popular, but its browser REPL was a small JavaScript shell over five
sysml-engineRPCs. It had six commands, you couldn't declare anything at the prompt, and there were no walkthroughs. This PR replaces it with the real REPL and adds an editable landing diagram.CLI page: the real
sysmlREPL in the page (docs/cli.md,docs/assets/sysml-repl.js)cmd/sysmlis built for js/wasm with-tags sysml_prod. It is about 11.9 MB gzipped and is only downloaded when you start it.make docs-engine-assets, which the Pages workflow already runs, now builds it next tosysml-engineand copies the runtime-showcase models intodocs/assets/repl-examples/.sysml-repl.jshosts it. It runs the REPL on an in-memory filesystem, so%loadand%savework. stdin is fed one line per prompt, and both thesysml>and...>prompts are rendered.localStorageand survives reloads. A multi-line block is stored as one entry. Shift+Enter adds a line. Tab completes through the REPL's own completer, exposed to the page asglobalThis.sysmlReplComplete(cmd/sysml/complete_js.go). Ctrl-L clears the screen, Ctrl-C clears the line and Ctrl-D ends the session.docs/assets/repl-walkthroughs.json. Each one types its commands into the prompt:%sweep%satisfy%stepand%tokens%send,%trace, and%save/%clear/%loadLanding page: the diagram can be edited (
overrides/home.html)sysml-enginere-parses and re-instantiates the model and redraws the parts and interfaces.ModelJourney, and Reset puts the original model back.How it was verified
TestBrowserREPLWalkthroughs(tests/wasm/browser_repl_test.goandtestdata/browser-repl.mjs):sysml_prodjs binary and runs every walkthrough step throughsysml-repl.jsunder Node, using the real example files.expectstrings, and no step may panic.go vetandstaticcheckwere run for the host, js and wasip1 builds, plusgosecon./cmd/sysmland./tests/wasm.scripts/check-doc-links.pyandscripts/changelog.py checkwere run too.partand aninterfacedraws a new box and wire. Deleting a;showsline 56:24: missing ';'and keeps the last good diagram. Run and Reset still work.Checklist
make testandmake lintpass locally: I ran the new test and the existing wasm landing-model test, plus lint on the changed packages. I did not run the fullmake test; CI covers it.changes/unreleased/<slug>.<section>.md, not as an edit toCHANGELOG.mdmake docs-countsrun if a gate count moved: not applicable, no gate count movedF4,K5) in the body, docs, or changelogLink to Devin session: https://nasa-jpl-demo.devinenterprise.com/sessions/3c199970a2f14e5a8984ccab7a7fd242
Open in Devin Desktop: https://nasa-jpl-demo.devinenterprise.com/desktop/session/3c199970a2f14e5a8984ccab7a7fd242?variant=devin
Requested by: @HuiJun