feat(crate): scaffold the ADR-013 §4 feature graph and module skeleton

- Declare the decided feature graph in the manifest: sqlite default-on
  (rusqlite 0.40 bundled), postgres (tokio-postgres 0.7 +
  deadpool-postgres 0.14), mem (dependency-free), pg-lo pulling the
  shared pg driver cluster only (no postgres implication, ADR-010 §1),
  ops (alkcall 0.8.1, default-off); local ungated
- Replace the placeholder crate body with the module skeleton: lib.rs
  re-export shape, ungated stubs (hashing, error, backend, facade,
  dispatch, gc, local), engine stubs behind #[cfg(feature)]
  (mem, pg_lo, postgres, sqlite, ops); stubs are doc-comment-only so
  wave-1 tasks own the module bodies

Verification: cargo test green (default); cargo check --all-features
resolves the full graph; cargo check --no-default-features --features
pg-lo resolves with rusqlite provably absent (tree-inverted match) —
the ADR-010 §1 no-implication rule; clippy --all-targets -D warnings
and cargo fmt --check clean.

Task: tasks/scaffold-crate-features.md (wave 1)
This commit is contained in:
glm-5.3-flash committed 2026-10-11 18:01:18 +00:00
1 parent 8a2df4fa57
commit 24d1c68343
15 files changed
+102 -5

No files matched your search

