#[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
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
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).
Implementations§
Source§impl TableInstanceRisk
impl TableInstanceRisk
Sourcepub fn note(&self) -> String
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.
Sourcepub fn token(&self) -> String
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
impl Clone for TableInstanceRisk
Source§fn clone(&self) -> TableInstanceRisk
fn clone(&self) -> TableInstanceRisk
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more