docs(tasks): decompose wave 3 — the sqlite kv engine, the durable delete window, the first SQL-backed column

Six tasks against the wave-2 contract surface as reviewed (no
amendments from the gate):

- engine-sqlite: the default kv engine — WAL + synchronous=NORMAL,
  prepared statements, the indexed size column probe (B5's row shape),
  has-as-EXISTS, virgin-store no-tables-yet tolerance, spawn_blocking
  discipline
- engine-sqlite-window: the engine-state seam's window family only
  (ADR-012 §5's reduction — gc_window, stage/take; no pin rows, no
  sweep-lock body)
- store-sqlite-construction: KvEngine::Sqlite slots in, the
  dual-tier/kv-only constructors with the constructor-tunable window
  delay (default 5 min), ensure_gc_schema at construction, the
  one-window-host posture
- store-sweep-durable-window: the sweep's SQL-backed form — overdue
  rows execute with re-arbitration before/alongside marking, candidates
  stage at mark_end + window, counts exact relative to the schedule
  (ADR-012 §6.7); the inline form preserved verbatim
- suite-column-sqlite: the first SQL-backed column, server-less —
  form-independent reference rows mirror directly; the sweep rows are
  schedule-relative (the recorded INV-4/5 mirror amendment)
- review-wave-3: the engine-wave gate (engine-vs-contract conformance)

Verification: dependency graph validated (all ids resolve, no cycles,
topological order clean); docs-only change.

Refs: docs/plans/implementation.md §Wave 3
This commit is contained in:
glm-5.3-flash committed 2026-10-11 23:48:23 +00:00
1 parent 79cf1f0220
commit 758ccfb359
7 files changed
+606 -2

No files matched your search

+108
View File
@@ -0,0 +1,108 @@
---
id: suite-column-sqlite
name: Conformance suite — the sqlite column (the first SQL-backed column)
status: pending
depends_on: [store-sweep-durable-window]
scope: moderate
risk: medium
impact: phase
level: implementation
tags: [wave-3, suite, sqlite]
---
## Description
Grow the **sqlite column** — the suite's first SQL-backed column,
server-less (never skips; README §SKIP posture: server-less engines'
columns must always be green in every environment). The column runs in
the default build (feature `sqlite` is default-on).
- **Factories** (`tests/conformance/sqlite_column.rs`):
- dual-tier `kv = sqlite + large = local` at a column-declared
threshold and the **test tuning of the window delay (`0` —
execute-on-next-sweep)**;
- `kv-only(sqlite)` at a column-declared threshold (the rejection
row's host; threshold materializable per the README's
configuration contract).
Fresh isolated sqlite file per `open()` (temp file), idempotent
teardown (remove the file), panicking-row-safe — the local column's
instance-tracks-its-own-root pattern.
- **Mirror the form-independent reference rows** (README §The
reference row set): INV-1 round-trips (content matrix × both put
paths, in-body), INV-2 dedup (same-path + cross-path legs), INV-3
stage hygiene (the degenerate kv stage form via the injectable
failure modes — mid-stream `Io`, declared-len `Verification`), INV-6
stat discipline, and the kv-only rejection row (threshold-agnostic
by discovery, unchanged).
- **The sweep rows are schedule-relative on this column.** The
reference set's single-sweep exact-count rows are the inline-form
host's (mem); the durable form's semantics differ (staged this
sweep, executed by the next — ADR-012 §6.7). The sqlite column grows
its own **durable-schedule rows** (concrete-factory per README
§Columns beyond the reference set, ADR-stamped, traced):
- exact counts across two sweeps (sweep 1 stages N, deletes nothing;
sweep 2 executes exactly N — `deleted + cancelled == N` against
the staged set) over the full protection set;
- the sweep-vs-put race across the window delay (a put landing
during the window survives the executing sweep; the unpinned twin
deletes);
- the abort shapes (`NoLivenessSources`/`ProtectFailed`/
`SweeperLock` — form-independent, abort before staging; these
mirror directly);
- INV-5 list correctness through durable-schedule outcomes (exact
counts, never list comparison).
- **The dual-tier dispatch rows** mirror the local column's family
(pure-function routing, threshold boundaries, fall-through per op)
with the placement oracle adapted: both tiers are on disk now — kv
entries live in the sqlite file, large entries under the local root;
the oracle distinguishes by medium (the sqlite file vs the root's
committed files).
- **Virgin-store rows**: reads are no-ops on a fresh file; the
no-tables-yet tolerance form.
- **README amendments** (the convention's normative test-side home):
- the **schedule-relative reading of INV-4/INV-5 for SQL-backed
columns** — the durable form's exact counts are asserted relative
to the staged schedule (ADR-012 §6.7); the reference set's
single-sweep rows are the inline-form host's, and SQL-backed
columns run the durable-schedule equivalents (the mirror
convention's recorded amendment);
- the column inventory (§Columns beyond the reference set grows the
sqlite rows table);
- current state (three columns; the default-build column).
- **Structural factory tests** (the mem column's pattern): factory
isolation (fresh file per open, nothing shared) and
teardown-against-a-panicking-row.
## Acceptance Criteria
- [ ] The sqlite column green server-less: the mirrored
form-independent reference rows + the durable-schedule sweep
rows + the dispatch rows + the virgin-store rows, every row
ADR-stamped and traceable to the backlog
- [ ] The schedule-relative INV-4/INV-5 reading recorded in README
(the mirror convention's amendment, citing ADR-012 §6.7)
- [ ] Factory isolation + idempotent teardown hold (fresh file per
open; teardown safe against a panicking row), structurally
exercised
- [ ] `cargo test` (default) green — the column runs in the default
build; `cargo clippy --all-targets -- -D warnings` and
`cargo fmt --check` green
## References
- tests/conformance/README.md (the conventions this grows against;
§SKIP posture, §Columns beyond the reference set)
- tests/conformance/rows.rs (the reference row set being mirrored)
- tests/conformance/local_column.rs (the dual-tier column pattern)
- tests/conformance/backlog.rs (INV-1…7 entries)
- docs/architecture/store-api.md (§Invariants — the test gate)
- docs/architecture/decisions/012-pre-decomposition-consistency-rulings.md §6.7 (the schedule the sweep rows assert against)
- docs/architecture/decisions/011-vocabulary-tiers-engines-and-fleet-state.md §2 (mem's reference role; INV-7)
## Notes
> To be filled by implementation agent
## Summary
> To be filled on completion