flux_lang/lib.rs
1//! `flux-lang` — the pure Flux-Lang language core.
2//!
3//! Flux-Lang is an authored workflow language: applications place deterministic control flow around
4//! typed model stages and registered operations, and a deterministic runtime runs the AST. This crate
5//! is the language half, deliberately separated from the engine that executes it:
6//!
7//! - [`ast`] — the Draft AST, typed HIR, physical plan, value model, the
8//! semantic [`ast::FlowEffect`]s, and the run-event trace.
9//! - [`render`] — the AST pretty-printer (human-auditable projections).
10//! - [`format`] / [`parse`] — the canonical compact **text syntax** (the round-trippable `.flux`
11//! surface): `parse(&format(&ast)) == ast` for every `DraftAst`. Distinct from `render` (one-way).
12//! - [`analyze`] — the validator, working against an abstract [`opspec::OpCatalog`] (no knowledge of
13//! any concrete tool registry).
14//! - [`opspec`] — the typed operation spec/signature and the [`opspec::OpCatalog`] seam.
15//! - [`prelude`] — the artifact-type ontology (claims, evidence, needs, context packs, …) ops declare
16//! their I/O against; a stdlib of `Named` schemas, not a `Value` change.
17//! - [`program`] — the multi-agent `Program` layer (agents/channels/triggers/journeys) + the
18//! key-sniffing module loader; pure-data decls the L6 `flux-app` host runs.
19//! - [`effects`] — lowering of semantic effects onto host [`flux_spec::Effect`] + policy actions.
20//! - [`schema`] — the single source of truth: a derived JSON Schema and the node-kind catalog that
21//! drives generated skill/docs and language tooling.
22//! - [`context_slice`] — automatic context slicing (KF4/L-56): derive the minimum model-visible
23//! context for a model-op call or diagnostic UI from HIR reads, field access paths, op
24//! schemas, and diagnostics, gated by visibility/secret/policy and a token budget.
25//!
26//! It is an **L0 leaf**: it depends only on other pure contracts (`flux-core`, `flux-spec`,
27//! `flux-policy`) and has no IO, no provider, no runtime, and no dependency on concrete tools. The
28//! engine crate `flux-flow` builds on top of it (analyze → execute) and re-exports it.
29
30pub mod analyze;
31pub mod ast;
32pub mod context_slice;
33mod cst_decode;
34pub mod dsl;
35pub mod effects;
36pub mod error;
37pub mod expr;
38pub mod format;
39pub mod highlight;
40pub mod host;
41pub mod lexer;
42pub mod lower_cst;
43pub mod opspec;
44pub mod optimize;
45pub mod parse;
46pub mod parser;
47pub mod prelude;
48pub mod program;
49pub mod render;
50pub mod runtime;
51pub mod schema;
52pub mod sink;
53pub mod skill;
54pub mod store;
55pub mod syntax;
56
57pub use error::{FlowError, Result};