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

Japanese version: IUnifiedContextContract (統合契約仕様)

IUnifiedContextContract (Unified Contract Specification)

1. Responsibility Boundary

IUnifiedContextContract is the top-level governance contract that composes Orchestration/Expression/Material contracts and enforces three-layer buffer isolation end-to-end.

  • Role:
  • Provide unified access to the orchestration, expression, and material contract views.

  • Non-role:
  • Validation, layer-separation checks, pollution detection, global SNR evaluation, and concrete payload management are delegated to specialized service interfaces and DTO boundaries.

2. Contract Signature

using AIKernel.Dtos.Context;\n\nnamespace AIKernel.Contracts;\n\n/// <summary>\n/// 統合コンテキスト契約を定義します。\n/// OrchestrationContract、ExpressionContract、MaterialContract を統合管理します。\n/// \n/// 参照: 2.CONTEXT_ISOLATION_SPEC.jp.md\n/// </summary>\npublic interface IUnifiedContextContract\n{\n    /// <summary>\n    /// 統合コンテキストの一意識別子を取得します。\n    /// </summary>\n    string GetId();\n\n    /// <summary>\n    /// OrchestrationContract を取得します。\n    /// </summary>\n    IOrchestrationContract GetOrchestration();\n\n    /// <summary>\n    /// ExpressionContract を取得します。\n    /// </summary>\n    IExpressionContract? GetExpression();\n\n    /// <summary>\n    /// MaterialContract を取得します。\n    /// </summary>\n    IMaterialContract? GetMaterial();\n\n    /// <summary>\n    /// 統合コンテキストのデータを取得します。\n    /// </summary>\n    UnifiedContextDto GetContext();\n}
  • UC-06 Three-layer buffer boundary:
  • Guarantees cross-layer integrity from a single contract point.

  • UC-20 Deterministic replay and audit trail:
  • Supports save/restore and replay integrity at unified-context granularity.

4. Governance & Determinism

  • Cross-layer validation:
  • IUnifiedContextContractValidator.ValidateAll() is expected to detect inter-layer contradictions and contamination.

  • Immutability chain:
  • While unified contract is active, subordinate contracts are expected to remain stable.

  • Fail-Closed:
  • Reject transition to reasoning when ILayerSeparationValidator.ValidateLayerSeparation() fails or critical pollution is detected.

5. Metric: SNR (Signal-to-Noise Ratio)

  • Unified measurement:
  • ISignalToNoiseRatioCalculator.CalculateSignalToNoiseRatio() evaluates signal density across the whole context window, not per layer only.

  • Threshold governance:
  • Use low-SNR outcomes for warnings, routing escalation, or execution denial policies.

6. Implementation Notes

  • Lazy evaluation:
  • For heavy Material, apply on-demand loading strategies to control runtime cost.

  • Serialization compatibility:
  • Ensure GetContext() DTO stays portable for storage/restore (e.g., JSON compatibility).


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/contracts/IUnifiedContextContract.md