Conceptual Data Model — Caméléon CVM

Version : v0.18-dev Authors : O. Cugnon de Sévricourt, C. Cugnon de Sévricourt


1. Overview

The Caméléon data model is organized in three tiers, classified by their grounding in Petri net theory :

MODÈLE CONCEPTUEL DE DONNÉES — VUE D'ENSEMBLE «net» Composition name, description version, authors nodes{}, connections[] ★ formal — Petri net (P, T, F) «transition» Operator id, label, family category, description firingPolicy, interaction run(), canFire(), rollback() ★ formal — Petri transition lifecycle: IDLE→READY→RUNNING→… «color set» Type id, label, color DataString, DataJSON, DataBool, Binary, Any ★ formal — CPN color set (Jensen 1981) «place» Connection id, from, to state: EMPTY | NEW | OLD value (data token) ★ formal — Petri place «applicative» Control id, label, type render(value, container) onInput(cb, container)? no Petri equivalent — UI concept «viewer» «editor» render() render() + onInput() Plug id, label type → Type.id side: input | output owned by Operator Config key, type → Type.id label, default, required owned by Operator — not in Petri graph Library name, label, version author, domain std-*-lib.js | cst-*-lib.js nodes 1 1..N connections 1 0..N inputs[] / outputs[] 1 0..N config{} 0..N type N 1 viewer / editor 1 0..1 control 0..1 0..1 from / to 0..N 1 exports 1 0..N type N 1 Formal concept — Petri-grounded Applicative concept — no Petri equivalent Structural entity «net» «transition» «place» «color set» = Petri net stereotypes = behavioral role (duck-typing) = relation with cardinalities label = role name
Fig. 18 — Conceptual Data Model — Overview

2. Formal Concepts — Petri-grounded

Each formal concept maps to a primitive from classical Petri net theory or from Colored Petri Nets (Jensen, 1981).

2.1 Operator «transition»

The central concept. An Operator is a Petri net transition — it consumes tokens from input places and produces tokens on output places.

AttributeTypeDescription
idstringSnake_case identifier, unique within its library
labelstringDisplay name
family"structural" \"transform"Structural operators copy references; transform operators process data
categorystring?Optional grouping (e.g. "io", "data", "struct")
descriptionstring?Human-readable purpose
firingPolicyFiringPolicyWhen the operator becomes READY (see §4.1)
interaction"human" \"live" \absentHuman-in-the-loop mode (see §4.2)
run()functionrun(inputs, { signal, config }) → outputs
canFire()function?Custom firing guard for COND policy
rollback()function?Undo logic for backward execution
Lifecycle states : `IDLE → READY → RUNNING → COMPLETEDFAILEDCANCELLED`

2.2 Connection «place»

A Connection is a Petri net place — it holds a data token and governs the firing readiness of downstream operators through its state automaton.

AttributeTypeDescription
idstringUnique identifier
fromstringQualified output plug id
tostringQualified input plug id
stateConnStateEMPTY \NEW \OLD
valueanyThe data token (when state ≠ EMPTY)

The state automaton EMPTY → NEW → OLD → EMPTY is the core mechanism of the execution model — it determines which transitions are enabled at each step.

2.3 Composition «net»

A Composition is a Petri net (P, T, F) — a complete workflow topology describing operator instances and their connections.

AttributeTypeDescription
namestringComposition name
descriptionstring?Purpose
versionstring?Semantic version
authorsstring[]?Contributors
nodesobjectMap of alias → { operatorId, configValues?, position? }
connectionsarrayList of { from, to } linking qualified plug ids

Compositions are stored as .cm.js files — pure topology, no logic.

2.4 Type «color set»

A Type classifies the data that flows through plugs and connections. It maps to the color set concept from Colored Petri Nets (Jensen, 1981) — tokens are not anonymous dots but carry typed data.

AttributeTypeDescription
idstringUnique identifier (e.g. DataString, DataJSON)
labelstringDisplay name
colorstringVisual color for UI rendering

Built-in types : DataString, DataJSON, DataBool, Binary, Any

Each Type can have an associated viewer Control (read-only display) and an editor Control (interactive input).


3. Applicative Concept — UI-specific

3.1 Control «applicative»

A Control is a UI component bound to a Type. It renders data values and optionally captures user input. Control has no equivalent in Petri net theory — it is a Caméléon-specific concept for bridging the execution model with user interaction.

AttributeTypeDescription
idstringUnique identifier
labelstringDisplay name
typeType.idThe data type this control handles
render()functionrender(value, container) — displays the value
onInput()function?onInput(callback, container) — captures user input

Behavioral roles (duck-typing)

Control has two behavioral roles, determined by which methods are present — there is no class hierarchy:

Controls are also used for operator interaction — when an operator has interaction: "human" or interaction: "live", a Control provides the UI for human-in-the-loop.


4. Enumerated Attributes

4.1 FiringPolicy

Determines when an Operator transitions from IDLE to READY.

ValueSemantics
ANY≥1 input connection is NEW
ALLAll input connections are NEW
CONDCustom canFire(states) returns true

Source operators (no inputs) are READY when all output connections are EMPTY.

4.2 Interaction

ValueSemantics
absentAutonomous — fires and completes without user input
"human"Blocking — waits for a single user resolve, then completes
"live"Re-fires on every user input until explicitly stopped

