Japanese version: IContextCollection (インターフェース仕様)
IContextCollection (Interface Specification)
1. Responsibility Boundary
IContextCollection is the boundary interface for managing runtime context fragments and enforcing phase-specific buffer boundaries during reasoning cycles.
- Role:
- Non-role:
Manage categorized ContextFragment data and provide Orchestration/Material/Expression/History buffers.
Persistence, external retrieval, and storage integration are out of scope. This interface focuses on in-cycle working memory.
2. Contract Signature
namespace AIKernel.Abstractions.Context;\n\npublic interface IContextCollection\n{\n IEnumerable<ContextFragment> GetAll();\n IEnumerable<ContextFragment> GetByCategory(ContextCategory category);\n OrchestrationBuffer GetOrchestrationBuffer();\n ExpressionBuffer GetExpressionBuffer();\n MaterialBuffer GetMaterialBuffer();\n HistoryBuffer GetHistoryBuffer();\n}
3. Related Use Cases
UC-06Three-layer buffer boundary (Context Isolation):UC-02Structure phase execution:
Maintains separation of instruction/material/expression to reduce attention pollution.
Supplies inputs required by IThoughtProcess logic construction.
4. Governance & Determinism
- Immutability in-cycle:
- Deterministic ordering:
- Fail-Closed:
Buffer content should be treated as immutable within a single reasoning cycle.
GetAll() / GetByCategory() should return stable ordering for identical inputs.
Missing mandatory categories should terminate on the deny side instead of allowing partial execution.
5. Implementation Notes
- Preserve boundaries:
- Memory efficiency:
Keep explicit buffer demarcation conventions during rendering to avoid category bleed.
Prefer reference-based handling for large material payloads and minimize deep copies.
Changelog
- v0.0.0 / v0.0.0.0: Initial draft
- v0.0.1 (2026-05-06): Version upgrade aligned with documentation guidelines
architecture/interfaces/context/IContextCollection.md