API Reference
This document provides a high level map of the public APIs. For full signatures, use the crate level lib.rs files and generated rustdoc.
Core Crates
telltale
Core session type library with channel primitives and macros.
Key exports:
GlobalType,LocalTypeR,Label,PayloadSortRole,Roles,Messagederive macros- Channel traits and session state types
See rust/src/lib.rs for the full list of re-exports.
Generated tell! APIs use one canonical effect-boundary import style:
- import
Protocol::effects effects::Runtimefor host traitseffects::RuntimeRequest/effects::RuntimeOutcomefor typed dispatcheffects::runtime::operation("ready")oreffects::runtime::READYfor generated per-operation semantic metadataProtocol::proof_statusfor theorem-pack, tier, parity, and agreement/finality metadata
telltale-types
Type definitions shared across the stack.
Key exports:
GlobalType,LocalTypeR,Label,PayloadSortContentId,Blake3Hasher,ContentStore,KeyedContentStoreDefaultContentHasherandDefaultContentIdfor central content-hash policySha256HasherandContentIdSha256when thesha256feature is enabled- Merge helpers (
merge,merge_all,can_merge) and canonical-serialization utilities
See rust/types/src/lib.rs for re-exports.
telltale-theory
Session-type algorithms and executable theory checks.
Key modules:
- Projection:
telltale_theory::projection::{project, project_all, MemoizedProjector} - Merge, duality, well-formedness, and semantics checks
- Subtyping (feature-gated):
telltale_theory::subtyping::{async_subtype, sync_subtype}
Exports are module-scoped, not re-exported at crate root. See rust/theory/src/lib.rs for the complete feature-gated API.
telltale-runtime
Choreographic DSL, projection, and effect execution.
Key exports:
- AST types:
Choreography,Protocol,Role,MessageType - Effect system:
Program,ProgramBuilder,interpret - Handlers:
ChoreoHandler,InMemoryHandler,TelltaleHandler - Topology:
Topology,TopologyHandler,TransportType - Heap:
Heap,DefaultHeapHasher,Hasher,Resource,ResourceId,CanonicalHeapEncoding,CanonicalHeapEncoder,HEAP_ENCODING_MAGIC,HEAP_ENCODING_VERSION,resource_leaf_hash,nullifier_leaf_hash,merkle_node_hash,MerkleTree,HeapCommitment - Heap preimage helpers (module-scoped, not at crate root):
telltale_runtime::heap::{resource_id_preimage, resource_leaf_preimage, nullifier_leaf_preimage, merkle_node_preimage, heap_commitment_preimage} - Extensions:
ExtensionRegistry,GrammarExtension,ProtocolExtension
See rust/runtime/src/lib.rs for the full export surface.
telltale-machine
Protocol-machine and guest-runtime surfaces for executing projected local types.
Canonical public modules:
telltale_machine::modeltelltale_machine::runtimetelltale_machine::semantics
Key exports:
ProtocolMachine,ProtocolMachineConfig,GuestRuntime,SchedPolicy,SimClockInstr,Value,SessionStore,SessionIdOwnedSession,EffectHandler, andNestedProtocolMachineHandler- proof-aligned effect algebra:
EffectSemanticClass,EffectRetryShape,EffectCompositionPolicyEffectResponsibilityDomain - canonical semantic objects:
OperationInstance,OutstandingEffect,SemanticHandoff,TransformationObligation,AuthoritativeRead,ObservedRead,MaterializationProof,CanonicalHandle,PublicationEvent,Region,ProgressContract,ProgressTransition,ProtocolMachineSemanticObjects - first-class capability/finalization taxonomy:
ProtocolCriticalCapabilityClass,ProtocolCriticalCapabilityLifecycleState,ProtocolCriticalCapabilityArtifact,ProtocolCriticalCapabilityLifecycleRecord,ProtocolMachineFinalization,FinalizationPath,FinalizationReadClass,FinalizationStage - proof-carrying runtime profiles:
ProtocolMachineExecutionProfile,ProtocolMachineFairnessAssumption,ProtocolMachineAdmissibilityClass,ProtocolMachineEscalationWindowClass - runtime introspection (methods on
ProtocolMachine/GuestRuntime):operation_instances(),outstanding_effects(),semantic_objects(),progress_contracts(),progress_transitions(),publication_events(),require_authoritative_read(),require_canonical_handle(),protocol_machine_finalization(),capability_lifecycle_audit_log(),semantic_audit_log(),canonical_replay_fragment()
GuestRuntime is the Telltale-owned runtime instantiated around the protocol
machine. EffectHandler is the host-runtime boundary implemented by embedders
and simulators.
telltale-search
Generic weighted-graph search substrate for the Telltale workspace.
Module structure:
telltale_search::costtelltale_search::domaintelltale_search::machinetelltale_search::admissiontelltale_search::runtimetelltale_search::observe
The supported boundary is intentionally generic:
- canonical search-machine semantics
- serial min-key batch extraction and deterministic commit
- full legal batch execution even under chunked parallel schedulers
- search replay and comparison artifacts
- scheduler and fairness capability vocabulary
- explicit graph-epoch and snapshot inputs
Downstream consumers are expected to provide application-specific node, edge, heuristic, and epoch semantics through typed domain traits.
Current serial-core exports include:
SearchCost,EpsilonMilliSearchDomain,SearchQuery,SearchQueryError,SearchSelectedResultSemanticsClassSearchMachineCanonicalBatch,Proposal,ProposalKind,SelectedSolutionSearchBudgetState,SearchTraceStateSearchError,SearchInvariantViolation- profile/admission types:
SearchDeterminismMode,SearchSchedulerProfile,SearchFairnessAssumption,SearchObservableClass,SearchClaimClass,CommutativityRegionClass,SearchDUser,SearchCertifiedCapability,AdmissionRejectionReason,check_capability_containment(...) - observation/comparison types:
SearchObservationArtifact,NormalizedCommitRecord,SelectedSolutionPublicationRecord,ObservationComparison,ObservationRelation,compare_observations(...) - runtime/replay types:
ProposalExecutor,SerialProposalExecutor,NativeParallelExecutor,NativeParallelExecutorError,AuthorityReadSet,AuthorityWriteSet,AuthoritySurface,SchedulerArtifact,SchedulerArtifactClass,ProgressSummary,TotalStepMode,SearchExecutionReport,SearchReplayArtifact,ReplayRoundRecord,ReplayExpectation,ReplayError,SearchRunConfig,SearchRunTermination,run_with_executor(...),replay_observation(...),EpochReconfigurationRequest,commit_epoch_reconfiguration(...),proposals_independent(...)
Replay validation is derived from canonical round commits rather than trusting stored summary fields when selected-result semantics are query-derived. For domain-defined selected-result semantics, replay fails closed instead of silently falling back to a compatibility goal anchor. Epoch reconfiguration is barriered and resets frontier/parent/incumbent state before reseeding the new epoch from the start node. Fairness bundles are explicit observation and admission surfaces. Observation artifacts also carry canonical parent identity and selected-result publication traces, while fairness and capability bundles use set semantics rather than order-sensitive vectors.
Import posture:
- prefer
SearchQuery::try_multi_goal(...)andSearchQuery::try_candidate_set(...) - prefer generic selected-result types over route/incumbent aliases
- use
telltale_search::compatonly for legacy migration - treat
SearchExecutionPolicyas an explicit compatibility matrix:CanonicalSerial=> serial + width1,ThreadedExactSingleLane=> native parallel + width1,BatchedParallelExact/BatchedParallelEnvelopeBounded=> native parallel + width> 1 - treat
SchedulerStepBudget(n)as the supported budgeted-anytime effort mode andSearchCachingProfile::IncrementalReuseas outside the stable import posture until implemented
Optional layers above the core crate:
telltale_simulator::project_search_run(...)telltale_viewer::project_search_artifacts(...)
Module access (not re-exported at crate root):
- Effect boundary:
telltale_machine::model::effects::EffectHandler,EffectRequest,EffectOutcome,EffectInterfaceMetadata,EffectExchangeRecord,EffectCompositionPolicyEffectSemanticClass,EffectRetryShape,EffectResponsibilityDomain,SendDecision,SendDecisionInputThe typed internal durability request isEffectRequestBody::WalSync. - Effect trace:
telltale_machine::model::effects::RecordingEffectHandler,ReplayEffectHandler - Durability:
telltale_machine::model::durability::{AgreementWal, AgreementWalArtifact, AgreementWalEntry, AgreementWalHandler, EvidenceIdResolver, EvidenceOutcomeCache, EvidenceOutcomeCacheArtifact, EvidenceOutcomeCacheEntry, EvidencePersistenceHandler, DurableRecoveryAction, DurableRecoveryDecision, DurableRecoveryMetadata, DurableRecoveryPlan, FileAgreementWal, FileEvidenceOutcomeCache, InMemoryAgreementWal, InMemoryEvidenceOutcomeCache, PersistedDurabilityArtifact, PersistedDurabilityPayload, WalSyncMode, WalSyncRequest}These are the authoritative typed contracts for durable agreement WALs, evidence outcome caches, recovery metadata, typed recovery planning, and the internalwal_syncdurability boundary. Helper/generated/viewer surfaces should consume projections of these artifacts rather than defining peer durable state. Downstream integrations should implementAgreementWaland/orEvidenceOutcomeCachedirectly rather than introducing backend-branded wrapper APIs. The supported contract is append/read/load plus fail-closed error returns. Storage-specific retries, replication, or transport details must remain behind that trait boundary. - Child-effect aggregation:
EffectCompositionPolicyis a secondary sibling-effect algebra used beneath parent agreement contracts, not the top-level agreement model - Loader:
telltale_machine::runtime::loader::CodeImage - Runtime contracts:
telltale_machine::runtime::failure::{RuntimeContracts, ProtocolMachineExecutionProfile} - Runtime runner:
telltale_machine::runtime::runner::{ProtocolMachine, GuestRuntime, StepResult, RunStatus} - Semantics:
telltale_machine::semantics::exec::{ExecResult, ExecStatus, StepPack}
See rust/machine/src/lib.rs for the full API.
See Effect Handlers and Session Types for integration-boundary guidance.
telltale-simulator
Simulation utilities built on the protocol machine.
Key exports:
- Harness surface in
rust/simulator/src/harness.rs:HostAdapter,DirectAdapter,FieldAdapter,HarnessSpec,HarnessConfig,SimulationHarness,BatchConfig,BatchRunResultFieldAdapter::from_scenario(...)requires built-in scenario field params. Generic harness runs may omitScenario.fieldwhen the adapter supplies its own initial states or environment models.SimulationHarness::run_batch(...)andrun_batch_with(...)preserve input-order results while parallelizing independent runs.
Module access (not re-exported at crate root):
telltale_simulator::trace::Trace,StepRecordtelltale_simulator::runner::run,run_concurrent,run_with_scenario,ChoreographySpectelltale_simulator::scenario::{Scenario, ExecutionSpec, ExecutionBackend, ResolvedExecution, ResolvedExecutionBackend, DurabilitySpec, DurabilityMode}telltale_simulator::runner::{resume_with_checkpoint_artifact, resume_with_durable_checkpoint_artifact, DurableResumeArtifacts, DurableResumeSummary}resume_with_checkpoint_artifact(...)is the exact non-durable checkpoint lane. Scenarios that declareDurabilityMode::Walmust resume throughresume_with_durable_checkpoint_artifact(...)so the simulator cannot bypass the typed WAL/evidence contract.telltale_simulator::durability::{FaultInjectingAgreementWal, DurableFaultProgram, ScheduledDurableFault, DurableFaultKind, DurableFaultRecord, DurableRecoveryRun, DurablePropertyReport, run_durable_recovery_case, durable_property_report}This is the reusable simulator-side durability assurance surface for deterministic fault injection, crash/recovery comparison, and durable property monitoring.telltale_simulator::durability::{DurableInspectionReport, DurableWalEntryProjection, EvidenceCacheEntryProjection, inspect_durable_artifacts}These are observed-only tooling projections of authoritative durable artifacts for viewer and CLI inspection.- CLI surface:
cargo run -p telltale-simulator --bin durable -- --wal <wal.cbor> --cache <cache.cbor> [--checkpoint <checkpoint.cbor> --scenario <scenario.toml>] [--json]This inspection-only lane projects typed WAL/cache/recovery artifacts without exposing backend-specific storage details. telltale_simulator::generated::{GeneratedEffectScenario, GeneratedEffectScenarioBuilder, GeneratedEffectSimulationReport, ScenarioEffectDisposition, ScenarioEffectResult, ScenarioEffectStep}Helper-only generated-effect support.GeneratedEffectSimulationReportexposes helper accessors, not authoritative replay or theorem-classification fields.telltale_simulator::{CheckpointArtifact, PersistedReplayArtifact, PersistedReplayPayload}Typed persisted replay/checkpoint wrappers for on-disk simulator artifacts. Durable agreement WALs and recovery metadata intentionally remain machine-level typed contracts instead of simulator helper exports.telltale_viewer::{SemanticComparisonResult, TheoremAwareCounterexample, DeterministicSweepReport, ExperimentSuiteReport, EffectTraceArtifact, MinimizationResult, ViewerExtensionManifest}Shared viewer/webapp tooling surfaces for comparison, counterexamples, sweeps, effects, minimization, and downstream overlays.- Contract checks in
rust/simulator/src/contracts.rs:ContractCheckConfig,ContractCheckReport,evaluate_contracts,assert_contracts - Preset helpers in
rust/simulator/src/presets.rs - Field handlers and factory:
IsingHandler,HamiltonianHandler,ContinuumFieldHandler,handler_from_fieldinrust/simulator/src/field_handlers/
telltale-bridge
Lean bridge for JSON export, import, and validation.
Key exports:
global_to_json,local_to_json,json_to_global,json_to_localLeanRunner,Validator,ValidationResultHeapParityRunner,HeapParityOutputProtocolMachineSemanticObjectsand semantic-object schema helpers These come from the same canonical semantic-object family astelltale_machine::model::semantic_objects, not a bridge-local duplicate.
See Rust-Lean Bridge and Parity for details.
telltale-transport
Reference TCP transport implementation for choreography topologies.
Key exports:
TcpTransport,TcpTransportConfig,TransportState- Resolver and factory surfaces:
EnvResolver,StaticResolver,TcpTransportFactory - Re-exported transport traits/types:
Transport,TransportError,TransportResult,RoleName
For the transport-contract boundary example, run cargo run -p telltale-transport --example theorem_admission. The example does not open sockets. It shows that pre-shared-key TCP exports an authenticated runtime contract and trusted-network TCP fails theorem admission on authenticated_peers.
TLS is intentionally out of scope for this reference transport. Production deployments that require confidentiality or certificate-bound identity should wrap or replace it and export equivalent semantic contract evidence.
See rust/transport/src/lib.rs for the current public surface.
Guidance
When you need an exact signature, open the crate lib.rs and follow re-exports to the module definition. This keeps the reference accurate as the API evolves.