$ show finos/morphir
Morphir is a FINOS-hosted toolchain for capturing business logic as a language-agnostic Intermediate Representation (IR). It compiles source code (Elm, Gleam) into a typed IR, supports code generation for multiple backends (OpenAPI, Avro, Python, Rust), evaluates IR expressions, manages packages with TUF-signed metadata, and runs a conformance test kit (MCK) to verify IR adapter implementations. The architecture is a monorepo with a Rust CLI (`morphir`), a web UI server (JSON-RPC over WebSocket), a Docusaurus documentation website, and submodules for language backends. Key entry points include the CLI binary (`crates/morphir/src/main.rs`), the MCK engine (`crates/morphir-mck/src/lib.rs`), and the web UI server (`crates/morphir/src/commands/ui/server.rs`). The system relies on external compilers (Elm, Gleam), WASM extensions, and subprocess adapters for conformance testing. The repository is actively maintained with recent commits, low technical drift, and a well-structured codebase.
The LLM identified 4 files worth highlighting for reuse:
Implements `ContentDigest` and `mck-file-map-sha256/1` algorithm for deterministic content hashing of file maps. Uses SHA-256 with UTF-16BE path ordering and frozen baseline vectors for conformance testing. Self-contained and reusable for any file-system snapshot verification.
A lightweight, purpose-built Markdown tokenizer that extracts fenced code blocks and inline code from Markdown text. No external dependencies beyond standard library. Reusable for any project that needs simple Markdown parsing without a full parser.
A strict JSON deserializer that detects duplicate keys and preserves fixture member ordering. Uses `serde_json` with custom logic to enforce `additionalProperties: false` semantics. Reusable for test fixtures or any scenario requiring strict JSON conformance.
Manages process tree cleanup on Windows using Job Objects (kernel32::CreateJobObject, AssignProcessToJobObject). Ensures child processes are terminated when the parent exits. Demonstrates non-obvious Win32 API usage and can be extracted for any Rust project needing reliable subprocess cleanup on Windows.