Skip to main content

FLUX

Flow Language for Universe eXperimentation

The open, declarative standard for governed synthetic customer universes — the discovery-side sibling of FLUID.

📖 Documentation · 🚀 Quickstart · 🧭 The Nineteen Kinds · 🔗 The FLUID Seam · 🗺️ Roadmap · ✨ What's New


FLUX describes synthetic customer universes: a governed digital twin in which candidate rules and data products are discovered, stress-tested and proven before a single production system is touched. A FLUX universe is assembled from small declarative documents — nineteen kinds across six families — and a Simulation emits its results under a FLUID data-product contract: what is proven in the twin is byte-for-byte the contract that ships.

FLUX discovers.  FLUID delivers.  The seam is where the risk goes to die.

Status

v0.5.0 — working draft. All nine vNext RFCs are shipped additively on the 0.3.0 core — the spec now carries a runtime enforcement contract with conformance vectors and portable, signable evidence bundles alongside the declarative core. Pre-1.0: minor versions may break; every release ships with a schema diff and a regression suite. The design is documented in the position paper "FLUX and FLUID" (distributed separately under CC BY 4.0); where the paper and this schema disagreed, docs/reconciliation.md is the honest ledger.

The nineteen kinds

Family Kinds Question it answers
Population World, Persona, Segment Who is in the universe
Commerce Catalog, Offer, Channel, ConsentProfile What can be sold, how it can be reached
Behaviour Journey, JourneyTaxonomy, Signal, Detector What happens and what to watch for
Activation Campaign, Treatment, Experiment What we do about it
Calibration Playback How the twin stays honest
Composition Simulation, Module, Blueprint, VerticalPack How it assembles and travels

Every document shares one envelope, aligned with FLUID's:

fluxVersion: "0.5.0"
kind: World
id: q3-retention-world
name: Q3 Retention World
metadata:
  owner:
    team: growth-lab
spec:
  seed: 42
  population:
    size: 25000
    lifecycleMix: { new: 0.15, active: 0.55, atrisk: 0.20, churned: 0.10 }

Any kind may additionally declare agentPolicy (model allow-list, token budget, use-case limits) and skills — the uniform agentic extension point. A skill never changes the shape a kind must satisfy, only the content it emits within those bounds.

The FLUID seam

A Simulation emits streams by referencing the FLUID contract they are proven under — never by restating it:

spec:
  worldRef: q3-retention-world
  emits:
    - productRef: telco.gold.payment_recovery_moment   # a .fluid.yml in the bundle
      exposeId: payment_recovery_moment                # an expose of that product
      fluidVersion: "0.7.5"                            # validated against the vendored FLUID schema

The offline validator resolves the reference, validates the .fluid.yml against the vendored FLUID schema for the pinned version, and asserts the expose exists. Promotion to production is not a re-implementation: the same contract file is wrapped around the real estate.

Validate a bundle

pip install flux-spec
git clone https://github.com/Agenticstiger/flux.git && cd flux    # the worked example lives here
python3 -m flux_spec.validate examples/telco-payment-recovery     # schema + cross-document
python3 -m flux_spec.enforce                                      # RFC-04 conformance vectors
python3 -m flux_spec.bundle pack examples/telco-payment-recovery -o dist/   # RFC-09 evidence bundle

Point the same commands at your own bundle directory; the clone is only for the example.

Two layers, both offline (no cloud, no running engine):

  1. Schema — every *.flux.yml against schema/flux-schema-0.5.0.json (JSON Schema 2020-12, closed specs, typed everything).
  2. Cross-document — every reference resolves to the right kind (no dangling links), mixes and weights sum to 1, transitions stay inside their taxonomies, skills stay inside their agentPolicy, and the FLUID seam conforms.

Use the schema in your editor:

# yaml-language-server: $schema=https://agenticstiger.github.io/flux/schema/flux-schema-0.5.0.json

As a library

