Files
alkstore/docs/architecture
glm-5.3-flash 79a135c934 docs: resolve OQ-05 + OQ-09 — queue semantics depth (ADR-010) and scheduler collapse (ADR-009)
ADR-009: scheduler collapses into queues — schedule()/unschedule()/
run_schedules (opt-in, no ambient timers), @every-only v1 grammar
(dissolves honker's local-TZ cron brittleness), boundary guarantee
row (at-least-once per boundary, fixed 64-cap catch-up with
skip-forward, row-locked fire tx as engine-generic no-double-fire
floor), __alkstore_scheduler leadership lock, InvalidSpec +
LeadershipLost taxonomy additions.

ADR-010: queue depth pinned engine-uniformly — three-state machine
(pending/processing/dead) with delete-on-ack, get_job sees dead rows,
heartbeat = renewal with late-heartbeat refusal, reclaim-consumes-
an-attempt stated as contract text, equal-jitter exponential backoff
(range definitionally pinned, 1 h cap), QueueOpts stamped onto job
rows at enqueue (no per-queue registry), move-to-dead dead-letter
with retention-sweep support and no redrive API, sweep_expired
carries the no-stranded-rows property (fixes honker's expired-
processing zombie hole — SQLite-side realization rides OQ-06 as a
concrete fork candidate), one engine-owned pg schema, queues are
rows not tables, result-storage cut-flag stands.

Also: full honker-machinery and pgboss-rs reference reads persisted
(docs/research/reference-*.md — the honker defect list pre-stages the
OQ-06 quality read), queues.md rewritten from design-space frame to
resolved-depth spec, core-contract/engines/README/overview/deployment/
ADR-002 propagated.
2026-10-05 03:10:52 +00:00
..

status, last_updated
status last_updated
draft 2026-10-05

alkstore — Architecture

Architecture documentation for the alkstore project: one reactive store interface (notify, streams, queues, locks, scheduler, outbox) over SQLite and Postgres, with each engine native underneath (see overview.md).

Current State

Phase 1 (Architecture) — in progress. Phase 0 is complete (docs/research/phase-0.md): both POCs ran and passed, the scope inventory is confirmed, and the crate split, drivers, and ownership postures are decided. This directory carries the architecture spec build-out over that evidence base; all spec documents are draft pending architecture review and OQ resolution.

Architecture Documents

Doc Status Purpose Key OQs
overview.md draft Crate family, feature surface, non-goals, evidence base —
core-contract.md draft The unified trait surface, delivery guarantees, tx seam OQ-08, OQ-10
engine-sqlite.md draft SQLite engine: honker-core/rusqlite mapping OQ-05 (resolved), OQ-06, OQ-09 (resolved)
engine-postgres.md draft Postgres engine: tokio-postgres/LISTEN mapping OQ-05 (resolved), OQ-08, OQ-09 (resolved)
queues.md draft Queue/scheduler/outbox semantics depth (resolved: ADR-009/ADR-010) OQ-06 (rides)
deployment.md draft Host semantics, connection budgets, knobs, matrix OQ-08
open-questions.md draft OQ tracker (promoted from OQ-ST register) —

Architecture Decision Records

ADR Title Status
001 Reactive-core crate + per-engine crates Accepted
002 Feature scope — inventory-confirmed surface Accepted
003 SQLite engine — rusqlite + honker-core, bridged seam Accepted
004 Postgres engine — tokio-postgres + deadpool, hand-rolled LISTEN Accepted
005 Published libraries by default, named fork triggers Accepted
006 Wake contract — opaque wake + re-read; notify-vs-streams split Accepted
007 Transactional seam — caller-held TxHandle, *_tx methods Accepted
008 Contract v1 surface pinning — surface partition, TxHandle shape, wake type, reserved strings, error taxonomy Accepted
009 Scheduler collapse — queues + schedule()/run_schedules, @every-only v1, boundary guarantee row Accepted
010 Queue semantics depth — visibility/renewal, backoff curve, dead-letter, no-stranded-rows sweep, schema layout Accepted

Open Questions

Tracked in open-questions.md (OQ-01..NN; the Phase 0 register's OQ-ST-01..08 promote one-to-one — OQ-NN mirrors OQ-ST-NN — with new Phase 1 questions appended after). Highlights, in suggested resolution order (OQ-04, OQ-09, OQ-05 resolved):

  • OQ-06 (high): honker-core quality read — fork-trigger gate; now carries two concrete fork candidates from the queue-depth design (the no-stranded-rows sweep fix, dead-row get_job visibility — complement vs fork is the read's call).
  • OQ-08 (medium): capability-surface shape.
  • OQ-10 (medium): contract versioning across engine crates.

Resolved (kept with resolutions): OQ-01 (feature scope), OQ-02 (crate split), OQ-03 (drivers), OQ-07 (extension surface cut), OQ-04 (contract v1 pinning — ADR-008), OQ-09 (scheduler collapse — ADR-009; scheduler guarantee row pinned), OQ-05 (queue semantics depth — ADR-010).

No deferred OQs: all open questions are actionable Phase 1 work with complete evidence bases.

Document Lifecycle

Status Meaning Transitions
draft Under active development; may change significantly → reviewed when the doc's OQs are resolved
reviewed Architecture final; implementation may begin → stable when implementation verified
stable Locked; changes need review, may warrant an ADR → deprecated when superseded
deprecated Superseded; kept for reference Removed when unreferenced

All spec documents carry YAML frontmatter (status, last_updated); ADRs carry a ## Status section (Accepted/Proposed/Superseded).

Provenance of decisions

Phase 1 inherits its decisions from Phase 0's evidence base — every Accepted ADR above cites its POC findings and register record. The research documents remain the deep background:

  • docs/research/phase-0.md — vision, prior art, OQ-ST register, convergence.
  • docs/research/consumer-inventory.md — per-feature scope evidence.
  • docs/research/poc-sqlite-posture-findings.md / docs/research/poc-pg-posture-findings.md — measured ground.