Skip to content
Ferrigura

Ferrigura / Architecture

Architecture decisions

Each record holds one decision that shapes ferrigura: what it covers, what it decides, why, and what follows from it. The records are living documents. When a decision changes, its record is edited in place; when a decision no longer holds, its record is deleted and its number is not reused. There are no dates, statuses or change logs in a record: what it says is what holds today.

A record has this outline:

  • Scope: what the decision covers and, as explicitly, what it does not cover.
  • Decision: the rule, worded so that it can be checked where possible.
  • Why: the reasons, and the options that were weighed and not chosen.
  • Consequences: what follows for the code, the tests and the users.
  • Related: other records and the learnings behind it.

A new decision that is hard to reverse gets the next free number. Code comments cite a record by its number, such as decision 0009.

Project

RecordDecision
0001Code, documentation and commit messages are written in US English
0002The domain terms and the words to avoid
0003Commit messages follow Conventional Commits; feat and fix are for what the packages show
0004All crates and npm packages share one version, one changelog and one tag
0005Every change keeps the whole suite green, and output changes are deliberate

Architecture

RecordDecision
0006Rust only, with no browser at run time
0007Hand-written parsers; Mermaid's grammars are the specification
0008A canonical model per diagram type; the configuration is resolved once and read through typed views
0009Labels are SVG text, not HTML in foreignObject
0010Only text is measured, with bundled fonts embedded as subsets
0011Themes are CSS custom properties with attribute fallback
0012Layout engines and browser arithmetic are ported to give the same numbers
0013Ported code keeps its source's license, in a crate of its own when it differs
0018The same input gives the same output: no randomness, screen or state from the environment

Verification

RecordDecision
0014The reference is upstream Mermaid at a pinned commit, with patches
0015Models, layouts and geometry are compared with the reference; ferrigura's own output is pinned by snapshots
0017Quirks of the reference are reproduced; a bug is fixed only together with a patch on the reference

Distribution

RecordDecision
0016Node.js gets a native addon built with napi-rs, in one facade and platform packages