flux_spec is also an installable Python package — the exact code behind scripts/validate.py, scripts/enforce.py and scripts/bundle.py, not a reimplementation; the three scripts are thin shims onto it. It is on PyPI as flux-spec:

pip install flux-spec
from flux_spec.validate import Bundle
from flux_spec.enforce import decide, run_vectors
from flux_spec.bundle import pack, verify

python3 scripts/validate.py ... and python3 -m flux_spec.validate ... behave identically — same for enforce and bundle. The scripts need a clone of this repository; the modules (python3 -m flux_spec.validate, python3 -m flux_spec.enforce and python3 -m flux_spec.bundle) run from the installed package anywhere.

Engine

The FLUX Simulation Engine is the open-source runtime for FLUX bundles. It turns a bundle into synthetic rows that follow the FLUID contract, the same rows every time, with a report that says what the run does not show. It builds on flux-spec.

pip install flux-sim-engine
fluxsim init demo && cd demo && fluxsim run . --verify --ship -o out

The command is fluxsim, and the engine needs Python 3.11 or newer. Documentation: agenticstiger.github.io/flux/engine.

Example

examples/telco-payment-recovery/ is the paper's worked example, complete: all nineteen kinds plus the FLUID contract at the seam, green under CI.

Repository layout

schema/          flux-schema-<version>.json (+ -latest alias) — normative
schema-diffs/    one diff document per version pair
examples/        validated bundles (CI-enforced)
vendor/fluid/    vendored FLUID schemas the seam validates against
flux_spec/       the flux-spec package: validate.py · enforce.py (RFC-04) · bundle.py (RFC-09)
scripts/         validate.py / enforce.py / bundle.py — thin CLI shims onto flux_spec
tests/           regression suite + published enforcement conformance vectors
docs/            documentation site (VuePress): guide, concepts, schema, roadmap, releases,
                 the reconciliation ledger, and engine/ (the engine's own docs, copied
                 from its repository)

Relationship to FLUID

FLUID is the data-product contract standard (MIT, open-data-protocol). FLUX is the experimentation language that emits FLUID contracts. They are separate standards with separate schemas, designed to interlock at exactly one seam. This repo vendors FLUID schemas for offline seam validation; it does not fork or redefine them.

License

Apache License 2.0. The originating position paper is distributed separately under CC BY 4.0 by The FLUX Project.

Contributing

See CONTRIBUTING.md, GOVERNANCE.md and VERSIONING.md. Spec changes travel as one PR touching schema

  • diff + examples + tests together.

Metadata

Release files for flux-spec 0.5.0.post1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flux-spec 0.5.0.post1
File Size Uploaded Provenance Actions
flux_spec-0.5.0.post1.tar.gz 181.1 kB With provenance Details for flux_spec-0.5.0.post1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for flux-spec 0.5.0.post1
File Interpreter ABI Platform Actions
flux_spec-0.5.0.post1-py3-none-any.whl Python 3 none any Details for flux_spec-0.5.0.post1-py3-none-any.whl

Total release size: 368.2 kB

Release files / flux_spec-0.5.0.post1.tar.gz

Download URL flux_spec-0.5.0.post1.tar.gz
Size 181.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2afc37365c5042ed9ce4e086d8cb368f9b83417d4df6ca7beb4ae988dd724b69
BLAKE2b-256 checksum
How to use checksums
1ce8a22f3486376fa0add3804b4562c7eefef2f72a0fe8866273a5ef1be6f555
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / flux_spec-0.5.0.post1-py3-none-any.whl

Download URL flux_spec-0.5.0.post1-py3-none-any.whl
Size 187.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4abdf2742c6bcf18190ff1b1de78175c2a17d7d70411ae4bc3a7a0e7abb40c7b
BLAKE2b-256 checksum
How to use checksums
67a4d5ac2dadc6ab11f42b36f19a27d1165b0edf1c899c8c55ffe6d8077e68ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for flux-spec 0.5.0.post1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for flux_spec-0.5.0.post1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page