Python wrapper for AIKernel.Control v0.1.2 governance contracts with bundled managed assemblies and pythonnet loading.
Project description
aikernel-governance
Python wrapper surface for AIKernel.Control.
Starting with the 0.1.2 canon line, aikernel-governance is the PyPI package
for the public AIKernel.Control governance boundary. The package remains a thin
wrapper over managed C# assemblies and does not re-implement CTG Gate logic in
Python.
Scope
aikernel-governance exposes the public AIKernel.Control contract boundary as a
single Python API:
- execution request, result, and snapshot envelopes
- provider contract metadata
- Bonsai provider, tokenizer, model config, and model-state wrappers
- emulator graph, node, scheduler, policy, and engine wrappers
- CPU kernel wrapper
- diagnostics replay approval wrapper
- GPU delegate contract loader
- managed assembly discovery and pythonnet loading
The reference package does not provide a separate Python implementation of governance semantics. It does not expose internal engine helpers, transport-specific logic, OS-specific implementations, or private runtime state.
Managed Assemblies
Python packaging resolves the public 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 packages from the NuGet
global-packages cache.
load_governance_runtime() loads the resolved assemblies through pythonnet.
Managed API Catalog
The v0.1.2 package exposes the generated managed API catalog through
managed_api_catalog(), managed_api_summary(), managed_type_names(), and
find_managed_type(full_name).
API
from aikernel_governance import (
ExecutionRequest,
ExecutionResult,
Snapshot,
ProviderContract,
GovernanceClient,
)
Example:
from 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)
snapshot = client.snapshot("exec-001")
backend must provide the governance operations used by the client:
submit(request)snapshot(id)result(id)
When pythonnet is available, wrappers can be converted to public C# DTOs with
to_managed().
Build and Validate
For local validation:
cd C:\Users\HP\source\repos\AIKernel-NET\AIKernel.Control
py -m pytest python\tests
Distribution
PyPI publishing is handled by the repository GitHub Actions workflow on release tags using Trusted Publishing. Keep Python experiments thin over the managed assemblies and do not add CTG Gate rules to Python code.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aikernel_governance-0.1.2.tar.gz.
File metadata
- Download URL: aikernel_governance-0.1.2.tar.gz
- Upload date:
- Size: 228.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7fddb24f99ddc0f84d4dc020daf6dbe33b0083e54e44a1d5fdb4b9f538af4fe5
|
|
| MD5 |
3a5aedb43f3a7db18fdefd01ac5c24ce
|
|
| BLAKE2b-256 |
85c81dd6d9675019452814676a5f994637f9d7d2525bb8d47f92d6d626076432
|
Provenance
The following attestation bundles were made for aikernel_governance-0.1.2.tar.gz:
Publisher:
publish-pypi.yml on AIKernel-NET/AIKernel.Control
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aikernel_governance-0.1.2.tar.gz -
Subject digest:
7fddb24f99ddc0f84d4dc020daf6dbe33b0083e54e44a1d5fdb4b9f538af4fe5 - Sigstore transparency entry: 1859819469
- Sigstore integration time:
-
Permalink:
AIKernel-NET/AIKernel.Control@e5ae3f400baff3904638901372c09a7a9268ad14 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/AIKernel-NET
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e5ae3f400baff3904638901372c09a7a9268ad14 -
Trigger Event:
push
-
Statement type:
File details
Details for the file aikernel_governance-0.1.2-py3-none-any.whl.
File metadata
- Download URL: aikernel_governance-0.1.2-py3-none-any.whl
- Upload date:
- Size: 241.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ec84dc73c239974eb66ea94bfc1d051086b89e508f0a3d9984b4bcf56fd955f
|
|
| MD5 |
afb551e9e2803d2001e83319d0fa333b
|
|
| BLAKE2b-256 |
808fefcc3e4e7a68aa73b5481f2b3146dac9c5aae571b53cddf2379c4c409ca8
|
Provenance
The following attestation bundles were made for aikernel_governance-0.1.2-py3-none-any.whl:
Publisher:
publish-pypi.yml on AIKernel-NET/AIKernel.Control
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
aikernel_governance-0.1.2-py3-none-any.whl -
Subject digest:
2ec84dc73c239974eb66ea94bfc1d051086b89e508f0a3d9984b4bcf56fd955f - Sigstore transparency entry: 1859819498
- Sigstore integration time:
-
Permalink:
AIKernel-NET/AIKernel.Control@e5ae3f400baff3904638901372c09a7a9268ad14 -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/AIKernel-NET
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e5ae3f400baff3904638901372c09a7a9268ad14 -
Trigger Event:
push
-
Statement type: