Contract-suite rows (task suite-opts-backoff-rows): the backoff-curve equivalence row and the deferred enqueue-opts clock legs. backoff_curve_equivalence — the equal-jitter exponential pinned as the range, not a jitter label (ADR-010 §3): claim → retry(err, None) cycles on a backoff_base_s = 2 queue land the ranges [1,2], [2,4], [4,8] across attempts 1–3, each computed delay read back through get_job's resolved run_at minus a clock read taken before the retry — the lower bound race-free (the retry's internal clock read cannot precede the suite's, so the observed value over-reads the delay, never under-reads) and the upper bound carrying a one-second straddle tolerance for the integer-second stamp crossing a wall second; identical bounds on both engines is the equivalence pin (ADR-012 §2, the row body shared). The explicit-delay override legs ride the same row: retry(err, Some(5)) honored verbatim ([5, 6] under the same straddle tolerance) and retry(err, Some(0)) resolving ready-now per the boundary-total rule (ADR-023 §2), claimed within a bounded wait. enqueue_opts_resolution extended in place with the wave-5 legs its deferral note named — the run_at-alone literal leg (a future run_at is the row's ready time verbatim, a deterministic equality with no clock read involved; a past run_at stores the literal too and is claimable now through the run_at <= now predicate within a bounded wait, the run_at-ASC ordering making the observation unambiguous among the row's other legs) and the neither-field leg (ready at the enqueue instant, abs_diff(now) <= 5 tolerance-bounded proximity, never a tight timing assert); the deferral note replaced by the completion statement, ADR-023 §2 stamp accumulated per the convention (ADR-020 §1 governs the resolutions). Cap-leg disposition recorded in Notes for the review gate: the 1-hour cap is not suite-pinnable (capped attempts need minute-scale waits) and stays pinned engine-side on both engines' unit tests per the wave-3/4 reviews. Ready-now waits are bounded claim_one poll loops (deadline asserts only, sequential single-store drive), with the one draft defect the finding surfaced (a re-claim after the bounded wait consumed nothing; the helper returns the claimed handle) noted. Wired into both engines' suite targets (SQLite tokio test, pg harness_row!), 25 rows per column up from 24. Verified: SQLite column green server-less (25/25 suite, 189 lib), pg column green vs harness (postgres/poc@:15432 — 25/25 suite, 121 lib + 9 schema), 3 solo re-runs of each new/extended row per engine (determinism), server-less pg skips cleanly via the reachability gate, cargo test -p alkstore-sqlite -p alkstore-postgres green, clippy -D warnings, fmt clean

This commit is contained in:
glm-5.3-flash committed 2026-10-10 07:26:55 +00:00
1 parent 2a2ad7e11f
commit 36023914b2
5 files changed
+375 -31

No files matched your search

+76 -2
View File
@@ -1,7 +1,7 @@
---
id: suite-opts-backoff-rows
name: Contract-suite rows — backoff-curve equivalence + the deferred enqueue-opts clock legs
status: pending
status: completed
depends_on: []
scope: narrow
risk: low
@@ -76,6 +76,80 @@ Work:
> To be filled by implementation agent
- **The 1-hour cap leg is not suite-pinned** (as pre-decided): reaching
capped attempts requires waiting out minute-scale delays. The cap
stays pinned engine-side — both engines' unit tests pin the curve
against the ADR text including the cap (SQLite's
`backoff_curve_lands_in_the_pinned_range` and the pg twin, verified
in the wave-3/4 rounds); the disposition is recorded in the row's
doc comment for the review gate.
- **Observation tolerance convention for the curve row**: the
computed delay is read back as `get_job`'s `run_at` minus a clock
read taken *before* the `retry(err, None)` call. That direction is
deliberate and race-free on the lower side: the retry's internal
clock read (SQLite's `unixepoch()` in-statement, pg's Rust-side
engine read) cannot precede the suite's, so the observed value
*over-reads* the delay, never under-reads — the pinned lower bound
is exact. The upper bound carries a one-second straddle tolerance
(retry commit and suite read may cross a wall second, and the
engines' stamps are integer seconds, ADR-010 §3's integerized
resolution). Asserted as a `(lower..=upper+1)` range membership; the
*identical* assertion on both engines is the equivalence pin
(ADR-012 §2's identical-outputs rule) — the row body is shared, so
the bounds are identical by construction.
- **Base 2 s kept the integer-second row resolution honest** per the
task text: ranges [1,2], [2,4], [4,8] across attempts 1–3 (the a=1
pin is inherently weak at one-second resolution — lower bound 1 with
upper ±1 — but the attempt-2/3 ranges are genuinely discriminating,
and the explicit-delay legs pin the exact-literal resolution).
- **Past-run_at leg stores the literal too**: the pin on the past leg
is the *claim semantics* (ready-now through the `run_at <= now`
predicate, bounded-wait claimable) and the stored literal (no
arithmetic on any form) — "resolves to ready now" is the claim-
predicate reading of the boundary-total rule (ADR-023 §2), not a
clamping of the stored value; both engines store verbatim
(`resolution.rs` twins verified).
- **Claim-polling observation posture**: both rows' ready-now waits
are bounded `claim_one` poll loops (100/50 ms cadence), deadline
asserts only — no timing-value assertions, single-store sequential
drive within the module doc's determinism posture.
- **One unreproducibility note on the helper**: the first draft made
`await_claimable` re-claim after the bounded wait, which found
nothing (the bounded wait consumed the claim); the helper returns
the claimed handle. Found on the first SQLite run, no engine-side
hazard.
- No ADR amendments needed; no divergences found (both engines'
arithmetic agreed out of the box — the equivalence pin held on the
first full run pairs).
## Summary
> To be filled on completion
> To be filled on completion
`enqueue_opts_resolution` extended in place with the wave-5
completion legs (its deferral note replaced by the completion
statement, ADR-023 §2 stamp accumulated): the `run_at`-alone literal
leg (future `run_at` = the row's ready time verbatim — a
deterministic equality, no clock read involved; past `run_at` stored
verbatim too and *claimable now* within a bounded-wait claim, the
run_at-ASC ordering making the observation unambiguous among the
row's other legs) and the neither-field leg (ready now at the
enqueue instant, `abs_diff(now) <= 5` tolerance-bounded proximity —
never a tight timing assert). New `backoff_curve_equivalence` row:
claim → `retry(err, None)` cycles on a `backoff_base_s = 2` queue
(ranges [1,2], [2,4], [4,8] per attempt, asserted as `(lower..=upper+1)`
range membership of `run_at − now_pre` with the race-free lower
bound and one-second straddle tolerance documented), reading each
computed delay back through `get_job`'s resolved `run_at`; the
explicit-delay override legs ride the same row (`Some(5)` honored
verbatim in [5, 6]; `Some(0)` resolving ready-now per the
boundary-total rule, claimed within a bounded wait). Stamped ADR-010
§3, ADR-020 §1, ADR-012 §2, ADR-023 §2. Both rows wired into both
engines' `contract_suite.rs` targets (SQLite `#[tokio::test]`, pg
`harness_row!`) — 25 rows per column, up from 24. Verified: SQLite
column green server-less (25/25 suite, 189 lib), pg column green vs
the harness server (postgres/poc@:15432 — 25/25 suite, 121 lib + 9
schema), 3 solo re-runs of each new/extended row per engine
(determinism), server-less pg column skips cleanly (25 "passed" via
the reachability gate), `cargo test -p alkstore-sqlite -p
alkstore-postgres` green, clippy `-D warnings`, fmt clean.