Files
alkblobs/tasks/feature-graph-verification.md
T
glm-5.3-flash 157f10f3f3 fix(store): the no-kv-feature build shape — the feature-graph verification pass (wave 12)
The wave-12 coherent feature-matrix verification pass: every engine-
feature combination row of the ADR-013 §4 graph compiles green under
clippy --all-targets -D warnings, and the test rows run green against
the live pglo-poc harness.

The pass caught one broken shape — the pass's purpose: the no-
kv-feature builds (`--no-default-features --features pg-lo` and
`--no-default-features`) never compiled since mem joined the default
set. Root cause: with mem/sqlite/postgres all off, KvEngine and
KvCursor are zero-variant enums, and rustc rejects an empty match over
a reference to a variant-less enum (references are treated as
inhabited), so all 11 `&self` kv dispatch sites were unexhaustive
(E0004), cascading into unused-import/variable and dead-code
diagnostics across construct.rs, sweep.rs, engines.rs, pg_lo, and
pg_common.

The fix (compile-only posture, no new ADR): a build whose constructor
set is empty cannot construct a Store, so each kv dispatch gained one
cfg-gated wildcard arm (`not(any(mem, sqlite, postgres))` `_ =>`
Err(no_kv_engine())) — a named error, never a panic — plus companion
cfg corrections: construct.rs import gates tightened to their true
usage shapes, impl-level cfg_attr allows for the empty-build dead
code, and the pg-lo/pg-common construction entry points marked dead
exactly where no kv pairing exists, each with a consumer comment.

Verification (full matrix in tasks/feature-graph-verification.md
Summary):
- clippy --all-targets -D warnings green on: default, --all-features,
  postgres, pg-lo, postgres,pg-lo, mem, no-features, mem,ops (plus
  adjacent mem,pg-lo and sqlite-only sanity shapes)
- cargo test green: default (149+54+4) and --all-features (328+125+4)
  against the live pglo-poc harness (pg columns ran, not skipped)
- fuzz corpus-replay gate green (7 passed); cargo fmt --check clean;
  cargo doc --no-deps clean
2026-10-16 09:02:55 +00:00

7.8 KiB

id, name, status, depends_on, scope, risk, impact, level
id name status depends_on scope risk impact level
feature-graph-verification The coherent feature-matrix verification pass completed
moderate medium phase implementation

Description

The plan's wave-12 feature-graph verification: every coherent engine-feature combination compiles and passes its gates. ADR-013 §4 declares the graph (engine features pull their own driver clusters; tiers are constructor composition, not features); this pass proves the declared matrix is actually green.

