Framework#

Layer 4: Extend Framework

The saealib framework places Component contracts in a ComponentGraph and provides the execution foundation for the Compiler to turn them into a verified ExecutablePlan. It treats contract structure and execution flow as separate relationships.

Concept pages#

Components return their static contract through contract(). ComponentContract describes contract inclusion for the components a Component holds and the capabilities it requires, not a Component inheritance hierarchy. PortSpec, DataSpec, and StateContract are declarative values that compose a contract, not Component subclasses.

The following pages explain the concepts needed for extensions by responsibility.

Component

The Component Protocol, contract(), and PartSpec.

Component
ComponentContract

Contract elements and invariants.

ComponentContract
Specs

Declarative values for ports, data, services, and compatibility.

Specs
Graph

Nodes, edges, state bindings, and structured regions.

Graph
Compiler

Verification, resolution, diagnostics, and ExecutablePlan.

Compiler
Runtime

ExecutablePlan execution, state application, resumption, and asynchronous waiting.

Runtime
SearchSpace

Candidate representation, services, and the RepresentationSpec boundary.

SearchSpace
Feedback

Candidate IDs and the correspondence between observations, true values, and predictions.

Feedback
OptimizationState

The ownership boundary between Stage-compatible and graph-native state.

OptimizationState

Execution flow#

The runtime relationship is Component → ComponentNode → ComponentGraph → Compiler → ExecutablePlan → ExecutionRuntime. This flow is separate from the contract tree; ComponentContract does not directly represent execution order.

See OptimizationState and Runtime for detailed state boundaries, and SearchSpace and Feedback for candidate-representation and observation boundaries.

Extension paths#

When you only need to swap the behavior of a built-in component, choose the corresponding extension page. When you need a new contract, candidate representation, Graph connection, Compiler rule, or Runtime semantic, see Framework extensions. See the API reference for import paths for public types.