#Configuration compatibility corpus

    ../workspace/parity_test.mbt compares the frozen former TOML loader with the published Moon-Lander TOML parser and explicit-source loader. It collects every leaf-value and winning-origin difference before reporting a failure. It also checks replacement of lists, inherited fields, scalar values and successive source origins.

    The corpus embeds the three tracked morphir*.toml fixtures under apps/morphir-workbench/scripts/fixtures/folder-import/monorepo/: the root workspace and its core and utils members. tests/configuration/toml-corpus.json freezes their canonical LF text and UTF-8 SHA-256 digests. Checkout CRLF pairs are normalized before comparison and hashing. CLI acceptance checks that every tracked fixture is represented, each snapshot still matches its source, and the embedded MoonBit test data matches the manifest. Update the manifest when changing a fixture, then regenerate it with:

    moon tool embed --text --name toml_corpus_json --input tests/configuration/toml-corpus.json --output pkgs/morphir-engine/workspace/corpus_generated_test.mbt

    Run moon test pkgs/morphir-engine/config pkgs/morphir-engine/workspace --target <target> on native, JS, WASI and Wasm GC. The workspace suite also compares every effective leaf and origin from the production conventions adapter with the former loader. The former parser and merge live only in workspace/old_loader_test.mbt; production configuration delegates to Moon-Lander. No discovery algorithm is implemented by the oracle.

    The JSON corpus freezes all 23 tracked morphir.json fixtures, including Elm conformance projects and the Workbench Rentals import. A test-only copy of the former legacy field mapping compares project values, legacy pipeline defaults, winning origins and unsupported-field warnings with production discovery. The CLI guard checks fixture membership, LF-normalized bytes, hashes and embedded data for both corpora. Regenerate JSON after updating its manifest with:

    moon tool embed --text --name json_corpus_json --input tests/configuration/json-corpus.json --output pkgs/morphir-engine/workspace/json_corpus_generated_test.mbt

    Invalid

    pub(all) suberror Invalid {
    Invalid(String)
    }

    Document

    pub(all) struct Document {
    provenance : Map[String, String]
    // private fields
    }

    Values and merge decisions belong to Moon-Lander. The origin projection keeps Morphir's existing path strings at command and Workbench boundaries.

    Document::boolean

    fn Document::boolean(self : Document, path : String, fallback : Bool) -> Bool raise

    Document::encode

    fn Document::encode(self : Document) -> String raise

    Document::framework

    Document::get

    fn Document::get(self : Document, path : String) ->
    Ion
    ?

    Document::json

    fn Document::json(self : Document, path : String) ->
    Json
    ? raise

    Document::metadata_provider_request

    fn Document::metadata_provider_request(self : Document) -> MetadataProviderRequest raise

    Read only the owned provider selections. Other metadata configuration stays available to its own consumers. Release semantics are finally checked by the shared restore service; this parser admits canonical stable release syntax.

    Document::shared

    fn Document::shared(self : Document) -> Document raise

    Document::sources

    Project already resolved host documents into framework file sources without losing a winning leaf's original file. No merge decision is repeated here.

    Document::strings

    fn Document::strings(self : Document, path : String) -> Array[String] raise

    Document::text

    fn Document::text(self : Document, path : String, fallback : String) -> String raise

    Document::validate

    fn Document::validate(self : Document) -> Unit raise

    MetadataPath

    pub(all) struct MetadataPath {
    path : String
    origin : String
    } derive(Eq,
    Debug
    )

    A path selection, not a filesystem grant. The host resolves it from its configuration origin and enforces its own accepted roots.

    MetadataPath::equal

    MetadataPath::not_equal

    fn MetadataPath::not_equal(x : MetadataPath, y : MetadataPath) -> Bool

    MetadataProviderRequest

    pub(all) enum MetadataProviderRequest {
    Disabled
    SharedLocalRestore(MetadataRestoreConfig)
    } derive(Eq,
    Debug
    )

    Immutable service selections for a host binder. Disabled requests no CLI service; it does not revoke capabilities explicitly granted by an embedding. Parsing performs no restoration, trust initialization or capability acquisition.

    MetadataProviderRequest::equal

    MetadataProviderRequest::not_equal

    MetadataRestoreConfig

    pub(all) struct MetadataRestoreConfig {
    service : MetadataPath
    policy : MetadataPath
    lock : MetadataPath
    registry : MetadataPath
    state : MetadataPath
    release : String
    assurance : String
    } derive(Eq,
    Debug
    )

    MetadataRestoreConfig::equal

    MetadataRestoreConfig::not_equal

    empty

    fn empty() -> Document

    environment

    fn environment(values : Map[String, String]) -> Document raise

    from_framework

    fn from_framework(configuration :
    Config
    ) -> Document

    from_json

    fn from_json(value :
    Json
    , origin? : String) -> Document raise

    merge

    fn merge(base : Document, overlay : Document) -> Document raise

    Compatibility composition delegates all value and provenance decisions to the framework, then projects the winning source back to its original label.

    parse

    fn parse(text : String, origin? : String) -> Document raise