The matrix to verify (each: cargo clippy --all-targets -- -D warnings at minimum; cargo test where the shape carries tests):

  • default (mem + sqlite) — the full test run; the contract-reference column plus local's and sqlite's.
  • --all-features — full test run; pg columns skip cleanly server-less; the live-harness run (ALKBLOBS_PG_* per AGENTS.md, the pglo-poc container on :15432) is the pg columns' acceptance if the container is up.
  • pg-pure — --no-default-features --features postgres (kv=postgres, large=local; ADR-013 §4's named supported non-default configuration).
  • pg-lo without postgres — --no-default-features --features pg-lo (the ADR-010 §1 discipline: the shared driver cluster pulled by pg-lo itself).
  • pg-pure + pg-lo — --no-default-features --features postgres,pg-lo (the fleet-canonical shape's build).
  • mem-only — --no-default-features --features mem.
  • local-only — --no-default-features (the ungated engine; the leanest build).
  • ops over the lean base — --no-default-features --features mem,ops (ops is a facade consumer; prove it needs no SQL engine).

Watch for the classic failures this pass exists to catch: a #[cfg] gated on the wrong feature pair, an item compiled only when two features co-occur, a test module referencing a type its feature doesn't pull. Any broken combination gets fixed (the fix is the point of the pass) or, if it exposes a real graph question, named for an ADR — neither is expected; waves 1-8 ran the split-gate matrix already.

Record the matrix and per-combo results in the task Summary — this is the record the wave-12 review re-runs.

Acceptance Criteria

  • Every matrix row: cargo clippy --all-targets -- -D warnings green (plus cargo clippy --all-features --all-targets -- -D warnings per the AGENTS block)
  • cargo test green on default and --all-features (pg columns skip cleanly server-less; live-harness acceptance if the container is up)
  • cargo test --manifest-path fuzz/shared/Cargo.toml green (the corpus-replay gate rides the same release)
  • Any broken combination fixed or named for an ADR (expected: none)
  • Matrix + per-combo results recorded in the Summary

References

  • docs/architecture/decisions/013-family-composition-reactive-boundary-and-feature-graph.md §4 (the declared graph and the pg-pure posture)
  • AGENTS.md (the feature-aware verification matrix; the live-harness env block)
  • docs/plans/implementation.md wave 12 (this pass's charter)

Notes

The pass caught exactly the classic failure it exists to catch: two kv-adjacent rows were broken — --no-default-features --features pg-lo and --no-default-features (local-only) — both for the same structural reason, now fixed; the other six rows plus the two AGENTS gate rows were already green.

The failure: with no kv-tier feature enabled (mem/sqlite/postgres all off — mem left the default set only on 2026-10-15, which is why local-only previously never surfaced), KvEngine and KvCursor compile with zero variants (rustc: E0004, "references are always considered inhabited" — an empty match over &ZeroVariant is rejected, so every &self kv dispatch needs a wildcard arm even for an empty enum). The empty-build dispatches were unexhaustive at 11 sites (engines.rs, construct.rs, sweep.rs), with a cascade of unused-import, unused-variable, dead-variant, and dead pg-lo entry-point diagnostics once the dispatches compiled.

The fix (compile-only posture, no new ADR — it states the graph as declared rather than changing it): in a no-kv feature build, no constructor exists (every constructor is kv-engine-gated), so Store is unconstructible and the kv dispatch is unreachable by construction. Each kv match gained one cfg-gated wildcard arm (#[cfg(not(any(mem, sqlite, postgres)))] _ => Err(no_kv_engine()))), closing the dispatch with a named error instead of a panic (the library no-panic convention); no_kv_engine lives in engines.rs with the design-point doc. Companion cfg corrections: import gates tightened to their true usage shapes (construct.rs Local*/PgLo* test-support imports, LocalBackend, PgLoBackend), impl-level cfg_attr allows for the empty-build dead code (KvEngine/KvCursor unused params; LargeEngine/AnyCursor variants), and the pg-lo/pg-common construction entry points (PgLoBackend::new, bootstrap_ddl, build_pool) marked dead exactly in builds where no kv pairing exists (pg-lo without mem/postgres) — each with a consumer comment stating the graph fact the allow encodes.

Nothing was named for an ADR: the fix's semantics are "a build with no kv-tier feature is compile-only", which is what ADR-013 §4's graph already implies (tiers are constructor composition; a build whose constructor set is empty constructs nothing).

Adjoining shapes sanity-checked beyond the matrix rows: mem,pg-lo (the constructible pg-lo pair) and sqlite-only.

Summary

The wave-12 feature-graph matrix, all rows green (run 2026-10-16, live pglo-poc harness up on :15432 — the pg columns ran for real):

# Configuration Gate Result
1 default (mem+sqlite) clippy --all-targets -D warnings green
2 default (mem+sqlite) cargo test (live pg env exported) green — 149 lib + 54 conformance + 4 git-interop, 0 failed
3 --all-features clippy --all-features --all-targets -D warnings green
4 --all-features cargo test (live pg columns, not skips) green — 328 lib + 125 conformance + 4 git-interop, 0 failed, 0 ignored
5 --no-default-features --features postgres (pg-pure) clippy --all-targets -D warnings green
6 --no-default-features --features pg-lo clippy --all-targets -D warnings was broken, fixed — zero-variant KvEngine/KvCursor E0004 x11 + dead pg-lo entry points; see Notes
7 --no-default-features --features postgres,pg-lo clippy --all-targets -D warnings green
8 --no-default-features --features mem clippy --all-targets -D warnings green
9 --no-default-features (local-only, leanest) clippy --all-targets -D warnings was broken, fixed — same zero-variant kv dispatch failure; see Notes
10 --no-default-features --features mem,ops clippy --all-targets -D warnings green
11 (adjacent sanity) --no-default-features --features mem,pg-lo clippy --all-targets -D warnings green
12 (adjacent sanity) --no-default-features --features sqlite clippy --all-targets -D warnings green
13 fuzz corpus-replay gate cargo test --manifest-path fuzz/shared/Cargo.toml green — 7 passed
14 cargo fmt --check — green (after one fmt reflow of the new cfg attrs)

Rows 2/4 acceptance shape: the pglo-poc container was up, so the pg columns executed against the live harness per AGENTS.md (full-suite default parallelism, no --test-threads reduction; the ~90 s unit and ~96 s conformance runtimes confirm the pg shapes ran rather than skipped).

The one broken graph fact found and fixed (the pass's point): the no-kv-feature build shape (rows 6, 9) had never compiled since mem joined the default set. Details, the fix shape, and the no-ADR ruling in Notes. No #[cfg] on-wrong-pair or co-occurrence-only item was found beyond this one root cause and its diagnostics cascade.