feat(tests): the conformance suite's sqlite column — the durable-schedule SQL-backed column green (wave 3)

- The first SQL-backed column: the default-build production shape
  (kv = sqlite + large = local, feature sqlite default-on) runs the
  form-independent reference rows verbatim (INV-1, INV-6, the
  NoLivenessSources/ProtectFailed abort shapes, the kv-only rejection
  row against kv-only(sqlite)) and grows the durable-schedule sweep
  rows — exact counts asserted relative to the staged schedule
  (ADR-012 §6.7): two-sweep counts over the full protection set, the
  race across the window delay (a re-put landing during the window
  survives the executing sweep), the holder-stages-only lease shape,
  INV-5 through durable-schedule outcomes, and the schedule-relative
  INV-2/INV-3 readings
- Dispatch rows mirror the local column's family with the placement
  oracle adapted by medium: the sqlite file's pool/window rows vs the
  root's committed files; virgin-store reads as no-ops on a fresh file
  (the no-tables-yet tolerance engine-instrumented, this row its
  facade form)
- Factories: dual-tier sqlite+local and kv-only(sqlite), instance-
  tracked temp sites (fresh sqlite file + private root per open;
  idempotent panicking-row-safe teardown), the column-tuned threshold
  and the test window-delay tuning (Duration::ZERO — execute-on-next-
  sweep); the module is cfg(feature = "sqlite"), default-on — the
  column runs in every default cargo test, server-less, never skips
- Shared fixtures moved to rows.rs (committed_file_count,
  staging_file_count, slice_digest, LatchProtect pub(crate)) so the
  columns share them without the mem gate
- README: the schedule-relative reading for SQL-backed columns
  recorded (citing ADR-012 §6.7), the sqlite rows table inventory,
  Current state (three columns)

Verification: cargo test (default) green — 69 lib + 19 conformance +
3 git-interop; cargo test --features mem green (124 lib + 54
conformance); cargo check --all-features --tests green; cargo clippy
--all-targets -- -D warnings green; cargo fmt --check green.
This commit is contained in:
glm-5.3-flash committed 2026-10-12 05:14:58 +00:00
1 parent fb8326c4d5
commit 3f8e8158a7
6 files changed
+2049 -67

No files matched your search

+77 -2
View File
@@ -1,7 +1,7 @@
---
id: suite-column-sqlite
name: Conformance suite — the sqlite column (the first SQL-backed column)
status: pending
status: completed
depends_on: [store-sweep-durable-window]
scope: moderate
risk: medium
@@ -103,6 +103,81 @@ the default build (feature `sqlite` is default-on).
> To be filled by implementation agent
The column as it landed (`tests/conformance/sqlite_column.rs`, 17 tests):
- **Factories**: `dual-tier sqlite+local` (the default-build
production shape, `DualTierSqliteFactory`) and `kv-only(sqlite)`
(`KvOnlySqliteFactory`), each instance-tracking the temp sites it
vends (a private temp directory per open holding `pool.db` and the
local root; teardown `remove_dir_all`s it — idempotent, NotFound
tolerated, panicking-row-safe, one runner per instance), with the
column-declared threshold (1024) and the **test tuning of the
window delay (`Duration::ZERO` — execute-on-next-sweep)**. The
module is `#[cfg(feature = "sqlite")]` — **default-on**, so the
column runs in every default `cargo test`.
- **The medium oracle distinguishes by medium**: the dual-tier rows
count the sqlite file's `blobs` rows (the kv tier) vs the local
root's committed files (the large tier), plus `gc_window` rows (the
durable schedule observer) — via the test's own independent
connection. The shared helpers (`committed_file_count`,
`staging_file_count`, `slice_digest`, `LatchProtect`) moved to
`rows.rs` (`pub(crate)`, the columns' shared fixtures) so the
sqlite column reuses them without the mem gate.
- **Mirrored verbatim** (form-independent, from `rows.rs`): INV-1
round-trips, INV-6 stat discipline, the `NoLivenessSources`/
`ProtectFailed` abort shapes, and the kv-only rejection row
(against `kv-only(sqlite)`; unchanged, threshold-agnostic by
discovery).
- **Durable-schedule rows** (the column's own, concrete-factory,
ADR-stamped, traced): INV-2 dedup and INV-3 stage hygiene with
counts read against the staged schedule (the sweep-counting rows'
amendment), the two-sweep exact-count row over the full protection
set (both tiers, the window observed), the race across the window
delay (a re-put landing during the window survives the executing
sweep via execution-time re-arbitration; the unpinned twin
deletes; both put paths in-body over both tiers), the
holder-stages-only lease shape (the reference `SweeperLock` row's
schedule-relative form), and INV-5 list correctness through
durable-schedule outcomes.
- **Dispatch rows** mirror the local column's family (pure-function
routing, threshold boundaries at the tuned + shipped-default
thresholds, fall-through per op) with the placement oracle adapted
by medium. **Virgin-store row**: reads are no-ops on a fresh file
(pool, window, and committed tree all empty); the no-tables-yet
tolerance itself is engine-instrumented (src/sqlite.rs — the
constructor always ensures the schema), this row being the facade
form. **Structural factory tests**: fresh isolated opens
(distinct private sqlite files and roots, medium-observable) and
teardown-against-a-panicking-row (files really removed).
- **README amendments**: §The schedule-relative reading for
SQL-backed columns (the mirror convention's amendment, citing
ADR-012 §6.7 — staged-this-sweep / executed-next-sweep, which rows
carry it, which mirror verbatim), the sqlite rows table in §Columns
beyond the reference set, and Current state (three columns; the
default-build column). main.rs's module doc names the column.
## Summary
> To be filled on completion
> To be filled on completion
The sqlite column — the suite's first SQL-backed column — is green:
the default-build production shape (`kv = sqlite` + `large = local`,
feature `sqlite` default-on) runs the form-independent reference rows
verbatim against its factories, grows the durable-schedule sweep rows
whose exact counts are asserted relative to the staged schedule
(ADR-012 §6.7: staged this sweep, executed by the next — two-sweep
counts over the full protection set, the race across the window delay,
the holder-stages-only lease shape, INV-5 through outcomes, and the
schedule-relative INV-2/INV-3 readings), and the dispatch rows with
the medium oracle distinguishing the sqlite file's rows from the
root's committed files. Every row ADR-stamped and traced; the
schedule-relative INV-4/INV-5 reading is recorded in the README (the
mirror convention's amendment); factory isolation (fresh site per
open) and idempotent panicking-row-safe teardown hold structurally.
The column never skips and runs in the default build (17 tests).
Verification: `cargo test` green (default: 69 lib + 19 conformance +
3 git-interop), `cargo test --features mem` green (124 lib + 54
conformance), `cargo check --all-features --tests` green,
`cargo clippy --all-targets -- -D warnings` green, `cargo fmt --check`
green (fmt applied).