+14 -1
View File
@@ -17,7 +17,20 @@ exclude = []
[lib]
name = "alkblobs"
[features]
default = ["sqlite"]
sqlite = ["dep:rusqlite"]
postgres = ["dep:tokio-postgres", "dep:deadpool-postgres"]
mem = []
pg-lo = ["dep:tokio-postgres", "dep:deadpool-postgres"]
ops = ["dep:alkcall"]
[dependencies]
tokio = { version = "1", default-features = false, features = ["rt", "sync", "io-util", "macros"] }
thiserror = "2"
parking_lot = "0.12"
parking_lot = "0.12"
alkcall = { version = "0.8.1", optional = true }
deadpool-postgres = { version = "0.14", optional = true }
rusqlite = { version = "0.40", features = ["bundled"], optional = true }
tokio-postgres = { version = "0.7", optional = true }
+3
View File
@@ -0,0 +1,3 @@
//! The Backend trait contract (ADR-003): opaque byte keys and byte-valued
//! entries, complete `list()`, and the read-cursor / staged-put I/O seams
//! (ADR-010) with the crate-internal engine-state companion seam.
+2
View File
@@ -0,0 +1,2 @@
//! Size-threshold dispatch between the kv and large tiers (ADR-003):
//! routing as a pure function of content length.
+3
View File
@@ -0,0 +1,3 @@
//! The error family (ADR-012 §6.5): one enum with members at two
//! altitudes — the trait's effective members plus the facade's
//! GC-refusal and key-validation variants.
+2
View File
@@ -0,0 +1,2 @@
//! The store facade value types: `EntryMeta`, `Pin`/`Batch`,
//! `SweepReport`, `GcAbortCause`, and `PinState`.
+2
View File
@@ -0,0 +1,2 @@
//! GC and namespace mechanism (ADR-005/012): registered liveness,
//! pin-before-publish, delete windows, and sweep outcomes as data.
+3
View File
@@ -0,0 +1,3 @@
//! Hashing & keys (ADR-002): `Digest`/`Key` types, the canonical
//! git-blob-sha-256 derivation, tolerated `git-blob-sha-1`, and the
//! algorithm-tagged byte encoding.
+22 -1
View File
@@ -1 +1,22 @@
pub fn placeholder() {}
pub mod backend;
pub mod dispatch;
pub mod error;
pub mod facade;
pub mod gc;
pub mod hashing;
pub mod local;
#[cfg(feature = "mem")]
pub mod mem;
#[cfg(feature = "pg-lo")]
pub mod pg_lo;
#[cfg(feature = "ops")]
pub mod ops;
#[cfg(feature = "postgres")]
pub mod postgres;
#[cfg(feature = "sqlite")]
pub mod sqlite;
+3
View File
@@ -0,0 +1,3 @@
//! The `local` large-tier engine (ADR-003/008): flat
//! `{hex-prefix}/{hex-prefix}/{hash}` sharding, stage-then-commit-rename
//! staged puts, and pread-based read cursors.
+2
View File
@@ -0,0 +1,2 @@
//! The `mem` kv-tier engine (ADR-011 §2): a `BTreeMap`-shaped ephemeral
//! implementation — the contract-reference engine.
+2
View File
@@ -0,0 +1,2 @@
//! The ops surface (ADR-001): alkcall-backed network operations behind
//! the `ops` feature gate.
+2
View File
@@ -0,0 +1,2 @@
//! The `pg-lo` large-tier engine (ADR-009): postgres Large Objects
//! storage with descriptorless `lo_get` read windows over companion rows.
+2
View File
@@ -0,0 +1,2 @@
//! The `postgres` kv-tier engine (ADR-007): content-addressed rows over
//! a pooled postgres connection, fleet-valid.
+2
View File
@@ -0,0 +1,2 @@
//! The `sqlite` kv-tier engine (ADR-003): WAL + `synchronous=NORMAL`
//! durability, prepared statements, bounded reads.
+38 -3
View File
@@ -1,7 +1,7 @@
---
id: scaffold-crate-features
name: Crate scaffold — ADR-013 §4 feature graph and module skeleton
status: pending
status: completed
depends_on: []
scope: narrow
risk: low
@@ -65,8 +65,43 @@ outside tests, no comments in code (doc comments on public API fine).
## Notes
> To be filled by implementation agent
- Feature graph declared exactly per ADR-013 §4's table:
`default = ["sqlite"]`; `sqlite = ["dep:rusqlite"]`;
`postgres = ["dep:tokio-postgres", "dep:deadpool-postgres"]`;
`pg-lo` pulls the same shared pg driver cluster by `dep:` reference
only (no feature implications — the `postgres` feature name appears
nowhere in its declaration); `mem = []`; `ops = ["dep:alkcall"]`.
`local` ungated, no feature, no dependency.
- Driver versions verified at implementation time (crates.io + the
alkstore engine manifests as the family baseline): `rusqlite = "0.40"`
(`bundled`; resolves 0.40.2, matching alkstore-sqlite's baseline),
`tokio-postgres = "0.7"` (0.7.18), `deadpool-postgres = "0.14"`
(0.14.2), `alkcall = "0.8.1"` (the exact pin the task specified —
present on the public registry).
- Module skeleton: `lib.rs` re-export shape with one module per file —
ungated stubs `hashing`, `error`, `backend`, `facade`, `dispatch`,
`gc`, `local`; gated stubs `mem`, `pg_lo`, `postgres`, `sqlite`,
`ops` behind `#[cfg(feature)]`. All stubs are doc-comment-only;
`pub fn placeholder()` removed. Stub content stays empty so the
wave-1 implementation tasks (core-hashing-keys, core-error-model,
core-trait-and-types) own their module bodies.
- `Cargo.lock` is untracked in this repo (workspace-wide exclude,
consistent with all prior commits) — left untracked.
- No CI wiring added (manual CI per docs/plans/implementation.md).
## Summary
> To be filled on completion
Crate scaffold complete per ADR-013 §4: the full decided feature
graph (`sqlite` default-on with rusqlite bundled; `postgres`, `mem`,
`pg-lo` default-off; `ops` with alkcall 0.8.1; `local` ungated) is
declared in the manifest with inert optional driver dependencies, and
the module skeleton (lib.rs re-export shape + 12 doc-comment-only
module stubs, engine modules behind `#[cfg(feature)]`) replaces the
placeholder body. All acceptance criteria verified: `cargo test` green
with defaults (rusqlite only non-base dep in the default tree),
`cargo check --all-features` resolves the whole graph including
alkcall, `cargo check --no-default-features --features pg-lo` resolves
with rusqlite provably absent (`cargo tree -i rusqlite` matches
nothing) proving pg-lo implies no other engine feature, and
`cargo clippy --all-targets -- -D warnings` + `cargo fmt --check`
are clean.