Expand description
Re-exports§
pub use api::evaluate_data_value_from_json_value;pub use api::parse_evaluate_data_object;pub use api::resolve_evaluate_rules;pub use api::show_document;pub use api::evaluate_data_value_from_json_value as run_data_value_from_json_value;pub use api::parse_evaluate_data_object as parse_run_data_object;pub use api::resolve_evaluate_rules as resolve_run_rules;pub use result_value::CalendarResult;pub use result_value::RangeResult;pub use result_value::RowReference;pub use result_value::RowResult;pub use result_value::RuleResultValue;pub use result_value::RuleResultValueFailure;pub use result_value::SpecResult;pub use result_value::SpecRuleResult;pub use quality::Recommendation;
Modules§
- api
- JSON API types for Engine boundary documents.
- deps
- Dependency layout under
<workdir>/lemma_deps/, shared by CLI install and LSP. - documentation
- Embedded language guides and example specs.
- mcp
- Pure Lemma MCP tools:
Engine+ arguments in, catalog or text out. - quality
- Structural quality analysis over loaded specs.
- result_
value - API value for a rule result,
ShowData.value, orShowData.suggestion.
Structs§
- Cause
- Context
- Ordered store of specs keyed by
(repository, name)and grouped intoLemmaSpecSets. - Data
Path - Resolved path to a data (created during planning from AST DataReference)
- Date
Time Value - Engine
- Engine for evaluating Lemma rules.
- Engine
Error - Flat wire view of
ErrormatchingEngineErrorinengine/schemas/api.v1.jsonandengine/packages/npm/lemma.d.ts. Missing optionals serialize as JSONnull. - Engine
Error Source - Source location attached to an
EngineError. Line and column are 1-based;lengthis the UTF-8 byte length of the offending span. - Error
Details - Detailed error information with optional source location.
- Errors
- Load failure: errors plus the source texts we attempted to load.
- Explained
Rule - One narrated rule body stored in an explanation’s
rulestable. - Explained
Rule Id - Compact id of a rule in an
crate::evaluation::explanations::Explanation’srulestable. Assigned in first-reach order from the root. - Explanation
- Fetch
- Header
- Http
Response - Index
Map - A hash table where the iteration order of the key-value pairs is independent of the hash values of the keys.
- Install
- Lemma
Base - LemmaBase registry: bound to
https://lemmabase.com. Not configurable. - Lemma
Data - Lemma
Repository - A Lemma repository header. Identity carrier; never owns specs.
- Lemma
Spec - A Lemma spec containing data and rules.
- Lemma
Spec Set - All spec versions sharing a (repository, name) identity, keyed by effective_from.
- Lemma
Type - Resolved type after planning
- Lexer
- Literal
Value - Runtime literal payload. Type lives on
NormalForm.result_type/DataDefinition/ explicit computation parameters — not on the value. - Measure
Unit - A single unit within a Measure type.
- Measure
Units - Parse
Result - Path
Segment - A single segment in a resolved path traversal
- Ratio
Unit - Ratio
Units - Registries
- The registries the host composes.
Defaultis LemmaBase alone. - Registry
Bundle - Registry
Error - Repository
- Repository group from
Engine::specs. - Repository
Install Result - Result of
Install: LemmaBase repository source text and normalized id. - Repository
Qualifier - Textual repository qualifier as written in source (for example
@iso/countries).namestores the qualifier verbatim, including a leading@when present. The planner resolves aRepositoryQualifierto anArc<LemmaRepository>against the active context. - Resolve
- Resource
Limits - Limits to prevent abuse and enable predictable resource usage
- Response
- Response from evaluating a Lemma spec
- Rule
Result - Result of evaluating a single rule. Struct fields match the API JSON shape.
- Serialized
Conversion Trace Step - Show
- Consumer [
Engine::show] result: local offered types, inputs rules need, this spec’s rule graph (local rules plus reachable imports), and resolved temporal window. Source: [Engine::source]. - Show
Branch - One arm of a rule’s flat last-match table on Show.
- Show
Data - One data entry in a
Show. - Show
Rule - Local rule on Show: result type, authored branches, stored topo deps.
- Source
- Positional source location: source id and span.
- Span
- Span representing a location in source code
- Spec
Dependency - One
usestarget from a spec version’s source. - Spec
Identity - Resolved spec a value or rule result refers to.
- SpecRef
- A spec reference written in source.
- Spec
Version - One temporal spec version from
Engine::specs. - Timezone
Value - UTC offset in signed whole minutes;
|offset_minutes|is at most 23:59. - Transport
Failure
Enums§
- Command
Arg - A parsed constraint command argument, preserving the literal kind from the
grammar rule
command_arg: { number_literal | boolean_literal | text_literal | label }. - Conversion
Trace Role - Data
Value - Parse-time data value (before type resolution)
- Date
Granularity - Effective
Date - Error
- Error types for the Lemma system with source location tracking
- Error
Kind - Classification of an
Error. Serialized as thekindfield on the flat object returned to JavaScript from WASM (engine/src/wasm.rs,JsError). - Evaluate
Data Value - Neutral overlay tree. [
EvaluateData::resolve] reads each value by declared type. - Explanation
Node - Install
Step - ListKey
- How a list addresses its rows.
- Operation
Result - Result of evaluating a rule, expression, or data leaf.
- Parent
Type - Parent type in a type definition: built-in primitive or custom type name.
- Registry
Error Kind - The kind of failure that occurred during a Registry operation.
- Request
Error Kind - Distinguishes HTTP 404 (not found) from 400 (bad request) for request errors.
- Resolve
Step - Show
Conversion Target - Conversion target on a Show
asexpression (no owning type — inspection only). - Show
Expression - Resolved expression tree for Show branches (
tag = "type"on the API mirror). - Source
Type - Token
Kind - Type
Constraint Command - Constraint command for type definitions. Derived from lexer tokens; no string matching.
- Type
Specification - Value
Kind - Value payload (shape of a literal).
- Veto
Type - Why an operation yielded no value (domain veto).
Constants§
- API_
V1_ SCHEMA_ JSON - Checked-in JSON Schema for Show, Response, and related wire types
(
engine/schemas/api.v1.json). Regenerated bycargo run -p xtask -- schema. - COMPLETION_
KEYWORD_ LABELS - Spellings shared by [
keyword_from_identifier] and LSP completion. - EMBEDDED_
STDLIB_ REPOSITORY - Repository name reserved for the embedded standard library (
repo lemma,spec units). UserEngine::loadmust not target this name viaSourceType::Dependency. - MAX_
DATA_ NAME_ LENGTH - MAX_
RULE_ NAME_ LENGTH - MAX_
SPEC_ NAME_ LENGTH - UNITS_
LEMMA
Traits§
- Http
Transport - Synchronous driver for Rust hosts. wasm drives the steps itself with async fetch.
- Registry
- A registry is a request builder and response interpreter. It never performs I/O.
Functions§
- attribute_
evaluate_ data_ error - Attribute a walker error to its top-level data key unless already attributed.
- attribute_
run_ data_ error - Attribute a walker error to its top-level data key unless already attributed.
- can_
be_ label - Returns true if the token kind can be used as a label or reference segment
(identifier, or one of the keywords
past/future/permille/isin label position). - evaluate_
data_ from_ entries - Top-level run-data entries from a host walker. Keys differing only in case: request Error.
- evaluate_
data_ map_ from_ entries - Nested object entries from a host walker. Keys differing only in case: request Error.
- evaluate_
data_ null_ list_ item - Host list item that is null (JSON
null, JSnull/undefined, Javanull, Elixirnil). A list has no unsupplied row, so this is a request Error, never an omitted item.positionis 1-based within its list. - format_
explanation - format_
parse_ result - Format a
ParseResult(repository groups + specs) into canonical Lemma source. - format_
repositories - Text view of
Engine::specs, aslemma specsprints it. - format_
source - Parse a source string and format it to canonical Lemma source.
- format_
specs - Format a sequence of parsed specs into canonical Lemma source.
- numbered_
row_ origin - 1-based numbered origin of a list row (
items.2). - parse
- parse_
spec_ set_ id - Validate and normalize a spec set identifier (a spec name in the default repository).
- resolve_
effective - Resolve an optional effective datetime string for planning or evaluation.
- row_
field_ input_ key - Input key of a field of a numbered list row (
items.2.weight). - run_
data_ from_ entries - Top-level run-data entries from a host walker. Keys differing only in case: request Error.
- run_
data_ map_ from_ entries - Nested object entries from a host walker. Keys differing only in case: request Error.
- run_
data_ null_ list_ item - Host list item that is null (JSON
null, JSnull/undefined, Javanull, Elixirnil). A list has no unsupplied row, so this is a request Error, never an omitted item.positionis 1-based within its list. - try_
parse_ type_ constraint_ command - Parses a constraint command name. Returns None for unknown (parser returns error).
- type_
detail_ lines - Produce a human-readable summary of type constraints, or
Nonewhen there are no constraints worth showing (e.g. bareboolean). Returns one formatted string per constraint or property of the type specification. Usesdisplay_strfor all rational bounds so they render as decimals, not as raw fractions.
Type Aliases§
- RunData
Value Deprecated