Skip to main content

IdSpaceKind

Enum IdSpaceKind 

Source
pub enum IdSpaceKind {
    Logical,
    Content,
    Passage,
}
Expand description

A single structured search hit (G1 / AC-057a-clean).

Both retrieval branches emit this shape. id is a typed IdSpace — the permanent caller-facing identity since C-2 (0.8.19 / TC-8), NOT the interim write_cursor: u64 the pre-0.8.19 releases carried and NOT an interim carrier awaiting a later swap. The positional write_cursor field below survives as engine-internal book-keeping and the SDK bindings do not surface it. See the field docs on SearchHit::id / IdSpace. score is the G9 RRF-fused relevance (Σ 1/(RRF_K + rank) over the branches that surfaced this body; higher = more relevant), optionally recency-reweighted when the dedicated recency flag is on. Raw vec_distance_l2 and bm25() are fused on rank, never compared raw (they are not comparable). branch tags which retrieval branch produced the representative hit (vector-first when a body is surfaced by both).

source_id (G0 Phase-2 / BLOCK-2; generalised by TC-31 in 0.8.20 Slice 10a) carries the source-document provenance of a hit — the identifier Engine::erase_source consumes. It is populated on every hit path:

  • Node hits (text/BM25F, vector, and the pre-step-12 legacy text fallback) carry the node’s own canonical_nodes.source_id.
  • Edge hits (edge-FTS from search_index_edges, and edge-fact hits hydrated by the vector arm) carry the edge’s own canonical_edges.source_id.
  • GraphArm hits carry the traversed edge’s source_id (the session the fact-edge was extracted from) — unchanged by TC-31 — enabling doc_id_of to resolve a graph-reached entity back to a gold session id.

Before TC-31 only the GraphArm branch populated this, which left erase_source shipping with its argument unreachable from a text or vector hit (0.8.19 also stopped surfacing write_cursor to the SDKs, removing the only fallback route). It stays Option<String>: a row written before 0.8.20, or a GOVERNED row deliberately spared by the step-21 backfill under the TC-11 pin, legitimately carries NULL at rest and must read back as None rather than a fabricated value.

The field never participates in ranking, so result order and scores are unaffected.

C-2 (0.8.19 / OPP-12 record-lifecycle Phase-1, TC-8) — the id-space of a SearchHit::id. A closed, typed enum (NOT a magic-prefixed string) — the C-2 binding ratified in the OPP-12 protocol:

  • Logical"l:", a governed/canonical node keyed by its logical_id (the only lifecycle-addressable space).
  • Content"h:", a doc-seeded/anonymous node keyed by a content hash of its body (the dominant corpus hit class).
  • Passage"p:", a synthetic rerank_passages hit keyed by the caller-supplied passage ordinal.

Variants§

§

Logical

"l:" — governed/canonical node (its logical_id).

§

Content

"h:" — doc-seeded/anonymous node (content hash of the body).

§

Passage

"p:" — synthetic rerank passage (caller-supplied ordinal).

Implementations§

Source§

impl IdSpaceKind

Source

pub fn prefix(self) -> &'static str

The two-char id-space prefix ("l:" / "h:" / "p:") used in the prefixed string form. Byte-identical to the pre-swap derive_stable_id tags so real-gold keying stays a no-op.

Source

pub fn as_str(self) -> &'static str

The lowercase discriminant ("logical" / "content" / "passage") surfaced through the SDK bindings as the IdSpace.space field (mirrors how SoftFallbackBranch is surfaced as a branch string).

Trait Implementations§

Source§

impl Clone for IdSpaceKind

Source§

fn clone(&self) -> IdSpaceKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for IdSpaceKind

Source§

impl Debug for IdSpaceKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for IdSpaceKind

Source§

impl Hash for IdSpaceKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for IdSpaceKind

Source§

fn eq(&self, other: &IdSpaceKind) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for IdSpaceKind

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.