necoherence/semantic_signatures
Types
AdmittedLibrary
opaquepub opaque type AdmittedLibrary
pub type Annotation {
Annotation(
target: Target,
key: String,
value: exact_json.JsonValue,
)
}
Constructors
-
Annotation( target: Target, key: String, value: exact_json.JsonValue, )
CheckedGeneration
opaquepub opaque type CheckedGeneration
CheckedLibrary
opaquepub opaque type CheckedLibrary
pub type DefinitionGroup {
DefinitionGroup(id: String, members: List(String))
}
Constructors
-
DefinitionGroup(id: String, members: List(String))
pub type DefinitionShape {
Value(type_id: String)
Symbol(wire_symbol: String)
Operation(contract: OperationContract)
Message(type_id: String)
}
Constructors
-
Value(type_id: String) -
Symbol(wire_symbol: String) -
Operation(contract: OperationContract) -
Message(type_id: String)
pub type Failure {
Codec(semantic_generation_runtime.ValueFailure)
Wire(semantic_generation_decode.DecodeFailure)
Json(semantic_generation_values.ValueCodecFailure)
Invalid(condition: String)
Profile(failure: semantic_types.ProfileFailure)
Meaning(obligations: List(semantic_types.SemanticObligation))
CompositionInput(semantic_composition.CompositionInputFailure)
Witness(semantic_composition.WitnessFailure)
}
Constructors
-
-
-
-
Invalid(condition: String) -
Profile(failure: semantic_types.ProfileFailure) -
Meaning(obligations: List(semantic_types.SemanticObligation)) -
CompositionInput(semantic_composition.CompositionInputFailure) -
Witness(semantic_composition.WitnessFailure)
pub type GenerationDifference {
SignatureSchemaDifference(required: String, observed: String)
LibraryIdentityDifference(required: String, observed: String)
LibraryRevisionDifference(required: String, observed: String)
ProfileDifference(
required: semantic_types.ProfileRef,
observed: semantic_types.ProfileRef,
)
GraphSha256Difference(required: String, observed: String)
ProvenanceSha256Difference(required: String, observed: String)
MetadataSha256Difference(required: String, observed: String)
ProblemSha256Difference(
required: option.Option(String),
observed: option.Option(String),
)
EntrypointsSha256Difference(required: String, observed: String)
}
Constructors
-
SignatureSchemaDifference(required: String, observed: String) -
LibraryIdentityDifference(required: String, observed: String) -
LibraryRevisionDifference(required: String, observed: String) -
ProfileDifference( required: semantic_types.ProfileRef, observed: semantic_types.ProfileRef, ) -
GraphSha256Difference(required: String, observed: String) -
ProvenanceSha256Difference(required: String, observed: String) -
MetadataSha256Difference(required: String, observed: String) -
ProblemSha256Difference( required: option.Option(String), observed: option.Option(String), ) -
EntrypointsSha256Difference(required: String, observed: String)
pub type GenerationMismatch {
GenerationMismatch(differences: List(GenerationDifference))
}
Constructors
-
GenerationMismatch(differences: List(GenerationDifference))
pub type GenerationRequirement {
GenerationRequirement(
signature_schema: String,
library_identity: String,
library_revision: String,
profile: semantic_types.ProfileRef,
graph_sha256: String,
provenance_sha256: String,
metadata_sha256: String,
problem_sha256: option.Option(String),
entrypoints_sha256: String,
)
}
Constructors
-
GenerationRequirement( signature_schema: String, library_identity: String, library_revision: String, profile: semantic_types.ProfileRef, graph_sha256: String, provenance_sha256: String, metadata_sha256: String, problem_sha256: option.Option(String), entrypoints_sha256: String, )
pub type LibraryArraySpec {
LibraryArraySpec(
item: LibraryElementContract,
minimum: option.Option(Int),
maximum: option.Option(Int),
)
}
Constructors
-
LibraryArraySpec( item: LibraryElementContract, minimum: option.Option(Int), maximum: option.Option(Int), )
pub type LibraryCheckFailure {
ProfileCheck(failure: semantic_types.ProfileFailure)
LibraryCheck(failure: LibraryFailure)
}
Constructors
-
ProfileCheck(failure: semantic_types.ProfileFailure) -
LibraryCheck(failure: LibraryFailure)
pub type LibraryElementContract {
LibraryElementContract(type_id: String, nullable: Bool)
}
Constructors
-
LibraryElementContract(type_id: String, nullable: Bool)
pub type LibraryExtraMembers {
LibraryRejectExtras
LibraryAllowExtras(
key_format: option.Option(semantic_types.FormatUse),
value: LibraryElementContract,
)
}
Constructors
-
LibraryRejectExtras -
LibraryAllowExtras( key_format: option.Option(semantic_types.FormatUse), value: LibraryElementContract, )
pub type LibraryFailure {
LibraryFailure(
reference: String,
predicate: LibraryPredicate,
location: List(String),
)
}
Constructors
-
LibraryFailure( reference: String, predicate: LibraryPredicate, location: List(String), )
pub type LibraryNode {
LibraryNode(id: String, shape: LibraryShape)
}
Constructors
-
LibraryNode(id: String, shape: LibraryShape)
pub type LibraryPredicate {
Lb01
Lb02
Lb03
Lb04
Lb05
Lb06
Lb07
Lb08
Lb09
Lb10
Lb11
Lb12
Lb13
Lb14
Lb15
Lb16
Lb17
Lb18
Lb19
}
Constructors
-
Lb01 -
Lb02 -
Lb03 -
Lb04 -
Lb05 -
Lb06 -
Lb07 -
Lb08 -
Lb09 -
Lb10 -
Lb11 -
Lb12 -
Lb13 -
Lb14 -
Lb15 -
Lb16 -
Lb17 -
Lb18 -
Lb19
pub type LibraryProductSpec {
LibraryProductSpec(
fields: List(SignatureField),
extras: LibraryExtraMembers,
)
}
Constructors
-
LibraryProductSpec( fields: List(SignatureField), extras: LibraryExtraMembers, )
pub type LibraryShape {
UnknownShape(kind: semantic_types.UnknownKind)
UnitShape
BooleanShape(spec: semantic_types.BooleanSpec)
IntegerShape(spec: semantic_types.IntegerSpec)
DecimalShape(spec: semantic_types.DecimalSpec)
StringShape(spec: semantic_types.StringSpec)
BytesShape(spec: semantic_types.LengthSpec)
ProductShape(spec: LibraryProductSpec)
ArrayShape(spec: LibraryArraySpec)
TaggedUnionShape(spec: LibraryUnionSpec)
SealedShape(
tag: String,
refinements: List(semantic_types.SealedRefinement),
)
NeverShape
AliasShape(target: String)
RawBodyShape(encoding: String)
OpaqueShape(name: String)
}
Constructors
-
UnknownShape(kind: semantic_types.UnknownKind) -
UnitShape -
BooleanShape(spec: semantic_types.BooleanSpec) -
IntegerShape(spec: semantic_types.IntegerSpec) -
DecimalShape(spec: semantic_types.DecimalSpec) -
StringShape(spec: semantic_types.StringSpec) -
BytesShape(spec: semantic_types.LengthSpec) -
ProductShape(spec: LibraryProductSpec) -
ArrayShape(spec: LibraryArraySpec) -
TaggedUnionShape(spec: LibraryUnionSpec) -
SealedShape( tag: String, refinements: List(semantic_types.SealedRefinement), ) -
NeverShape -
AliasShape(target: String) -
RawBodyShape(encoding: String) -
OpaqueShape(name: String)
pub type LibraryUnionBranch {
LibraryUnionBranch(
target: String,
wire_tag: String,
selector: semantic_types.BranchSelector,
)
}
Constructors
-
LibraryUnionBranch( target: String, wire_tag: String, selector: semantic_types.BranchSelector, )
pub type LibraryUnionSpec {
LibraryUnionSpec(branches: List(LibraryUnionBranch))
}
Constructors
-
LibraryUnionSpec(branches: List(LibraryUnionBranch))
pub type OperationContract {
OperationContract(
effect: semantic_types.EffectPoint,
inputs: List(semantic_composition.InputPort),
outcomes: List(OutcomeContract),
)
}
Constructors
-
OperationContract( effect: semantic_types.EffectPoint, inputs: List(semantic_composition.InputPort), outcomes: List(OutcomeContract), )
pub type Origin =
semantic_types.Origin
pub type OutcomeCause {
ValueContract(origin: semantic_types.Origin)
ExternalCondition(specification: semantic_types.Origin)
}
Constructors
-
ValueContract(origin: semantic_types.Origin) -
ExternalCondition(specification: semantic_types.Origin)
pub type OutcomeContract {
OutcomeContract(
contract: semantic_composition.OutcomeContract,
cause: OutcomeCause,
)
}
Constructors
-
OutcomeContract( contract: semantic_composition.OutcomeContract, cause: OutcomeCause, )
pub type ProvenanceBinding {
ProvenanceBinding(
target: Target,
origins: List(semantic_types.Origin),
)
}
Constructors
-
ProvenanceBinding( target: Target, origins: List(semantic_types.Origin), )
pub type SignatureDefinition {
SignatureDefinition(
id: String,
wire_identity: String,
shape: DefinitionShape,
)
}
Constructors
-
SignatureDefinition( id: String, wire_identity: String, shape: DefinitionShape, )
pub type SignatureField {
SignatureField(wire_name: String, slot: SignatureSlot)
}
Constructors
-
SignatureField(wire_name: String, slot: SignatureSlot)
pub type SignatureSlot {
SignatureSlot(type_id: String, required: Bool, nullable: Bool)
}
Constructors
-
SignatureSlot(type_id: String, required: Bool, nullable: Bool)
pub type SourceIdentity =
semantic_types.SourceIdentity
pub type Target {
Library
Group(id: String)
Definition(id: String)
Type(id: String)
Outcome(definition: String, outcome: String)
}
Constructors
-
Library -
Group(id: String) -
Definition(id: String) -
Type(id: String) -
Outcome(definition: String, outcome: String)
pub type TypeSignatureLibrary {
TypeSignatureLibrary(
schema: String,
identity: String,
revision: String,
profile: semantic_types.SemanticProfile,
sources: List(semantic_types.SourceIdentity),
provenance: List(ProvenanceBinding),
groups: List(DefinitionGroup),
annotations: List(Annotation),
nodes: List(LibraryNode),
definitions: List(SignatureDefinition),
)
}
Constructors
-
TypeSignatureLibrary( schema: String, identity: String, revision: String, profile: semantic_types.SemanticProfile, sources: List(semantic_types.SourceIdentity), provenance: List(ProvenanceBinding), groups: List(DefinitionGroup), annotations: List(Annotation), nodes: List(LibraryNode), definitions: List(SignatureDefinition), )
Values
pub fn admit_generation(
expected_json: String,
input_json: String,
) -> Result(CheckedGeneration, Failure)
pub fn all_annotations(
library: AdmittedLibrary,
) -> List(Annotation)
pub fn annotations(
library: AdmittedLibrary,
target: Target,
) -> List(Annotation)
pub fn assemble_generation(
library_json: String,
composition: exact_json.JsonValue,
entrypoints: exact_json.JsonValue,
) -> Result(#(String, String), Failure)
pub fn canonical(
value: exact_json.JsonValue,
) -> Result(String, Failure)
pub fn check_library(
library: TypeSignatureLibrary,
) -> Result(CheckedLibrary, LibraryCheckFailure)
pub fn checked_composition(
checked: CheckedGeneration,
) -> option.Option(semantic_composition.CheckedComposition)
pub fn checked_graph(
checked: CheckedGeneration,
) -> semantic_types.SemanticGraph
pub fn checked_library(
checked: CheckedGeneration,
) -> AdmittedLibrary
pub fn checked_library_value(
checked: CheckedLibrary,
) -> TypeSignatureLibrary
pub fn checked_outcomes(
checked: CheckedGeneration,
function: semantic_composition.FunctionRef,
) -> List(OutcomeContract)
pub fn decode_library(
wire: String,
) -> Result(AdmittedLibrary, Failure)
pub fn decode_library_shape(
value: exact_json.JsonValue,
) -> Result(LibraryShape, Failure)
pub fn decode_library_value(
value: exact_json.JsonValue,
) -> Result(AdmittedLibrary, Failure)
pub fn decode_outcome(
checked: CheckedGeneration,
definition: String,
wire: String,
) -> Result(semantic_generation_runtime.OutcomeValues, Failure)
pub fn definition_ref(
library: AdmittedLibrary,
id: String,
) -> Result(semantic_types.DefinitionRef, Failure)
pub fn definitions(
library: AdmittedLibrary,
) -> List(SignatureDefinition)
pub fn encode_basis(
checked: CheckedGeneration,
) -> Result(String, Failure)
pub fn encode_checked(
checked: CheckedGeneration,
) -> Result(String, Failure)
pub fn encode_library(
library: AdmittedLibrary,
) -> Result(String, Failure)
pub fn encode_library_shape(
value: LibraryShape,
) -> Result(exact_json.JsonValue, Failure)
pub fn encode_outcome(
checked: CheckedGeneration,
definition: String,
output: semantic_generation_runtime.OutcomeValues,
) -> Result(String, Failure)
pub fn field(
value: exact_json.JsonValue,
key: String,
) -> Result(exact_json.JsonValue, Failure)
pub fn generated_definitions(
checked: CheckedGeneration,
) -> List(SignatureDefinition)
pub fn generation_basis(
library: AdmittedLibrary,
composition: exact_json.JsonValue,
entrypoints: exact_json.JsonValue,
) -> Result(exact_json.JsonValue, Failure)
pub fn generation_requirement(
checked: CheckedGeneration,
) -> GenerationRequirement
pub fn groups(library: AdmittedLibrary) -> List(DefinitionGroup)
pub fn is_external_failure(
checked: CheckedGeneration,
function: semantic_composition.FunctionRef,
outcome: semantic_composition.OutcomeId,
) -> Bool
pub fn library_graph(
library: AdmittedLibrary,
) -> semantic_types.SemanticGraph
pub fn object(
value: exact_json.JsonValue,
keys: List(String),
) -> Result(List(#(String, exact_json.JsonValue)), Failure)
pub fn prepare_composition(
library: AdmittedLibrary,
input: semantic_composition.CompositionInput,
causes: List(
#(semantic_composition.FunctionRef, List(OutcomeContract)),
),
) -> Result(
semantic_composition.PreparedCompositionInput,
Failure,
)
pub fn require_generation(
required: GenerationRequirement,
checked: CheckedGeneration,
) -> Result(CheckedGeneration, GenerationMismatch)
pub fn signature_digests(
library: AdmittedLibrary,
) -> Result(#(String, String, String), Failure)
pub fn start_generation(
checked: CheckedGeneration,
arguments: List(
#(
semantic_composition.InputId,
semantic_types.SlotValue(exact_json.JsonValue),
),
),
providers: List(semantic_generation_runtime.Provider),
state: network_effect.NetworkState,
) -> Result(
semantic_generation_runtime.Progress,
semantic_generation_runtime.RunFailure,
)
pub fn translate_composition(
library: AdmittedLibrary,
value: exact_json.JsonValue,
) -> Result(exact_json.JsonValue, Failure)
pub fn type_ref(
library: AdmittedLibrary,
id: String,
) -> semantic_types.TypeRef
pub fn validate_outcome(
checked: CheckedGeneration,
definition: String,
output: semantic_generation_runtime.OutcomeValues,
) -> Result(Nil, Failure)
pub fn validate_value(
library: AdmittedLibrary,
id: String,
value: exact_json.JsonValue,
) -> Result(Nil, semantic_generation_runtime.ValueFailure)