aikernel-governance is the Python distribution for the public
AIKernel.Control governance surface.
It is a wrapper over the C# packages, not a Python reimplementation of Control. The package bundles managed assemblies and exposes a single import surface:
from aikernel_governance import (
ExecutionRequest,
ExecutionResult,
Snapshot,
ProviderContract,
GovernanceClient,
)pip install aikernel-governanceThe distribution name is aikernel-governance. The import name is
aikernel_governance.
The package exposes public Control contracts and public wrapper types:
ExecutionRequestExecutionResultSnapshotSnapshotMetadataProviderContractGovernanceClient- Bonsai provider, model, tokenizer, and model-state wrappers
- Emulator graph, node, scheduler, policy, and engine wrappers
- CPU kernel wrapper
- Diagnostics replay approval wrapper
- GPU delegate contract loader
It does not expose internal governance engine helpers, transport-specific code, OS-specific implementations, or private runtime internals.
The wheel bundles the Control and contract assemblies under
aikernel_governance/native:
AIKernel.Abstractions.dllAIKernel.Dtos.dllAIKernel.Enums.dllAIKernel.Control.Core.dllAIKernel.Control.CPU.dllAIKernel.Control.Diagnostics.dllAIKernel.Control.Emulator.dllAIKernel.Control.GPU.dll
governance_assemblies() resolves bundled assemblies first, then paths from
AIKERNEL_GOVERNANCE_ASSEMBLY_PATH, then matching NuGet packages from the
global packages cache.
load_governance_runtime() loads the resolved assemblies through pythonnet.
cd C:\Users\HP\source\repos\AIKernel-NET\AIKernel.Control
dotnet test AIKernel.Control.slnx -c Release --no-restore
dotnet pack AIKernel.Control.slnx -c Release --no-restore
cd python
py -m pytest
py -m build --wheel
py -m twine check dist\aikernel_governance-0.1.0-py3-none-any.whlfrom aikernel_governance import ExecutionRequest, GovernanceClient
request = ExecutionRequest(
model="bonsai-1.7b",
input="hello",
parameters={"execution_id": "exec-001"},
)
client = GovernanceClient(backend)
result = client.submit(request)GovernanceClient delegates to a public backend. The backend must expose
submit(request), snapshot(id), and result(id).