MCP-Server

whatif

xyz.pflow.sim/whatif
Daten & Analytik Wissenschaft & Engineering Öffentlich und erreichbar MCP 2025-11-25

Was dieses MCP kann

Builds, validates, calibrates, compares, and simulates Petri-net process models using event logs, scenarios, invariants, and diagnostics.

sim_bind
Record an intended connection between two stored models' declared ports — fromModel's fromPort feeding toModel's toPort — as a new content-addressed Binding, alongside sim_link's Relation graph rather than inside either model (ROADMAP.md Phase 9). This does not run anything, does not validate that either port exists or has the right direction, and does not touch either model: it is a proposal to connect, discoverable afterward via sim_edges on either model id (a from/to Relation is recorded automatically) or sim_get_binding on the id this returns. Storing the same from/to/transform twice returns the same id rather than a duplicate.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['fromModel', 'fromPort', 'toModel', 'toPort'], 'properties': {'toPort': {'type': 'string', 'description': 'element id of the declared input port on toModel'}, 'toModel': {'type': 'string', 'description': 'id of the model receiving the connection'}, 'fromPort': {'type': 'string', 'description': 'element id of the declared output port on fromModel (see GET /api/models/{id}/ports)'}, 'fromModel': {'type': 'string', 'description': "id of the model supplying the connection's output"}, 'transform': {'type': 'string', 'description': "how fromPort's value becomes toPort's. A plain non-negative number is applied by sim_run_pipeline as a scale factor on the resampled rate; any other text (a unit note, a resample window, an aggregation) is recorded, reported by sim_run_pipeline as an assumption, and treated as 1:1"}}}
sim_calibrate
Calibrate a model against YOUR event log — the reading that meets reality. Upload CSV (case_id, activity, timestamp; the shape sim_dataset emits, activities = transition ids), and rates are learned from the observed timings: sources from inter-arrival times, services from the gap before their completions, all per hour. Instant-pickup transitions (declared rate >= 100) keep their declared rate — their observed gap is the queue wait, and learning it would destroy the calibration discipline. A transition declaring a delay (a fixed-duration timer, not a rate) is fit differently and returned in learnedDelays instead of learnedRates: the MEDIAN observed gap, in hours, written onto the transition itself since a delay has no solver-map slot — a gapCV in rateEvidence far from 0 means the log looks exponential, not fixed, and the calibration says so in a caveat rather than trusting the median anyway. Returns a NEW content-addressed model (learned rates in the solver map, learned delays on the transitions, declared values otherwise untouched, lineage recorded) plus a conformance report: fittingPercent (full replays) is the headline, worst traces named with the activities that could not fire. tokenFitness is a second, harsher reading of the same replay (raw tokens present vs. required at every step, not full-trace success) that under-reads any net with a resource pool — read fittingPercent, not tokenFitness, unless you specifically want the raw-token number. Every learned rate or delay has an entry in rateEvidence: n (gaps it rests on), gapCV (sample std dev over mean of those gaps; ~1 for exponential timings, near 0 for a true timer) and insufficient when n < 2 — n=0 yields nothing, n=1 a value with no spread. Learned values on a structure that cannot replay the traces would be numerology — read fittingPercent before trusting them. Costs 3 tokens from your account's compute bucket (a replay of the log, 2, and the stored model, 1).
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id', 'log'], 'properties': {'id': {'type': 'string', 'description': 'model id to calibrate'}, 'log': {'type': 'string', 'description': 'the event log, as CSV text'}}}
sim_canonical
Tell whether two differently-labelled models are actually the same net: an isomorphism-invariant id computed from the model's EXACT automorphism orbits (orbits.go), not the colour-refinement (WL) kind sim_classify falls back to when the exact search can't decide. Two models differing only by renaming places or transitions share the same canonicalId even though their content-addressed ids (from sim_get_model) differ — this is the id to compare, not the model id, when checking whether a catalog already holds this net. Also returns the non-trivial automorphism orbits and generator count the id was computed from: zero generators means the net is rigid (no symmetry at all), which is itself a fact about the net's structure. Refuses (as a tool error) when the exact search exceeds its 200,000-leaf budget — too large or too symmetric for this implementation, per orbits.go — rather than silently falling back to a weaker answer; sim_classify's own fallback covers that case for classification specifically.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'model id'}}}
sim_classify
Discover the parameter classes of a stored model and return them as JSON-LD with empty annotation slots for you to fill in (label, comment, unit, domain, substitutes — nothing else; membership/kind/evidence are derived and settled by measurement, not yours to edit). With verify=true a shared colour is checked by exact automorphism proof where the search can decide it (settling interchangeability outright, the stronger claim), falling back to the sampled permutation experiment only where it can't — the exact search refuses past a 200,000-leaf budget on nets too large or too symmetric for it. Read the sim://docs/classification resource once for the colour-refinement caveat and the annotation contract in full.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'model id'}, 'verify': {'type': 'boolean', 'description': 'run the permutation experiment (costs simulation; default false, and classes then say they are candidates)'}, 'inline_context': {'type': 'boolean', 'description': 'embed the full JSON-LD @context map in the result instead of the URL it is served from (https://sim.pflow.xyz/ns/v1/context). Default false: the URL resolves to the identical map, so only set this for an offline consumer that cannot fetch it.'}}}
sim_code_to_flow
Derive a Petri-net model from source code with the configured LLM (control flow, state machine, resources or concurrency focus), validate it, and store it as a NEW model you own. Runs generator.CodeToFlow directly — this tool is its only surface on sim.pflow.xyz, which mounts no code-to-flow HTTP endpoint; refused when this deployment has no LLM provider configured. Returns the new id when the answer validates, otherwise the raw model JSON and the validation errors so you can fix and sim_create_model it by hand.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['code'], 'properties': {'code': {'type': 'string', 'description': 'source code to analyse'}, 'name': {'type': 'string', 'description': 'name for the derived model'}, 'focus': {'type': 'string', 'description': 'control-flow (default), state-machine, resources or concurrency'}, 'language': {'type': 'string', 'description': 'source language hint, e.g. go, python, javascript'}}}
sim_compare
Run several scenarios against one model on one shared seed and return them side by side — the seed sharing is server-enforced, so differences are the scenarios, not the dice. Returns a summary by default (finals, throughput/mean/P95 metrics, contention, depletion — no time series); pass full=true for the complete trajectories, which run to hundreds of KB. A scenario carrying "summary": true stays summarized even under full=true, so one comparison can chart some scenarios and only read the rest. Unset hours default to 8, samples to 60 (the trajectory grid, which only matters under full=true — metrics are time-weighted and do not depend on it) and realizations to 16 per scenario. Each scenario can set its own "engine" (see sim_scenario / docs/engine-selection.md); comparing an "ode" run against an "ssa" one is legitimate but the shared seed only removes dice from scenarios using the same engine. Costs 1 token per scenario from the compute bucket (per address, or per account when signed in).
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id', 'scenarios'], 'properties': {'id': {'type': 'string', 'description': 'model id'}, 'full': {'type': 'boolean', 'description': 'include the sample-grid time series in every result (large; default false); a scenario with its own "summary": true is left summarized regardless'}, 'scenarios': {'type': 'string', 'description': 'JSON array of at most 20 scenarios, each with a name, e.g. [{"name":"today","hours":8},{"name":"one more","hours":8,"marking":{"staff/available":3}},{"name":"bigger batches","hours":8,"params":{"batch_size":6}}]; each is held to sim_scenario\'s caps'}}}
sim_components
List the component registry: pre-baked subnet templates (arrivals, service, hazard, inventory, decision, mailbox, datastore) with the calibration discipline baked into the arcs and rates. Each entry names its ports (places you can attach onto existing places), its params with recommended defaults, and the discipline notes explaining WHY the template is shaped the way it is. Compose them with sim_compose.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object'}
sim_compose
Instantiate a registry component into a model and store the result as a NEW content-addressed model you own (lineage recorded when composing onto an existing id). Omit id to start a model from the component alone; pass attach to fuse a component port onto one of the model's existing places (e.g. attach {"queue": "tickets_queue"} wires a hazard onto the service's queue). Prefix namespaces the created elements (defaults to the component name). Three calls build a working helpdesk: arrivals, then service attached to its queue, then hazard attached to the same queue — the result passes diagnose because the discipline is in the template.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['component'], 'properties': {'id': {'type': 'string', 'description': 'model to compose onto; omit to start fresh'}, 'name': {'type': 'string', 'description': 'model name for the stored result (kept from the base when composing onto an id)'}, 'attach': {'type': 'string', 'description': 'JSON object mapping port name -> existing place id'}, 'params': {'type': 'string', 'description': 'JSON object overriding param defaults, e.g. {"staff": 3}'}, 'prefix': {'type': 'string', 'description': 'instance prefix for created elements (default: component name)'}, 'component': {'type': 'string', 'description': 'registry component name (see sim_components)'}}}
sim_conformance
Check how well a stored model matches an observed event log WITHOUT rewriting its rates — the read sim_calibrate bundles into calibration, offered on its own and in full: fitness (can the model replay each case?), precision (does it allow behaviour never observed?), generalization and simplicity, with per-trace diagnostics naming the activities that could not fire. Log is CSV (case_id, activity, timestamp; the shape sim_dataset emits, activities = transition ids). The log is replayed one case at a time from the model's initial marking, so the model should be the per-case workflow; a resource net whose places are shared across cases will not fit. Caveats name what the analysable net encoded lossily. Costs 2 tokens from your account's compute bucket.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id', 'log'], 'properties': {'id': {'type': 'string', 'description': 'model id'}, 'log': {'type': 'string', 'description': 'the event log, as CSV text'}}}
sim_create_collection
Mint a named Collection and return its content id. A collection carries no member list of its own — a mutable list would change the collection's own id every time something joined it, the same reason Lineage lives beside a model rather than inside it. Add members with sim_link(collectionID, "hasMember", memberID) and read them back with sim_neighbors(collectionID, "hasMember") or sim_edges(collectionID). Content-addressed: creating a collection with a name already used returns the existing id, not a new sibling.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['name'], 'properties': {'name': {'type': 'string', 'description': 'collection name'}}}
sim_create_model
Store a Petri-net model (JSON with name/places/transitions/arcs) and return its content id. Models are immutable; a changed model is a new id. Structural validation rejects malformed nets with every reason at once. The model is yours: 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. Anyone you give the id to can use it either way. Needs sign-in (opens OAuth the first time); anonymous callers can POST /api/models over HTTP instead, stored unowned.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['model'], 'properties': {'model': {'type': 'string', 'description': 'the model JSON'}}}
sim_crosscheck
Run every applicable READING of a model against the others and report agreement or divergence with the reason: discrete SSA means vs the continuous mean-field solve, algebraically derived conservation laws vs simulated means, and (for game-schema models) the closed-form incidence ranking vs rollouts vs exact search. Divergence is a finding, not an error — small-count mean-field gaps and the prior's threat-blindness are named as such. Trust is agreement between independent readings of one structure. Gated nets (read arc, inhibitor, reached capacity, guard) have no ODE reading to compare against at all — see docs/engine-selection.md for the four-rule decision behind which readings even apply.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'model id'}, 'hours': {'type': 'number', 'description': 'horizon (default 8, max 168)'}, 'realizations': {'type': 'number', 'description': 'SSA runs averaged, max 200 (default 24)'}}}
sim_dataset
Generate a synthetic event log from a stored model (seeded SSA playout; case-per-arrival). Returns CSV. Deterministic: same id, same seed, same bytes.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'model id'}, 'seed': {'type': 'number', 'description': 'PRNG seed (default 1)'}, 'cases': {'type': 'number', 'description': 'cases to generate (default 200, max 2000 over MCP)'}}}
sim_delete_model
Delete a model you created. Refused for the curated catalog, for models you do not own, and for models already dedicated to the commons (a dedication is irrevocable).
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'model id to delete'}}}
sim_diagnose
Returns what one more of each resource (and a change in each rate) is worth to the outcome, each ranked against a measured noise floor — no fitness test to write. Also reports generic gates (mass balance, dormant sources, staffing knee, whether any knob binds), the parameter classes among the controls, and four structural readings needing no run (T-invariants, siphons/traps with deadlock witnesses, CTMC lumpability, constrained lumping). Pure read. Loss/success inference and objective framing can be corrected by tagging places or declaring simulation.objective — read the sim://docs/classification resource once for how to read influence and noise, the structural readings, and the corrections.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'model id'}, 'seed': {'type': 'number', 'description': 'seed shared by every run, so differences measure the knob and not the dice (default 7)'}, 'hours': {'type': 'number', 'description': 'horizon per run (default 8, max 168)'}, 'realizations': {'type': 'number', 'description': "runs averaged per measurement, max 200. Leave unset and the default ADAPTS: a 24-realization pilot that doubles while the baseline outcome sits inside its own noise floor, up to 200 (or maxRealizations, if set); the report's realizations field and sample-size finding record where it settled and why. Set it and that exact count is used, never more. If the report still says underpowered after adapting, raise hours or set a count explicitly."}, 'inline_context': {'type': 'boolean', 'description': 'embed the full JSON-LD @context map in the result instead of the URL it is served from (https://sim.pflow.xyz/ns/v1/context). Default false: the URL resolves to the identical map, so only set this for an offline consumer that cannot fetch it.'}, 'maxRealizations': {'type': 'number', 'description': 'bounds how far the adaptive default may escalate (default 200, the same ceiling an explicit realizations refuses above). Ignored once realizations is set. For a caller with its own latency budget, not for narrowing a report.'}}}
sim_diff
Structural difference between two stored models: places, transitions and arcs added or removed, and surviving elements whose numbers changed (initial, capacity, rate, stages, arc weight or kind). The readout for what a builder turn, a sim_extend or a sim_refine actually changed between two ids in a lineage.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['a', 'b'], 'properties': {'a': {'type': 'string', 'description': 'model id (before)'}, 'b': {'type': 'string', 'description': 'model id (after)'}}}
sim_distill
Distill exact search into the play scorer: fit rate multipliers for named transition groups so play's rankings agree with exact minimax, on positions sampled by random self-play and labeled by search. This is TACTICAL calibration — the counterpart of sim_calibrate, which learns rates from an event log. The division of labor is deliberate (petri-pilot experiments/ode-minimax): structure carries the tactic, and no fitting of an unmodified net's rates can express what its final state cannot separate — declare the structural prior as transitions in the model (e.g. forced-reply copies of the plays, catalyzed by the opponent's pattern) and distill the magnitudes it introduced. Zero agreement improvement is a finding about the structure, not a failed fit. Read agreementBefore/agreementAfter, not the loss: the hinge loss can overstate failure while every argmax is right. At most 16 groups, each non-empty, and no transition in two groups; the estimated work (loss evaluations × candidate moves × realizations × horizon) must stay under a fixed cap, and an over-cap request is refused with the estimate. Costs 5 tokens from your account's compute bucket at the defaults, scaled by that work estimate (rounded up).
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id', 'groups'], 'properties': {'id': {'type': 'string', 'description': 'model id (needs simulation.objective, players with turnPlace)'}, 'groups': {'type': 'string', 'description': 'JSON object: group name -> transition ids sharing one fitted multiplier, e.g. {"detectors":["x_win_0","o_win_0"],"draw":["call_draw"]}'}, 'options': {'type': 'string', 'description': 'JSON: {"games":20,"positions":40,"iters":40,"horizon":3,"realizations":40,"seed":11,"engine":""} (the defaults shown; 0 or unset takes the default). Caps: games at most 100, positions at most 100, iters at most 100, realizations at most 200, horizon at most 10000; over a cap, a negative value or an unknown key is refused'}}}
sim_edges
List every relation touching an entity, as either subject or object — the two-directional view datum_edges gives. A filtered scan over every stored relation rather than a maintained index: this is a simulation sandbox's model graph, not a large corpus, so scanning on each call is the honest tradeoff over a second data structure that could drift from the source of truth.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'entity id to look up'}}}
sim_evaluate
Score a player's legal next moves with the PLAY method (the blog post's move picker): apply each candidate hypothetically and score the expected objective of the position it leads to, by seeded SSA rollouts (seed 11, shared across candidates so a difference measures the move, not the dice) — the best move scores highest. Needs the game schema (simulation.objective + simulation.players). The response names the engine. This tool always uses play on SSA: next-move elimination (rate-zero ablation, which reads an ungated net through the continuous ODE relaxation), the closed-form incidence reduction and exact search are the HTTP evaluate endpoint's method option (eliminate | incidence | search), not selectable here.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id', 'player'], 'properties': {'id': {'type': 'string', 'description': 'model id'}, 'player': {'type': 'string', 'description': 'player name from simulation.players'}, 'horizon': {'type': 'number', 'description': 'model time to explore ahead (default 3, max 10000)'}, 'marking': {'type': 'string', 'description': 'JSON object, sparse marking override (the position to evaluate from); default = the initial marking'}, 'realizations': {'type': 'number', 'description': 'SSA rollouts per candidate move (default 40, max 200)'}}}
sim_extend
Apply structural edits to a stored model and store the result as a NEW model you own, with lineage back to the original — the same vocabulary the guided builder uses behind its interview, now callable directly. Operations (JSON array, each with "op"): add_place {id, initial}, add_transition {id, guard, event}, add_arc {from, to, weight, kinetic, type}, remove_place, remove_transition, remove_arc {from, to}, set_rate {id, rate}, set_initial {id, initial}, set_capacity {id, capacity}. The edited model is validated before it is stored; a set of operations that leaves the net malformed is refused with every reason, and nothing is written. Returns the new id, the operations applied, and the structural diff.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id', 'operations'], 'properties': {'id': {'type': 'string', 'description': 'model id to edit'}, 'name': {'type': 'string', 'description': 'optional name for the edited model'}, 'operations': {'type': 'string', 'description': 'JSON array of operations'}}}
sim_get_binding
Fetch a stored Binding (see sim_bind) by id: which model/port feeds which, and any recorded transform.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'binding id'}}}
sim_get_model
Fetch a stored model's full Petri-net JSON by id.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'model id (content hash)'}}}
sim_invariants
Derive a model's full algebraic invariant structure: conservation laws (Farkas P-invariants — weighted place sums every run preserves, the arithmetic a trust panel should show), firing cycles (T-invariants, named per-cycle with a readable detail sentence, each tagged StructuralProof), and the siphon/trap report (every minimal siphon and trap found from the arc structure, plus deadlock witnesses — minimal siphons holding no tokens at this model's own initial marking, which proves every transition needing one permanently disabled). This is the same computation sim_diagnose's structural fields read from, not a lesser copy of it. Pure structure, no simulation; every claim holds for every trajectory from this initial marking.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'model id'}}}
sim_license_model
Dedicate a model you created to the commons under CC0-1.0, CC-BY-4.0, CC-BY-SA-4.0. It then appears in every user's listing with the license shown, and the dedication is IRREVOCABLE — it cannot be changed or deleted afterwards, which is what makes it safe for others to build on. CC0-1.0 is the cleanest choice for a model: attribution terms are hard to honor for a net someone folds into a larger one.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id', 'license'], 'properties': {'id': {'type': 'string', 'description': 'model id to dedicate'}, 'license': {'type': 'string', 'description': 'one of CC0-1.0, CC-BY-4.0, CC-BY-SA-4.0'}}}
sim_link
Record a typed edge between any two stored entities — models, prompts, artifacts, maps, collections, or anything else addressed by a content id — with no fixed predicate vocabulary: the caller's choice ("hasMember", "cites", "supersedes", whatever the relationship actually is). Distinct from the Lineage a model/prompt/artifact already carries, which is specifically derivation (parent -> prompt -> child); a Relation is any OTHER assertion about how two entities relate, including sim_create_collection's own membership edges. Linking the same subject/predicate/object again as the same user is idempotent: it returns the existing relation's id (existing: true) rather than recording a duplicate edge.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['subject', 'predicate', 'object'], 'properties': {'object': {'type': 'string', 'description': 'id of the entity the relation points to'}, 'subject': {'type': 'string', 'description': 'id of the entity the relation starts from'}, 'predicate': {'type': 'string', 'description': 'the relationship, e.g. hasMember, cites, supersedes — no fixed vocabulary'}}}
sim_list_bindings
List the content id of every stored Binding.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object'}
sim_list_models
List the models visible to you: the curated catalog, models dedicated to the commons (their entry carries the license), and your own (marked mine). Other users' undedicated models are not listed, but any model id works with every sim_* tool — an id someone shares with you is the model.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object'}
sim_map_get
Fetch a stored Map's key->value data by id.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'map id'}}}
sim_map_list
List the content id of every stored Map.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object'}
sim_map_put
Store a key->value lookup table as its own content-addressed entity — a generated parameter sweep, a rate table, a component registry, anything shaped as key->value rather than free text (an artifact) or a Petri net (a model). Returns its content id; the same data, even with keys inserted in a different order, returns the same id.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['data'], 'properties': {'data': {'type': 'string', 'description': 'the table as a JSON object'}}}
sim_my_sheets
List the sheets this user has published, with their URLs.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object'}
sim_neighbors
One-hop traversal from an entity: every object reachable via a relation where it is the subject, optionally filtered to a single predicate (omit for all of them). Pass a collection's id with predicate hasMember to list its members.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'subject id to traverse from'}, 'predicate': {'type': 'string', 'description': 'restrict to this predicate; omit for every outgoing relation'}}}
sim_optimize
Multi-objective optimisation over transition rates for a stored model: Monte Carlo samples the rate ranges, runs each combination to the horizon with the continuous engine, and returns every sample with a Pareto flag — the non-dominated set is the trade-off frontier ('which staffing is non-dominated on served vs walked out'). Continuous reading: a model with a schedule or a gate is refused with the reason (use sim_compare with explicit scenarios for those). Costs 1 token per 50 samples (rounded up) from your account's compute bucket; rate ranges must be non-negative.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id', 'parameters', 'objectives'], 'properties': {'id': {'type': 'string', 'description': 'model id'}, 'seed': {'type': 'number', 'description': 'sampling seed, a whole number (default 42)'}, 'hours': {'type': 'number', 'description': 'horizon per run (default 8, above 0 and at most 10000)'}, 'samples': {'type': 'number', 'description': 'Monte Carlo samples (default 100, 1..1000; outside that is refused)'}, 'objectives': {'type': 'string', 'description': 'JSON array of {"place": id, "direction": "max"|"min"}'}, 'parameters': {'type': 'string', 'description': 'JSON object transition_id → [min, max] rate range, e.g. {"finish_brew": [10, 40]}'}}}
sim_param_heatmap
Two-rate grid for a stored model: vary two transition rates over ranges, run each combination to the horizon with the continuous engine, and return the observable's final value as a grid — 'which regime of arrivals × restock keeps the queue empty'. Continuous reading: a model with a schedule or a gate is refused with the reason. Costs 1 token per 50 grid cells (rounded up; a 40x40 grid empties the bucket) from your account's compute bucket.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id', 'param_x', 'param_y', 'observable', 'range_x', 'range_y'], 'properties': {'id': {'type': 'string', 'description': 'model id'}, 'hours': {'type': 'number', 'description': 'horizon per run (default 8, above 0 and at most 10000)'}, 'param_x': {'type': 'string', 'description': 'first transition id'}, 'param_y': {'type': 'string', 'description': 'second transition id'}, 'range_x': {'type': 'string', 'description': 'JSON [start, stop, n] for param_x: non-negative rates, n a whole number 2..40'}, 'range_y': {'type': 'string', 'description': 'JSON [start, stop, n] for param_y: non-negative rates, n a whole number 2..40'}, 'log_scale': {'type': 'boolean', 'description': 'space the grid in log10 (default false)'}, 'observable': {'type': 'string', 'description': 'place id whose final value fills the grid'}}}
sim_prompt
Ask an LLM to derive something from a stored entity: a variant model, a report, a piece of generated code — whatever the prompt asks for. The parent's JSON rides along as context, the same way the guided builder gives its interviewer the draft. The parent is looked up as a model first, then a prompt, then an artifact, then a map — whichever resolves — and the context block is labelled by what kind it found ("## Parent model", "## Parent prompt", ...), so the LLM is never told a report is a Petri net. The prompt is stored first and content-addressed like a model, so it has an id of its own before the LLM ever answers; both the prompt and whatever came back are placed in lineage under the parent (sim_prompt as the activity), so Ancestry walks parent -> prompt -> result. A Relation{prompt, "produced", result} is recorded alongside — sim_reroll's forward index, and queryable directly via sim_edges/sim_neighbors. If the response parses and validates as a Petri-net model it is stored as a NEW model you own; otherwise the raw text is stored as an artifact. Refused if this deployment has no LLM provider configured.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['parent', 'text'], 'properties': {'text': {'type': 'string', 'description': 'the natural-language instruction'}, 'parent': {'type': 'string', 'description': 'id to run the prompt against — a model, prompt, artifact, or map'}, 'system': {'type': 'string', 'description': 'optional system-level instructions, in addition to the parent context this tool always supplies'}}}
sim_propose_types
Propose candidate @type values for one or more stored models, e.g. "QueueingSystem" or "ResourcePool", from a small Diagnose run this tool performs on each model (nothing is cached or reused between calls). Every rule is a hand-written assumption about what a shape of knobs/loss/siphons/classes tends to mean, not a structural proof or a measurement, so results are ASSUMPTION-grade until a human reviews one and applies it — apply with sim_link(id, "@type", "<Type>"), there is no separate apply tool. Pure read; nothing here is written to any model. Defaults to scanning the visible catalog (up to limit) when ids is omitted. Costs one Diagnose run per model — 5 tokens each from the compute bucket (per address, or per account when signed in), charged as each model is reached — so limit and realizations are both capped.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'properties': {'ids': {'type': 'string', 'description': 'JSON array of model ids to consider, e.g. ["id1","id2"]. Omit to scan every model ListFor("") would list (the public catalog), truncated to limit.'}, 'limit': {'type': 'number', 'description': 'maximum number of models to diagnose (default 10, 1..25; over 25 is refused, and so are explicit ids naming more models than limit) — a cost control, since this runs a simulation per model'}, 'realizations': {'type': 'number', 'description': "realizations per model's Diagnose run (default 8, 1..16; outside that is refused) — deliberately small, this only needs to name a shape, not measure precise influence"}}}
sim_publish
Publish a stored model into the signed-in user's Google Sheets: the model workbook (live formulas when honest, a refusal tab when not), a server-run scenario as data tabs, and trajectory + contention charts. Returns the sheet URL. Counts against the daily quota, and costs 1 token from your account's compute bucket for the run.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'model id'}, 'scenario': {'type': 'string', 'description': "optional scenario JSON to run for the data tabs; sim_scenario's defaults (hours 8, realizations 16, seed 20260809) fill whatever is omitted"}}}
sim_publish_app
Publish the generated application for a model you own — the single-file HTML a generator produced from the model's `view` prompt. Served at /app/<id> in a sandboxed opaque origin (no cookies, no session; only the CORS-open public API is reachable). START FROM THE RUNTIME, not from scratch: /lib/app-template.html is a working console that imports /lib/sim-console.js and composes <sim-controls>, <sim-disruptions>, <sim-net>, <sim-timeline>, <sim-trajectory> and <sim-results> — the same components the generic console at /whatif/ runs. Composing them is how an app inherits role derivation, the fungible-set collapse, the influence ranking that never filters, the contention ledger and the verbatim caveats, none of which the checks below can verify you reimplemented correctly. Root-relative /lib/ imports are allowed. Off-origin loading is stopped in two places: the upload checks refuse an off-origin <script src> or <link href>, and the app is served under a Content-Security-Policy that confines scripts, styles, fetches, images and fonts to this origin — which is what stops the forms the checks do not parse (an inline module's import "https://…", a dynamic import(), a CSS @import). Checks refuse an app that is empty, oversized, never references its model id, or carries an off-origin <script src>/<link href>; behavioral correctness (does the app actually do what the view says) is on the generator and any browser gate you run.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id', 'html'], 'properties': {'id': {'type': 'string', 'description': 'model id the app presents'}, 'html': {'type': 'string', 'description': 'the complete self-contained HTML document'}}}
sim_publish_compare
Publish a multi-scenario comparison into the signed-in user's Google Sheets — sim_compare's export, the counterpart of sim_publish for a single scenario. Runs every scenario on one shared seed (the same server-enforced sharing sim_compare uses, so differences are the scenarios and not the dice) and writes a comparison table plus a trajectory chart, rather than one scenario's own data tabs. Returns the sheet URL. Counts against the same daily publish quota as sim_publish, and costs 1 token per scenario from your account's compute bucket.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id', 'scenarios'], 'properties': {'id': {'type': 'string', 'description': 'model id'}, 'scenarios': {'type': 'string', 'description': 'JSON array of scenarios, each with a name, e.g. [{"name":"today","hours":8},{"name":"one more","hours":8,"marking":{"staff/available":3}}]; sim_compare\'s defaults (hours 8 and realizations 16 per scenario, seed 20260809) fill whatever is omitted'}}}
sim_receipt
Run a seeded scenario and get back the result PLUS a signed run receipt: an Ed25519 certificate over (model id, scenario, result hash, service revision). Anyone can check it two ways — verify the signature offline against the embedded public key (proves this service reported this result), and POST it to /api/receipts/verify (no auth) to replay the run and confirm the result hash reproduces (proves the run is reproducible, not invented). The current signing key is at GET /api/receipts/key. Reproducibility is the bottom rung of the trust ladder receipts build: play the model, check the anchors, re-run the seed, verify the certificate. Costs 1 token from your account's compute bucket.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'model id to run'}, 'scenario': {'type': 'string', 'description': "scenario JSON (hours, samples, seed, marking, rates, schedule, summary — the same shape sim_scenario takes); sim_scenario's defaults (hours 8, realizations 16, seed 20260809) fill whatever is omitted, and the receipt's scenario records the filled-in values so its replay reproduces this run. The result hash covers the result as returned, so a summary: true scenario certifies the summarized form and replays to it"}}}
sim_refine
Refine a model's parameter classes by editing what the model SAYS (tags on a place or transition, or assertedClasses), then re-derive. Returns a NEW model id (ids are content addresses, so the original stays reachable) plus a before/after class diff. tags can only split classes; assertedClasses declares a merge and gets re-verified and costed, never trusted blind. Read the sim://docs/classification resource once for why the two levers are not symmetric. Costs 2 tokens from your account's compute bucket (the stored model, 1, and the verified re-classification, 1).
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'model id to refine'}, 'tags': {'type': 'string', 'description': 'JSON object of place OR transition id -> {key: value}, e.g. {"nurse_avail":{"refine.shift":"night"}}. Keys not prefixed refine. are stored as metadata and refine nothing. classify.go\'s colour refinement seeds from both places\' and transitions\' tags, so either kind of id works here.'}, 'signer': {'type': 'string', 'description': 'optional {"type":"eth"|"ed25519","address":"..."} — signs the lineage claim so it is the refiner\'s word rather than the server\'s account of a session'}, 'signature': {'type': 'string', 'description': 'optional hex signature over the CID of the signed claim; see modelstore.SignedClaim for the exact bytes. An unverifiable signature is refused, not stored with a flag.'}, 'assertedClasses': {'type': 'string', 'description': 'JSON array, e.g. [{"id":"items","members":["item0","item1"],"note":"one stocking decision"}]'}}}
sim_reroll
Re-run a stored sim_prompt against the SAME parent it originally ran against — a sibling attempt, never a chain: it never derives from the previous attempt's output, only from the original parent, so rerolling ten times leaves ten independent siblings in lineage rather than a chain of ten. Reuses the original prompt's text and system unless you override them here. The original prompt and its result are left untouched; this stores a new prompt and a new result (model or artifact, same rule as sim_prompt) under Activity sim_reroll. When called with neither override and the deployment's LLM provider and model are unchanged since the original ran, the response carries a reproducibility field checked against every prior result this exact prompt has ever produced (via the same forward "produced" relation sim_edges/sim_neighbors can query directly): "verified" if this result content-matches one of them, "diverged" if it doesn't, "not verified" if there's no prior result on record yet.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['prompt'], 'properties': {'text': {'type': 'string', 'description': "override the original prompt's text; default reuses it verbatim"}, 'prompt': {'type': 'string', 'description': 'id of the sim_prompt (or earlier sim_reroll) to re-run'}, 'system': {'type': 'string', 'description': "override the original prompt's system text; default reuses it verbatim"}}}
sim_run_pipeline
Run a set of stored Bindings (see sim_bind) as a composed pipeline: each bound model runs through its own ordinary scenario, in topological order, with an output port's own trajectory resampled into the target's input-transition schedule. One seed and horizon shared across every model in the pipeline, same discipline sim_compare enforces within one model. Refuses a cyclic binding set, and refuses any binding whose named port does not exist with the right direction (output must be a place, input must be a transition) — this is where that check finally happens, not at sim_bind time. The result carries an explicit assumption for the seam itself: no model's own fitness gates cover whether the JOIN between them is sound. Costs one ordinary scenario run per model in the pipeline, each under the same caps sim_scenario applies (hours up to 10000, realizations up to 200). Each binding into a model becomes a 60-segment schedule and a scenario holds at most 100 segments, so bind at most one source into any one model; more is refused before anything runs.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['bindingIds'], 'properties': {'seed': {'type': 'number', 'description': "shared seed across every model's run (default 1)"}, 'hours': {'type': 'number', 'description': 'horizon in hours, shared across every model in the pipeline (default 8)'}, 'bindingIds': {'type': 'string', 'description': 'JSON array of binding ids to run together, e.g. ["id1","id2"] — every model these bindings touch is included automatically.'}, 'realizations': {'type': 'number', 'description': 'realizations per model (default 0, which the engine runs as a single realization — one SSA trajectory per model, so set it, e.g. 16 as sim_scenario defaults to, when the resampled series should be a mean rather than one draw; max 200)'}}}
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, contention, 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, metrics, depleted, contended, caveats and assumptions — the verdict without the chart data, and the right form when nothing will be plotted. 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.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'model id'}, 'scenario': {'type': 'string', 'description': 'scenario JSON, e.g. {"hours":8,"samples":60,"realizations":16,"seed":7,"marking":{"staff/available":3},"params":{"batch_size":6},"schedule":{"arrive":[{"until":2,"value":12},{"until":8,"value":4}]},"engine":"ssa","summary":false}; hours defaults to 8, samples to 60, realizations to 16, seed to 20260809, summary to false (full trajectory); hours above 10000, realizations above 200 or samples above 5000 are refused'}}}
sim_supersede_model
Mark an old version of your model as replaced by a newer one. The old id keeps working and its commons dedication (if any) stands — only the listing moves on to the successor. Both models must be yours.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['old', 'new'], 'properties': {'new': {'type': 'string', 'description': 'model id of the successor'}, 'old': {'type': 'string', 'description': 'model id being replaced'}}}
sim_verify
Verify declared properties of a stored model: deadlock-free, bounded, mutual-exclusion, invariant expressions, reachable/unreachable targets. Verdicts are proved/refuted/unknown — unknown is never a pass — and each carries a method: structural means it holds for ANY initial marking (linear algebra on the incidence matrix, the strongest claim available), exhaustive means this marking's full state space, partial means truncated (only refutations sound). Caveats name anything the analysis net could not express.
Destruktiv Externer Zugriff
Eingabeschema
{'type': 'object', 'required': ['id'], 'properties': {'id': {'type': 'string', 'description': 'model id'}, 'properties': {'type': 'string', 'description': 'JSON array of properties, e.g. [{"kind":"deadlock-free"},{"kind":"mutual-exclusion","places":["win_x","win_o"]},{"kind":"invariant","expr":"a + 2*b == 10"}]. Default: bounded + deadlock-free.'}}}
Geändert
sim_scenario
1. October 2026 02:51
Geändert
sim_run_pipeline
1. October 2026 02:51
Geändert
sim_refine
1. October 2026 02:51
Geändert
sim_receipt
1. October 2026 02:51
Geändert
sim_publish_compare
1. October 2026 02:51
Geändert
sim_publish_app
1. October 2026 02:51
Geändert
sim_publish
1. October 2026 02:51
Geändert
sim_propose_types
1. October 2026 02:51
Geändert
sim_param_heatmap
1. October 2026 02:51
Geändert
sim_optimize
1. October 2026 02:51
Geändert
sim_link
1. October 2026 02:51
Geändert
sim_evaluate
1. October 2026 02:51
Geändert
sim_distill
1. October 2026 02:51
Geändert
sim_diagnose
1. October 2026 02:51
Geändert
sim_crosscheck
1. October 2026 02:51
Geändert
sim_create_model
1. October 2026 02:51
Geändert
sim_conformance
1. October 2026 02:51
Geändert
sim_compare
1. October 2026 02:51
Geändert
sim_code_to_flow
1. October 2026 02:51
Geändert
sim_calibrate
1. October 2026 02:51
Geändert
sim_bind
1. October 2026 02:51
Hinzugefügt
sim_verify
17. September 2026 12:55
Hinzugefügt
sim_supersede_model
17. September 2026 12:55
Hinzugefügt
sim_scenario
17. September 2026 12:55
Hinzugefügt
sim_run_pipeline
17. September 2026 12:55
Hinzugefügt
sim_reroll
17. September 2026 12:55
Hinzugefügt
sim_refine
17. September 2026 12:55
Hinzugefügt
sim_receipt
17. September 2026 12:55
Hinzugefügt
sim_publish_compare
17. September 2026 12:55
Hinzugefügt
sim_publish_app
17. September 2026 12:55