This page names the intended public Python surfaces for the pre-1.0 package.
from catalyst import __version__Primary import path:
from catalyst.operation.commands import (
chunk_source,
chunk_observed_source,
chunk_parsed_code,
emit_projection,
emit_boundary_inspection,
evaluate_candidates,
evaluate_context_recovery,
evaluate_performance_benchmark,
evaluate_retrieval_sanity,
inspect_boundaries,
)Result types:
from catalyst.operation.commands import (
CandidateEvaluation,
ChunkCodeResult,
ChunkSourceResult,
ContextRecoveryBenchmark,
PerformanceBenchmark,
RetrievalSanityEvaluation,
)from catalyst.source.records.source_record import SourceRecord
from catalyst.source.records.source_span import SourceSpanfrom catalyst.observation.instruments.collect import observe_sourceThe default observation set includes source_measure, which reports raw source size measures such as character count, byte count, line count, lexical token count, and max atomic run length.
from catalyst.formation.selection.selection_policy import SelectionPolicyfrom catalyst.boundary.ports import (
CHUNK_SOURCE_COMPLETED,
ArtifactWriter,
AstParserPort,
DocumentParserPort,
EmbeddingPort,
LlmCandidatePort,
ProviderTokenPort,
SourceLoader,
TelemetrySink,
TokenizerPort,
)Telemetry event names and payload fields are available from catalyst.boundary.ports.
Concrete adapters are public at the boundary layer:
from catalyst.boundary.adapters.ast_python import PythonAstParser
from catalyst.boundary.adapters.telemetry import (
InMemoryTelemetrySink,
NoOpTelemetrySink,
record_telemetry,
)
from catalyst.boundary.adapters.tokenizers import ExampleProviderTokenizer
from catalyst.boundary.adapters.filesystem.source_loader import FileSystemSourceLoader
from catalyst.boundary.adapters.jsonl.artifact_writer import JsonlArtifactWriterOptional adapters may require extras.
Catalyst is pre-1.0. Public API changes should be documented in CHANGELOG.md. Internal modules may change without compatibility guarantees.
from catalyst.shared.errors import EmptySourceError, InvariantViolation
from catalyst.formation.selection import SelectionFailureEmptySourceError: source material contains no chunkable text.SelectionFailure: no candidate set satisfied selection policy; rejection records are attached to the error.InvariantViolation: admitted structures failed hard invariants.
See Error Records for the structured error shape.