OQ-06 resolved: honker-core quality read fires the fork trigger (ADR-011)
Quality read of honker-core's watcher/transactional core cross-checked against the published crates.io artifact: the core itself is clean (Writer/Readers, polling-watcher failure handling, WatcherDeathGuard all verified), but published 0.5.0 predates upstream's unreleased fix train carrying the issue-#133 savepoint hardening (silent job loss in the dead-letter paths) and five .ok() error swallows — and ADR-010's queue depth requires engine-owned queue SQL in any posture. Resolution: fork honker-core at the reference revision, inherit the clean machinery and test suites, re-derive queue ops on contract v1, rename tables to __alkstore_*. - docs/research/quality-read-honker-core.md — full evidence - docs/architecture/decisions/011-sqlite-substrate-fork.md — decision - OQ-06 resolved in open-questions.md; ADR-003/005/008, engine-sqlite, queues, README annotated for consistency
This commit is contained in:
1 parent
79a135c934
commit
befbe2e714
10 files changed
+586
-74
No files matched your search
@@ -6,20 +6,24 @@ last_updated: 2026-10-05
|
||||
# SQLite engine
|
||||
|
||||
The `alkstore-sqlite` engine implements
|
||||
[core-contract.md](core-contract.md) on rusqlite + published
|
||||
honker-core. This spec records WHAT the engine is internally (its
|
||||
[core-contract.md](core-contract.md) on rusqlite over the
|
||||
[forked honker-core substrate](decisions/011-sqlite-substrate-fork.md).
|
||||
This spec records WHAT the engine is internally (its
|
||||
connection architecture, seam, and wake plumbing) — not code-level
|
||||
HOW. Decisions live in ADRs; per-contract obligations live in the core
|
||||
spec and are not restated here.
|
||||
|
||||
## Identity and posture
|
||||
|
||||
- Single driver: rusqlite (riding
|
||||
[honker-core's pin](decisions/003-sqlite-driver.md)),
|
||||
`bundled-sqlite` for hermetic builds. No `.so` runtime artifacts, no
|
||||
vendored patches
|
||||
([ADR-003](decisions/003-sqlite-driver.md),
|
||||
[ADR-001](decisions/001-crate-split.md)).
|
||||
- Single driver: rusqlite, riding the
|
||||
[forked honker-core substrate](decisions/011-sqlite-substrate-fork.md)
|
||||
(fork of published honker-core 0.5.0's lineage at the reference
|
||||
revision),
|
||||
`bundled-sqlite` for hermetic builds. No `.so` runtime artifacts
|
||||
([ADR-003](decisions/003-sqlite-driver.md) for the driver decision;
|
||||
ownership resolved by
|
||||
[ADR-011](decisions/011-sqlite-substrate-fork.md) — OQ-06's read
|
||||
fired ADR-005's fork trigger).
|
||||
- Sync machinery, async-facing trait: honker-core is sync (std
|
||||
threads, blocking iterators); the engine bridges at the trait seam
|
||||
per the family-standard posture (alktty REQ-TTY-01 precedent).
|
||||
@@ -52,9 +56,9 @@ spec and are not restated here.
|
||||
|---|---|
|
||||
| notify / listen | honker's notify functions inside the caller's tx; `listen()` bridges the watcher's fanout into a tokio receiver (one `spawn_blocking` thread per subscription doing `blocking_send`) |
|
||||
| streams | honker's stream machinery; explicit offset saves through the tx seam |
|
||||
| queues | honker's queue functions ([ADR-002](decisions/002-feature-scope.md)); semantics depth per [ADR-010](decisions/010-queue-semantics-depth.md) — ride + pin, except two contract properties honker's machinery doesn't provide (the no-stranded-rows `sweep_expired`, dead-row `get_job` visibility — OQ-06's concrete fork candidates) |
|
||||
| queues | owned queue machinery (forked substrate re-derived on [ADR-010](decisions/010-queue-semantics-depth.md) — stamps, no-stranded-rows sweep, dead-visible `get_job`); ADR-003's ride posture superseded on ownership by [ADR-011](decisions/011-sqlite-substrate-fork.md) |
|
||||
| named locks | honker's lock machinery |
|
||||
| scheduler / outbox | collapse shape ([ADR-009](decisions/009-scheduler-collapse.md)): honker's scheduler machinery (`_honker_scheduler_tasks`) carries `@every` specs (its cron boundary machinery unused — cron strings are contract-rejected); honker's leader loop pattern (TTL lock, heartbeat, exit-before-tick-on-loss); the leadership lock is `__alkstore_scheduler`; outbox = helper over queues with the derived backing-queue name ([ADR-008](decisions/008-contract-v1-pinning.md) §4) |
|
||||
| scheduler / outbox | collapse shape ([ADR-009](decisions/009-scheduler-collapse.md)): owned scheduler storage (`__alkstore_scheduler_tasks`, forked substrate) carrying `@every` specs (cron machinery not ported); the leader loop pattern (TTL lock, heartbeat, exit-before-tick-on-loss); the leadership lock is `__alkstore_scheduler`; outbox = helper over queues with the derived backing-queue name ([ADR-008](decisions/008-contract-v1-pinning.md) §4) | |
|
||||
| begin_tx | acquires the writer slot, opens `BEGIN IMMEDIATE`, returns the caller-held handle ([ADR-007](decisions/007-transactional-seam.md)) |
|
||||
| handle ops | each `*_tx` op round-trips `spawn_blocking` to the same connection (thread-affinity note in [ADR-007](decisions/007-transactional-seam.md)) |
|
||||
| commit/rollback | releases the writer slot |
|
||||
@@ -72,24 +76,28 @@ spec and are not restated here.
|
||||
- Wake coalescing: bursts inside one poll tick produce one wake;
|
||||
correctness is preserved by the re-read contract
|
||||
(POC-pinned: missed-wake stress with correct post-burst re-reads).
|
||||
- **Deployment note**: honker-core 0.5 pins rusqlite ^0.40.1, whose
|
||||
rustc floor is ≥ 1.99; binaries linking this engine carry that
|
||||
requirement ([deployment.md](deployment.md) matrix).
|
||||
- **Deployment note**: the substrate's rusqlite generation
|
||||
(^0.40.1) has a rustc floor ≥ 1.99; binaries linking this engine
|
||||
carry that requirement ([deployment.md](deployment.md) matrix).
|
||||
- The optimization path, if seam throughput ever demands it: a
|
||||
dedicated std-thread bridge (one thread owning the writer conn, ops
|
||||
over mpsc — measured ~2× the spawn_blocking shape at p50 in POC #1),
|
||||
or a raised watcher cadence for idle CPU. Neither is the default.
|
||||
|
||||
## What rides on the fork question
|
||||
## What the fork question resolved
|
||||
|
||||
Nearly all of honker-core's surface is consumed (Writer/Readers/
|
||||
SharedUpdateWatcher/attach_*). The [quality read
|
||||
(OQ-06)](decisions/005-dependency-ownership.md) is this engine's only
|
||||
open dependency gate: if it names a defect or an upstream-unwon't
|
||||
change, the fork posture
|
||||
([ADR-005](decisions/005-dependency-ownership.md)) fires and this
|
||||
engine's substrate becomes owned code. Until then, published-library
|
||||
consumption stands.
|
||||
The [quality read (OQ-06)](decisions/005-dependency-ownership.md) —
|
||||
this engine's dependency gate — resolved 2026-10-05: ADR-005's fork
|
||||
trigger **fired** ([ADR-011](decisions/011-sqlite-substrate-fork.md)).
|
||||
The substrate is owned code forked from honker-core's lineage; the
|
||||
watcher/connection architecture this spec describes is inherited
|
||||
verbatim where kept ([ADR-003](decisions/003-sqlite-driver.md)
|
||||
unchanged in architecture). The
|
||||
[evidence](../research/quality-read-honker-core.md): published
|
||||
0.5.0's unreleased-fix-train defect class, plus ADR-010's queue depth
|
||||
requiring engine-owned queue SQL in any posture. The forked
|
||||
substrate's table family is `__alkstore_*` (ADR-010 §8's naming
|
||||
authorization).
|
||||
|
||||
## Design Decisions
|
||||
|
||||
@@ -97,13 +105,14 @@ consumption stands.
|
||||
|---|---|---|
|
||||
| [001](decisions/001-crate-split.md) | Crate split | single-driver engine crate |
|
||||
| [002](decisions/002-feature-scope.md) | Feature scope | which rows this engine serves |
|
||||
| [003](decisions/003-sqlite-driver.md) | Driver | rusqlite + honker-core, bridged seam, inherited watcher |
|
||||
| [005](decisions/005-dependency-ownership.md) | Ownership | published honker-core; named fork triggers |
|
||||
| [003](decisions/003-sqlite-driver.md) | Driver | rusqlite + honker-core lineage, bridged seam, inherited watcher — ownership resolved by 011 |
|
||||
| [005](decisions/005-dependency-ownership.md) | Ownership | published honker-core; fork trigger fired by OQ-06 (ADR-011) |
|
||||
| [006](decisions/006-wake-and-delivery-contract.md) | Wake contract | data_version watcher, coalescing, death-closes-receivers |
|
||||
| [007](decisions/007-transactional-seam.md) | Tx seam | writer-slot lease, `BEGIN IMMEDIATE`, `spawn_blocking` round-trips |
|
||||
| [008](decisions/008-contract-v1-pinning.md) | Contract v1 | pinned surface; outbox backing queue derived under the reserved prefix; wake payload transport unused (non-contract) |
|
||||
| [009](decisions/009-scheduler-collapse.md) | Scheduler collapse | honker scheduler machinery with `@every` specs; `__alkstore_scheduler` leadership; cron machinery unused |
|
||||
| [010](decisions/010-queue-semantics-depth.md) | Queue depth | ride + pin over honker's functions; §5/§3a properties are OQ-06 fork candidates |
|
||||
| [009](decisions/009-scheduler-collapse.md) | Scheduler collapse | `@every` specs; `__alkstore_scheduler` leadership; cron rejected |
|
||||
| [010](decisions/010-queue-semantics-depth.md) | Queue depth | semantics pinned; §5/§3a realization resolved by ADR-011 (owned code) |
|
||||
| [011](decisions/011-sqlite-substrate-fork.md) | Substrate fork | OQ-06's trigger fired; substrate owned, queue ops re-derived on contract v1 |
|
||||
|
||||
## Open Questions
|
||||
|
||||
@@ -111,10 +120,9 @@ Open questions are tracked in
|
||||
[open-questions.md](open-questions.md). Key
|
||||
questions affecting this document:
|
||||
|
||||
- **OQ-06**: honker-core quality read — fork-trigger assessment
|
||||
(open); now carrying two concrete candidates from the queue-depth
|
||||
design (no-stranded-rows sweep, dead-row visibility —
|
||||
complement vs fork is the read's call)
|
||||
- **OQ-06**: honker-core quality read — fork-trigger assessment —
|
||||
**resolved** (2026-10-05,
|
||||
[ADR-011](decisions/011-sqlite-substrate-fork.md); trigger fired).
|
||||
|
||||
Resolved: **OQ-09** (scheduler collapse —
|
||||
[ADR-009](decisions/009-scheduler-collapse.md)) and **OQ-05** (queue
|
||||
|
||||
Reference in new issue
Block a user