A small, complete Digital Thread demonstrator built with SysML v2 — used as the running example for the LinkedIn blog series in ../BlogSeries-4-Posts.md.
spec/*.sysml + data/*.sysml → parser/extract.js → generated/todo-model.generated.json → vscode-extension/
↘
05-test-cases.sysml @implementedBy → tests/todo-app.test.js → app/todoApp.js
Verified against the official grammar and shipped standard library in C:\projects\sysml\SysML-v2-Release (BNF + sysml.library), not just "looks plausible."
Not to build another to-do app. To show that SysML v2 can specify a software-intensive system end-to-end — use cases, requirements, data model, task/list specification, logical architecture, traceability, test cases, physical architecture — using SysML v2's own relationship constructs (satisfy, verify, dependency, allocate), not comment conventions standing in for them, all the way down to real, passing software tests, and that the model can drive a real, running artifact instead of staying documentation.
spec/— the tool specification, 6 files:01-use-cases.sysml,02-requirements.sysml— the content.03-architecture.sysml— logical architecture (functional roles, technology-agnostic). Also wheresatisfy requirement ... by todoDigitalThread;lives: the system satisfies the requirements, not any individual example task indata/02-task-list-specification.sysml— a task is content the app manages, not the thing that fulfills a requirement.04-traceability.sysml— UC → REQ links viadependency ... from ... to ...;(the one link type with no dedicated SysML v2 keyword in this release).06-physical-architecture.sysml— physical architecture, refining the logical one via realallocate ... to ...;statements onto concrete processes/files/tech (Node.js process, TypeScript extension host, JSON file on disk).- REQ → TEST uses real
verify requirement verifiedRequirement : ...;inside each verification case's objective in05-test-cases.sysml(definition-level, unbound), re-bound to a concrete subject viaverify ... :>> verifiedRequirement;usages in03-architecture.sysml; each verification case also carries// @implementedBy: tests/todo-app.test.js#<TestName>pointing at a real, runnable test.
data/— the data model and instance data, 2 files:01-data-model.sysml— theTodoDataModelpackage:Task/TodoListoccurrence defs (TaskStatusnow has three values —open,inProgress,completed), plus theCriticalPathTaskMetadata/SprintBacklogListMetadataSemanticMetadatasubtypes tagging Task/TodoList usages with project-management concepts (same pattern the standard library itself uses inDomain Libraries/Requirement Derivation/RequirementDerivation.sysml) — kept in the same file since both describe the shape of the data, separate from the tool specification.02-task-list-specification.sysml— concreteTask/TodoListoccurrences (example backlog content) built on01-data-model.sysml.
app/todoApp.js— minimal reference implementation oftodoDigitalThread(ARCH-APP): the thing the model says satisfies REQ-TODO-001..005. Plain Node.js, no dependencies.tests/todo-app.test.js— real software tests, one per SysML verification case, same names (CreateTaskTest,ViewTasksTest, ...), Given/When/Then comments copied from each case'sdoc. Uses Node's built-in test runner.tests/sysml-task-writer.test.js— unit tests forvscode-extension/src/sysmlTaskWriter.ts'spatchTask()/addTask()/deleteTask()/nextTaskId(), the text-patch functions the extension panel uses to write status/priority edits, new tasks, and deletions back intodata/02-task-list-specification.sysmlwithout a full SysML writer. Requiresnpm run compileinsidevscode-extension/first (tests run against the compiledout/sysmlTaskWriter.js).tests/webview-harness.js— a Playwright-driven check of the actual production webview markup (vscode-extension/src/webviewMarkup.ts, compiled toout/webviewMarkup.js, has novscodeimport specifically so this canrequire()it outside the extension host). Renders it in a real Chromium page with a small in-page mock of the extension-host side of the postMessage contract, then drives filtering/selecting/editing/creating/deleting through real DOM interaction — this repo has no way to drive an actual interactive VS Code window, so this is the closest thing to a real UI test the panel gets. Also writes reference screenshots totests/screenshots/. Run withnode tests/webview-harness.js(needscd vscode-extension && npm install && npm run compilefirst, and Chromium vianpx playwright install chromiumonce).parser/—extract.js, a purpose-built demo extractor (seeparser/README.md). Reads@id/@implementedBycomments (for stable IDs and test references) plus the realsatisfy/verify/dependency/metadata ... about ...constructs above. Not a general SysML v2 parser.generated/todo-model.generated.json— actual output of running the extractor againstspec/anddata/: 11 use cases, 11 requirements, 2 tasks, 1 list, 13 test cases (each withimplementedBy), 35 trace links (derive/satisfy/verify), 2 metadata tags. Regenerate withcd parser && node extract.js.vscode-extension/— a VS Code extension with two views:- "To-Do List App", a custom Activity Bar panel (
taskPanelProvider.ts, aWebviewViewProvider): a filterable/searchable task list with status tabs (All/Open/In Progress/Done) and count badges, an inline (+) create-task input, plus an inline Task Details section showing Title, Description, editable Status/Priority dropdowns, Related Requirement(s)/Use Case(s) (resolved from the generated model'straceabilitydata — seespecs/001-task-panel-redesign/research.mdDecision 4 for why that's a list, not a single hardcoded pair), Created/Updated timestamps, and a delete action gated by an inline Yes/Cancel confirm. Every create/edit/delete round-trips throughsysmlTaskWriter.ts, which text-patchesdata/02-task-list-specification.sysmland re-runsparser/extract.jsvia the extension host's own Node runtime (not anodebinary resolved fromPATH) — the SysML model stays the source of truth, changes are never written straight to the generated JSON. Icons use the real@vscode/codiconsfont (bundled as a smalldependenciesentry, loaded viawebview.asWebviewUri/localResourceRoots), not unicode approximations. - "Model Explorer", a native
TreeViewin the Explorer sidebar (modelExplorerProvider.tswrapping the vscode-freemodelExplorerLogic.ts): browses Use Cases/Requirements/Test Cases grouped from the generated model, with each Requirement expandable into its "Derived from"/"Verified by" trace links (from the sametraceabilitydata, never a hardcoded mapping). Clicking any element opens its.sysmlsource at the matching// @id:line, found by a plain text search at click time, not a stored/extracted position — seespecs/003-model-explorer/research.md. - Not published; scaffold only — install the packaged
.vsixor run viaF5in VS Code with this folder open oncenpm install && npm run compilehas been run insidevscode-extension/.
- "To-Do List App", a custom Activity Bar panel (
This is the "public demo path" from the blog plan: no commercial tooling required, runs with plain Node.js. The "professional path" (Sensmetry Syside Automator for validated model extraction) is not implemented here — it's referenced as a future extension in the blog series, not a current claim.
cd parser && node extract.jsnode --test(Auto-discovers every *.test.js under tests/. Compile the extension first — cd vscode-extension && npm run compile — so sysml-task-writer.test.js can resolve its compiled module.)