Skip to main content

Module capability_allocator

Module capability_allocator 

Source
Expand description

Capability Allocator — WASM sandbox runner with CPU fuel metering.

Replaces coreason_runtime/execution_plane/capability_allocator.py.

Provides zero-trust WASM plugin loading with:

  • SHA-256 attestation before execution (supply-chain attack prevention)
  • CPU fuel metering (configurable instruction budget per invocation)
  • Memory limits (10MB WASM page cap)
  • Execution telemetry (fuel consumed, memory pages, wall-clock time)

Zero Waste: WASM execution is delegated to extism (MIT/Apache-2.0, already in Cargo.toml). SHA-256 attestation uses the sha2 crate. We only write the domain-specific attestation, fuel metering, and Merkle bundle verification logic.

Structs§

ExecutionTelemetry
Telemetry from a WASM execution.

Functions§

call_with_telemetry
Execute a WASM plugin via extism with telemetry collection.
compute_merkle_directory_cid
Merkle-style SHA-256 CID computation for a directory of files.
sync_active_inference_priors
Sync manager for intermittent active inference prior reconciliation.
verify_bundle_integrity
Zero-trust Merkle verification: recompute the CID and compare to the registry.
verify_wasm_attestation
Verify a WASM binary’s SHA-256 hash before loading (constant-time comparison).
wasm_hash
Compute the SHA-256 hash of WASM bytes.