This page describes the opt-in connection between AIKernel.Control and the Canonical Triadic Governance contracts provided by AIKernel.NET and evaluated by AIKernel.Core.
CTG is treated as a contract-level governance boundary:
Logos,Ethos, andPathosare normalized as council votes.GateInputcarries only the three discreteCouncilVoteValuevalues.- Decision Gate and Trajectory Gate evaluation are owned by AIKernel.Core.
- AIKernel.Control never computes approve counts, veto conditions, or halt aggregation.
- Provider confidence, risk, and score carriers are not accepted by the Control
CTG vote-output surface.
ProviderVoteOutputis discrete-only, andGateInputremains only the three council votes.
In Control, CTG belongs to the Apply Policy stage. The policy decides whether physical execution proceeds, but the gate decision itself remains a Core evaluator result.
Provider output
-> CouncilVote
-> CouncilDecision
-> GateInput
-> Core IDecisionGate
-> DecisionGateResult
-> ControlPolicyEvaluation
| Package | Responsibility |
|---|---|
AIKernel.NET |
Contracts, DTOs, enums, and Canon/ROM contract carriers. |
AIKernel.Core |
Pure CTG evaluators and governance trace construction. |
AIKernel.Control.Core |
Provider vote normalization, orchestration, policy adapter, and DI connection. |
AIKernel.Control.Emulator |
Deterministic execution validation after policy evaluation. |
AIKernel.Control.CPU / AIKernel.Control.GPU |
Physical execution kernels only. CTG logic is not placed here. |
AllowAllControlPolicy remains the default emulator-friendly policy. CTG is
enabled only when a host registers the CTG services:
using AIKernel.Control.Core.Ctg;
using AIKernel.Enums.Governance;
services.AddCtgControl(new CtgControlCoordinatorOptions
{
ProviderOutputs =
[
new ProviderVoteOutput
{
ProviderId = "provider.logos",
CouncilKind = CouncilKind.Logos,
VoteValue = CouncilVoteValue.Approve
},
new ProviderVoteOutput
{
ProviderId = "provider.ethos",
CouncilKind = CouncilKind.Ethos,
VoteValue = CouncilVoteValue.Approve
},
new ProviderVoteOutput
{
ProviderId = "provider.pathos",
CouncilKind = CouncilKind.Pathos,
VoteValue = CouncilVoteValue.Abstain
}
]
});The registration uses TryAdd semantics, so existing host-provided services are
not overwritten.
ProviderVoteAdapterconvertsProviderVoteOutputintoCouncilVote.CtgCouncilEvaluationProviderRegistrystores provider vote outputs for local orchestration and tests. Missing providers becomeUnknownvotes; multiple providers for the same council produce a deterministic error.CtgCouncilEvaluationOrchestratorresolves provider vote outputs from the registry without performing semantic or gate evaluation.CouncilDecisionBuildercreatesCouncilEvaluationResultand fills missing councils withUnknownvotes.CouncilDecisionToGateInputAdapterextracts onlyLogos,Ethos, andPathosvote values.CtgControlCoordinatorcalls CoreIDecisionGateand builds aCtgControlDecisionEnvelope.CtgControlPolicyAdaptermaps the envelope into the existingControlPolicyEvaluation.CtgPolicyDecisionMappermaps accepted decision gates toALLOW, rejected decision gates toDENY, and rejected trajectory gates toABORT.AddCtgControl()registers CoreIDecisionGateandITrajectoryGateimplementations for hosts that need both decision and trajectory evaluation.
AIKernel.Control.Emulator provides CTG scenario helpers for deterministic
dry-runs:
CtgControlEmulatorruns a scenario through the Control policy adapter and the existing emulator engine.CtgTruthTableScenariocreates the 27 discreteApprove/Abstain/Rejectcombinations.EthosRejectScenario,AllAbstainDenyScenario,EmptyTrajectoryHaltScenario, andAnyDenyTrajectoryHaltScenarioprovide named regression scenarios.CtgReplayScenariosupplies stable metadata for replay checks.
The emulator calls Core gate evaluators. It does not contain CTG gate logic.
AIKernel.Control.Diagnostics exposes formatting and replay helpers:
CtgReplayMetadataWriterserializesStepGovernanceTraceandTrajectoryGateResultmetadata.CtgGovernanceTraceEmitteremits governance traces throughIControlStateObserver.CtgDiagnosticsFormatter,CtgTraceRenderer, and formatter helpers provide stable text views for development tooling.CtgGateTelemetryValidatorverifies that gate metadata does not contain provider confidence, risk, or score carriers.
Reject reason kinds are written in uppercase snake case metadata form, while C# enum names remain PascalCase.
Provider and model components may supply evidence and vote material, but they
must not return GateDecisionKind or CTG execution decisions. BonsaiBuiltInProvider
remains a physical/model provider boundary; its execution result metadata does
not contain CTG gate fields.
Run the normal Control validation surface:
dotnet restore AIKernel.Control.slnx
dotnet build AIKernel.Control.slnx -c Release --no-restore
dotnet test AIKernel.Control.slnx -c Release --no-buildThe CTG tests cover allow, deny, halt mapping, truth-table parity with Core,
replay metadata, diagnostics emission, and the guarantee that provider
diagnostics do not enter the GateInput carrier.
This connection includes the opt-in policy adapter, deterministic emulator
scenarios, replay metadata helpers, and diagnostics formatters. Dynamic
ProviderRouter integration remains intentionally outside the 0.1.1.1 surface:
local orchestration uses CtgCouncilEvaluationProviderRegistry, where missing
providers become Unknown votes and multiple matches are deterministic errors.
Fallback routing is not implicit. If it is added later, it must be opt-in and must still return vote material rather than Gate decisions.