pub struct Chunk {
pub id: Ulid,
pub scope: Scope,
pub episode_id: Ulid,
pub text: String,
pub tokens: u32,
pub offset: u32,
pub heading_path: Vec<String>,
pub overlap_tail: String,
pub embedding: Option<Vec<f32>>,
pub parent_id: Option<Ulid>,
pub bt: BiTemporal,
}Fields§
§id: Ulid§scope: ScopeRFC 0001 — partition key, inherited from the parent Episode.
episode_id: Ulid§text: String§tokens: u32§offset: u32§heading_path: Vec<String>§overlap_tail: String§embedding: Option<Vec<f32>>The 768-d embedding vector.
§W3 embedding double-store fix (moon-v051-perf-exploit)
skip_serializing is deliberate: the KV KvPut JSON payload used to
carry this as a raw JSON float array — ~80% of the document’s bytes
and a straight duplicate of the binary vector Moon’s FT index
already stores. Nothing
on the read path (lunaris-retrieve::hydrate, the tree.rs RAPTOR
descent, the detail.rs inspector route) reads .embedding back off
a KV-deserialized primitive — verified via find_referencing_symbols
before this cut.
#[serde(default)] keeps deserialization tolerant of BOTH shapes:
legacy payloads written before this fix (field present) still
populate Some(..); payloads written after it (field absent)
deserialize to None. This is a one-way, additive-compatible
serialize-side change — never a breaking wire format change.
parent_id: Option<Ulid>Optional link to the nearest parent TocNode in the document tree.
None in Phase 27 (field + migration + serde-compat delivered here;
full parent wiring — setting a non-None value — lands in Phase 29).
Pre-existing rows serialised without this field deserialise to None
via #[serde(default)] (STRUCT-03 serde back-compat contract).
Travels in the existing JSONB KvPut payload — no DDL, no index change.
(Through 0.6.x the Postgres backend carried it as
chunks.parent_id BYTEA NULL; that backend was removed in 0.7.0.)
bt: BiTemporalImplementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Chunk
impl<'de> Deserialize<'de> for Chunk
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Chunk, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Chunk, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Chunk
impl Serialize for Chunk
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Chunk
Auto Trait Implementations§
impl Freeze for Chunk
impl RefUnwindSafe for Chunk
impl Send for Chunk
impl Sync for Chunk
impl Unpin for Chunk
impl UnsafeUnpin for Chunk
impl UnwindSafe for Chunk
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more