For Japanese version, see IRomCanonicalizer-jp.md.
IRomCanonicalizer (ROM Canonicalization Interface Specification)
1. Responsibility Boundary
IRomCanonicalizer transforms heterogeneous ROM representations into meaning-preserving canonical form, enabling deterministic comparison, signing, and verification.
- Role:
- Non-role:
Normalize newline/order/whitespace/reference representation so semantically equal inputs produce identical canonical outputs.
ROM execution and physical I/O are out of scope; this contract focuses on canonical transformation only.
2. Contract Signature
namespace AIKernel.Abstractions.Rom;\n\npublic interface IRomCanonicalizer\n{\n CanonicalizedRomDto Canonicalize(IRomDocument document);\n\n Task<CanonicalizedRomDto> CanonicalizeAsync(IRomDocument document, CancellationToken cancellationToken = default);\n}
3. Related Use Cases
UC-13Runtime signature verification and governance:UC-20Deterministic replay:UC-01ROM loading and parsing:
Removes formatting drift from signature validation semantics.
Strengthens semantic-equivalence checks against runtime ROM artifacts.
Stabilizes structure before downstream resolution/execution.
4. Governance & Determinism
- Deterministic stability:
- Semantic preservation:
- Hash invariance foundation:
Semantically identical inputs must yield identical CanonicalizedRomDto regardless of platform/runtime.
Canonicalization must not alter intended ROM semantics.
Canonical outputs underpin signing/verification pipelines and require strict compatibility discipline.
5. Exception Contract
This interface does not hard-code exception types. Implementations should surface clear categories for:
- Syntax/shape failures:
- Unsupported versions:
ROM cannot be canonicalized due to malformed structure.
ROM schema/version not supported by current canonicalizer.
6. Implementation Notes
- Metadata normalization:
- Extensibility:
- Locale discipline:
Normalize front matter and key ordering policies explicitly.
Preserve canonicalization consistency for future multimodal-linked assets.
Define language/character normalization policies to preserve cross-locale replay stability.
Changelog
- v0.0.0 / v0.0.0.0: Initial draft
- v0.0.1 (2026-05-06): Version upgrade aligned with documentation guidelines
architecture/interfaces/rom/IRomCanonicalizer.md