Repository navigation
v3.0.0 feat: time selected direct ledger pool acquisitions - #368
Conversation
Reuse the existing cancellation-safe wait guard for a shared Ledger::acquire boundary and eight direct query paths. Preserve SQL and transaction behavior, and qualify elapsed timing, cancellation, and checkout release against PostgreSQL. Refs #352.
The HTTP exhaustion test observes the aggregate pool histogram, now including payout-revision and heartbeat waits. Require every explicit cancellation to remain visible while preserving exact per-attempt assertions in the isolated tests.
Refresh canonical metric and alert guidance and regenerate the inventory and review-only provisioning patch from the checksum-pinned source snapshot. Alert expressions, thresholds and role exports are unchanged.
Co-Authored-By: OpenAI Codex <[email protected]>
|
Bounded review dispositions at
The final Codex adversarial report found no refutation across the full implementation diff at |
|
@cursor review |
|
Final review ledger for current head
All nine ledger entries are terminal: 2 fixed, 1 approved deferral, 6 rejected change requests. Thermo T4 was a positive layering assessment, not an additional finding. Remaining #352 work now explicitly records observer consolidation, clock compatibility and ownership constraints. Review evidence verified by reading the actual reports:
The timer starts on first poll and ends at checkout completion/cancellation, before SQL or Integration resolution at
Ready for maintainer merge of this bounded partial slice; not merged. GitHub reports mergeable/clean at |
|
Conflict resolution pushed as
The existing medium, Codex, Fable and thermo reports remain the review evidence for the prior implementation; this mechanical integration received a focused overlap review and fresh tests, without repeating broad lanes. The earlier base SHA shown in the pull-request response was stale; the true remote tip reproduced the manifest conflict and is now integrated. Current-head CI and Bugbot are complete: 16 successful checks, one skipped check, all 272 expected gated tests verified from the downloaded manifest, and no new Bugbot issues or review threads. GitHub reports mergeable/clean; a read-only merge-tree also succeeds against the newer remote base |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 9d2afc8. Configure here.
Summary
Direct ledger queries previously checked out connections outside the acquisition histogram. Add
Ledger::acquire()using the existing cancellation guard, route both transaction entrypoints through it, and instrument eight direct callers: owner-reservation release, payout revision, worker difficulty, accepted-share timestamp, CPFP package/funding reads, heartbeat, and attached fatal-state reads.A polled acquisition records exactly one success/error/cancellation sample; an unpolled future records none. Query text, values/errors, deadlines and statement-scoped connection release are preserved. SQL and
BEGINfollow the acquisition timer. The live HTTP test permits independent publisher acquisitions while isolated tests assert exact per-attempt counts.Refs #352 — partial delivery. Remaining job/coordinator, audit and block-reconciliation, migration/startup, cleanup, tools and rollup callsites remain tracked there. Observer consolidation requires explicit compatibility tests for the collector's Tokio clock and ledger's standard clock; both clocks are preserved here. API/read-pool coverage and public-role export policy remain separate decisions. This is not a complete acquisition census, and
_countis not request throughput.Integration with 3.x.x
Append-only merge
9d2afc8incorporates the actual remote base12fda81. Both branches appended test gates at the same location; the sole textual conflict was resolved as the exact sorted union of all 271 upstream gates plus the acquire gate, 272 unique entries. The acquire test supplies fixed keys for the upstreamLedger::configuresigner-key argument. Automatic merges retain upstream fingerprint/signing validation alongside the reviewed acquisition behavior; the resolution changes no observer clock or production timing semantics.Test plan
[code]smithskipped, none active/failed. The downloaded PostgreSQL/multi-instance manifest proves 272/272 expected gates executed, with no failed/skipped gates.Earlier implementation evidence remains distinct: 332 selected tests passed at
d7947cdwith real PostgreSQL and zero ignored tests. The exact-headbed69c7reviewer independently reran all seven acquire tests and both ignored observability tests, plus generator checks and PromQL (28 expressions, 73 scenarios, 145 expression assertions, 86 alert assertions). That reviewer did not repeat the entire 332-test suite. An initial parallel ledger run hit fixture advisory-lock timeouts; the complete serial run passed. The HTTP oracle regression was reproduced before correction.Review and coverage
The medium report's request to migrate all remaining callers is outside this expressly partial slice. Codex identified and confirmed fixes for the aggregate HTTP oracle and stale coverage wording, then found no refutation through
d7947cd. Fable adversarial and thermo reviewed exact headbed69c7with no refutation or blocking finding. All nine findings/suggestions have written dispositions: two fixed, one approved #352 deferral, six rejected change requests. The merge resolution received focused overlap review and fresh qualification; it was mechanical and did not require duplicate broad lanes.Bugbot found no new issues at exact head
9d2afc8; GitHub has no review threads or change-request review. No pass is claimed for skipped checks or Tenki/Codex-on-GitHub, which produced no report. The final review ledger in this PR contains the complete per-finding evidence and dispositions.Tests cover first-poll arming, unpolled/absent telemetry, success/error identity, cancellation cleanup and exactly-once counts, concurrent outcomes, real pool exhaustion/recovery, all eight callers on a one-slot pool, a following transaction, and slow/error/cancelled SQL exclusion. A delayed/failed/cancelled
BEGINround trip remains an explicit empirical regression-test gap: source ordering stops the timer before BEGIN, but that delay/failure itself is not simulated. The earlier 21/22 behavioral-group assessment is an estimate, not measured line/branch coverage.Documentation and completion
Canonical/manual/generated guidance describes selected direct-query coverage and the remaining #352 work without changing metric identity or alert expressions, thresholds or roles. Implementation, focused tests, gate registration, documentation and review dispositions are complete for the bounded slice. Full #352 integration remains follow-up work. No version, changelog or signing-configuration changes were made.
Ready for maintainer merge of the bounded slice; not merged. GitHub reports mergeable/clean at
9d2afc8. A read-only merge-tree check also succeeds against the newer remote3.x.xtipba52d4b, which changes CI/test tooling and landed while qualification ran. No additional base merge was needed to resolve a conflict.