Added in 0.3. The matching producer capability is
configuration.run.configuration records what ran, separately from how it went. It has two parts: a workflow, the shape of the work (pieces of agent work, the artifacts they pass, and the control policy that gates and repairs), and a setting for each piece (harness, model, reasoning effort, context policy and options). Its id is computed from both, so the same workflow with the same settings has the same id in every tool, and runs of one configuration can be counted together. The id covers the declared configuration only: an attempt may override its piece’s setting, so two runs with the same id can still differ in what individual attempts used.
implement runs again, up to three rounds in all.
What ran: a workflow and a setting per piece vertex.
string
cfg_ plus the first 12 hex digits of SHA-256 over the canonical JSON of {workflow, settings} (see Configuration id): keys sorted, no whitespace, workflow id, version, title and ext excluded. Same shape and settings, same id, everywhere (E190).Inline, or a catalog reference such as {“ref”: “plan_implement_review”, “version”: 1}.
enum
Why this configuration ran. usual: the user’s usual workflow. alternative: an alternative loopmath offered. exploration: an exploration pick. user_edit: the user edited a suggestion. habit: a logged run, chosen by habit. designed: chosen by a planner such as
loopmath plan.One of: usual, alternative, exploration, user_edit, habit, designed.string
The recommendation id (rec_…) this choice came from.At most 200 characters.
Workflow
A workflow is a graph with two kinds of vertex. A piece is one unit of agent (or command) work; an artifact is what pieces consume and produce. Edges only join a piece and an artifact. A workflow shape: piece and artifact vertices, typed edges, and the control policy.string
Catalog or user workflow id. Excluded from the configuration id hash.At most 200 characters.
integer
Excluded from the configuration id hash.
array[]
Pairs [from, to]. Piece to artifact means produces; artifact to piece means consumes. Every edge joins a piece and an artifact and the graph is acyclic (E192); the repair loop lives in control.repair, not in an edge. Artifacts with no producer are inputs; with no consumer, outputs.
- An edge
[piece, artifact]means the piece produces the artifact;[artifact, piece]means the piece consumes it. An artifact with no producer is an input, one with no consumer an output. - Piece and artifact ids share one namespace and MUST be unique in it, every edge MUST join a piece and an artifact that exist, and the edges MUST NOT form a cycle (E192). A repair loop is written in
control.repair, never as an edge. - A nested workflow is checked the same way.
string
required
A catalog or user workflow id, e.g.
plan_implement_review.At most 200 characters.integer
Pieces
A piece vertex: one unit of agent (or command) work in the workflow.string
What the piece does. loopmath writes planner, implementer, reviewer, tester, referee, worker; readers never rewrite roles.Recommended values (open set):
planner, implementer, reviewer, tester, referee, worker, plan, implement, review, test, integrate, select, research, docs.At most 100 characters.integer
Parallel copies of the piece (best of n). 1 when absent.
A nested workflow. A piece may have a role, a nested workflow, both or neither.
roleis an open string. loopmath writesplanner,implementer,reviewer,tester,refereeandworker. A reader MUST NOT rewrite a role into its own vocabulary; it compares roles as written.widthabove 1 runs that many copies of the piece in parallel, as in best of n.- A piece may name a
role, hold a nestedworkflow, do both, or do neither: the schema requires onlyid, and 0.3 allows all four. A piece that holds a nested workflow and has no role needs no setting (E191); every other top-level piece does.
Artifacts
An artifact vertex: what pieces consume and produce.string
What the artifact is.Recommended values (open set):
issue, repo, plan, spec, diff, review, verdict, test_record, report, other.At most 100 characters.Control
The control policy: gates, the repair map, the repair budget and the rescue.string[]
Piece ids whose output is a verdict (E193: each names a piece).
map of string
Gate id to the piece that reruns when the gate rejects (E193: keys are gates, values are pieces).
integer
Rounds allowed, including the first. 1 means no repair; a missing or 0 budget reads as 1.
Extension data. The key
dev.loopmath.gate_rules (piece id to a gate rule other than the role’s default) is part of the configuration id.budgetcounts rounds including the first. A budget of 1 means no repair, and a missing or 0 budget reads as 1.- Every
control.gatesentry MUST name a piece, everycontrol.repairkey MUST be a gate, and everycontrol.repairvalue MUST be a piece (E193). - The extension key
dev.loopmath.gate_rulesmaps a gate to a rule other than its role’s default. Because it changes what ran, it is part of the configuration id, the oneextkey that is.
string
required
The fallback when the workflow ends without acceptance. configuration: redo with the configuration in
ref (usually the user’s usual one). person: a person does it. none: no fallback.Recommended values (open set): configuration, person, none.At most 100 characters.string
At most 200 characters.
number
Settings
settings maps each piece id to the setting it ran with. Every top-level piece of the workflow MUST have an object in settings under its id, except a piece that holds a nested workflow and has no role (E191).
How one piece runs: harness, model, reasoning effort, context policy and harness options.
string
The harness that runs the piece.
command marks a mechanical gate whose command is in options.command.Recommended values (open set): claude-code, codex, command.At most 100 characters.string
Reasoning-effort label as configured (low, medium, high, xhigh, max, default); harness-specific values kept verbatim.At most 100 characters.
string
Open string;
fresh when absent.Recommended values (open set): fresh, inherit, summary, default.At most 100 characters.object
Harness options, e.g. {“command”: “pytest -q”} for a command gate.
- A setting without
context_policyreads asfresh. harness: "command"marks a mechanical gate, such as a test run, whose command is inoptions.command.- An attempt carries its own
settingonly when it differs from the configuration’s setting for its piece. Such overrides are not part of the configuration id.node.vertexandattempt.vertexname the piece a node or attempt executes, andattempt.roundthe repair round, from 1.
Configuration id
configuration.id is cfg_ followed by the first 12 hexadecimal digits of the SHA-256 digest of the canonical JSON of {"workflow": W, "settings": S}. The canonical form keeps the declared workflow and baseline settings and drops labels, so renaming a workflow or giving it a new version does not change the id, and changing a model or a budget does. Per-attempt setting overrides are outside the id. A document whose id does not match its workflow and settings fails E190.
1
Resolve the workflow
If the workflow is a reference
{ref, version} without pieces, replace it with the catalog workflow it names.2
Canonicalize the workflow (W)
Keep exactly four keys, and drop the workflow’s
id, version, title, ext and any other field:pieces: each piece object as{id, width}, withwidth1 when absent, plusrolewhen present andworkflowwhen present (a nested workflow is canonicalized the same way). Other piece fields are dropped. Sorted byid;[]when absent.artifacts: each artifact object as{id}, pluskindwhen present. Sorted byid;[]when absent.edges: the[from, to]pairs, sorted by the string forms of their two ends;[]when absent.control:gatessorted,[]when absent;repairas given,{}when absent;budgetas max(1, budget) when it is an integer and 1 otherwise, so a missing budget and a number with a fraction part such as2.0both read as 1;rescuereduced to itskindandref, only when present; andgate_rules, the value ofcontrol.ext["dev.loopmath.gate_rules"], only when present and not empty. Otherextkeys are dropped. An absentcontrolreads as{"budget": 1, "gates": [], "repair": {}}.
3
Canonicalize the settings (S)
Map every key of
settings, not only the piece ids, to {harness, model, effort, context_policy, options}: harness as given, else null; model is the modelRef’s id, else its raw, else a bare string as given, else null; effort is "default" when absent, context_policy "fresh" and options {}. The setting’s ext is dropped.4
Serialize
Write
{"workflow": W, "settings": S} as JSON with object keys sorted at every level, no whitespace (separators , and :), non-ASCII characters written as themselves, and encode it as UTF-8.5
Hash
Take the SHA-256 digest of those bytes, in lowercase hexadecimal. The id is
cfg_ plus its first 12 digits.Worked example
A one-piece workflow,solo: one agent reads the issue and the repository and writes a diff.
Try it
Paste a configuration, or a whole OCP document, to compute its id. loopmath’sloopmath.ocp.canonical.config_id is the reference implementation, and loopmath ocp validate checks it as E190. Numbers are written as the reference implementation’s JSON encoder writes them, so 2.0 in options stays 2.0. The calculator above was tested against the reference implementation on randomly generated configurations and on every example document. A producer that computes ids in another language should check its output the same way, for example on the documents in examples/v0.3/, whose ids all verify.
Why it ran
source says why this configuration ran: the user’s usual workflow, an alternative a recommender offered, an exploration pick, a user_edit of a suggestion, habit for a logged run, or designed by a planner. rec names the recommendation the choice came from. Provenance says whether the run was logged or designed.