4.3 Connection State

ValueSemantics
EMPTYNo token — place is free
NEWToken just deposited — not yet consumed
OLDToken consumed by downstream operator

5. Structural Entities

5.1 Plug

A typed connection point on an Operator — either input or output.

AttributeTypeDescription
idstringIdentifier within the operator
labelstringDisplay name
typeType.idData type reference
side"input" \"output"Direction

Qualified addressing : alias.plug_id (e.g. transform_1.in_data).

5.2 Config

Static parameterization of an operator instance — not part of the Petri net data flow.

AttributeTypeDescription
keystringParameter name
typeType.idExpected data type
labelstringDisplay name
defaultany?Default value
requiredboolean?Whether the parameter must be set

Config values are resolved at execution time : configValues[key] ?? schema.default.

5.3 Library

A package of reusable operators.

AttributeTypeDescription
namestringPackage name (e.g. std-io-lib)
labelstringDisplay name
versionstringSemantic version
authorstringCreator
domainstring?Specialization domain

Naming convention : std--lib.js (standard) or cst--lib.js (custom).


6. Relationships and Cardinalities


Library      1 ──── 0..N   Operator        (a library exports N operators)
Operator     1 ──── 0..N   Plug (input)    (N input plugs)
Operator     1 ──── 0..N   Plug (output)   (N output plugs)
Operator     1 ──── 0..N   Config          (N config parameters)
Plug         N ────── 1    Type            (each plug has one type)
Config       N ────── 1    Type            (each config entry has one type)
Type         1 ──── 0..1   Control «viewer» (one viewer per type)
Type         1 ──── 0..1   Control «editor» (one editor per type)
Operator   0..1 ── 0..1    Control         (interaction control, if interactive)
Composition  1 ──── 1..N   OpInstance      (instantiated nodes)
OpInstance   1 ────── 1    Operator         (template reference)
Composition  1 ──── 0..N   Connection      (graph arcs)
Connection   1 ────── 1    Plug (output)   (from)
Connection   1 ────── 1    Plug (input)    (to)
OPERATOR — DÉTAIL DES RELATIONS «transition» Operator id string — snake_case, unique in lib label string — displayed name family "structural" | "transform" run() run(inputs, { signal, config }) canFire()? · rollback()? · category? · description? interaction? · control? ★ formal — Petri transition Plug (input) id, label type → Type.id qualified: alias.plug_id Plug (output) id, label type → Type.id qualified: alias.plug_id inputs[] 1 0..N outputs[] 1 0..N FiringPolicy ANY — ≥1 input NEW ALL — all inputs NEW COND — canFire(states) enumerated attribute firingPolicy 1 1 Interaction absent — autonomous operator "human" — blocking, single resolve "live" — re-fire on every input optional attribute — triggers control association interaction 1 0..1 «applicative» Control id, label, type render(value, container) onInput(cb, container)? «viewer» «editor» render() only render() + onInput() control id 0..1 0..1 Config key → { type, label, default?, required? } configValues{} — instance overrides static parameterization — not in Petri graph config{} 1 0..N Lifecycle States IDLE → READY → RUNNING → COMPLETED | FAILED | CANCELLED
Fig. 19 — Operator Detail — plugs, config, firing policy, interaction, control

7. Petri Net Mapping

The Caméléon execution model is a direct implementation of Petri net semantics :

Petri NetCaméléonStereotypeReference
PlaceConnection«place»Petri, 1962
TransitionOperator«transition»Petri, 1962
TokenData valuetyped via «color set» (Jensen, 1981)
ArcPlug bindingstructural entity
Firing ruleFiringPolicyANY / ALL / COND
Net (P, T, F)Composition«net»topology .cm.js
Color setType«color set»Jensen, 1981
MarkingGlobal stateset of all connection states
MAPPING RÉSEAU DE PETRI → CAMÉLÉON Réseau de Petri Place P Transition T Token Arc Firing Rule enabled → fire Caméléon «place» Connection from, to, value state: EMPTY | NEW | OLD «transition» Operator run() firingPolicy Data (value) typed payload in Connection sets state → NEW Connection States — Petri Token Semantics EMPTY NEW OLD write value consumed reset (source re-fires) Firing Policies ANY ≥1 input NEW ALL all inputs NEW COND canFire(states)
Fig. 20 — Petri Net → Caméléon Mapping

Forward execution

  1. Evaluate firing rules → identify READY operators
  2. Select one operator (deterministic order)
  3. Consume inputs (NEW → OLD)
  4. Execute run(inputs, { signal, config })
  5. Deposit outputs on output connections (EMPTY → NEW)
  6. Record step in history

Backward execution (rollback)

  1. Pop last step from history
  2. Call rollback() if defined
  3. Restore input connections to NEW
  4. Reset output connections to EMPTY
  5. Operator returns to READY

This bidirectional execution is what makes Caméléon unique — every step is reversible by construction.


8. Invariants

  1. Type safety — a Connection can only link plugs of compatible types (same type or one is Any)
  2. No self-loops — an operator cannot connect an output to its own input
  3. Single consumer — each input plug receives at most one connection
  4. Deterministic firing — at each step, exactly one operator fires (no concurrency)
  5. History completeness — every forward step is recorded; backward always possible
  6. State consistency — connection states are always in {EMPTY, NEW, OLD}; operator states follow the lifecycle FSM