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:
- Non-role:
Provide unified access to the orchestration, expression, and material contract views.
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}
3. Related Use Cases
UC-06Three-layer buffer boundary:UC-20Deterministic replay and audit trail:
Guarantees cross-layer integrity from a single contract point.
Supports save/restore and replay integrity at unified-context granularity.
4. Governance & Determinism
- Cross-layer validation:
- Immutability chain:
- Fail-Closed:
IUnifiedContextContractValidator.ValidateAll() is expected to detect inter-layer contradictions and contamination.
While unified contract is active, subordinate contracts are expected to remain stable.
Reject transition to reasoning when ILayerSeparationValidator.ValidateLayerSeparation() fails or critical pollution is detected.
5. Metric: SNR (Signal-to-Noise Ratio)
- Unified measurement:
- Threshold governance:
ISignalToNoiseRatioCalculator.CalculateSignalToNoiseRatio() evaluates signal density across the whole context window, not per layer only.
Use low-SNR outcomes for warnings, routing escalation, or execution denial policies.
6. Implementation Notes
- Lazy evaluation:
- Serialization compatibility:
For heavy Material, apply on-demand loading strategies to control runtime cost.
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
architecture/interfaces/contracts/IUnifiedContextContract.md