sim_check_witness
Re-check a stored structural witness against both stored models with the independent checker (pkg/morphism), which does no search. Given a structural edge's id, checks every witness of that edge; an edge with none answers unwitnessed (unproven, not disproved). Verdicts: valid, invalid (the map is not a morphism of the stored models), or uncheckable (a model was deleted, a net is malformed, or the predicate is now checked under a newer definition). Public: no sign-in. A witness or edge id is free (no compute tokens). With derivation (from sim_query): re-checks every step's witness, the chain, the composed map's digest and the composed map against both end models, and answers {verdict, reason, hops} (the body POST /api/derivation/check returns); a derivation naming a definition other than the predicate's current one is uncheckable; costs 1 compute token. With reach (a sim_reach answer): replays a trace through metamodel.Enabled/Fire and the guards, or re-checks an invariant witness against the stored model, answering {verdict, reason}; from and to are held to the scenario caps (1,000,000 per place, 4,000,000 in total), and a replay is priced before its first firing and is uncheckable over 200,000,000 work units; an exhaustive no is uncheckable (re-run sim_reach); an unknown answer is refused; costs 1 compute token (POST /api/reach/check). With reach on a system's answer, via is re-checked whole with it: the system is stored and holds the net, every other model has exactly one embedding, each embedding's witness or derivation re-checks valid now, and any translation of component places follows them. With reachResult (the result id sim_reach returns): re-checks a stored answer end to end — the record (its bytes hash to its id, its stored question asks what the answer answers under the budgets it records, and over names what it rests on), via as above, and the witness — answering {verdict, reason, parts, answer, currency}; an unknown answer stays unknown (its witness part is uncheckable, never a no); currency says whether this server would compute the same result (definition, budgets, registry, view, every model still stored) and lists superseded models without flipping current; costs 1 compute token (POST /api/reach/check with {"result": …}, or GET /api/lineage/<result>). With refutation (a refuted sim_prove answer's refutation, ROADMAP.md Phase 12i): re-checks its counterexample against both stored models with pkg/morphism — a refines trace replayed through the shared firing rule on both nets, or for preservesInvariant each embedding re-checked as an induced embedding, its invariant re-checked as a P-invariant of the object (y·C = 0 for every transition) and its pullback shown to break at the subject transition named (that the list holds every embedding is the search's claim and is not re-checked) — answering {verdict, reason}; costs 1 compute token (POST /api/refutation/check). A preservesInvariant or refines witness id re-checks its cover or simulation relation the same way (free, bounded: at most 4,096 cover terms, or 4,096 pairs and 20,000,000 firing-rule units). Give exactly one of id, derivation, reach, reachResult or refutation. Writes nothing.
sim_conformance_stream
Online conformance: replay an ORDERED event stream against a stored model and get a running verdict — does the model still match, or which event was the first that did not, and why. Unlike sim_conformance (whole finished cases, aggregate fitness) the order of events IS the stream's order, cases may interleave, and the answer names the first non-conforming event: its position, case, activity, whether the activity is unknown to the model or the transition was not enabled, the places that blocked it (need vs have), the case's marking just before it, and `repair` — the shortest unobserved transitions that would have enabled it (a local alignment of that one step, bounded; absent when none is found within repairDepth). This is token replay, not trace alignment. A divergent event is force-fired so the case resynchronises and later events are judged on their own. fitness is conforming events / events; tokenFitness is 1 - missing/consumed tokens: 1 while nothing has been consumed, and below 0 when more tokens are missing than were consumed. Missing tokens are counted as sim_conformance's replay counts them (an unknown activity and a blocking inhibitor each count one, an unmet read arc its shortfall), except where that replay ignores capacity or merges parallel arcs, which its caveats name. Give the stream as `events` (JSON array of {case, activity, timestamp?}) or `log` (CSV with a case_id, activity header, timestamp optional; rows are taken in the order given, not sorted). Activities are transition ids. Each case replays from the model's initial marking, so the model should be the per-case workflow; guard expressions are not evaluated and timestamps are not checked against delays (caveats says so). keepSteps adds the per-event running signal. Costs 2 tokens from your account's compute bucket. With outlook (JSON {"goal": {place: count}, "avoid": {place: count}, "cases": [case ids]}) the reply adds outlook, separate from conforming and firstDivergence: from the marking each case is in after the replay, whether goal is reached on every way the net can go on and avoid on none. Each target constrains only the places it names, to exactly that count, as sim_reach's to does. Each verdict is guaranteed, forced-violated, open (some continuations satisfy it and some do not) or unknown, which names the budget, cap, guard or timer that stopped the search and is never a yes or a no. A verdict rests on the case's marking itself, a sim_reach answer from that marking (reach; re-check a yes or an invariant no with sim_check_witness(reach=…)), an escape (a deadlock or a cycle that never reaches the target, re-checked before it is returned), or a search of every marking before the target, which has no smaller certificate. No fairness is assumed: a loop that can repeat forever makes a goal open, unless a delayed transition stays enabled along it unfired (the simulator starts a timer the instant it is enabled), which is unknown. Guards decidable from the marking are enforced, though the replay ignores them; a transition whose guard reads action parameters is never fired. Cases are grouped by marking, at most 4 distinct markings per call (outlook.cases, default every case in the stream, narrows it), and each search is bounded by sim_reach's 100,000-state and 20,000,000-unit budgets. The outlook costs 2 more tokens per distinct marking and predicate the marking does not already decide (one for each reachability search it may run, as sim_reach's search costs 1; at most 16), charged before any runs, even when the first search decides it; a refused outlook costs nothing more.
sim_create_model
Store a Petri-net model and return its content id and url, plus warnings (omitted when there are none) for a model that stores but probably does not say what was meant: transitions with no rate, which simulations run at the engine default of 1 per hour (each stage of a staged one, in a run without a schedule); a net in which nothing can fire at its declared initial marking; a guard no simulation enforces; an inhibitor arc drawn transition -> place; a pool (staff, machines) one transition takes and gives back in the same firing beside the work it serves, which is never busy, so its headcount multiplies that rate (or, through a "kinetic": false arc, changes nothing) instead of capping work in progress; a pool a transition only reads, through a read arc beside the work it takes, declared above the read arc's weight (staff at 2 read by serve beside queue), which is never taken and stays out of the rate, so every count above the weight runs exactly as the weight does (at the weight, such as an open sign at 1, it is a gate and draws no warning). At most 10 of each per-element warning are listed, the rest counted. The model is JSON with name, places, transitions and arcs; rates are per hour. Read resource sim://docs/authoring once for a worked example and the fields a simulation reads. Refused, with every reason at once: a key the schema does not define, named by its path with the key it most likely meant (unknown field places[0].intial (did you mean "initial"?)) or, when none is close, to be removed, a key repeated across elements written once (arcs[0..6].source); a value of the wrong kind, by its path and the kind wanted (the first one only, and the structure is checked once every value has the right kind); and otherwise every structural defect, leaving out the ones a misspelt key caused. At most 20 of each are listed, the rest counted. Models are immutable; a changed model is a new id. Costs 1 compute token (the account's bucket when signed in, the client address's otherwise); the model JSON is at most 262144 bytes.
Signed in with write scope, the model is yours (mine: true): it appears only in your own listing until you dedicate it to the commons with sim_license_model, and you can remove it with sim_delete_model. An identical model stored before this call keeps the envelope it has, so the reply is then mine: false with a note saying whose it is: another account's, the catalog's, or nobody's (created without sign-in). Without sign-in it is stored unowned, for good (mine: false, and a note saying so): reachable by id, listed for nobody, and nobody can delete, license or supersede it — creating the identical model signed in later returns the same id, still unowned. To own a model, sign in before creating it; a changed model (a new name is enough) is a new id. A call whose token has expired or lacks write scope is asked to sign in, not stored unowned. Anyone you give the id to can use the model either way.
sim_distinguish
Compare the behaviour of two stored models of one process — typically a net formalized from a document and a net sim_code_to_flow read out of code — and return proved (no word of visible steps separates them), refuted (with separation: the shortest firing sequence one net can make and the other cannot, or after which only one can stop) or unknown. Definition corresponded-traces-v1: correspondence maps subject transitions one-to-one to object transitions (unset: every transition id the two share); each mapped pair is a visible label, and every transition left out is hidden on its own side and closed over, so an internal step the code takes that the document does not name is not a difference. With outcomes (default true) it also compares where each net can stop (a marking where no transition, hidden ones included, is enabled), reading the observed places correspondence.places maps (unset: none, so it compares only whether each can stop); set outcomes=false for nets meant to run forever, such as a server loop. Untimed and interleaving through the shared firing rule: rates, delays and schedules are not compared; a guard, a precondition the net's source carried and it could not represent (guardUnrepresentable, as sim_code_to_flow can leave), a fixed delay, or two consuming arcs from one place into one transition make the answer unknown (nothing is compared). Budgets: 20,000,000 work units, 4,096 joint states, 4,096 markings per side after one word, 262,144 markings held across every joint state kept, 4,096 steps in a run, 1,000,000 tokens per place; the whole call is also bounded by the 55 s request limit. A budget that runs out answers unknown, with agreesThroughLength once the empty word was compared (no word of at most that many labels separates them), and never counts as agreement; retrying gives the same answer. A refuted answer's separation was re-checked by pkg/morphism before it was returned; pass it back as separation, with nothing else, to re-check it against both stored models now, with no search (valid, invalid, or uncheckable: a model was deleted, a net carries a guard, a lost precondition or a fixed delay, the separation names another definition, or the check is over the checker's bounds). A proved answer carries no certificate. Every answer carries means: a refutation shows the two NETS differ; whether the document and the code differ, or a formalization or the correspondence is wrong, the engine does not decide; a proof is agreement between two readings, not fidelity. Unlike sim_prove's refines (one direction, by id, no hidden steps, recorded), it is symmetric and records nothing; unlike sim_diff (the text of two models), it compares behaviour. Needs sign-in (opens OAuth the first time). Costs 2 compute tokens to compare, 1 to re-check a separation. Writes nothing.
sim_prove
Prove a structural relation between two stored models and record it with its witness. isomorphicTo: an exact canonical-labelling search (the one behind sim_canonical, seeded with exactly what the check compares) finds a place/transition bijection preserving arcs (direction, type, weight, kinetic), place sort, initial marking, capacity, rate or delay and refine.* tags. It does not compare guards, stages, schedules, constraints, non-refine tags (outcome, port.*), data-place types and initial values, objectives, players or asserted classes; those the pair carries are listed as notCompared, so proved is not 'behaves the same'. subnetOf: a bounded embedding search finds an injective, sort-preserving map (token places to token places, data places to data places, transitions to transitions) of the subject's places and transitions into the object's whose arcs among the image are exactly the subject's (initial markings, capacities, rates, delays and tags are not compared). preservesInvariant (invariant-pullback-v1): an induced embedding as subnetOf's along which every P-invariant of the object pulls back to a P-invariant of the subject (the incidence the shared firing rule implies: consuming and producing arcs on token places). Proved carries the map and a cover — per subject transition, rational coefficients of object transitions with the same incidence — which proves it for every invariant at once, plus invariantDimension (0 means vacuous: the object conserves nothing). Embeddings are tried one image at a time (embeddings onto one image differ by a symmetry of the subject, which keeps or breaks the pullback with them), at most 16 images. refines (id-simulation-v1): every firing sequence of the subject from its initial marking, transitions the object has no transition of (by id) dropped as silent, is one of the object from its own; untimed, guards and fixed delays refused (unknown: a delay is a timer whose in-flight markings an atomic step skips), rates not compared, at least one shared transition id required. Proved carries a simulation relation (pairs of markings closed under the subject's firings, at most 4,096; relationPairs counts them, GET /api/lineage/<witness> lists them), which makes the claim unbounded; neverFired lists the shared transitions the subject never fires from its initial marking, and vacuous: true says it never fires any of them, so the proof (still recorded) has no visible step to match. Neither is declared transitive, so sim_query never closes over them. The answer is proved (with the map, in the caller's direction, or the relation), refuted (exhaustive, with the reason; a refuted refines, or a refuted preservesInvariant where the subject embeds at all, carries refutation, a counterexample sim_check_witness(refutation=…) re-checks: a trace for refines, an invariant per embedding for preservesInvariant, whose list of embeddings is the search's claim; a preservesInvariant refuted because no embedding exists carries none, as a refuted subnetOf carries none) or unknown (a search budget ran out; nothing is recorded, retrying gives the same answer, and unknown is not a no). Needs sign-in (opens OAuth the first time), including with record=false. Costs 3 compute tokens from your account's bucket, or 2 with record=false. Budgets: 1,000,000 refinement steps for both nets' canonical labelling together (isomorphicTo), 2,000,000 embedding steps (subnetOf), 4,000,000 units for elimination, embedding and tests together (preservesInvariant), 20,000,000 firing-rule units and 4,096 pairs (refines); the whole call is also bounded by the 55 s request limit. Writes, only when proved and record is true (the default): one witness, then one relation; isomorphicTo is stored with the smaller id as subject, and storedAs says so when that turned the call round. Otherwise it writes nothing. sim_check_witness re-checks either at any time. With via, sim_prove promotes instead of searching: it takes a structural fact sim_query derived (two to eight stored witnesses composed), re-derives it here from the stored witnesses — every step's witness re-checked against both stored models now, the chain, the composed map's digest, and the composed map checked against the two end models by pkg/morphism — and records the composed map as one direct witness through the same write gate as a search's, so the edge has the same id (one per subject, predicate and object) and is trusted exactly as far. The witness records the derivation as promotedFrom; re-promoting the same derivation writes nothing new (existing: true). A derivation that re-checks invalid or uncheckable is refused and nothing is written; an unknown is never promoted. Costs 2 compute tokens (a derivation re-check plus a store) instead of 3; record=false is refused with via.
sim_query
Answer a question over the edge graph between stored models: bounded paths, closure over transitive predicates, and conjunctive patterns of up to 4 triples joined on shared ?variables. The query argument is JSON: {"select": ["?m"], "where": [{"subject": "?m", "predicate": "subnetOf", "object": "<content id>", "mode": "closure"}, {"subject": "?m", "predicate": "@type", "object": "QueueingSystem"}]}; a term starting with ? is a variable, anything else a constant (a 24-hex content id, or for @type's object a model kind). Modes: edge (default; one stored edge, read through the registry: narrower is read as broader turned round, symmetric predicates match either way round), path (1..maxHops hops, maxHops 1 to 8 required; a row says reached by a path unless the predicate is transitive), closure (no maxHops; allowed only on the transitive predicates broader, isomorphicTo, migratedFrom, narrower, subnetOf, supersededBy). Put the bound term in object to walk backwards. Unregistered (legacy) predicates are one stored edge in their stored direction only, never walked or closed over. A structural edge (isomorphicTo, subnetOf, preservesInvariant, refines) counts only when one of its stored witnesses re-checks valid now; a derived structural fact carries a derivation (the chain of witnesses and the composed map's digest) that sim_check_witness(derivation=…) re-checks, and is never stored; excluded lists the edges not walked and why. Closure runs per predicate (isomorphicTo hops never feed a subnetOf closure). status complete means complete over the eligible edges (and, for path, within maxHops: hopLimitReached names patterns with edges beyond); truncated means a bound was reached, rows is absent and the rows found so far are in partialRows (true, but not all of them). A query with no variables answers yes, no or unknown (a bound stopped it, or a stored row could not be decoded); a no's caveat says how far the search looked (only closure rules out a derived edge, and a path cut at maxHops says so), and no is not a refutation. Pattern numbers in a result (support[].pattern, hopLimitReached, unmatched, truncated.pattern) are 0-based positions in query.normalized.where; refusals number your patterns from 1. Limits: 4 patterns, 8 hops, 200 rows, 10,000 intermediate rows, 1,000,000 work units, 64 models probed, a 256 KiB result, a 16 KiB query; the whole call is bounded by the 55s request limit. Over a limit before running is a refusal naming it; reached while running is truncated, and retrying gives the same answer. Needs sign-in with read scope (opens OAuth the first time). Costs 2 compute tokens per call, cache hits and refusals included. Writes one Query and one Result entity, content-addressed (resolve either at GET /api/lineage/{id}; stored is false, with storedNote saying why, if the write failed or a composed map was refused); a repeated question is served from the cache only while the edges and witnesses it read, and the models it checked, are unchanged. An answer naming models that have since been superseded carries superseded ([{model, successor, current, chainStatus}]); the answer is still right about those versions.
sim_reach
Returns whether the marking to is reachable from the marking from in ONE stored net (a model, or a system that is one net): yes with a firing trace, no with a re-checkable P-invariant (or after an exhaustive search), or unknown with every reason. A sim_compose result is one fused net, so it qualifies; a sim_bind binding or a collection links rates, not tokens, and answers unknown (not-one-net). A system id (sim_create_system) is answered on its one net when one member has every other embedded in it by a witnessed subnetOf or isomorphicTo edge or a chain of edges of one predicate (the answer carries via: an edge and witness per member, or the derivation sim_check_witness(derivation=…) re-checks); otherwise it answers unknown: not-one-net when it holds bindings (they link rates, not tokens) or no member qualifies, system-truncated when its witness bound was reached or the chain search stopped at a bound. On a one-net system, a key in from or to may name a member's place as <model>:<place> (the member's id, or its name when no other member shares it): it is translated into the net place that member's embedding maps it to, the answer's from and to are the translated question, and via.translation lists each key's member, place and net place, which sim_check_witness(reach=…) re-checks against the stored witnesses. Refused, naming the key: a member or place the system does not have, a data place, a key that reads more than one way, a place two valid witnesses of the member's edge map differently, and two keys landing on one net place with different counts; more than 16 other witnesses to compare answers unknown (translation-budget). from is a sparse override on the model's declared initial marking (unset = declared). to constrains only the places it names, each to exactly that count; naming every token place asks for an exact marking. Unknown or data places, negative or fractional counts and counts over the scenario caps (1,000,000 per place, 4,000,000 in total) are refused. Reachability here is untimed: each firing is one atomic step under the shared firing rule (read and inhibitor arcs, capacities, guards decidable from the marking); rates, schedules, delays and stages play no part. Answers: no with a P-invariant y whose weighted sum differs between from and to (when to leaves a place of y free, to alone must already exceed it), valid whatever read arcs, inhibitors, capacities or guards allow, since those only remove firings; no (exhaustive) when every marking reachable from from was searched; yes with a firing trace (shortest among the firings the search makes; reads says when it skipped some); unknown (unknownBecause lists each cause) when neither is found within 100,000 markings or 20,000,000 work units, when a firing would pass 1,000,000 tokens on a place, when a guard fails to evaluate at a reached marking, when a transition whose guard reads action parameters (or does not parse, or whose precondition was lost) was enabled and so left out, when the invariant algebra runs past its 20,000,000-operation budget, is cut short or needs coefficients over 2147483647, or when a found trace would cost the independent checker more than 200,000,000 work units to replay. Unknown is not a no. Every answer (unknown included) is stored: question is the content id of the question as asked (the id, from and to as written, the definition and the budgets), result the id of the answer with what it was computed over (the net, every model, edge and witness via rests on, the predicate registry and system view for a system); a repeated question is served from a per-instance cache with the same bytes, and storedNote says why an answer too large to store (over 262,144 bytes) was not. Public: no sign-in; costs 2 compute tokens (a search plus a store). Re-check a yes or an invariant no with sim_check_witness(reach=<this answer>), which also re-checks via whole; re-check a stored answer end to end with sim_check_witness(reachResult=<result>) or GET /api/lineage/<result>.
sim_run_pipeline
Returns one scenario result per model that a set of stored Bindings (see sim_bind) touches, run as a composed pipeline (each result's contention split into contended, waitingForWork and neverFired exactly as sim_scenario's is), with the assumptions the composition makes, inTransit (per delayed binding, the source's flow its delay carried past the horizon) and, when the set holds a loop, the loop's reading (loop, pipeline-loop-v1: verdict, claim, components with sweepsNeeded and sweepsRun, sweepsRun, residual). Costs 1 compute token per model run, charged up front, before any model is read, for the most runs the set can take — one per model outside a loop, and a loop's models times the most sweeps it can take — and not refunded when a loop settles in fewer. Defaults: hours 8, seed 1, realizations 0 (one SSA trajectory per model; set it, e.g. 16 as sim_scenario does, since bindings and loops couple means). Caps: hours up to 10000, realizations up to 200, as sim_scenario. Each model runs through its own ordinary scenario in topological order, an output port's trajectory resampled into the target's input-transition schedule, one seed and horizon shared by every model (the discipline sim_compare enforces within one model). A declared conversion is applied exactly as declared: the resampled rate is multiplied by any numeric transform, then by the convert factor. A binding with a delay drives its target that many hours later; before then the target runs on its own declared rate. A loop between models runs only when some binding on it declares a delay. It is solved by sweeps, each running every member once with one delayed binding (cut) driven by the previous sweep, until a sweep reproduces the previous one's schedules bit for bit: verdict fixed-point, whose claim (also assumptions' first line) is that this is the unique fixed point of the coupling over 0 to hours at the seed, followed by its four limits — each model was driven by the other's mean across realizations (mean-field: for joint dynamics build one net with sim_extend), each delay is declared, not measured, before its delay a target ran on its declared rate, and nothing is claimed past the horizon (a fixed point can be a loop that grows; read the series). Verdict stopped means a run hit the step budget or token cap (from sweep 2 on, typically a loop whose gain is above 1, which grows every sweep; in sweep 1, before any feedback has gone round the loop, the model itself at these hours and realizations) and not-settled is a defect to report; neither carries steps, and models after the loop are not run. Refused before anything is charged or read, each refusal naming the value and the bound: more than 64 binding ids; realizations or hours out of range (the text sim_scenario gives); and the set-level refusals, whose tool error starts with its code — a loop with no delayed binding (closes-loop), two bindings into one input (port-taken), more than one binding into a model (segment-cap: each becomes a schedule of up to 61 segments, and a scenario holds at most 100), a loop of more than 4 models (loop-too-large), a loop whose total delay does not exceed one resample interval (hours/60) per binding (loop-lag), one needing more than 24 sweeps (loop-horizon), loops needing more than 48 model runs together (run-cap); loop-lag and loop-horizon name the delay that would run at these hours and the most hours that run at this delay, and sim_system's view of a system holding the loop reports that most as maxHours. Refused after the charge (which pays for reading the models) and before anything runs: any binding that fails the check sim_bind applies (binds-port-v1; v2 for a unit conversion; v3 for a delay; a binding recorded before a check may be refused here by the same text), and a delayed binding whose target declares so many schedule segments before the delay ends that its schedule would pass the cap at these hours (segment-cap, code first as above). Every result names its seams: no model's own fitness gates cover the join, one unit line per binding (units agree; converted, naming the factor; or unchecked where a port declares no port.unit), and that a binding couples means: a driven model ran on its source's mean, so its std_dev is its own spread given that mean, not the joint system's. A driven model's resampled schedule keeps one random stream per realization across its segments, so splitting a run into segments adds nothing where no rate changes; the resampling itself is a piecewise-constant approximation of the source's mean, which smooths anything shorter than one resample window (hours/60). Public: no sign-in; writes nothing.
sim_scenario
Run a seeded what-if scenario against a stored model: marking overrides, rate overrides, piecewise rate schedules, and params assignments to the model's declared structural parameters (arc weights, capacities — batch sizes and shelf sizes). Pure read — asking cannot change the model. Returns trajectory, final marking, metrics, depleted, contended, waitingForWork, neverFired (all three described below), caveats and assumptions. "samples" (default 60) is the trajectory's resolution: the number of evenly spaced points from 0 to hours inclusive at which times and every place's series (mean and std_dev per point) are reported — it sizes the answer, not the run, since metrics (throughput, mean, p95, utilization, inFlight) are time-weighted over every firing and do not change with the grid. "summary": true omits the times and series arrays entirely (the keys are absent, not null) and returns just final, finalStdDev, metrics, depleted, contended, waitingForWork, neverFired, caveats and assumptions — the verdict without the chart data, and the right form when nothing will be plotted. finalStdDev, summarized or not, is each place's spread across realizations at the horizon beside final's mean (absent at one realization and on the ode engine). Transitions declaring stages (phase-type durations) run with the declared lower spread — the engine expands them structurally and reports in the model's own vocabulary. A model-declared schedule (the day shape on a transition) is honored by every run; the scenario's own schedule or rate override still wins for that transition. "engine" picks the reading: "ssa" (default, discrete Gillespie — the right choice whenever counts are small enough that variance is the answer, or a schedule is in play) or "ode" (continuous mass-action; refuses a schedule, and refuses outright rather than silently misread a model carrying a read arc, inhibitor, reached capacity, guard or non-kinetic arc — Forecast's caveats name which). See docs/engine-selection.md for the full decision rule, including why an arc weight above 1 gets a genuinely different rate law from each engine, and sim_crosscheck to run both readings side by side. Contention arrives split three ways. contended holds only what the run was short of, something an operator could buy more of: kind conserved (a fixed pool such as staff) or bounded (a shelf with a declared capacity), each entry with fraction (the share of the run, across every realization, in which that place was the only input missing for the transitions under blocking), longest wait first. waitingForWork holds the engine's other entries in the same shape, and neither of its kinds is a shortage: queue (filled only by the model's own flow, such as waiting customers or work in service) means the work had not arrived, a statement about demand; state (a marker of which phase of a cycle the model is in, such as a stoplight's colour) means the model was in another phase. neverFired is one note per entry whose place never held a token in any run and whose transitions never fired, e.g. "work" never fired in any run: its input "q" never held a token. A queue or state entry like that appears only as its note; a conserved or bounded one keeps its contended row as well, since the run was short of it. The run cannot tell why a place stayed empty. Either it starts empty and nothing fills it (check its initial count and what produces it), or its producer was switched off (a rate of 0, or a scenario marking of 0 on it or upstream of it), or what fills it is rarer than this run's hours and realizations can sample (raise either; once the place fills, the note goes). sim_receipt and the HTTP scenario routes return the engine's unsplit contended list instead, each entry with its kind.
sim_sequences
Returns a deterministic suite of firing sequences generated from ONE stored model, for replaying against an implementation outside sim (for example the code a sim_code_to_flow model came from): every transition fired once, a refusal probe for each transition at a marking where the model refuses it, and each conflict found (two enabled transitions where firing one disables the other) fired then probed. Each sequence starts from the declared initial marking: fire each of fires in order (the model fires each), then try refused once when it is set (the model refuses it); covers names its targets and final is the model's nonzero marking after fires. calls counts every fire and probe, not the resets. The reading is untimed, as sim_reach's is: each firing is one atomic step under the shared firing rule (read and inhibitor arcs, capacities, guards decidable from the marking); rates, schedules, delays and stages play no part, and a transition whose guard reads action parameters (or does not parse, or whose precondition was lost) is never fired or probed (excluded lists it). Each target is covered; unreachable, said only after an exhaustive search; or not-covered with a reason: depth-bound (markings or targets were left unexplored past depth: ask a larger depth), state-budget or work-budget (the 20,000-marking or 10,000,000-unit search budget), token-cap, guard-error, excluded-live (an excluded transition was enabled, so markings past it were not searched), excluded, or suite-budget (past 20,000 calls or 100,000 listed entries, each fire, probe and final-marking place counting one). notCovered gives each reason's detail and remedy, and coverage.conflict.complete is true only after an exhaustive search. depth is 1..16, default 8; a model over 128 transitions is refused. defects (0..200, default 50; 0 omits the figure) seeds up to that many single-point net mutants (all of them when the model has fewer; defects.candidates and defects.seeded say how many) (drop-arc, weight-up, weight-down, test-flip, read-to-consume, initial-up, initial-down, capacity-down, capacity-drop, guard-drop; rates and timing are never mutated), picked by seed (default 1), replays the suite against each with markings compared, and runs 8 seeded random testers (seeds seed to seed+7) against each with the suite's own call budget, resetting every depth fires. defects.suite.detected counts seeded mutants the suite told apart from the model, beside defects.random.detected's mean, min and max across the runs; it is a count of seeded defects, never a share of real bugs. survivors lists the mutants the suite missed: a survivor may be equivalent (no sequence of any length tells it apart), and this figure does not decide which. A mutant no suite sequence told apart and at least one could not drive to an answer (a firing it cannot decide, such as one past the token cap) is undecided: undecidedDefects lists it with its first error, and it counts in neither figure. The score is priced before it runs (defects.price) and refused over 2,000,000,000 work units: each call costs its arc test, its guard and passes over the model's token places, and each mutant its compile. summary true omits the sequences array (the key is absent, not null). MCP only: there is no HTTP route. Public: no sign-in; costs 2 compute tokens (one bounded search plus a priced replay battery). Writes nothing.
sim_system
Returns a stored System's view ({id}), the models whose ports can bind to one declared port ({model, port, direction?, among?}), or the stored systems that name a model or a binding ({naming}); one form per call. {id}: the system's view, computed now and never stored (system-view-v2): each model (present, superseded), each binding with its binds-port check (v1, or v2 with its convert when it declares a unit conversion, or v3 with its delay when it declares one) and whether the set runs as a pipeline (with its loops and maxHours when it holds one), the isomorphicTo/subnetOf edges among the models with up to 128 witnesses re-checked (past that the view is truncated and the rest read unchecked), and the shape — one-net when one member has every other embedded in it by a direct witnessed edge or a chain of edges of one predicate through any stored model, every hop's witness and the composed map re-checked (net, embeddings: a direct one names edge and witness, a chained one its derivation, which sim_check_witness(derivation=…) re-checks; closure says what the chain search cost; sim_reach then answers on that net), pipeline when it holds bindings (they link rates, not tokens: sim_reach answers unknown), separate otherwise (notOneNet says why; a chain mixing subnetOf and isomorphicTo hops does not count), unknown when the witness bound was reached before any member qualified, or the chain search stopped at its hop, model or work bound (closure-incomplete: not a no). {model, port, direction?, among?}: what can bind to that declared port — every model with a port sim_bind would accept against it without a unit conversion (opposite direction, equal kind, units agreeing where both declare one), ranked units-agree first, then model id and port; each row carries the sim_bind arguments. A port whose declared unit differs is counted under excluded as unit-differs, not listed: it binds only through sim_bind with convertFrom, convertTo and convertFactor (binds-port-v2), and an empty answer means none binds without one. The universe is the visible catalog, or among (a collection's model members, at most 256, or a system's models, where a candidate that would take a bound port or close a loop of undelayed bindings is counted under excluded, never listed, and one that closes a loop already holding a delayed binding is listed with closesLoop: bindable-v3). Every model in the universe is searched (bindable-v2; bindable-v3 among a system), through a port index that keeps each model's ports by direction and kind, read once per content id and synced from the listing on every call (a model another instance stored is searched on the next call). At most 256 models the index does not hold yet are read per call (past it status is truncated with bound fetches and unscanned says how many were left; ask again and it continues), 100000 candidate ports checked and 50 rows listed: past any bound status is truncated, and if a member model cannot be read status is incomplete (listed under unreadable); in both cases the rows are in partialRows. candidates, scanned, unscanned, fromIndex, read and portChecks say exactly how far it searched; the index holds at most 16777216 bytes of ports (of which at most 2097152 for models no catalog-wide search has listed, such as an among search's or the asked model's) and at most 65536 bytes for one model, and a model past any of these is searched but not kept (notKept). The call's token covers its first 64 reads; each further 64 cost one more token, charged before they are read, and when the bucket cannot cover them status is truncated with bound rate. {naming}: every stored system whose models or bindings include that id (as: model or binding), sorted by system id, from an index synced from the store's listing on every call (a system another instance stored is seen on the next read). At most 100 systems listed (past it status is truncated, total says how many) and at most 256 not-yet-read systems fetched per call (past it status is incomplete and unindexed says how many are unread; ask again and it continues); the index holds at most 33554432 bytes of systems, and once full nothing more is indexed on that instance (status incomplete, unindexed says how many, and asking again does not change it); a stored system that cannot be decoded also keeps status incomplete (listed under unreadable), and asking again does not clear it; in every case the rows are in partialSystems. A system cannot be named (systems do not nest) and a collection is refused, naming the remedy; an id no entity holds any more (a deleted model) is answered when a system still names it. Systems are linkable and collectable: sim_link puts one in a collection (hasMember) and relates it with cites, about, broader and related. This is not refines: a system's edges are isomorphicTo and subnetOf (embeds by wiring / is the same coloured net). refines (trace inclusion with transitions matched by id) and preservesInvariant (the object's P-invariants pull back along an embedding) are proved one pair at a time by sim_prove and are never walked by closure, since neither is declared transitive. For "what contains this pattern?" ask sim_query with closure: {"select":["?m"],"where":[{"subject":"<pattern id>","predicate":"subnetOf","object":"?m","mode":"closure"}]} (isomorphicTo for copies; add {"subject":"<collection>","predicate":"hasMember","object":"?m"} to scope it), each row carrying a derivation sim_check_witness re-checks; a subnetOf row claims no behaviour inclusion. For "what does this model refine?" ask sim_query for one hop: {"select":["?m"],"where":[{"subject":"<model id>","predicate":"refines","object":"?m"}]}, each row an edge sim_prove recorded. A loop between models runs only through a binding that declares a delay (sim_bind delay; ROADMAP.md Phase 12j): a system may hold one, of at most 4 models, and its view lists it under pipeline.loops with pipeline.maxHours, the longest horizon sim_run_pipeline runs it at (0 when no horizon of 0.01 h or more does; pipeline.runnable covers only the checks that do not depend on the hours), where it is solved as an exact fixed point over the horizon (pipeline-loop-v1). A loop with no delayed binding is refused when a system is defined and by sim_run_pipeline, and sim_bind refuses a self-binding. A port search with among a system (bindable-v3) lists a candidate that closes a loop already holding a delayed binding, with that loop's models under closesLoop, and counts one that would close a loop of undelayed bindings under excluded as closes-loop (sim_bind with a delay can close it); a catalog or collection search does not consult stored bindings, so sim_create_system or sim_run_pipeline is where such a loop is refused. Public: no sign-in; costs 1 compute token (a port search, 1 more per 64 models read past its first 64); writes nothing.