Skip to main content

TableInstanceRisk

Enum TableInstanceRisk 

Source
#[non_exhaustive]
pub enum TableInstanceRisk { None, RowidExceedsAutoincHighwater { table: String, rowid: i64, seq: i64, }, SidecarSchemaChanged { table: String, }, }
Expand description

A non-overclaiming diagnostic HINT about a recovered record’s relationship to the instance of the table it was attributed to — ORTHOGONAL to Attribution (it never changes the tier, the routing, or the table claim).

Detector A (docs/design/drop-recreate-attribution.md): when a record attributed Known(T) has a rowid exceeding T’s AUTOINCREMENT sqlite_sequence high-water mark, that is consistent with residue from a prior incarnation of T (a drop-recreate reset sqlite_sequence) — but it is not proof: the Codex review confirmed rowid > seq is equally reachable by an UPDATE of the rowid, a manual sqlite_sequence edit, or a current-instance deletion. So the flag is surfaced as a hint that names its evidence, and the examiner draws the conclusion. The note never asserts “predecessor”.

#[non_exhaustive] so the documented follow-up SidecarSchemaChanged variant (Detector B — a sidecar -wal/-journal DDL boundary) can be added without a breaking change.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

None

No instance-provenance hint applies to this record.

§

RowidExceedsAutoincHighwater

The record was attributed Known(table), table is AUTOINCREMENT, has a sqlite_sequence entry seq, and the record’s rowid exceeds it. The current instance never assigned a rowid above seq via INSERT, so this is consistent with prior-incarnation residue — and equally with an UPDATE to the rowid, a sqlite_sequence edit, or a current-instance deletion.

Fields

§table: String

The live table the record was attributed to.

§rowid: i64

The record’s recovered rowid (the value exceeding the high-water mark).

§seq: i64

The table’s AUTOINCREMENT high-water mark (sqlite_sequence.seq).

§

SidecarSchemaChanged

Detector B (docs/design/drop-recreate-attribution.md): the record was attributed Known(table), a -wal/-journal sidecar is in play, and the sidecar’s PRIOR sqlite_master for table is absent OR carries a different CREATE SQL text than the current schema — an UNAMBIGUOUS table-level schema change within the captured window. It is consistent with a CREATE/ALTER or a drop+recreate of table, so residue attributed to table may predate the current schema. It is table-level, NOT row-level provenance, and deliberately does NOT fire on a rootpage move with identical CREATE SQL (a VACUUM), a schema-cookie advance alone, or a same-schema drop+recreate (indistinguishable from a benign page move).

Fields

§table: String

The live table whose sidecar prior schema differs from the current.

Implementations§

Source§

impl TableInstanceRisk

Source

pub fn note(&self) -> String

A human, evidence-bearing note for the examiner — or "" for TableInstanceRisk::None. The wording deliberately states what the observation is consistent with and lists the equally-consistent benign explanations; it never asserts the row is a predecessor.

Source

pub fn token(&self) -> String

A short, stable provenance token for column/field output (null-like for TableInstanceRisk::None → empty string), carrying the evidence inline: rowid_exceeds_autoinc_highwater(r=…,seq=…).

Trait Implementations§

Source§

impl Clone for TableInstanceRisk

Source§

fn clone(&self) -> TableInstanceRisk

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 Debug for TableInstanceRisk

Source§

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

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

impl Eq for TableInstanceRisk

Source§

impl PartialEq for TableInstanceRisk

Source§

fn eq(&self, other: &TableInstanceRisk) -> 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 TableInstanceRisk

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<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.