Japanese version: IExpressionContract (契約仕様)
IExpressionContract (Contract Specification)
1. Responsibility Boundary
IExpressionContract defines how finalized logic is expressed, while preserving strict separation between reasoning and expression layers.
- Role:
- Non-role:
Provide expression-time conventions such as style, examples, templates, and analogies.
It must not generate or alter reasoning logic. Expression metadata must not leak into reasoning inputs. Isolation checks and application gates belong to service interfaces such as IExpressionIsolationValidator and IExpressionApplicationGate.
2. Contract Signature
using AIKernel.Dtos.Context;\n\nnamespace AIKernel.Contracts;\n\n/// <summary>\n/// 表現(Expression)契約を定義します。\n/// 推論が完全に終了した後にのみ適用される、出力表現層の契約です。\n/// \n/// 参照: 2.CONTEXT_ISOLATION_SPEC.jp.md\n/// </summary>\npublic interface IExpressionContract\n{\n /// <summary>\n /// 表現層のコンテキストを取得します。\n /// </summary>\n ExpressionContextDto GetContext();\n\n /// <summary>\n /// 出力の文体を取得します。\n /// </summary>\n string? GetStyle();\n\n /// <summary>\n /// 説明用の例を取得します。\n /// 注意: これらは推論には混入しません。\n /// </summary>\n IReadOnlyList<string> GetExamples();\n\n /// <summary>\n /// 説明テンプレートを取得します。\n /// </summary>\n string? GetDescriptionTemplate();\n\n /// <summary>\n /// 比喩・類推を取得します。\n /// </summary>\n IReadOnlyList<string> GetAnalogies();\n}
3. Related Use Cases
UC-04Generation and output polishing:UC-06Three-layer buffer boundary:
Acts as the policy source used by IOutputPolisher during final rendering.
Enforces separation between reasoning context and expression context.
4. Governance & Determinism
- Isolation enforcement:
- Post-inference application:
- Deterministic rendering policy:
IExpressionIsolationValidator.ValidateIsolation() is the gate for detecting expression-data leakage into reasoning context.
IExpressionApplicationGate.CanApplyAfterInference() should only allow application after Structure phase completion.
The same inputs should yield the same expression behavior under this contract.
5. Implementation Notes
- Multilingual operation:
- Auditability:
GetStyle(), GetExamples(), and GetAnalogies() should follow consistent locale-selection rules.
Keep template/example application traceable so output differences remain explainable.
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/IExpressionContract.md