Expand description
ECC RVF segment type definitions (WEFT-508).
Upstream rvf-types::SegmentType covers vector/index/federation codes
(0x00–0x36). WeftOS ECC structures need domain-local discriminants
that do not collide with:
- rvf-types (
≤ 0x36) - context-router research reservations (
0x40–0x42)
We allocate the 0x50–0x5F block for ECC persistence payloads.
Each variant wraps a CBOR (preferred) or JSON body; this module defines
the type table + encode/decode helpers. Full migration of on-disk chain
blobs onto these segments is follow-up work (see migration notes).
§Segment table
| Code | Name | Payload |
|---|---|---|
0x50 | CausalEdge | CausalEdge |
0x51 | CausalNode | CausalNode |
0x52 | Impulse | Impulse |
0x53 | CalibrationProfile | JSON profile blob (calibration / democritus) |
0x54 | CrossRef | CrossRef |
0x55 | SpectralCheckpoint | λ₂ / eigenvalue snapshot |
0x56 | CausalGraphSnap | Whole-graph snapshot envelope |
§Migration plan
- Today: ad-hoc JSON / ExoChain CBOR events remain authoritative.
- Writers may dual-write ECC segments alongside chain events.
- Readers prefer ECC segments when present; fall back to legacy.
- After one release cycle, stop writing legacy-only forms for new events.
Structs§
- Calibration
Profile Segment - Calibration profile payload (opaque JSON-friendly map for now).
- EccSegment
- Framed ECC segment: type byte + codec + payload bytes.
- Spectral
Checkpoint - Spectral checkpoint payload (λ₂ snapshot).
Enums§
- EccSegment
Codec - Codec for ECC segment payloads.
- EccSegment
Error - Errors for ECC segment codec.
- EccSegment
Type - WeftOS ECC segment discriminants (RVF
typebyte, domain0x50–0x5F).
Functions§
- decode_
ecc_ segment - Decode payload bytes into
T. - encode_
ecc_ segment - Encode a serializable payload as an
EccSegment. - segment_
from_ wire - Parse wire bytes produced by
segment_to_wire. - segment_
to_ wire - Wire bytes:
[type:u8][codec:u8][payload...].