Expand description
Unified Output Format Semantics (Task 3)
This module provides a single taxonomy for output formats with:
- Clear layer boundaries (WireFormat vs ContextFormat)
- No lossy coercions (round-trip property preserved)
- Explicit conversion with error handling
§Problem Solved
Previously, there were two competing format universes:
- Client: Soch | Json | Columnar
- Context: Soch | Json | Markdown | Text (with Text -> Soch coercion)
This created semantic drift and violated the round-trip property:
decode(encode(x)) = x should hold for all formats.
§Solution
Separate format enums with explicit conversions:
WireFormat: For query results sent to clientsContextFormat: For LLM context packaging
Conversions between them use TryFrom and can fail, making
incompatibilities explicit rather than silent.
Structs§
- Format
Capabilities - Capabilities of a format
- Format
Conversion Error - Error when format conversion fails
Enums§
- Canonical
Format - Canonical format identifier for AST nodes.
- Context
Format - Output format for LLM context packaging.
- Wire
Format - Output format for query results sent to clients.