Engineering / architecture
One artifact, many consumers.
Phero Lang compiles nine modeling surfaces into versioned JSON artifacts. Everything downstream — code generation, schemas, policy, the editor, the graph on this page — reads those artifacts, never the source grammar.
9
Surfaces
23
Crates
305
Graph nodes
463
Graph edges
The pipeline
From source text to a versioned artifact
Five stages, one job each. The boundary between the fourth and the fifth is the invariant the rest of the system rests on.
- 01
Sources
nine surfaces
The models you write and review: structure, policy, decisions, events, design, use cases, cases, interaction flows, deployment.
.mox .ddd .actor .dmn .evt .uc .cmmn .ifml .deploy
- 02
Parse and format
phero-syntax · phero-ifml · phero-expr
A logos lexer and a chumsky grammar per surface, plus the canonical formatter. The shared expression language is parsed and typed once by phero-expr; no surface grows its own.
spanned syntax tree
- 03
Resolve, validate, lower
phero-driver
Salsa-based. Imports resolve, references validate, diagnostics come from one registry, and lowering produces the IR. The semantic graph and the editor index are derived after checking.
diagnostics · graph · span tables
- 04
Versioned artifact
phero-ir
The wire contract: camelCase fields, adjacent tagging, a formatVersion gate, and additive-only growth. One Core IR Model, and one artifact per surface.
formatVersion · byte-stable goldens
- 05
Consumers
5 backend crates
Backends and tools read the artifact and nothing above it: generated Rust, JSON Schema, Cedar policy, the DMN engine model, the CMMN case definition.
cedar · cmmn · dmn · jsonschema · rust
The nine surfaces
Nine languages, one compiler discipline
Each row states what the surface models, where it stands, and which backends consume its artifact: implemented means an in-tree backend reads it today; validated means it compiles and checks with no backend yet.
| Extension | Surface | What it models | Status | Backends |
|---|---|---|---|---|
| .mox | Domain model | Packages, classes, features, operations, enums, datatypes and vocabularies — the structural domain every other surface reads. | Backend |
|
| .ddd | Application design | Sculptor-style designs: applications, modules, services, repositories, searches, entity state machines, and executable operation bodies. | Validated | No in-tree backend |
| .actor | Authorisation | Who may do what: actors, delegation, capability grants with typed when conditions, obligations, and Cedar policy generation. | Backend |
|
| .dmn | Decision model | The decision-requirements graph, business knowledge models, knowledge sources, decision services, and external markdown decision tables. | Backend |
|
| .evt | Event contract | What the system publishes and who reacts: versioned event contracts, channels, and subscriptions with their binding rules. | Validated | No in-tree backend |
| .uc | Use case pattern | SysML-v2-style use case patterns: subjects, actors, messages, successions and realizes links. | Validated | No in-tree backend |
| .cmmn | Case management | CMMN 1.1 case models: case files, discretionary and required plan items, sentries, and decision tasks that invoke sibling decision services. | Backend |
|
| .ifml | Interaction flow | Interaction flows over a composed pattern library: views, containers, components, events, navigation, and the declaration-backed control/route manifest. | Validated | No in-tree backend |
| .deploy | Deployment | Deployment projections: application components, target capabilities and engines, profiles, settings, and type-checked placement policies. | Validated | No in-tree backend |
What a surface compiles to is not a promise in a table: each row's artifact is generated by the released binary and committed under site/data/artifacts/, one per surface.
The semantic graph
One graph across nine surfaces
pherolang graph build compiles every surface in a tree into one queryable artifact: import-connected applications, nodes and edges. It is derived post-compile — the builder never re-reads a source or re-compiles a file.
This is the domain perspective of the support application — the full-stack example that exercises all nine surfaces. 20 nodes and 23 connections from the domain surface alone, with each node's declaration file baked into its tooltip. The coordinates are part of the committed data: the first paint is a finished SVG, and JavaScript only adds focus and filtering.
Node ids are the artifact's ids verbatim, so a node here is the same nodepherolang graph query answers for. Edges are kept per perspective and only when both endpoints are in it: a connection into another view is not drawn as a phantom box.
The crates
The crate graph
Every workspace crate, read live from its manifest at build time and grouped by role. Each card lists the workspace crates it depends on; a test-only dev-dependency is omitted, so an edge here is a relationship the compiler actually has.
23 crates · 57 workspace dependencies
Syntax and expressions
Lexers, grammars, formatters, and the shared expression language every surface embeds.
phero-dates
no workspace dependencies
phero-expr
uses
phero-datesphero-diagnosticsphero-irphero-parserphero-stringsphero-ifml
uses
phero-diagnosticsphero-exprphero-irphero-parserphero-stringsphero-parser
no workspace dependencies
phero-strings
no workspace dependencies
phero-syntax
uses
phero-parserphero-strings
Driver, IR and evidence
Resolution, validation and lowering; the versioned artifact; the diagnostics registry and the evidence spine.
phero-diagnostics
no workspace dependencies
phero-driver
uses
phero-diagnosticsphero-exprphero-ifmlphero-irphero-syntaxphero-verifyphero-vocabphero-evidence
no workspace dependencies
phero-ir
no workspace dependencies
phero-verify
no workspace dependencies
phero-vocab
uses
phero-ir
Backends
Artifact consumers. Each one is a pure function from the IR to generated output.
phero-backend-cedar
uses
phero-backend-commonphero-exprphero-irphero-backend-cmmn
uses
phero-exprphero-irphero-backend-common
no workspace dependencies
phero-backend-dmn
uses
phero-backend-commonphero-irphero-backend-jsonschema
uses
phero-backend-commonphero-irphero-backend-rust
uses
phero-backend-commonphero-exprphero-ir
Tooling
The binary, the editor server, the generated-code runtime, and the test kit.
phero-cli
uses
phero-backend-cedarphero-backend-commonphero-backend-jsonschemaphero-backend-rustphero-diagnosticsphero-driverphero-evidencephero-highlightphero-ifmlphero-irphero-lspphero-runtimephero-syntaxphero-vocabphero-highlight
uses
phero-ifmlphero-syntaxphero-lsp
uses
phero-driverphero-exprphero-ifmlphero-irphero-syntaxphero-runtime
uses
phero-datesphero-testkit
uses
phero-driverphero-ifmlphero-ir
Outside the backend family, phero-cli carries a backend dependency — so a backend is loaded by the binary, not by the compiler core. Edges run from a crate to the crates it names, and nothing is drawn that a manifest does not declare.
Provenance
Generated, not written
The counts on this page are a projection of the committed graph artifact, not a claim typed into prose. CI regenerates them with the released binary and fails on a one-byte difference.
site/data/graph.json is produced by the releasedpherolang binary from examples/. The site then derivessite/data/evidence.json (counts, kinds, crates),site/data/surfaces.json (the surface table above) andsite/data/support-model.json (the figure's baked geometry) from it.
The generator was pherolang 0.3.0 (x86_64-unknown-linux-gnu). It found8 import-connected applications,305 nodes and 463 edges across the corpus, and the figure on this page is derived from that artifact.
The full contract — node kinds, edge kinds, determinism rules, queries — isdocs/GRAPH.md in the repository.
node scripts/fetch-pherolang.mjs # released binary, sha256-verified
node scripts/sync-model.mjs # graph, artifacts, evidence, figure
git diff --exit-code data # what CI checksThe same script runs in the Site workflow with the released asset. A stale count is a build failure, not a documentation bug.