Skip to main content

aikernel-governance

日本語

Python wrapper surface for AIKernel.Control.

Starting with the 0.1.3 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.dll
  • AIKernel.Dtos.dll
  • AIKernel.Enums.dll
  • AIKernel.Control.Core.dll
  • AIKernel.Control.CPU.dll
  • AIKernel.Control.Diagnostics.dll
  • AIKernel.Control.Emulator.dll
  • AIKernel.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.3 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.

Metadata

Release files for aikernel-governance 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for aikernel-governance 0.4.0
File Size Uploaded Provenance Actions
aikernel_governance-0.4.0.tar.gz 1.2 MB Without provenance Details for aikernel_governance-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aikernel-governance 0.4.0
File Interpreter ABI Platform Actions
aikernel_governance-0.4.0-py3-none-any.whl Python 3 none any Details for aikernel_governance-0.4.0-py3-none-any.whl

Total release size: 2.3 MB

Release files / aikernel_governance-0.4.0.tar.gz

Download URL aikernel_governance-0.4.0.tar.gz
Size 1.2 MB
Tags Source
SHA-256 checksum
How to use checksums
1a7e490ea30c4c2c995623b338bd27cf04ef69094adcdc0a76ea73748e1558f8
BLAKE2b-256 checksum
How to use checksums
d38cc53109eb6c63b828df10afa7f0f5bf3e8247648d9833f832f8b9b6798905
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.6

Release files / aikernel_governance-0.4.0-py3-none-any.whl

Download URL aikernel_governance-0.4.0-py3-none-any.whl
Size 1.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
49d0bf3c9e8b169a2078f5669d115e8d0e875ac9b99d7229ce88d764c24a9202
BLAKE2b-256 checksum
How to use checksums
b6c3d34510b94a9b770503d0e3811e28bbc0803d06e311d892a26e2bb68f9170
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.6

Security for aikernel-governance 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page