Skip to main content

Module metadata

Module metadata 

Source
Expand description

Exports and imports an application’s whole, callback-free checking environment.

The host explicitly exports after registration. Save the returned UTF-8 JSON using your application’s file-replacement policy; no editor launches the host. Pin both identity fields when importing, and regenerate the saved artifact and update its revision whenever the checking contract changes. An offline reader cannot detect an unexported registration change under an unchanged revision.

use adam_lang::{TypeRegistry, checking::metadata::{
    EnvironmentIdentity, export_checking_metadata, import_checking_metadata,
}};
let identity = EnvironmentIdentity {
    application: "my.application".into(),
    revision: "1".into(),
};
let text = export_checking_metadata(
    &TypeRegistry::new(), &cel_parser::OpLookup::new(), &identity,
)?;
let environment = import_checking_metadata(&text, &identity)?;
assert!(environment.cel().resolve_type("i32").is_some());

Imports replace, rather than extend, bundled library environments. Artifacts contain catalog-local IDs, never native bindings, callbacks, or runtime type descriptors. Nominal record recursion is valid; structural shapes are trees. Artifacts require schema version 2, checker contract cel-adam-checking/2, and environment: { cel: ..., cellTypes: [...] }. The CEL description requires explicit typeFunctions signatures; cellTypes lists Adam-registered leaf IDs from that catalog. Regenerate older artifacts; import never infers type applications or storage membership.

Structs§

EnvironmentIdentity
An application-owned, nonempty identity and checking-contract revision.

Functions§

export_checking_metadata
Exports effective registrations without invoking application callbacks.
import_checking_metadata
Imports a fully validated environment pinned to the expected application contract.