Morphir.Models
0.5.0-alpha.5
Prefix Reserved
dotnet add package Morphir.Models --version 0.5.0-alpha.5
NuGet\Install-Package Morphir.Models -Version 0.5.0-alpha.5
<PackageReference Include="Morphir.Models" Version="0.5.0-alpha.5" />
<PackageVersion Include="Morphir.Models" Version="0.5.0-alpha.5" />
<PackageReference Include="Morphir.Models" />
paket add Morphir.Models --version 0.5.0-alpha.5
#r "nuget: Morphir.Models, 0.5.0-alpha.5"
#:package Morphir.Models@0.5.0-alpha.5
#addin nuget:?package=Morphir.Models&version=0.5.0-alpha.5&prerelease
#tool nuget:?package=Morphir.Models&version=0.5.0-alpha.5&prerelease
<img src="https://github.com/finos/branding/blob/master/project-logos/active-project-logos/Morphir%20Logo/Horizontal/2020_Morphir_Logo_Horizontal.png?raw=true" width="450">
Morphir
Morphir is a library of tools that works to capture business logic as data.
For the first time, business logic can be shared, stored, translated and visualised, all with the reliability of standardisation ensured in the Morphir framework.
What is it?
A set of tools for integrating technologies. Morphir is composed of a library of tools that facilitate the digitisation of business logic into multiple different languages & platforms. The Morphir framework is unique too in that facilities elements of automation and conversion that were previously unavailable in the field of finance-tech.
Why is it important?
Makes business logic portable. Business logic digitised provides distinct advantages: capacity for movement across departments and fields & the ability to be converted to new languages and applications.
How does it work?
Defines a standard format for storing and sharing business logic. A clear set of standards and format is in-place from the input/output, allowing for coherent structure.
What are the benefits?
✔️ Eliminates technical debt risk
Refactoring code libraries is often a harmful and time-sensitive issue for businesses, Morphir ensure the standards introduced from input eliminate delays at deployment.
✔️ Increases agility
Adaptability and usability are key concepts of the Morphir framework, business logic can now move with the code, be easily understood and adopted, in an ever-developing eco-system.
✔️ Ensures correctness
Certifying that specified functions behave as intended from input to output is assured through the Morphir library / tool chain.
✔️ Disseminates information through automation
Morphir’s automated processing helps disseminate information which otherwise may not be understood or shared at all, a useful tool when brining elements of business logic to conversation outside of its immediate audience (i.e developers).
Morphir .NET
Provides tooling for the Morphir ecosystem and .NET libraries that can be used to help you work with Morphir.
The additive shared configuration libraries
provide typed TOML, YAML, JSON/JSON5 documents, pure source resolution, named
profiles, validation and winning origins without constructing the CLI.
Morphir.Configuration.IO reads explicit files or supplied text and exposes
bounded project/workspace discovery through native and in-memory trees. See the
discovery guide for
ProjectSystem.Discover, per-root/member ProjectSystem.Load, membership/selection,
host boundaries and explicitly authorized machine sources.
Existing Git-first artifact discovery, cache-only tooling and CI overlays keep
their compatibility behavior. Shared inspection APIs
and morphir config get/list/show/path/explain expose typed values, source reports,
scoped queries and redacted explanations. The optional
Microsoft adapter projects one
resolved document with explicit/source-generated Options binding. See the
CLI reference for read controls, JSON schema
and exit codes. Shared editing services
and morphir config set/unset provide typed, scoped TOML previews and writes,
source-preserving changes, optimistic conflicts and explicit recovery ownership.
Shared classic project migration
and morphir project migrate provide loss-checked previews and guarded TOML
adoption while retaining classic bytes. Shared workspace migration
adds bounded inventory, verified membership and recoverable batch application through
morphir workspace migrate [directory]. See the
reader profile for syntax and provenance.
Get started
Install morphirup, the Morphir toolchain manager. It is one file and needs nothing else installed.
# macOS (Apple silicon) and Linux (x64, ARM64)
curl -fsSL https://raw.githubusercontent.com/finos/morphir-dotnet/main/scripts/install-morphirup.sh | sh
# Windows (x64, ARM64), in PowerShell
irm https://raw.githubusercontent.com/finos/morphir-dotnet/main/scripts/install-morphirup.ps1 | iex
# Or with mise
mise use -g 'github:finos/morphir[matching=morphirup,version_prefix=v,prerelease=true]'
The script installs morphirup from the newest Morphir release that has
it, and verifies the download first. morphirup then sets up the toolchain from the same releases. Open a new
terminal and run morphirup --version; it prints the version you installed.
| Platform | Install morphirup | Set up, compile and generate |
|---|---|---|
| macOS on Apple silicon | Yes | Yes |
| Windows x64 and ARM64 | Yes | Yes |
| Linux x64 and ARM64 | Yes | Not yet: morphirup setup does not support Linux yet |
| macOS on Intel | No | No |
Next, build your first model. The
installation guide covers script options, a given release,
manual download and the standalone morphir CLI. If something goes wrong, see
Troubleshooting.
SDK libraries
Morphir.SDK.CSharp is an independent net11.0 and net10.0 runtime package with immutable
C#/.NET public types. See the C# SDK guide
for its bounded operation contract and package usage.
Morphir.Diagrams reads Mermaid flowcharts and sequence diagrams into
immutable models and renders them to standalone SVG.
See the diagram library guide.
The in-memory C# generator lowers typed classic/v4 libraries as C# 15 (Roslyn syntax trees), immutable values, executable functions/patterns/record operations and public SDK bindings. Original business fixtures and the bounded modern package-host/trimming checks are verified under #474. Implementation #478 landed. The main specification and archived acceptance evidence landed in archive follow-up #480. Coordinator cleanup remains pending.
Generate C# through the existing CLI, with numeric profiles and a validated optional namespace:
morphir generate --input model.json --target csharp --output generated --option language-version=15 --option namespace=Example.Generated --json
The C# walkthrough builds and runs a fresh consumer against the immutable runtime. CLI implementation #482 landed; its main specification and archived evidence are synchronized in this follow-up. Archive PR landing and root-verified cleanup remain pending.
Build from source and other installs
Building from source
The repository builds with the .NET 11 SDK and C# 15. Applications, .NET tools and tests target net11.0.
Packable libraries target net11.0 and net10.0 (.NET 10 LTS), so .NET 10 applications can use them.
.NET 8 and .NET 9 reached the end of support on 2026-11-10, so .NET 10 is the lowest target.
MSBuild tasks and Myriad plugins target net10.0, so the .NET 10 SDK can load them.
The netstandard2.0 attribute packages keep that target. The properties
MorphirCurrentTargetFramework, MorphirLibraryTargetFrameworks and MorphirHostedTargetFramework in
Directory.Build.props set these targets.
Install the SDK pinned in global.json, for example with dotnetup sdk install or
dotnet-install --jsonfile global.json. CI uses the same SDK pin. mise.toml pins the other
development tools (OpenSpec, Node, PowerShell), not the .NET SDK.
VS Code users can run Dev Containers: Reopen in Container to use the
Microsoft .NET SDK image in .devcontainer/Dockerfile.
The SDK includes the C# and F# compilers. Renovate groups the container and global.json
SDK updates together and keeps them on the .NET 11 SDK. Moving to the next SDK
major version requires an explicit baseline update.
./build.sh --target Test
./build.sh --target PackAll
./build.sh --target TestBuild
To compile classic Morphir model JSON into F#, see the Myriad getting-started article, plugin reference, and car rental tutorial. The runnable example covers inventory, reservation, pickup, return and billing with one generated F# file per module.
Other ways to install the standalone morphir CLI
To install with morphirup, see Get started. These routes install the morphir command line
itself:
Using proto (Recommended for multi-language toolchains):
# Install proto (if not already installed)
curl -fsSL https://moonrepo.dev/install/proto.sh | bash # Linux/macOS
# or: irm https://moonrepo.dev/install/proto.ps1 | iex # Windows
# Add Morphir plugin and install
proto plugin add morphir "source:https://github.com/finos/morphir-dotnet/releases/latest/download/morphir_plugin.wasm"
proto install morphir
Using Platform-Specific Install Scripts:
# Linux
curl -fsSL https://raw.githubusercontent.com/finos/morphir-dotnet/main/scripts/install-linux.sh | bash
# macOS
curl -fsSL https://raw.githubusercontent.com/finos/morphir-dotnet/main/scripts/install-macos.sh | bash
# Windows (PowerShell)
irm https://raw.githubusercontent.com/finos/morphir-dotnet/main/scripts/install-windows.ps1 | iex
Using .NET Tool (requires .NET SDK):
dotnet tool install --global Morphir.Tool --prerelease
Verify Installation:
morphir --version # native executable
dotnet-morphir --version # .NET tool
Compile F# to Morphir IR: follow the five-minute Compile F# guide.
For detailed installation instructions and troubleshooting, see the Installation Guide.
Documentation
Building
This project uses Nuke for build orchestration, providing a strongly-typed, cross-platform build system written in C#.
Requirements
- .NET SDK 11.0.100 or a later patch in the same feature band, as specified in
global.json
Basic Commands
# First-time setup: Restore tools and dependencies
dotnet tool restore
./build.sh --target Restore
# Build the solution (default target)
./build.sh
# Run tests
./build.sh --target Test
# Run linting/formatting checks
./build.sh --target Lint
# Format code
./build.sh --target Format
# Run full CI pipeline (restore, build, test, lint)
./build.sh --target CI
# Show all available targets
./build.sh --help
Windows users: Use build.cmd or build.ps1 instead of ./build.sh
Configuration
You can set the build configuration using the --configuration parameter:
# Build in Debug mode
./build.sh --configuration Debug
# Run tests in Debug mode
./build.sh --target Test --configuration Debug
By default, commands use Release configuration.
Build system
The build runs on Fallout 10.5.0, the successor to Nuke. ./build.sh, build.ps1, and build.cmd are the entry points. Target names are unchanged from the earlier Just-to-Nuke move, which is recorded in NUKE_MIGRATION.md.
Developing
The shared .NET SDK contract freezes the bounded operation signatures, scalar limits and independent expectations used by both SDK deliveries. See the fixture guide for the build command, schema and provenance. After building its test project, run the offline validator with:
dotnet exec tests/Morphir.SDK.Conformance.Tests/bin/Debug/net11.0/Morphir.SDK.Conformance.Tests.dll --maximum-parallel-tests 2
F# runtime consumers use Morphir.SDK.FSharp. Its namespace and runtime assembly
remain Morphir.SDK, so existing generated source and runtime type identities
remain valid. The legacy Morphir.SDK package depends on the canonical package
and ships no runtime assembly. See the F# runtime migration guide
for dependency selection and covered behavior corrections.
Project Structure
morphir-dotnet/
├── src/
│ ├── Morphir.Core/ # Core IR types and utilities
│ ├── Morphir.Tooling/ # Tooling infrastructure
│ └── Morphir/ # CLI application
├── tests/
│ ├── Morphir.Core.Tests/ # Unit tests for Core
│ ├── Morphir.Tooling.Tests/ # Unit tests for Tooling
│ └── Morphir.BlackBox.Tests/ # Black-box tests of the built artifacts (BDD/Gherkin)
├── build/
│ ├── _build.csproj # Nuke build project
│ └── Build.cs # Build orchestration (strongly-typed)
├── scripts/ # Build and utility scripts (C# scripts)
├── build.sh/cmd/ps1 # Nuke bootstrap scripts
└── justfile # Legacy build commands (preserved for reference)
Development Workflow
Restore dependencies:
./build.sh --target RestoreBuild the solution:
./build.sh --target CompileRun tests:
./build.sh --target TestCheck code formatting:
./build.sh --target LintFormat code (if needed):
# Unix/macOS ./build.sh --target Format # Windows build.cmd --target Format # or ./build.ps1 --target Format
Scripts
The project uses C# scripts (.cs files) for build automation, leveraging the direct C# file execution of the .NET SDK. These scripts are located in the scripts/ directory:
run-tests.cs- Runs unit testsrun-e2e-tests.cs- Runs end-to-end testsgenerate-wolverine-code.cs- Generates Wolverine code
Note: The deprecated build-tool-dll.cs, pack-tool-platform.cs, publish-single-file.cs and publish-single-file-untrimmed.cs scripts have been removed. Use the Nuke build targets (PackTool, PublishTool, PackRelease, PublishSingleFile, PublishSingleFileUntrimmed) instead.
Build Commands
All Nuke build commands support both Unix/macOS (./build.sh) and Windows (build.cmd or ./build.ps1) bootstrap scripts. Examples below show both formats.
Building Libraries
# Unix/macOS: Pack library projects as NuGet packages
./build.sh --target PackLibs
# Windows
build.cmd --target PackLibs
# or
./build.ps1 --target PackLibs
# Pack all projects (libraries and tool)
./build.sh --target PackAll # Unix/macOS
build.cmd --target PackAll # Windows
# Specify configuration and version
./build.sh --target PackLibs --configuration Debug --version 1.2.3
build.cmd --target PackLibs --configuration Debug --version 1.2.3
# Custom output directory
./build.sh --target PackLibs --output-dir ./my-packages
build.cmd --target PackLibs --output-dir ./my-packages
Building Release Profiles
The four .NET deployment offerings each have a named release profile. PackRelease publishes one profile for one platform and packs it into an archive named morphir-dotnet-<release>-<deployment>-<rid>.<zip|tar.gz> (zip on Windows, tar.gz elsewhere, files at the archive root), or for dotnet-tool the Morphir.Tool.<release>.nupkg package. The release comes from CHANGELOG.md. Output goes to artifacts/release/; the publish folders are in artifacts/release/publish/<deployment>/<rid>/.
# Native AOT morphir (src/Morphir). Build on the operating system of the RID.
./build.sh --target PackRelease --deployment native-aot --rid linux-x64
build.cmd --target PackRelease --deployment native-aot --rid win-arm64
# Managed morphir with the in-process F# frontend (src/Morphir.Managed), untrimmed folder archives
./build.sh --target PackRelease --deployment self-contained --rid osx-arm64
./build.sh --target PackRelease --deployment framework-dependent --rid linux-arm64
# The Morphir.Tool package (dotnet-morphir). Portable, so no --rid.
./build.sh --target PackRelease --deployment dotnet-tool
# Publish only, without the archive
./build.sh --target PublishRelease --deployment self-contained --rid win-x64
Platforms: win-x64, win-arm64, osx-x64, osx-arm64, linux-x64, linux-arm64. Any other RID is refused. Beside each archive, <archive>.build-launch.json records its launch path, execution mode, layout (single-file, folder or tool-package), bundled runtime, required runtime or SDK, F# frontend, prerequisites and SHA-256. The operating-system prerequisites are not declared yet; qualifying the artifact on each platform establishes them. It is a build output, not a public contract. PackRelease fails when the publish folder contradicts it, for example a framework-dependent folder that carries coreclr. Building a profile does not qualify a platform: no platform is release-qualified yet. Checking the release profiles from packaged artifacts runs the E2E suite against the packaged archives and lists what has been run on each platform; nothing is qualified by it. PackRelease also writes <archive>.build-contents.json and artifacts/release/size-report.md, which list every file each artifact contains with its size.
The same publish folder always gives the same archive bytes. A publish for one RID writes its NuGet lock files under obj/publish-lock/<rid>/, so it leaves the committed packages.lock.json files alone. To check, run git status --short before and after PackRelease: it should list nothing new outside artifacts/, which is ignored.
On Windows, the Native AOT link needs the Visual Studio C++ build tools for the target architecture, and the ILCompiler targets call vswhere.exe. If the link fails with "'vswhere.exe' is not recognized", put %ProgramFiles(x86)%\Microsoft Visual Studio\Installer on PATH in that shell.
Building Executables
These targets keep the layouts that the workflows and E2E tests use. PublishSingleFile builds the legacy release asset that releases ship as morphir-<rid>[.exe] and morphir-<rid>-v<version>.tar.gz.
# Build a trimmed single-file executable for a specific platform
./build.sh --target PublishSingleFile --rid linux-x64 # Unix/macOS
build.cmd --target PublishSingleFile --rid linux-x64 # Windows
# Build an AOT (ahead-of-time compiled) executable
./build.sh --target PublishExecutable --rid linux-x64
build.cmd --target PublishExecutable --rid linux-x64
# Build an untrimmed executable (larger, better for debugging)
./build.sh --target PublishSingleFileUntrimmed --rid win-x64
build.cmd --target PublishSingleFileUntrimmed --rid win-x64
# Common RIDs: linux-x64, linux-arm64, win-x64, osx-x64, osx-arm64
# With custom configuration and output directory
./build.sh --target PublishSingleFile --rid linux-x64 --configuration Debug --single-file-dir ./bin
build.cmd --target PublishSingleFile --rid linux-x64 --configuration Debug --single-file-dir ./bin
Building the Dotnet Tool
# Pack the Morphir CLI as a dotnet tool
./build.sh --target PackTool # Unix/macOS
build.cmd --target PackTool # Windows
# With version and output directory
./build.sh --target PackTool --version 2.0.0 --output-dir ./packages
build.cmd --target PackTool --version 2.0.0 --output-dir ./packages
Testing
# Run unit tests
./build.sh --target Test # Unix/macOS
build.cmd --target Test # Windows
# Run tests in Debug configuration
./build.sh --target Test --configuration Debug
build.cmd --target Test --configuration Debug
# Build the black-box test project for the published targets
./build.sh --target BuildE2ETests
build.cmd --target BuildE2ETests
# Run end-to-end tests
./build.sh --target TestE2E # Unix/macOS
build.cmd --target TestE2E # Windows
# Run the black-box tests on one target (a value of MORPHIR_TEST_TARGET, or tool, all or offerings)
./build.sh --target TestE2E --executable-type trimmed
build.cmd --target TestE2E --executable-type trimmed
Publishing to NuGet
# Publish library packages to NuGet.org
./build.sh --target PublishLibs --api-key YOUR_API_KEY # Unix/macOS
build.cmd --target PublishLibs --api-key YOUR_API_KEY # Windows
# Publish the Morphir CLI tool package to NuGet.org
./build.sh --target PublishTool --api-key YOUR_API_KEY
build.cmd --target PublishTool --api-key YOUR_API_KEY
# Publish all packages
./build.sh --target PublishAll --api-key YOUR_API_KEY
build.cmd --target PublishAll --api-key YOUR_API_KEY
# Publish to custom NuGet source
./build.sh --target PublishLibs --nuget-source https://custom-feed.com --api-key YOUR_KEY
build.cmd --target PublishLibs --nuget-source https://custom-feed.com --api-key YOUR_KEY
# Publish to local NuGet feed (for testing)
./build.sh --target PublishLocalLibs # Unix/macOS
build.cmd --target PublishLocalLibs # Windows
# With custom local source
./build.sh --target PublishLocalLibs --local-source ./my-local-feed
build.cmd --target PublishLocalLibs --local-source ./my-local-feed
# Install tool locally from package
./build.sh --target PublishLocalTool
build.cmd --target PublishLocalTool
# Install globally
./build.sh --target PublishLocalTool --global true
build.cmd --target PublishLocalTool --global true
Available Nuke Targets
Run ./build.sh --help (Unix/macOS) or build.cmd --help (Windows) to see all available targets with descriptions and parameters.
Key targets:
Restore- Restore .NET dependenciesCompile- Build the solution (default target)Test- Run unit testsLint- Check code formattingFormat- Format codeCI- Run full CI pipeline (restore, build, test, lint)PackLibs- Pack library projects as NuGet packagesPackTool- Pack the Morphir CLI as a dotnet toolPackAll- Pack all projects (libraries and tool)PublishRelease- Publish one release profile (requires--deployment, and--ridexcept fordotnet-tool)PackRelease- Pack one release profile into its named archive and launch metadataPublishSingleFile- Publish the legacy trimmed single-file release asset (requires--rid)PublishExecutable- Publish AOT executable (requires--rid)PublishSingleFileUntrimmed- Publish untrimmed single-file executable (requires--rid)TestE2E- Run each group of the black-box tests against a published or packaged targetPublishLibs- Publish library packages to NuGetPublishTool- Publish tool package to NuGetPublishAll- Publish all packages to NuGetPublishLocalLibs- Publish libraries to local feedPublishLocalTool- Install tool locally from packagePublishLocalAll- Publish all to local feed
Contributing
We welcome contributions! Please see our Contributing Guide for details.
License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Links
SDK runtime delivery and archival evidence is recorded in the runtime delivery record. The canonical C# runtime spec, F# package spec, and stable C# API handoff describe the landed runtimes. SDK archive #472 landed; source SDK worktrees and their owned artifacts were removed. Empty shared archive directory cleanup remains pending with the recorded permission/policy limitations.
OpenSpec change proposals
The extension installation library documents the implemented distribution parsers, platform mappings and MEP eligibility checks, along with the remaining installer work tracked by #558. Extension installation commands are not implemented yet.
The Morphir Compatibility Kit seed contains portable F# frontend cases, a closed step vocabulary and the deterministic library runner. Its reader/runner tests and Native AOT smoke check are independent of the production F# frontend, which is still being implemented.
This repository uses the shared html-design OpenSpec workflow. New proposals
produce capability specs, a standalone design.html, and implementation tasks.
See the OpenSpec guide for setup, verification and updates.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- FSharp.Core (>= 10.1.403)
- Microsoft.Extensions.FileProviders.Abstractions (>= 11.0.0)
- Microsoft.Extensions.Primitives (>= 11.0.0)
- Morphir.Files (>= 0.5.0-alpha.5)
- System.Text.Json (>= 11.0.0)
- YamlDotNet (>= 16.3.0)
-
net10.0
- FSharp.Core (>= 10.1.403)
- Microsoft.Extensions.FileProviders.Abstractions (>= 11.0.0)
- Microsoft.Extensions.Primitives (>= 11.0.0)
- Morphir.Files (>= 0.5.0-alpha.5)
- YamlDotNet (>= 16.3.0)
-
net11.0
- FSharp.Core (>= 10.1.403)
- Morphir.Files (>= 0.5.0-alpha.5)
- YamlDotNet (>= 16.3.0)
NuGet packages (9)
Showing the top 5 NuGet packages that depend on Morphir.Models:
| Package | Downloads |
|---|---|
|
Morphir.Tooling
Package Description |
|
|
Morphir.IR.Pipeline.Plugins
Pipeline plugins for Morphir IR packages: optimizer, type validator, exact scalar folding and pretty printer. |
|
|
Morphir.Ion
Reads Morphir's Amazon Ion formats: the Ion IR format and the MEP morphir_model document |
|
|
Morphir.CodeGeneration.FSharp
Morphir classic and v4 IR to F# code generation |
|
|
Morphir.Compilation
Language-neutral Morphir compilation contracts: exact IR targets, checked diagnostics, the IR builder interface and the writer, builder and project-file provider registries. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.5.0-alpha.5 | 58 | 11/22/2026 |
| 0.5.0-alpha.4 | 115 | 11/16/2026 |
| 0.5.0-alpha.3 | 116 | 11/14/2026 |
| 0.5.0-alpha.2 | 118 | 11/13/2026 |
| 0.5.0-alpha.1 | 118 | 11/13/2026 |
| 0.4.0-alpha.5 | 115 | 11/13/2026 |
| 0.4.0-alpha.4 | 110 | 11/10/2026 |
| 0.4.0-alpha.3 | 105 | 11/9/2026 |
| 0.4.0-alpha.2 | 92 | 11/8/2026 |
| 0.4.0-alpha.1 | 90 | 11/7/2026 |
### Added
- `Morphir.Svg` builds immutable SVG scenes with F# computation expressions and C# factories. `Morphir.Diagrams` reads Mermaid flowcharts and sequence diagrams and renders standalone SVG or an offline HTML player in a theme with dark and light palettes: Archify (the default), Monokai, Cobalt, Solarized, Gruvbox, Ocean, Darcula, Material or a custom `DiagramTheme`. `SvgRenderOptions` selects the theme and a mode: `Auto` follows the viewer preference, and `Dark` or `Light` writes one palette. The colours are documented CSS variables that a host page can override. See the [diagram library guide](src/Morphir.Diagrams/README.md) for current coverage.
- `Morphir.Knowledge` provides versioned text selections, annotations and links. `Morphir.Knowledge.Okf` provides an AST and lossless CST with cursor visitors and OKF v0.2 and v0.3 bundle validation through `morphir knowledge validate`. `Morphir.Knowledge.Rdf` provides RDF datasets, graph and statement addresses, and N-Quads exchange. See the [knowledge library guide](src/Morphir.Knowledge/README.md).
- Diagram-linked metadata. Every element of a Mermaid diagram has a stable reference (`DiagramElementRef`, such as `node=Billing` or `edge=Cart/Billing/0`) and an IRI under the diagram's document, and rendered SVG marks each element with `data-ref`. `DiagramSnapshot` and `DiagramSelection` target elements of one source revision, which defaults to the SHA-256 of the source. `DiagramAnnotations` maps comments (W3C Web Annotation) and links to text, code, IRIs or other diagrams to and from RDF, and keeps every other statement. `SvgRenderOptions.WithDocument` and `WithMetadata` embed a dataset canonically in the SVG's `metadata` element as RDF/XML, N-Quads or N-Triples, `DiagramMetadata.TryRead` reads it back, and the offline player marks each annotated element and lists its comments, links and statements in a notes panel. `Morphir.Knowledge.Rdf` adds N-Triples and RDF/XML reading and writing (the W3C RDF/XML suite passes) and RDFC-1.0 canonicalization (the W3C rdf-canon suite passes); `Morphir.Svg` adds namespaced names and a secure metadata reader. XML readers prohibit DTDs and use no resolver. See [Metadata in the SVG](src/Morphir.Diagrams/README.md#metadata-in-the-svg) ([#689](https://github.com/finos/morphir-dotnet/issues/689))
- Every diagram family of diagrams.mbt 60a8dd1. `Morphir.Diagrams` reads Mermaid state, swimlane, architecture (with 526 icon keys: AWS, Azure, Google Cloud and UML symbols copied with their notices, and symbols drawn for this library) and ZenUML diagrams; PlantUML activity (modern and legacy), state, regex, EBNF, JSON and YAML blocks; and BPMN 2.0.2 process and collaboration views with BPMN notation, supplied geometry or an automatic layout. `DiagramSource` detects the language. Each family has element references, themes, the offline player and a printer where the syntax has one (`Mermaid.Print`, `PlantUml.Print`), and the pinned upstream corpora are read as Mermaid and PlantUML read them. Mermaid flowcharts and sequences gain the remaining syntax and canonical printing; connectors take elbow, rounded or curved styles and opt-in bridges; railroad diagrams draw external match traces; and the player explores routes and reachability (`DiagramExploration`) and plays node visits. See the [diagram library guide](src/Morphir.Diagrams/README.md).
- `Morphir.Bpmn` reads BPMN 2.0.2 XML with DTDs and entities refused into a lossless tree and a typed element view, validates structure and references, writes canonical and pretty XML, and traverses and queries the document without recursion. `Morphir.Diagrams.Query` adds a bounded structural query language over trees with a BPMN adapter. `Morphir.Diagrams.Raster` exports the library's SVG as PNG or JPEG and a playback as an animated GIF in managed code, with the same bytes on every platform, embedded Noto fonts under the SIL Open Font License, and player downloads. See [Morphir.Bpmn](src/Morphir.Bpmn/README.md), [Morphir.Diagrams.Query](src/Morphir.Diagrams.Query/README.md) and [Morphir.Diagrams.Raster](src/Morphir.Diagrams.Raster/README.md).
- `DocumentTreeStore.openSnapshot` reads plain v3.1 and v4 JSON or YAML document trees from an `IFileProvider`. Generators can page modules and members and decode selected definitions within a per-file byte limit. The caller keeps the input revision stable while those operations run. See [the pipeline guide](src/Morphir.IR.Pipeline/README.md#read-a-document-tree-by-page).
- The bounded document-tree reader reads contextual trees too: it resolves a name-compaction alias in one typed slot without expanding the enclosing body, in JSON and YAML, and keeps the original bytes for pass-through. It can export one logical file as expanded plain JSON under an output limit that is separate from the source limit, without holding every definition body, and keeps the physical stems that `fileNames` records ([#681](https://github.com/finos/morphir-dotnet/pull/681), [#684](https://github.com/finos/morphir-dotnet/pull/684)).
- `Morphir.Mep` negotiates MEP `0.2.0-draft.2` with model access `0.1.0-draft.1`. A guest can generate from a package on disk without receiving the whole model: `HostSession.CreateWithModelAccess` builds the host, and `StartGenerationAsync`, `AdvanceGenerationAsync` and `CancelGenerationAsync` drive ordered rounds in which the guest requests inventory pages and documents of one snapshot. Deliveries are checked for canonical base64, length, SHA-256, request order and batch limits before dispatch. A draft.1 selection keeps the whole-model path. The same exchange runs on a framed process connection and on a WASM byte-call channel. See [Bounded generation](src/Morphir.Mep/README.md#bounded-generation) ([#680](https://github.com/finos/morphir-dotnet/pull/680), [#684](https://github.com/finos/morphir-dotnet/pull/684)).
- `morphir generate` without `--input` generates from a compile record whose IR is a document tree through a bounded session. The host offers the record's exact IR version and codec under MEP `0.2.0-draft.2`, holds the compile read lease until the guest has stopped, and serves the selected documents without giving the guest the tree's path. It works with a native guest (`--extension`) or an Extism WASM guest configured under `[extensions.<target>]` with `abi = "extism-kernel-v1"`. Frame, guest-state and artifact limits are checked before decoding, and one `maxSessionWorkUnits` budget covers reading and output; running out returns `extension.bounded_work_limit` and discards the stage. Chunks are staged privately, then the completed files go to `<out-dir>/generate/<target>.dest`, are recorded in `<target>.json` and are installed into `--output` through the task record's `installed` ledger. A run that fails after replacing a working result leaves a tombstone, and the previous install stays in place. See [Bounded generation from a compile record](docs/content/docs/cli/generate.md#bounded-generation-from-a-compile-record) ([#690](https://github.com/finos/morphir-dotnet/pull/690), [#691](https://github.com/finos/morphir-dotnet/pull/691), [#697](https://github.com/finos/morphir-dotnet/pull/697)).
- `morphir generate --bounded-profile orders-scale` selects provisional limits for the recorded-tree path with a configured WASM backend and a plain JSON v4 tree, for the Orders scale workload. Its JSON report adds `boundedAccess`: the effective limits, the guest's and Extism kernel's peak linear memory against the applied ceiling, the largest input and output batches, and the discovery index's peak charge. These limits are not a resident-memory guarantee. See [Manual Orders scale admission](docs/content/docs/cli/generate.md#manual-orders-scale-admission) ([#693](https://github.com/finos/morphir-dotnet/pull/693), [#696](https://github.com/finos/morphir-dotnet/pull/696)).
- `Morphir.Files` exchanges trees with `Microsoft.Extensions.FileProviders`: `VFileProviders.asFileProvider` gives a `VFileTree` wherever an `IFileProvider` is accepted, and `VFileProviders.ofFileProvider` builds a tree from any provider (physical, embedded, composite) without reading a file until it is read. `Morphir.Models` now depends on `Morphir.Files`, so the analyzer and MSBuild task folders of `Morphir.Lang.CSharp` also carry `Morphir.Files`, `Microsoft.Extensions.FileProviders.Abstractions` and `Microsoft.Extensions.Primitives`. See [the Morphir.Files README](src/Morphir.Files/README.md#exchange-files-with-ifileprovider).
- `Morphir.Models` has `Morphir.IR.Trees.TreeStems`, the stems of a document tree that `Morphir.Ion` used internally: `escapeName` writes a name as a file stem, `parseStem` reads one back (a whole name or a cut stem), `matchesCut` checks a cut stem's prefix and digest against a name, and `splitDependency` splits a `deps/` path at its bare `@` segment.
- `ClassicJsonWriter` writes a classic `Specs` distribution at format `3.1.0` with the new profile `ClassicWireProfile.v3_1_0`: `"formatVersion": "3.1.0"` and the `Specs` tag. A Specs at 1, 2 or 3, or a Library at 3.1.0, is refused with `unsupported-distribution`, and the message names the supported set. `Morphir.IR.Trees.ClassicDocumentTree`, beside `V4DocumentTree`, splits a classic v3 model into a document tree and joins it back with every attribute unchanged; its manifest records whether the single file says `3` (a Library) or `"3.1.0"` (a Specs).
- `morphir model verify` checks IR v4 and document trees. A single file with `"formatVersion": 4` (or a v4 release such as `"4.0.0"`) is checked against the parent's `morphir-ir-v4.json`, and `--schema-version=4` selects it; it is then decoded with the v4 reader, which names the node at fault in a module (the parent's schema, which checks a module in every spelling, locates the fault only at the module), and the reader's error is listed with its code and JSON location. A directory is a document tree: each file of a v4 tree against its kind in the parent's `morphir-ir-v4-document-tree-files.json`, then every rule of a tree and every document through the document-tree store, as `morphir model convert` reads it; a v3 tree, whose files say `"3.1.0"`, through the store alone. Every error is listed, each with its `file` in the tree and its JSON location (`Path`, a JSON Pointer), and a rule of the tree has the parent's code, such as `missing_member`. The version of a tree comes from its manifest, and a `--schema-version` that contradicts it exits 2 with `verify.schema_version_conflict`. The report adds `layout` (`single-file` or `document-tree`), `filesChecked` and `compactedFiles`, and an error of a tree adds `file` and `code`. See [model verify](docs/content/docs/cli/model-verify.md#document-trees).
- `morphir model convert` stores a Morphir model as a single file or as a document tree without changing the model or its IR version: `morphir model convert --input morphir-ir.json --output tree --layout=document-tree`, and back with `--layout=single-file`. The input's layout is detected (a file or a tree's directory), and `--layout=document-treesingle-file` chooses the output's (the form with a space is accepted too); it defaults to the input's layout, and a run that changes neither the layout nor the encoding exits 2 with `model.nothing_to_do`. IR v3 and IR v4 are converted: a v3 Library tree says `"3.1.0"` in every file and joins back to `"formatVersion": 3`, a v3 Specs keeps `"3.1.0"`, and a v1 or v2 file is refused with `model.unsupported_version`. A tree is read and written through the document-tree store that `model verify` checks trees with, so a refused tree has the parent's code, such as `missing_member` or `tree.ambiguous_profile`, and names its file; a v4 manifest's `version` and `created` are dropped with a `tree.dropped_manifest_member` notice each. `--output` must not exist (a tree may also go to an empty directory) and must not overlap the input (`model.output_not_empty`, `model.output_overlaps_input`); the output is staged beside it and moved into place, so a refused or failed run leaves nothing there. `--json[=streamdocument]` gives the report (`success`, `exitCode`, the paths, layouts and encodings, `irVersion`, `filesWritten`, `diagnostics`, `notices`) and, as a stream, `stageStarted`, `stageCompleted`, `diagnostics`, `notices` and one `fileWritten` event per file. Compacted files are read and written (see the next two entries). See [model convert](docs/content/docs/cli/model-convert.md).
- `morphir model convert` and `morphir model verify` read compacted Morphir files: a single file or a tree file in a name-compaction envelope of finos/morphir's `ir/name-compaction` (`ir-context` 0.1.0-draft.1), whose document names entries of the envelope's `context` with `{"$name": "<id>"}`. The document is expanded at the typed name positions only (classic word arrays in a v3 document, canonical strings in a v4 one, with no change of version), and then read or checked as a plain document. `convert` writes the expanded model plain and states `inputEncoding: "compacted"`; a tree is compacted when any of its files is, so a compacted input with no `--layout` is not `model.nothing_to_do`. `verify` checks the expanded documents against their schemas and lists the compacted files in `compactedFiles`. An envelope or a context that breaks a rule of the contract is refused, naming the file, with the contract's code: `context.undeclared_schema`, `context.unknown_alias`, `context.duplicate_entry`, `context.unknown_critical`, `context.too_many_entries`, `context.name_too_long`, `context.after_document`, `context.invalid_envelope` or `context.invalid_entry` (exit code 1). See [Encodings](docs/content/docs/cli/model-convert.md#encodings) and [Compacted files](docs/content/docs/cli/model-verify.md#compacted-files).
- `morphir model convert --compact[=names]` writes compacted files under finos/morphir's writer policy `morphir.compact/0.1.0-draft.1`: a single file stays one file, and each file of a tree, the manifest included, gets its own context. A name, path or fully qualified name gets an alias only when its uses save more bytes than its table entry costs, and the envelope is written only when the aliases save more than it adds; otherwise the file is its plain document, with a `model.compaction_declined` notice. Every file written with `--compact`, compacted or declined, is in the policy's written form: the member sorting and string escaping of RFC 8785 canonical JSON, no whitespace and no trailing newline, with three exceptions: numbers are written as the plain file writes them (IR v4 keeps their lexemes, so `9007199254740993`, `1.0` and `1e2` stay as they are; a classic v3 float is a double, which the plain file writes in its shortest form, so `1.0` and `1e2` are written `1` and `100`, compacted or not, with the same value), the parameters of a v4 value (a definition's `inputTypes`, a specification's `inputs`) keep their order, and the content of a `DocumentLiteral` is written exactly as in the source, its keys in their order and its numbers as their lexemes. Every size is the UTF-8 byte length of that form. Record fields, module members, constructors and dependencies may come back in sorted order; function parameters keep their order. `Morphir.Json.CanonicalJson.writeSourceForm` writes that form, and `CanonicalJson.write` stays RFC 8785. On Windows, the move of the written output into place, a single file or the staged directory of a tree, waits a bounded time while another process briefly holds a written file open (`Morphir.Files.FileReplacement`, which also counts the access denial that `Directory.Move` raises as an `IOException`), as the publication of a tree's files does; if something appears at the output during the wait, the write is refused with `model.write_failed` and that output is left as it is, never replaced or merged into. The output equals the policy's fixed cases byte for byte, expands to the document it was written from, and is the same for the same model. The report names `compactMode` and `compactPolicy`, and `outputEncoding` is `compacted` when a file written is in an envelope. In `Morphir.Models`, `Morphir.IR.Files.CompactionPolicy.compact` compacts one document, `DocumentTreeStore.write` with `Compact = Some Names` compacts each file of a tree and lists the declined ones in `DocumentTreeStore.plainFiles`, and `StoredModel.TryWriteSingleFile` takes the compaction flag and says whether an alias was worth its cost. See [Compaction](docs/content/docs/cli/model-convert.md#compaction).
### Changed
- `morphir model verify` refuses a single file whose top-level `$schema` is not the declared name-compaction envelope (`ir-context` 0.1.0-draft.1) with `context.undeclared_schema` (exit code 1). It used to check such a file as a plain document. An error in a compacted file is located in the file as written: its `Path` starts with `/document`, the envelope's document member.
- `morphir model verify` lists only the errors of the subschemas that fail: an error of a branch of an `anyOf` or a `oneOf` that another branch satisfies is no longer listed, so an invalid node no longer brings errors of members that are valid. `--schema-version` takes 1 to 4, and another number is a usage error with exit code 2, where it was reported as a file that does not exist. A path whose directory does not exist is reported as a file that does not exist rather than failing.
- **BREAKING:** `morphir model` replaces `morphir ir`. The group holds the commands that act on a Morphir model, and `morphir ir verify` is now `morphir model verify`, with the same inputs, options and exit codes, apart from the changes below and the `--schema-version` entry above. There is no alias: `morphir ir` is an unknown command, so scripts change `ir verify` to `model verify`. The verification report adds `exitCode` (0 valid, 1 not valid, 2 a command line that does not parse) beside `IsValid`, which keeps its name, so the report itself tells a usage failure from a model that is not valid. `--quiet` with a JSON mode now writes the JSON report, which it hid before; `--quiet` alone still writes nothing. See [model verify](docs/content/docs/cli/model-verify.md).
- **BREAKING:** `ClassicWireProfile` replaces `LibraryTag` with `Distribution` (`ClassicProfileDistribution.Library` or `ClassicProfileDistribution.Specs`, each with its tag) and adds `Release`, the string `formatVersion` of a release profile, and `EntryDocs`, how a type or value of a module with no documentation is written. The v1, v2 and v3 profiles write the same bytes as before.
- **BREAKING:** `morphir compile --json` streams: it writes the compile events as JSON Lines (`stageStarted`, `diagnostics`, `stageCompleted`) and ends with one `{"event":"completed","report":{...}}` record that holds the report. `--json=document` writes the report alone, as `--json` did before. `--json-lines` is removed and fails as an unknown option with exit code 2; use `--json`. A mode is given only after `=`: `--json document` fails with exit code 2 and suggests `--json=document`, and the help shows `--json[=streamdocument]`. The conformance `cli` adapter drives `compile --json`.
- **BREAKING:** every other command with machine output follows the same convention: `validate`, `generate`, `config` (`get`, `list`, `show`, `path`, `explain`, `set`, `unset`), `extension list`, `extension runtimes`, `project migrate`, `workspace migrate` and `model verify`. A bare `--json` now writes one `{"event":"completed","report":{...}}` line, which is also one JSON document; `--json=document` writes the report alone, as `--json` did before. A mode is given only after `=`, so `model verify --json model.json` verifies `model.json`, and a mode that is not `stream` or `document` fails with exit code 2. A parse or usage error in a JSON mode still ends with one report and exit code 2: `extension list`, `extension runtimes` and `model verify` now render their own parse errors, with exit code 2 instead of 1. The usage failure of `config` and the migrations adds only the parser messages that quote no value (an unknown mode, the `--json=document` hint, an unknown option name). `extension worker` keeps the form of the pinned WASM worker contract: `--help --json` still writes one `morphir/command-result`, with no `completed` wrapper, and the event lines stay `morphir/command-event`; it takes `--json=stream` and `--json=document`, which change nothing. The conformance runner refuses a host whose help result is wrapped. morphirup's readiness check runs `generate --json=document`. See [Machine output](docs/content/docs/cli/_index.md#machine-output).
- `VFile`, `VFileTree` and `PropertyBag` moved from `Morphir.IR.Pipeline` to the new package `Morphir.Files`, in the namespace `Morphir.Files`. Code that uses them adds `open Morphir.Files` (F#) or `using Morphir.Files;` (C#). `Morphir.IR.Pipeline` depends on `Morphir.Files` and keeps `MorphirProcessor`, so a pipeline also opens `Morphir.IR.Pipeline`.
- `Morphir.Files` writes the nullable metadata of F# nullness, as `Morphir.Models` does, so C# sees which of its values may be null: the delegates of `FileReplacement.Replace` must not be null, and `PropertyBag.Equals` accepts `null`. Before, C# saw every reference type of the package as oblivious and gave no warning for a `null` argument.
### Fixed
- `morphir generate --input <directory>` checks the captured files a second time before decoding. If a file changed or disappeared during capture, it stops with `input-changed` before starting the backend; before, it could generate from a mix of old and new files ([#698](https://github.com/finos/morphir-dotnet/pull/698)).
- `morphir model verify` reports `tree.unreadable_file` with the file name when a document-tree stream fails on close.
- `morphir model convert` no longer drops a member of a classic v3 model that the classic model has no place for, such as a member beside the `inputTypes`, `outputType` and `body` of a value definition, at any depth of a v3 single file or of the `def` or `spec` of a v3 tree file, including a member beside the `access` and `value` of a `def` or the `doc` and `value` of a documented entry (which a tree read refused as `invalid_distribution_shape` at the payload). It refuses the input with `unknown_member` at the member's JSON location (exit code 1, nothing written), and `morphir model verify` reports the same error for a v3 tree, and for a v3 single file that states `"formatVersion": 3` or `"3.1.0"`, which it now also reads with that reader after the schema check. In `Morphir.Models`, `ClassicJson.readDistributionStrict` reads as `readDistribution` does and refuses such a member; `StoredModel.TryReadSingleFile` and the v3 tree reader use it. See [Layouts](docs/content/docs/cli/model-convert.md#layouts).
- `morphir model verify` accepts the v3 `Specs` single file that `morphir model convert` writes. A single file that says `"formatVersion": "3.1.0"` is checked against finos/morphir's 3.1.0 schema (`morphir-ir-v3.json` at `4fa51c8b`, pinned as `morphir-ir-v3.1.0.json`), also with `--schema-version=3`, where the older v3 schema, which accepts the integer `3` and a `Library` only, refused it; the report still says schema version `3`. To pass that schema, `ClassicWireProfile.v3_1_0` writes each type and value of a module that has no documentation as `{ "doc": null, "value": ... }`, the wrapper the 3.1.0 schema requires, where it wrote the bare entry; the new `ClassicWireProfile.EntryDocs` (`ClassicEntryDocStyle.Bare` or `NullDoc`) holds the choice, and the integer 3 profile writes the same bytes as before. See [Schema version detection](docs/content/docs/cli/model-verify.md#schema-version-detection).
- `morphir model convert` writes a document tree that it can read back when a module has a type and a value of one name whose path is over the path budget. Their files now share one cut stem, short enough for the longer `.value.json` path, and the module file's `fileNames` names the name once; before, each file got its own cut stem, `fileNames` held the name twice, and reading the tree failed with `duplicate_member` and `tree.name_mismatch`. finos/morphir's tree specification maps a name to one stem in `fileNames` and does not say how a shared name is cut.
- `ProjectPath.join` keeps an absolute Windows path written with backslashes. `morphir project migrate C:/work/orders` and `config --file C:/work/morphir.toml` no longer read the path as relative to the invocation directory (which `project migrate` reported as `migration.io`).