smcraft

DMDF — Decision Model Definition Format

RISE Framework Specification References: Spec 70 (SMDF Format), Spec 80 (ERDF Format), Spec 81 (SQDF Format), Spec 82 (System Definition), Spec 83 (The Stage and the Marks); OMG Decision Model and Notation (DMN) 1.5

Spec ID: 85 Version: 0.3 Where this file is read: on main too, from 2026-11-28, so the specification is indexed and cited with specs 70 to 84 while it is proposed. The implementation, the first documents and the stateloom-decision skill it names are on branch rispec/85-dmdf-decision-model (jgwill/smcraft#33) and reach main only when that pull request merges. Status: proposed, with a first working version of what 0.2 specified. Its name, its extension, the questions at the end and every bar’s value belong to Guillaume (Episode 121’s format circle, Episode 564). It is not merged before he answers them. Implementation: bridge-protocol/src/decision/ (types, the rule language, validation, typed answers, the evaluator, the engine request, the ledger replay), bridge-protocol/src/render/mermaidDecisions.ts, bridge-protocol/src/system/ (membership and D008), mcp/src/decision.ts (the tools). The canvas does not draw a decision model yet. What 0.3 adds (triggers and routes, counting per category, the decision instance and its review) is specified and not implemented. examples/advance-gate/replay-0.3.mjs replays Episode 564’s ledger through the protocol’s evaluator and counts it as 0.3 says, so the difference is measured before anything is built. First documents: examples/advance-gate/advance-gate.dmdf.json, which is Episode 564’s advance gate written to this version, with its ledger of 2026-11-14. The first drawing, written by hand to version 0.1, is kept beside it as advance-gate.draft-0.1.dmdf.json. Origin: jgwill/smcraft#32. Guillaume, 2026-11-14: “I was really thinking about upgrading the factory to support a fourth new type of diagram, which is a decision model that is based on try to represent what you try to do when you use that decision engine to help you choose. So I would have a representation about the decision model … I’m pretty sure there is a diagram type that enable us to actually represent decisions.” Grounded in miadi-foundation:decision-modelling-notations (held by Episode 564). Version 0.2 takes what fits from a research report Guillaume sent the Factory on 2026-11-18 and from the Factory’s assessment of it (both in Episode 564, decision-diagram-report-261118/). Version 0.3 adds what Episode 564 holds as of 2026-11-28 (the gate in live use, its ledger, a second document) and Guillaume’s requirement that when a decision is questioned, he and the session that made it can stand in front of the decision diagram together and review how the decision actually happened. A research pass Guillaume commissioned on 2026-11-28, on how multi-agent systems reach decisions with their human, was written for a discussion. It is background here, and a section that draws on it says so.

Creative Intent

What DMDF Enables Users to Create: A declarative JSON document where a person and an agent draw a decision the Factory makes: the inputs it reads, the questions a decision engine answers about them, the table that combines the answers, the person who rules, the authority it answers to, and where the rulings on it are kept. It sits beside the machines (SMDF), the data (ERDF) and the scenarios (SQDF) of the same system.

Desired Outcomes:

  1. A person or an agent writes one .dmdf.json file and reads it back as a decision requirements diagram
  2. Which part of a decision an engine judges, which part a table decides, and which part a person rules is visible in the drawing, never left to a script
  3. A decision engine’s call is generated from the document, so the drawing and the call cannot disagree
  4. A recorded run replays through the document with no call to an engine: the same snapshot and the same answers give the same outcome and the same rule trace in every caller
  5. A decision whose outcome fires an event of a machine, or reads an entity, is checked against the drawings that define those names (Spec 82)
  6. The rulings kept on a decision are counted against what they answered, category by category, so a person can set its bars from them
  7. A category the person’s authority covers stays theirs whatever the rulings say: a bar sets how sure the engine must be that an act is in it, never who decides it
  8. Every decision actually made is an instance pinned to the version and hash of the diagram it ran on. When it is questioned, the person and the session that made it review it on that diagram, with the path it took drawn on it

Why DMN, and what the loom adds

DMN’s decision requirements diagram (DRD) is the standard drawing of a decision: a Decision (rectangle), Input Data (rounded), a Business Knowledge Model (clipped rectangle, a reusable piece of logic) and a Knowledge Source (document shape, an authority), joined by information, knowledge and authority requirements. Decision logic is a boxed expression, most often a decision table with a hit policy.

The loom keeps that vocabulary and adds two kinds of logic DMN does not have:

Five boundaries follow. The loom holds the first three mechanically, and 0.3 specifies the last two:

  1. The engine makes judgments, a table makes the decision. A question’s answer is typed, and a rule reads it through that type. A rule that reads a judgment as one bare number is refused (D014).
  2. A person’s ruling is a decision of its own, never a fallback. Nothing computed produces it: no rule, no bar, no failure route. Until a ruling is recorded it is awaiting_owner, and whatever reads it waits with it.
  3. What is asked is kept apart from who answers. The provider and its model are in binding. No question names them (D017).
  4. Authority is read before any score. A question that asks whether an act falls in a category the person holds is a trigger. Its rules come first, they end at a person, and no count of rulings removes them (Authority before scoring).
  5. The document is the decision type, and a decision made is an instance. A type changes only by a new version. An instance is pinned to the version it ran on and is never edited (The decision instance).

FEEL is not adopted. A table’s rules are written twice: in words, for the person who reads the drawing, and in a small rule language the loom runs. The format is DMN-inspired. It claims no DMN interchange.

Core Concepts

DecisionModelDefinition

{
  "settings": { "namespace": "...", "name": "...", "description": "...", "notes": "...", "version": "0.1.0", "supersedes": { "version": "...", "sha256": "..." } },
  "binding": { "provider": "...", "model": "jev-1.14.0", "timeout_ms": 60000, "credentials": "JEV_AI_API_KEY" },
  "inputs": [ { "name": "...", "description": "...", "entity": "...", "type": "string | number | boolean" } ],
  "knowledge": [ { "name": "...", "kind": "source | model | authority", "ref": "...", "description": "..." } ],
  "groups": [ { "name": "...", "questions": ["..."], "description": "..." } ],
  "bars": [ { "name": "...", "value": 0.5, "category": "...", "set_by": "...", "calibrated_from": 0, "description": "..." } ],
  "decisions": [ { "name": "...", "logic": { "kind": "question | table | person" }, "requires": ["..."], "knowledge": ["..."], "authority": ["..."], "outcomes": ["..."], "machine": "...", "event": "...", "events": { "<outcome>": "<event>" } } ],
  "rulings": { "ledger": "...", "snapshot": "...", "key": "decision_id", "bar_after": 20, "decision": "...", "record": { } }
}

Definition version — settings.version, settings.supersedes

Every document states its version (D012), and every run records it. A ruling is then always read against the rules it answered. The replay says so when a recorded run names another version than the document’s.

The document is never edited in place. A change of any kind, a bar’s value included, is a new version: settings.version is raised, and settings.supersedes names the version it replaces with that file’s sha256 (D023). The file it replaces is kept, so every instance can still open the version it ran on.

DmdInput (DMN Input Data)

Field Type Description
name string Unique among inputs and decisions; what requires names
description string What the input holds. For an engine question, the key of the state it becomes
entity string An ERDF entity this input is (Spec 80), checked by the system (D008)
type "string" | "number" | "boolean" What a rule may do with it. Absent: the value is compared as it is given

DmdKnowledge

Field Type Description
name string Unique among knowledge
kind "source" | "model" | "authority" source: a document the decision rests on (a study, a skill). model: logic reused by several decisions (DMN’s business knowledge model), such as one question text shared by every caller. authority: who or what governs the decision whatever the number (DMN’s authority requirement)
ref string A loom, chronicle, repository or file address

A knowledge entry is never executed and never asked. An engine is reached through a question, and nowhere else.

DmdDecision

Field Type Description
name string Unique among inputs and decisions
logic object A question, a table or a person (below)
requires string[] Inputs and other decisions this one reads (information requirements). A rule reads only what its table requires
knowledge string[] source or model knowledge it uses
authority string[] authority knowledge that governs it
outcomes string[] What it can decide; a choice question’s option keys by default
machine string settings.name of the machine its outcomes drive (Spec 70)
event string One event for every outcome; the outcome travels as its parameter
events object One event per outcome. Wins over event for the outcomes it names

When a decision drives a machine, every outcome fires an event (D013), and each event exists in that machine (D008). A decision returns an event. It never moves a machine’s state, and no engine is called inside a guard: the machine has a state in which it waits for the decision (examples/decision-gate: Scoring, then Scored).

A question — logic.kind: "question"

Field Description
type noul, choice or score
instructions The question. An input is named in backticks, and only one the decision requires (D007)
criteria A noul’s criterion: { "true": what makes it yes, "false": what makes it no }
criteria_from A noul’s criterion when it arrives with the run: an input the decision requires and names (an acceptance line)
options A choice’s options, each with what makes it the one. 2 to 255. A choice decides one of its options: when it also writes outcomes, they are the same names
levels A score’s levels, lowest first. 2 to 10
rotate The options’ order changes per call and the order used is recorded (study jaggedness item 8). Options that rotate are named with words: a JSON object written by JavaScript puts a key that is a whole number first, so "1", "2", "3" can be sent in one order only (D005)
trigger On a noul that asks whether the act falls in a category the person holds: { "category": "<name>" } (D025). See Authority before scoring

Every question states its criterion, a noul included (D009). The Factory measured why twice: without its acceptance line, “is it done” came back 83.3% unclassifiable, and on 2026-11-15 a judge’s question without its criterion read 0.18 to 0.57 on five moments.

Typed answers

Each question type has its own answer, read in the engine’s own shape so a recorded response replays as it was received.

Type The engine’s answer What a rule reads
noul { type, noul } <name>.yes: the probability that the proposition is true. 0.5 is “cannot tell”, not “half as much”. It has no confidence of its own
choice { type, choice, confidence, probabilities } .choice, .confidence (how peaked the distribution is), .probabilities.<option>, .top (the highest probability), .margin (the highest minus the next)
score { type, score, confidence, probabilities } .score (a position on the levels, which may fall between two), .confidence, .probabilities["<level index>"]

A decision’s bare name is never a value. deletes >= 0.5 is refused, and the message says to read deletes.yes. An answer that breaks its contract (a probability outside 0 to 1, a distribution that does not cover the declared options or sum to one within 0.025, an option that was not declared) is invalid, and no number is read from it. A constrained answer is a well-formed answer. It is not thereby a true one.

A question group — groups

The questions of one group go to the engine in one request: they see the same snapshot and each is answered without the others. A group is drawn as a box around its questions.

A group is never a dependency. A question that needs another’s answer requires it, which is an arrow, and the two are then two requests (D010). Questions that no group names are grouped by the loom: those that wait on no other question share one request named default, and each question that needs an answer is a request of its own, named after it. A group the document writes takes neither of those names (D010). Answering together is not statistical independence: two questions of one group may be about related facts.

A table — logic.kind: "table"

{ "kind": "table", "hit": "first", "to_person": ["hold_for_person"],
  "rules": [
    { "when": "any of the six triggers >= 0.5", "if": "max(deletes.yes, credential.yes) >= owner_at", "then": "hold_for_person", "route": "authority" },
    { "when": "the choice is sure enough", "if": "answered(advance) and advance.confidence >= advance_at", "from": "advance", "route": "score" },
    { "when": "otherwise", "if": "otherwise", "then": "seat_reads", "route": "default" }
  ],
  "failure": { "then": "hold_for_person", "description": "..." } }
Field Description
hit Stated on every table (D011). first: the first rule that holds. unique: exactly one may hold, and two holding together is a conflict with no outcome. collect: every rule that holds, in order
rules[].when The rule in words
rules[].if The same rule in the rule language. Without it the loom draws the rule and does not run it (D020)
rules[].then The outcome, one of the decision’s outcomes
rules[].from In place of then: a required decision whose own value is the outcome (a choice question’s option, a table’s outcome, a ruling). Every value it can give is one of this table’s outcomes (D006)
failure.then The failure route
to_person The outcomes that send the decision to a person. Required on a table that reads a trigger (D024)
rules[].route Why the outcome goes where it goes: authority, uncertain, score or default. Required on each rule of a table that reads a trigger (D024). See Routes

from exists because of the first document. Its rule 3 gave “the advance choice”, while advance was both a decision and one of the table’s outcomes. A then that may mean either is now two fields.

The rule language

Bounded on purpose. A rule is parsed into a tree and the tree is walked. Nothing is handed to eval, and a name is only ever looked up in what the document declares.

rule     := "otherwise" | or
or       := and ( "or" and )*
and      := not ( "and" not )*
not      := "not" not | compare
compare  := sum [ ( "==" | "!=" | "<" | "<=" | ">" | ">=" ) sum | "in" interval ]
interval := ( "[" | "(" ) sum "," sum ( "]" | ")" )        [0.4, 0.6) holds 0.4 and not 0.6
sum      := product ( ( "+" | "-" ) product )*
product  := unary ( ( "*" | "/" ) unary )*
unary    := "-" unary | primary
primary  := number | string | "true" | "false" | call | ref | "(" or ")"
call     := ( "max" | "min" | "answered" | "collected" ) "(" or ( "," or )* ")"
ref      := name ( "." name | "[" string "]" )*

A reference names an input, a bar, or one field of a required decision. answered(q) says whether a question has a valid answer, so a missing answer is told apart from a negative one. It asks about a question only: whether a person has ruled is never a rule’s to route around. collected(t, "x") asks a collect table. and and or stop at the first operand that settles them. A rule is at most 2000 characters and nests at most 32 deep, the rule itself being the first level. Before any run, D014 checks that each rule parses, reads only what its table requires, and compares like with like.

The failure route — logic.failure

A table that reads an engine’s answers says where it goes when the engine fails, times out, or breaks its contract (D015). When a rule reads a question that has no valid answer, the table is failed and its outcome is failure.then (for a collect table, the one outcome it then holds). The outcome is one of the table’s own, so a machine it drives receives it like any other (D013). Without a declared route a failed table has no outcome, and nothing is assumed in its place.

The failure route is for an engine. A table that requires a decision still awaiting its owner never takes it: see the person, below.

A person — logic.kind: "person"

Field Description
who Who rules: the seat, a named person, a circle
description What they rule on, and how it is recorded

A person’s decision lists the outcomes that can be ruled (D016). Its result is awaiting_owner until a ruling is recorded for it, and then ruled, with who ruled and their words, which are never edited. It carries no rule, no bar and no failure route (D016). toEngineRequest never sends a person’s decision. An event mapped from its outcome fires only from a recorded ruling. On a run a trigger sent to the person, who may rule is said in Authority before scoring.

Waiting is not failing. A table that reads an unruled person’s decision is awaiting_owner too. And while a table requires any decision that still awaits its owner, a missing answer never sends it to its failure route, whichever of the two a rule reads first and whatever its hit policy: it waits, and says what it waits on and which answer is missing. Once the person has ruled, an engine’s failure is the table’s to route. A rule that holds before either is read still decides, as its place in the table says.

Authority before scoring — logic.trigger

Some questions do not ask whether an act is wise. They ask whether it falls in a category that is the person’s to decide whatever the number. Such a question is a trigger: a noul with logic.trigger.category, a name unique in the model (D025). Episode 564’s six are deletes, credential, names_new, money, foreign_repo and outside_audience.

  1. Authority first. In a table that reads a trigger, no rule whose outcome stands without a person comes before a rule that reads a trigger (D026). A score is read only for an act no trigger holds.
  2. A trigger ends at a person. A rule routed authority or uncertain gives an outcome in to_person, and so does the failure route of a table that reads a trigger (D024).
  3. No calibration takes a category out of the person’s hands. A bar that a trigger’s rule reads sets how sure the engine must be that an act is in the category. Its value is strictly between 0 and 1 (D027), so the route can always be taken. A new version that drops a category’s route to the person is a change of authority. Only the person makes it, and no count of rulings stands in for that.
  4. A ruling on a trigger’s route answers the category. For each category that routed the run, it says whether the act was in it ("categories": { "foreign_repo": false }), and it gives the outcome. An advance ruling on a run held for deletes is the person deciding a deletion. That ruling is not evidence that the trigger was wrong. Only the answer on the category is.
  5. Who rules it. The person the authority names, or a seat that records the person’s own word for this act, verbatim, with where it was said (authorized_by). A seat’s ruling with neither is kept as the seat’s reading, and the person’s decision stays awaiting_owner.

A noul that asks about such a category without being declared a trigger is not checked for authority. The drawing shows which nouls are declared triggers, so a reader sees one that is not.

Routes — rules[].route

A table’s outcome says what is decided. Its route says why it goes where it goes, and calibration counts by route:

route the outcome counted in
authority goes to a person: a trigger holds each category that routed the run
uncertain goes to a person: a trigger’s score cannot be relied on, such as a .yes in [uncertain_from, uncertain_to) each category that routed the run, apart from authority
score stands without a person, from a question’s score (the advance choice) the question
default stands without a person, and no question decided it (otherwise) the table

A run that takes its table’s failure route has the route failure. The uncertain route is kept apart from authority because a score of 0.47 does not mean the act is almost in the category. It means the engine cannot be read on it, and a ruling there tells about the band, not about the trigger’s bar.

Which categories routed a run. A category routed the run when the rule that decided it still holds on that trigger’s answer alone, every other trigger read as yes: 0. That is a second evaluation of the same rule, so every caller gets the same list. When no single category makes the rule hold, every trigger the rule read is named.

Bars — bars

A bar is a threshold a rule reads by name. It is a choice someone made: set_by names them, and calibrated_from counts the rulings the value was checked against.

How a bar moves. A person moves it, never the loom.

  1. Each ruling is kept in the ledger beside the run it answers.
  2. The replay counts the rulings in force (per run and person’s decision, the last that still stands and can stand) and compares each with what the replay gives for the decisions it answered: the table’s outcome and the engine’s choice. Under the document’s own bars, that is what the ruling answered.
  3. Per category, never pooled. Under 0.3 a ruling is counted in the class its run’s route names (Routes). On a trigger’s route it counts in a category only when it answers that category. rulings.bar_after applies to each class: twenty rulings on deletes say nothing about money.
  4. Per scorer. A class’s count belongs to one scorer: the binding’s model and the version of the questions it was sent. When either changes, the count starts again. Earlier rulings stay in the ledger and are shown, and they are not counted for the new scorer.
  5. When a class has bar_after rulings counted, a person may set its bar. Before that the count is shown as not reached.
  6. A candidate value is tried on the recorded answers (bars on simulate_decision and replay_decision_ledger): the replay says which recorded runs would then decide differently. The document is not changed by a trial.
  7. The person writes the new value with set_by and calibrated_from as a new version (settings.supersedes). Runs recorded under the earlier version keep it.

Steps 1, 2, 5 and 6 are implemented, on one pooled count. Steps 3 and 4 are 0.3’s and are not. Step 7 is an edit of the document by a person or at their word. The loom has no tool that sets a bar, and this format sets no bar’s value.

The binding — binding

provider, model, timeout_ms, and credentials, which is the name of the environment variable that holds the key. A key is never written in a document (D017). A caller may pass another model to toEngineRequest, and nothing that is asked changes. Version 0.1 wrote the model as settings.engine. It is still read when there is no binding, with a warning.

Rulings and the ledger — rulings

rulings.ledger names the file where each run and each ruling are kept, snapshot a copy beside the document, key the field of a ruling that names its run, decision the person’s decision the rulings are the outcome of, bar_after the count after which a person may set a bar (study S5). The loom reads the ledger. It never writes it.

A line of the ledger, in the format’s own shape:

{ "kind": "decision", "id": "…", "at": "…", "definition": { "name": "…", "version": "…" }, "values": { }, "answers": { }, "outcomes": { "band": "hold_for_person" } }
{ "kind": "ruling", "decision_id": "…", "decision": "ruling", "outcome": "advance", "decided_by": "…", "words": "…", "at": "…" }
{ "kind": "ruling_withdrawn", "decision_id": "…", "withdrawn_ruling_at": "…" }

answers holds each question’s answer as the engine gave it. A ledger written before this shape is read through rulings.record, which gives the dot-separated path of each value, each answer field, each recorded outcome and the version inside a line ("deletes": { "noul": "triggers.deletes" }).

A ruling counts when it can stand: it names a run the ledger holds and a person’s decision of the model, it rules one of that decision’s outcomes, and it says who ruled. A ruling that cannot stand, and a withdrawal that finds no ruling, are reported with their line and never counted. When a model has several person’s decisions, each ruling line names its own in decision, and rulings.decision is the one counted against bar_after.

Version 0.3 adds to a run’s line the document’s sha256, each input’s hash and length, and the route; and to a ruling its categories and, when a seat rules a trigger’s route, authorized_by (The decision instance). Whether callers write that shape is Q7.

Validation Rules

An issue is an error unless marked as a warning. A warning is a document the loom reads and draws, and does less with.

A document written in the wrong shape (a list where a map belongs, an entry that is not an object, a path that is not text) is reported under the rule that owns the field, and the rest of it is still checked. No reader of a decision model throws on a document, whatever it holds: the validator, the evaluator, the drawing, the request and the replay all read it through safeModel.

A name every JavaScript object already carries (constructor, toString, __proto__ and the like) is refused for an input, a decision, a knowledge, a bar, a group, an option and an outcome, under the rule of each. A model has at most 500 decisions (D002). Past that it is refused whole and not run.

Rule Description
D001 settings.name is present
D002 Input and decision names are non-empty and unique together; knowledge names are unique, with a known kind
D003 Every requires names an input or a decision; every knowledge names a source or model; every authority names an authority
D004 The requirements form no cycle
D005 A decision’s logic is a question, a table or a person. A question has a type of noul, choice or score, and instructions; a choice has 2 to 255 options, a score 2 to 10 levels. A choice’s outcomes, when written, are its options. A choice that rotates names no option with a whole number
D006 A table lists its outcomes and has at least one rule. Each rule has a when, and one of then (one of the outcomes) or from (a required decision, all of whose values are among the outcomes)
D007 A question’s text names, in backticks, only inputs it requires (`action` needs action in requires)
D008 (system) A decision’s machine is a member machine, each event an outcome fires exists in it, and an input’s entity exists in a member ERD
D009 Every question states its criterion: a noul in criteria.true, or in a required input named by criteria_from and by its instructions; a choice on every option; a score on every level
D010 A group names questions of the model, a question is in one group at most, and no question of a group needs the answer of another. A group is not named default or after a decision
D011 A table states its hit policy: first, unique or collect
D012 settings.version is present
D013 When a decision drives a machine, events names only its outcomes, and every outcome has an event
D014 A rule’s if parses in the rule language, reads only what its table requires and the bars, reads a judgment through its type, and compares like with like
D015 A table that requires a question declares a failure route, and failure.then is one of its outcomes
D016 A person’s decision names who, lists its outcomes, and carries no rule, no hit policy and no failure route
D017 binding is well formed and its credentials is a variable name; no decision’s logic names a provider or a model. Warning: settings.engine is version 0.1’s place for the model
D018 Bar names are unique, are not the name of an input, a decision or a word of the rule language, and each has a number
D019 Warning: a first table with no otherwise rule, or with one before its last rule; a unique table with an otherwise rule
D020 Warning: a table with a rule written in words only (when without if). The loom draws it and does not run it
D021 Warning: a question whose answer no decision requires
D022 rulings.bar_after is a whole number of 1 or more, rulings.decision names a person’s decision, and rulings.record names inputs, questions and decisions of the model, with every field of each answer, each as a path in text
D023 settings.supersedes, when present, names an earlier version and a sha256 of 64 hexadecimal characters
D024 A table that reads a trigger lists to_person, among its outcomes. Each of its rules states a route. A rule routed authority or uncertain, and the failure route, give an outcome in to_person
D025 logic.trigger is on a noul, and its category is unique in the model. A bar’s category names a trigger’s
D026 In a table that reads a trigger, no rule whose outcome is outside to_person comes before a rule that reads a trigger
D027 A bar that a rule routed authority or uncertain reads has a value strictly between 0 and 1

D023 to D027 are 0.3’s and are not implemented. A 0.2 document declares none of the fields they read, and they report nothing on it.

Evaluation — evaluateDecisions(def, { values, answers, rulings, bars })

One run from recorded answers. It asks no engine and reads no clock. It returns the definition and its version, the bars the run was read against, and one result per decision, each after what it requires:

A decision Can be
question answered (with its typed answer), missing, invalid (with why)
table decided (its outcome, the rule that decided it), failed (its failure route, the questions that had no answer), awaiting_owner (what it waits on, and any answer missing as well), or no outcome with the reason: no_rule, conflict, error, not_evaluable
person awaiting_owner (with who), ruled (the outcome, who ruled, their words)

A table’s result carries its rule trace: each rule tried, in order, whether it held, and every value it read, keyed as the rule wrote it ("foreign_repo.yes": 0.47, "owner_at": 0.5). An explanation of a run is this trace, read aloud. It is never a story about what the engine thought.

The acceptance test of the format: given a fixed input snapshot and fixed answers, every caller produces the same outcome and rule trace. Every caller uses this one function. The protocol’s tests and the MCP’s tests compare their results as data.

Engine Call — toEngineRequest(def, values, options)

Builds one request, and sends nothing. state holds what the questions of one group require, keyed by name, in the document’s order. questions holds those questions, each with its type, its instructions and its criteria (a noul’s { true, false }, a choice’s options in the order sent, a score’s levels). options.group names the request, options.rotation turns the options of each question that rotates, options.optionOrder gives a recorded order instead, and options.model overrides the binding. A value the request needs and does not have is an error: it is not sent as an empty one. A question that waits on another decision finds that decision’s result in values, like an input.

A provider adapter (sending the request, checking and recording the response) is not part of this version.

The ledger replay — replayLedger(def, lines, { bars })

Runs every recorded run through the document again, from the answers its line holds, and says for each whether the tables give the outcome the line recorded, with the rule that decided it and the rulings in force. A line that lacks something a table reads is not replayable, and the report names the field. An answer no table reads may be absent. A key that is absent is a ledger that never kept it. A null is an engine that never answered: that is a recorded fact, and it replays through the failure route.

On Episode 564’s ledger of 2026-11-14 (16 lines: 7 runs, 8 rulings, 1 withdrawal), the 7 runs replay to their recorded bands: hold_for_person by rule 1 five times, by rule 2 once, and seat_reads by rule 4 once. Seven rulings are in force. One ruled as the band did and six ruled against it. Twenty are needed before a bar may be set.

The decision instance

The document is the decision type. Each decision actually made is an instance: the lines of the ledger that name one run, its own line first, then every line on it in the order written (rulings, withdrawals, the outcome of the act, reviews, annotations). No line is edited or removed. A correction is a new line that names the one it corrects.

An instance is pinned to its type: its run line names the document’s name, version and the sha256 of the document file it ran on. It holds:

Part What it holds
definition name, version, sha256
inputs Each input as it was sent, with the sha256 of the whole value and its length, and kept: "prefix" when the line keeps only its start
scorer The model, the questions’ version and the option order sent
answers Each answer as the engine gave it
route The table’s outcome, its route, the rule and the categories that routed it
ruling The outcome, who ruled, the category answers, authorized_by when a seat ruled a trigger’s route, and the words, verbatim
outcome What was done after the decision and what it gave, written when known, by whom
reviews Each review, with its annotations

Replayed or reconstructed. The tables’ outcomes, rule traces and routes can be replayed from the recorded answers and the pinned version, and so can the request, from inputs kept whole. The engine’s answers, the person’s ruling and its reasons, and the outcome of the act can only be read as recorded. A review shows the two apart. A replay that does not give what was recorded is a finding about the instance, never a correction of it.

An instance bundle is those lines with the pinned document file, in one file, so a review needs neither the ledger nor the repository it came from.

Reviewing a decision

When a decision is questioned, the person and the session that made it look at the same drawing: the diagram of the pinned version, with the path the decision took drawn on it. The inputs it read, each answer, the rule that held and the values it read, the route, and the ruling.

  1. The pinned version, not the current one. The review opens the file whose sha256 the instance names. When that file is not found, it says so and draws nothing in its place.
  2. Reconstituted from the bundle. The session’s view is rebuilt from the instance: its inputs, answers, bars and lines. Nothing current enters it: not today’s document, bars or ledger, and not a new engine call.
  3. Reviewers annotate. They do not rewrite. An annotation is a new line on the instance, anchored to one of its parts, with who wrote it and when.
  4. A review’s outcome is a new line. upheld, superseded (a later decision took its place) or reversed (the review finds it wrong), with who reviewed and their words. The ruling it reviews is unchanged.
  5. Reviews are counted. A review’s outcome counts in the class of the instance’s route, as a ruling does: upheld as agreeing, reversed as not. superseded is not counted.

This is how the factory reviews a decision wherever it reviews one, the Musical Composition Review included.

What Episode 564 holds (2026-11-28)

The advance gate, advance-gate-261114/ in Episode 564, written to 0.2 as examples/advance-gate/advance-gate.dmdf.json. A seat working on its own asks it before an act it would otherwise decide alone.

The episode birth, episode-birth.dmdf.json, staged at _staging_for_new_episodes/who-reads-a-session-before-it-exists-261114/decision-model/ and written to 0.1. Five nouls, a choice of four (birth), a band in words, and a ruling (mint, not_yet, set_aside) that stays the person’s.

Both are 0.1 documents in the episode. Who writes their later form is Q5.

The ledger counted as 0.3 says (node examples/advance-gate/replay-0.3.mjs). The seven bands replay as recorded: 0.3 changes no table. Five runs took the authority route (foreign_repo twice, deletes twice, outside_audience once), one the uncertain route (foreign_repo at 0.47), and one the default route. No run took the score route. Two things diverge from 0.2’s count:

The ledger is not changed by either reading.

Rendering — renderMermaidDecisions(def)

A Mermaid flowchart BT: an input is a stadium, a decision a rectangle with its logic under its name, a model a subroutine box, a source or authority an asymmetric box. Information is a solid arrow, knowledge a dotted arrow, authority a dotted line ending in a circle. The three kinds of logic are told apart by their border as well as their words, never by colour: a question is dashed, a table plain, a person’s decision heavy. A group the document writes is a box around its questions, and never an arrow. render_diagram writes it as <name>.dmd.mmd. Under 0.3 a trigger shows its category under its name and a rule its route, and an instance is drawn on the diagram of its pinned version with its path marked (Reviewing a decision). Neither is implemented.

In a system (Spec 82)

A decision model stands alone: every tool above works on one document. It is also a member kind a system admits. checkSystem then reports its own rules with the system’s, and D008 for the names that cross. Membership is one entry in MEMBER_KINDS. Taking it out is the whole of making a decision model stand alone only, which is how Q3 below stays open.

Not yet in a system: links as data for a decision’s elements, a scenario message that invokes a decision, and a replay that walks a decision and a machine together.

MCP Tools

Check — validate_decision_model (D001 to D007, D009 to D022). Engine — decision_request returns the request toEngineRequest builds, and sends nothing. Run — simulate_decision runs the model from recorded answers; replay_decision_ledger replays a ledger. By extension — set_project_file, get_project_file, get_definition, load_definition, render_diagram, get_notes and set_notes answer for a decision model when it is the active document. In a system — add_member takes a .dmdf.json, and check_system reports D008.

Proposed in 0.1 and not built: create_decision_model, add_input, add_knowledge, add_decision, update_decision, remove_decision, add_requirement, remove_requirement. A model is written whole with load_definition.

From 0.1 to 0.2

A document written to 0.1 is still read and drawn. It is not valid, and its table is not run. What it needs:

0.1 0.2
no version settings.version (D012)
settings.engine binding.model (D017, warning)
a noul with instructions only its criteria (D009)
rules in words (when) the same rule beside it in the rule language (if), and thresholds as bars
then naming an outcome or “the choice of a decision” then for an outcome, from for a decision
a table that reads answers its failure route (D015)
one request, unstated a groups entry
a ledger read by its script rulings.record, or lines in the format’s own shape

The first document showed two more things. Its drawing and its script had different option texts for the advance choice, which is what a generated request ends (Desired Outcome 3). And its nouls had criteria in the script (the kit’s TRIGGERS) that the drawing did not show.

From 0.2 to 0.3

A 0.2 document is read, drawn and run under 0.3 as it is. It declares no trigger, no route and no to_person, so D023 to D027 report nothing on it, and its rulings are counted as 0.2 counts them. What it needs for 0.3’s counting:

0.2 0.3
a noul that asks about a category the person holds logic.trigger.category (D025)
rules that say what is decided to_person, and a route on each rule (D024), trigger rules first (D026)
one count against bar_after a count per category and scorer
a run’s line the document’s sha256, each input’s hash and length, the route
a ruling its category answers, and authorized_by when a seat rules a trigger’s route
a document edited when a bar moves a new version with settings.supersedes

Creative Advancement Scenarios

Scenario: A Decision Made in a Script Becomes a Drawing

Desired Outcome: The person sees what a seat decides with an engine before it acts on its own Current Reality: advance-gate.mjs holds seven questions and a band rule; its ledger holds its calls and their rulings; the person reads a README table Natural Progression: The agent writes advance-gate.dmdf.json: four inputs, three knowledge, seven questions in one group, four bars, the band table and the ruling; the loom validates it and draws it Resolution: Episode 564 holds the drawing; the person asks why foreign_repo reads facts, and the answer is J1 in the notes

Scenario: A Recorded Run Is Replayed

Desired Outcome: A person reads why a past run was held, without paying for a new one Current Reality: The ledger holds the engine’s answers of 2026-11-14 and the band each run was given Natural Progression: replay_decision_ledger runs each line through the table; the fifth run shows rule 1 not holding and rule 2 holding on foreign_repo.yes 0.47 Resolution: The person sees that the uncertain band, not the owner’s bar, held that run, and tries uncertain_from at another value on the same answers

Scenario: A Decision Drives a Machine

Desired Outcome: A lane’s state machine moves on a decision, and both drawings say so Current Reality: lane-check’s lane_status decides whether a lane is relayed, reopened or held (study S4); the lane’s machine and the decision live in different files Natural Progression: The decision’s outcomes name the machine’s events; the system check (D008) finds the one the machine lacks Resolution: The machine waits in one state for the decision’s event, and no engine is called inside a guard

Scenario: A Questioned Decision Is Reviewed on Its Diagram

Desired Outcome: Guillaume and the session that made a decision review together how it happened Current Reality: A run of the gate is questioned days later. The document has a newer version since, and the ledger has grown Natural Progression: The review opens the instance bundle and draws the version the run was pinned to, with the inputs it read, the answers, the rule that held, the route and the ruling. The session’s view is rebuilt from the bundle. Guillaume annotates the ruling Resolution: The review adds upheld or reversed, the outcome is counted in the run’s class, and the ruling itself is unchanged

Dependencies

Not in this version

Questions for Guillaume (Episode 121’s format circle)

Each stays open. The line under a question says what its answer changes.

Every bar’s value, and any cost or rate the research pass names, is Guillaume’s as well. This format sets none.