Implementation
Our implementation.
Our implementation of the specification is open source under Apache-2.0: a Rust engine, command line and MCP server. Our hosted editor, trumly cloud, is built on it. This page shows how the code is built and how it is tested against the specification.
A small core, with tools around it.
At the centre is a small engine that knows nothing about files, networks or AI. Everything you use is a thin tool around it, so every tool checks a design in exactly the same way.
Command line
Check a project, show a node, rename things and add packs. It exits 1 when a rule fails, so it runs in CI.
trumlyMCP server
Lets an AI agent read a project, query it and check it. Read-only unless you start it with
--write.trumly-mcpWebAssembly
The same engine compiled for the web, so a page can run the checks in the reader's browser, as the demo on trumly.co does.
trumly-wasm
The core engine
Parses files into a graph, checks its structure and runs the rules. It is pure, with no file or network access, so it behaves the same everywhere.
trumly-coreA project: a folder of Markdown files, read and written through trumly-fs.
The reference code.
Every public item is documented, and the documentation is generated from the code. The crates are not on crates.io
yet. For now, build them from the repository with cargo build --release.
API documentation
trumly-coreThe engine: parse files into a graph, check its structure, run rules. Pure, with no file or network access, so it runs the same everywhere.trumly-fsReads a project folder from disk, and reads and writes packs, for the core.trumly-wasmThe core as a WebAssembly module for the browser.trumly (command line)The trumly command. Its commands are listed below.trumly-mcpThe MCP server. Its tools are listed below.
The command line
trumly check [--json] [DIR]- Run every rule and list the findings. Exits 1 when one fails.
trumly init [DIR]- Set a new project up: a few short questions, the core packs and an overview node.
trumly show ID [DIR]- One node: its links in and out, and its rule results.
trumly index [DIR] [--write]- A Markdown map of the whole project. --write saves .trumly/INDEX.md.
trumly rename node | type | link-type- Rename an id, a type or a link type; links, parents and rule filters follow.
trumly pack list | add | remove | status | check- Add ready-made packs to a project, take them out, see what you changed, and lint packs.
trumly quickstart- A short guide to getting going.
Run trumly help for every option.
The MCP server
trumly-mcp DIR is a Model Context Protocol server over a project folder, so an agent can read the
project, query it and check it. It reads the folder on every call, so the files stay the source of truth. To use
it with an agent, see the agents guide.
get_index- A Markdown map of the whole project. Read this first, then open only the nodes you need.
get_node- One node in full, plus its inbound links, rule results and a revision.
list_nodes- List nodes, optionally filtered by type, plane or ancestor.
search- Find nodes by text in their id, title, fields or body.
get_links- A node's links in both directions.
check- Validate the project and run its rules.
status- What has changed since the last commit, and what this session changed.
It is read-only by default. Start it with --write and it also offers these tools, which change the working
copy. Nothing is committed: you review the change and publish it. A change to a node you have not read, or that has
changed since, is refused with a conflict.
put_node- Create a node, or replace one you have read. Returns the check findings for it.
delete_node- Delete a node, and list the links left pointing at nothing.
rename_node- Give a node a new id; links, parents and rule filters follow.
How it is tested.
Each conformance case is a small project and the exact output the format requires for it. Our implementation passes every case, and its test suite runs them all on every change. They are published so anyone can see what the specification requires.
- A case is a folder holding an input project and an
expected.json. - The expected output is what
check --jsonprints for that project, with every finding in a fixed order. - An implementation is correct when its output equals the
expected.jsonof every case.
The 78 cases
They cover loading and load errors, structure findings, every check in the rule vocabulary, rule options and the worked examples. Open a case to see its input and the expected output.
applies-to-any-ofcheck-acycliccheck-and-semanticscheck-any-ofcheck-compare-fieldscheck-derived-fieldscheck-field-ischeck-field-pathscheck-link-cardinalitycheck-link-fieldscheck-link-inboundcheck-link-scopecheck-node-fieldscheck-pathcheck-precedencecheck-same-fieldscheck-text-lengthcheck-title-idcheck-unsupportedderived-basicderived-edgederived-fan-out-missingderived-limitsderived-overridederived-specificityderived-type-mid-hopderived-type-nameduplicate-definitionsduplicate-linkex-ops-apiex-scaleformat-bodyforward-compatghost-multipleghost-plane-fallbacklink-endpointsload-bad-field-typesload-duplicate-idload-id-mismatchload-invalid-frontmatterload-missing-idload-not-jsonload-notes-ignoredload-subdirsmissing-link-targetmissing-parentmissing-typenames-ambiguousnames-pack-depthnames-pack-localnames-pack-optionalnames-pack-optional-absentnames-qualifiednames-qualified-unknownpack-namespacesparent-chain-missingparent-cyclerequired-fieldsreserved-definition-kindsreserved-exemptrule-advisoryrule-applies-torule-bad-severityrule-disabledrule-id-filterrule-require-fieldsrule-require-linkrule-under-strictscratch-sandboxstress-cross-typestress-observed-datastress-task-lifecycletitle-too-longundeclared-planevalid-minimalvalues-dates-are-stringsvalues-numbersvalues-yaml12
The suite is version 0 and will grow with the format. The format has no version field or JSON Schema yet; both are planned.