#Rich conceptual records

    finos/morphir-conceptual/model reads and preserves the complete Ion graph for morphir-conceptual/0.1.0-draft.1, including its optional morphir-traits/0.1.0-draft.1 extension. Record versions match 0.1.0-draft.1 exactly. It uses the existing moonrockz/ion value model and reuses the validated identity/revision types from conceptual/intent; the bounded intent model remains unchanged.

    Graph::decode(IonValue) creates private record views. Accessors expose sources, entities, relationships, capabilities, trait definitions and applications. Entity kinds, resolved/unresolved references, trait targets, interpretation requirements, multiplicity and provenance origins have distinct variants. Record::field, Entity::content, Entity::concern and Graph::to_ion retain the remaining content, including all five independent concerns and unknown descriptive fields. No graph field is reconstructed from a smaller JSON representation.

    Decoding checks required structural members, exact record/profile versions, known record-member uniqueness, graph-wide record IDs, known variant boundaries and the nested records used by inspection. Contract and claim subjects, declaration parents and derived provenance inputs require resolved references. Digest claims require sha256 and 64 lowercase hexadecimal digits. Opaque ASTs, types and payloads remain Ion values; their struct multiplicity, annotations, exact numbers, typed nulls and symbol/string distinctions survive. Decode and accessors copy mutable Ion containers and Blob/Clob bytes, so callers cannot mutate validated storage through aliases, including bytes created through unsafe mutable reinterpretation. Standalone decode checks depth 128 and 100,000 values before copying, including cyclic input. Engine codecs additionally apply their existing transport budgets and symbol catalog rules.

    Graph::inspect(inputs~) reports structural reference failures or independent representation gaps. inputs maps declared inputId values to explicit Graph snapshots. Resolution traverses only declared, supplied exact snapshots, including transitive dependencies. Each graph's references use its own closure; an ancestor's extra inputs do not grant it access. Model trait targets use the same exact local or declared dependency snapshots. Missing or mismatched resolved references are invalid. Authored unresolved references remain gaps. Conflicting same-revision snapshots are invalid, and closure traversal is bounded to 128 distinct snapshots. Dependency diagnostics use /inputs/<escaped-input-id> prefixes.

    Built-in entity trait targets check the referenced kind and declaration role; unresolved targets check their claimed expected kind. Unknown targets, foreign target profiles and module artifact targets retain their values and report gaps for interpretation or artifact binding that this package does not implement.

    Inspection includes source pin gaps, unresolved references, built-in relationship signatures, formalization/example gaps, open domain aspects, implementation gaps, projection gaps, unsupported critical/semantic facts, trait interpretation mismatches and competing single-valued applications. Conflicts retain both assertions and their provenance; inspection selects neither. Inspected reports only these checks. It does not certify a complete M1/M2 validator, payload assignability, binder/type correctness, evidence currency, source digest verification, provider trust, target-profile semantics or successful execution. Digest claims remain unverified: a source without a revision still reports conceptual.source_unpinned. The original records remain available for those consumers.

    Graph::require_interpretation(Check | Execute | ValidateTraits) always refuses: this package has no semantic interpreter. It names a required semantic fact when one is present. Unknown required semantics remain storable and inspectable with gaps, independently of this refusal. No capability advertisement or stored evidence is converted into new execution evidence.

    The engine adapter supplies IRUnit::with_conceptual_graph, IRUnit::conceptual_graph and IRUnit::conceptual_specification. See the data boundary. MEP model transport, provider publication, linked-metadata projection, source acquisition and expression evaluation retain their existing owners; this package introduces no envelope, transport tuple or compatibility runner.

    Fixture provenance and operation coverage identify the independent upstream inputs and the bounded claims established by the tests.

    M1 identities are opaque nonempty strings, not necessarily URIs.

    ModelError

    pub(all) suberror ModelError {
    Invalid(Diagnostic)
    } derive(
    Debug
    )

    Diagnostic

    pub(all) struct Diagnostic {
    code : String
    path : String
    related_path : String?
    } derive(Eq,
    Debug
    )

    Diagnostic::equal

    fn Diagnostic::equal(Diagnostic, Diagnostic) -> Bool

    Diagnostic::not_equal

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

    Entity

    pub struct Entity {
    // private fields
    }

    Entity::concern

    fn Entity::concern(self : Entity, name : String) -> Record? raise ModelError

    Each concern is independent; absence means that no fact was recorded.

    Entity::content

    fn Entity::content(self : Entity) ->
    Ion

    Entity::content_field

    fn Entity::content_field(self : Entity, name : String) ->
    Ion
    ?

    Entity::kind

    fn Entity::kind(self : Entity) -> EntityKind

    Entity::record

    fn Entity::record(self : Entity) -> Record

    EntityKind

    pub(all) enum EntityKind {
    Intent
    Requirement
    Concept
    DataElement
    SourceFragment
    Declaration
    Contract
    Scenario
    Implementation
    Claim
    Evidence
    Unknown(String)
    } derive(Eq,
    Debug
    )

    EntityKind::equal

    fn EntityKind::equal(EntityKind, EntityKind) -> Bool

    EntityKind::not_equal

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

    Fragment

    pub(all) struct Fragment {
    anchor :
    Id

    text : String
    }

    Graph

    pub struct Graph {
    // private fields
    }

    Structural preservation is distinct from semantic validation and execution.

    Graph::capabilities

    fn Graph::capabilities(self : Graph) -> Array[Record]

    Graph::decode

    fn Graph::decode(value :
    Ion
    ) -> Graph raise ModelError

    Decode bounded structural records while leaving opaque values uninterpreted. Semantic validity is reported separately by inspect, never implied by decode.

    Graph::entities

    fn Graph::entities(self : Graph) -> Array[Entity]

    Graph::entity

    fn Graph::entity(self : Graph, id : String) -> Entity?

    Graph::inspect

    fn Graph::inspect(self : Graph, inputs? : Map[String, Graph]) -> Inspection raise ModelError

    Inspect the graph and its declared dependency closure. Supplied inputs never widen the scope of another graph: each resolves under its own declarations.

    Graph::record

    fn Graph::record(self : Graph) -> Record

    Graph::relationships

    fn Graph::relationships(self : Graph) -> Array[Relationship]

    Graph::require_interpretation

    fn Graph::require_interpretation(self : Graph, _operation : Interpretation) -> Unit raise ModelError

    No semantic interpreter is implemented by this codec package. Refusal names the first required fact; successful storage never grants interpretation.

    Graph::sources

    fn Graph::sources(self : Graph) -> Array[Source]

    Graph::to_ion

    fn Graph::to_ion(self : Graph) ->
    Ion

    Graph::trait_applications

    fn Graph::trait_applications(self : Graph) -> Array[TraitApplication]

    Graph::trait_definitions

    fn Graph::trait_definitions(self : Graph) -> Array[TraitDefinition]

    Inspection

    pub(all) enum Inspection {
    InvalidGraph(Array[Diagnostic])
    Inspected(Array[Diagnostic])
    }

    Inspection::diagnostics

    fn Inspection::diagnostics(self : Inspection) -> Array[Diagnostic]

    Interpretation

    pub(all) enum Interpretation {
    Check
    Execute
    ValidateTraits
    }

    Multiplicity

    pub(all) enum Multiplicity {
    One
    Many
    }

    Origin

    pub(all) enum Origin {
    Authored
    Imported
    Derived
    }

    Record

    pub struct Record {
    // private fields
    }

    A lossless record view. Values returned to callers never alias its storage.

    Record::field

    fn Record::field(self : Record, name : String) ->
    Ion
    ?

    Record::to_ion

    Reference

    pub(all) enum Reference {
    Resolved(
    ResolvedRef
    )
    Unresolved(String, String, String)
    } derive(Eq,
    Debug
    )

    Reference::equal

    fn Reference::equal(Reference, Reference) -> Bool

    Reference::not_equal

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

    Relationship

    pub struct Relationship {
    // private fields
    }

    Relationship::predicate

    fn Relationship::predicate(self : Relationship) -> String

    Relationship::record

    fn Relationship::record(self : Relationship) -> Record

    Relationship::subject

    fn Relationship::subject(self : Relationship) -> Reference

    Relationship::target

    fn Relationship::target(self : Relationship) -> Reference

    Source

    pub struct Source {
    // private fields
    }

    Source::fragments

    fn Source::fragments(self : Source) -> Array[Fragment]

    Source::record

    fn Source::record(self : Source) -> Record

    TraitApplication

    pub struct TraitApplication {
    // private fields
    }

    TraitApplication::definition

    fn TraitApplication::definition(self : TraitApplication) -> Reference

    TraitApplication::interpretation

    TraitApplication::origin

    TraitApplication::payload

    TraitApplication::provenance

    fn TraitApplication::provenance(self : TraitApplication) -> Record

    TraitApplication::record

    TraitApplication::target

    TraitDefinition

    pub struct TraitDefinition {
    // private fields
    }

    TraitDefinition::interpretation

    TraitDefinition::multiplicity

    fn TraitDefinition::multiplicity(self : TraitDefinition) -> Multiplicity raise ModelError

    TraitDefinition::record

    fn TraitDefinition::record(self : TraitDefinition) -> Record

    TraitInterpretation

    pub(all) enum TraitInterpretation {
    Descriptive
    Semantic(Array[
    Id
    ])
    }

    TraitTarget

    TraitTargetKind

    pub(all) enum TraitTargetKind {
    ConceptTarget
    TypeTarget
    MemberTarget
    FunctionTarget
    OperationTarget
    ServiceBindingTarget
    } derive(Eq)

    TraitTargetKind::equal

    TraitTargetKind::not_equal

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

    PROFILE

    let PROFILE : String

    RECORD_VERSION

    let RECORD_VERSION : String

    TRAITS_PROFILE

    let TRAITS_PROFILE : String