Primmel Studio
Primmel Studio is the authoring tool for the Primmel language, a
browser application for creating, editing, mapping, reviewing, and
validating .prl models. It is the full port of the Paneron MMEL
Editor/Viewer/Mapper lineage onto the Primmel v3 kernel, and the first
program-layer host (OIML SMART plugs in as a plugin).
The repository is
primmel/editor; the full manual
is its user
guide, organized
by audience, with diagrams for every surface.
The three laws it shares with the platform
- The AST is the single source of truth. Every edit is a typed command (apply + revert); undo/redo is exact. Tree, canvas, code, inspector, mapper, and diff are projections of one store.
- The kernel owns the semantics. Parsing, the coverage calculus,
model-diff, and the type vocabulary come from
@primmel/primmel, the Studio bridges, never reimplements, so it cannot drift from the runtime. - Programs plug in, they don’t branch the kernel. The OIML SMART layer (requirement/test/form palettes, the certificate preview) is a plugin registered at boot. A second 〈scope〉 SMART program plugs the same way.
The surfaces
- The model workspace, the canvas (drag/connect with the connection discipline, refused out loud), the element palette, per-type inspectors, subprocess pages with breadcrumbs, the Monaco code editor with completion from the live model and inline kernel markers, comment threads, the measurement harness, and the process simulation (a token walk with registers, ephemeral, never model content).
- The mapper, reference⇄implementation pairs over the v3 MapProfile: multi-target pairs with description/justification/ coverage, the KERNEL’s coverage calculus as canvas tints with the C23 conflict marker, the multi-reference lens with seed review lists, document mapping with clause URNs, and automap (ranked suggestions with provenance; the kernel’s closure proposals flagged, never asserted).
- Review, the model-diff view (the kernel’s diffStandards with
facet-level before/after and a status-tinted canvas), the save
review (validation + change preview before any write; download or
write-to-file with a
.bak), and the validation surface that is always on (the topbar badge, the Validate tab, editor markers, import report, save review). - Migration, the legacy MMEL import: the v1/v2 corpus (PAS2060, ISO 27001, BS 13485, ISO 14971, BS 6004, BS 16341, acme) converts natively with the honest report (constructs converted, the canonical renames, the v2 comment forms inverted, anything with no v3 home named).
Run and prove
cd editor
npm install && npm run dev # → http://localhost:5173
npx vitest run # the unit proofs
./e2e/run-all.sh # the browser legs, against the dev server
The e2e suite walks the real workflows: create→edit→serialize, the mapper with coverage, multi-reference seeding, document mapping, automap confirm/reject, the diff view, simulation, comments, measurements, the legacy import, the plugin layer, and the save with its preview, plus the nine-leg capability walk in a single session.
Where it plugs in
- Upstream: the kernel (
primmel-ts), the Studio pins the local package; upstream rebuilds refresh it. - Programs: the plugin registry, OIML SMART is the first layer; see the platform volume’s Studio chapter.
- Education: Tier 5, the dual demo teaches modelling OIML R 7 (clinical thermometers) with the Studio , the methodology applied to a second instrument after the r60 classroom.