AIKernel.NET
version: 0.0.2 / status: Refactor / edition: Draft / published: 2026-05-16 / updated: 2026-05-16

Japanese version: ICapabilityRegistry (インターフェース仕様)

ICapabilityRegistry (Interface Specification)

1. Responsibility Boundary

ICapabilityRegistry is the boundary interface that manages the inventory of available model/provider capabilities and supplies routing facts for decision-making.

  • Role:
  • Register, retrieve, and resolve candidates based on ModelCapacityVector data.

  • Non-role:
  • Final optimization/scoring and route selection are owned by IModelVectorRouter.

2. Contract Signature

namespace AIKernel.Abstractions.Routing;\n\npublic interface ICapabilityRegistry\n{\n    ValueTask RegisterCapabilityAsync(\n        string providerId,\n        ModelCapacityVector capacityVector,\n        CancellationToken cancellationToken = default);\n\n    ValueTask<ModelCapacityVector?> GetCapabilityAsync(\n        string providerId,\n        CancellationToken cancellationToken = default);\n\n    ValueTask<IReadOnlyList<string>> ResolveCandidatesAsync(\n        RuleEvaluationContext context,\n        CancellationToken cancellationToken = default);\n}
  • UC-03 Model vector routing:
  • Provides the candidate universe consumed by the router.

  • UC-22 Dynamic capacity control and model routing:
  • Supports candidate resolution under runtime changes and constraints.

4. Governance & Determinism

  • Deterministic candidate resolution:
  • For identical registry state and RuleEvaluationContext, ResolveCandidatesAsync must return the same candidates in the same order.

  • Data integrity protection:
  • RegisterCapabilityAsync should be restricted to trusted administration paths; unauthorized mutations must be rejected by design.

5. Exception Contract

This interface does not hard-code exception types. Implementations should explicitly handle:

  • Unknown provider lookup:
  • Failed retrieval for non-existent providerId.

  • Registry conflicts:
  • Conflicting capability registration for the same provider ID.

6. Implementation Notes

  • Fast lookup:
  • Use low-latency indexing/caching structures for frequent reads.

  • Policy-aware filtering:
  • ResolveCandidatesAsync should apply governance filters from RuleEvaluationContext, not only liveness checks.


Changelog

  • v0.0.0 / v0.0.0.0: Initial draft
  • v0.0.1 (2026-05-06): Version upgrade aligned with documentation guidelines
Source: architecture/interfaces/routing/ICapabilityRegistry.md