From 23a23f9744238d2b28f2b07d1bdf87e45ce72a98 Mon Sep 17 00:00:00 2001 From: Will McLemore Date: Thu, 26 Nov 2026 11:29:56 -0600 Subject: [PATCH] chore: reconcile docs/version metadata, remove empty placeholders, and harden CI/release workflows --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/workflows/ci.yml | 27 +++++- .github/workflows/release.yml | 95 ++++++++++++++++++--- CHANGELOG.md | 111 ++++++++++++------------ CONTRIBUTING.md | 5 +- README.md | 6 +- ROADMAP.md | 35 +++++--- clients/README.md | 5 -- docs/architecture.md | 23 +++-- docs/live-scheduling-implementation.md | 14 +-- docs/releasing.md | 16 +++- examples/README.md | 48 +++++++++-- rfcs/0002-initial-closing-schedules.md | 6 +- rfcs/README.md | 22 ++++- ruby/engine/README.md | 14 ++- ruby/engine/rbbb.gemspec | 2 +- ruby/server/README.md | 9 -- specification/fixed-bid-ladder.md | 113 ++++++++----------------- 18 files changed, 338 insertions(+), 215 deletions(-) delete mode 100644 clients/README.md delete mode 100644 ruby/server/README.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 980c653..44a93c2 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -26,7 +26,7 @@ body: id: version attributes: label: Version or commit - placeholder: 0.1.0.pre.3 or commit SHA + placeholder: 0.2.0.pre.1 (or installed gem version) validations: required: true - type: textarea diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 02d407b..943a975 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,10 +5,31 @@ on: push: branches: [main] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + permissions: contents: read jobs: + documents-and-examples: + name: documents-and-examples + runs-on: ubuntu-latest + steps: + - name: Check out repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Set up Ruby + uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0 + with: + ruby-version: "3.4" + - name: Validate specification documents + run: ruby scripts/validate_documents.rb + - name: Run fixed bid ladder example + run: ruby -Iruby/engine/lib examples/fixed_bid_ladder.rb + test: name: Ruby ${{ matrix.ruby }} runs-on: ubuntu-latest @@ -19,14 +40,14 @@ jobs: steps: - name: Check out repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Set up Ruby - uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # pinned 2026-09-01 + uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0 with: ruby-version: ${{ matrix.ruby }} bundler-cache: true working-directory: ruby/engine - - name: Validate specification documents - run: ruby scripts/validate_documents.rb - name: Test and package reference engine working-directory: ruby/engine run: bundle exec rake diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f42f5f..a8e41b5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,45 +9,110 @@ permissions: contents: read jobs: - publish: - name: Publish to RubyGems.org + verify: + name: Verify release tag and package if: github.repository == 'willtmc/rbbb' runs-on: ubuntu-latest - environment: release permissions: - contents: write - id-token: write + contents: read steps: - name: Check out repository uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false + fetch-depth: 0 - name: Set up Ruby - uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # pinned 2026-09-01 + uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0 with: - ruby-version: "3.2" + ruby-version: "3.4" bundler-cache: true working-directory: ruby/engine - - name: Verify tag, documents, engine, and package + - name: Verify tag, ancestry, changelog, documents, engine, and package shell: bash - working-directory: ruby/engine run: | - version="$(ruby -Ilib -rrbbb/version -e 'print RBBB::VERSION')" + set -euo pipefail + version="$(ruby -Iruby/engine/lib -rrbbb/version -e 'print RBBB::VERSION')" test "$GITHUB_REF_NAME" = "v$version" - ruby ../../scripts/validate_documents.rb - bundle exec rake + git rev-parse --verify refs/remotes/origin/main >/dev/null + git merge-base --is-ancestor HEAD refs/remotes/origin/main + grep -Fq "$version" CHANGELOG.md + ruby scripts/validate_documents.rb + ( + cd ruby/engine + bundle exec rake + bundle exec rake build + ) + test -f "ruby/engine/pkg/rbbb-${version}.gem" + - name: Upload verified gem artifact + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: rbbb-verified-gem + path: ruby/engine/pkg/rbbb-*.gem + if-no-files-found: error + + publish-rubygems: + name: Publish to RubyGems.org + needs: verify + if: github.repository == 'willtmc/rbbb' + runs-on: ubuntu-latest + environment: release + permissions: + contents: read + id-token: write + steps: + - name: Check out repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Set up Ruby + uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0 + with: + ruby-version: "3.4" + bundler-cache: true + working-directory: ruby/engine - name: Publish with RubyGems trusted publishing uses: rubygems/release-gem@5c53f5308233b7c0f47411f0471b3faae6fa57b2 # v1.4.2 with: working-directory: ruby/engine + - name: Upload published gem artifact + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: rbbb-published-gem + path: ruby/engine/pkg/rbbb-*.gem + if-no-files-found: error + + github-release: + name: Publish matching GitHub release + needs: publish-rubygems + if: github.repository == 'willtmc/rbbb' + runs-on: ubuntu-latest + environment: release + permissions: + contents: write + steps: + - name: Check out repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - name: Set up Ruby + uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0 + with: + ruby-version: "3.4" + - name: Download published gem artifact + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + with: + name: rbbb-published-gem + path: ruby/engine/pkg - name: Publish matching GitHub release shell: bash env: GH_TOKEN: ${{ github.token }} run: | + set -euo pipefail version="${GITHUB_REF_NAME#v}" release_status="$(ruby -Iruby/engine/lib -rrbbb/version -e 'print RBBB::RELEASE_STATUS')" gem_file="ruby/engine/pkg/rbbb-${version}.gem" + test -f "$gem_file" checksum="$(sha256sum "$gem_file" | cut -d ' ' -f 1)" notes_file="$RUNNER_TEMP/rbbb-release-notes.md" release_flags=() @@ -56,8 +121,10 @@ jobs: fi { echo "${release_status^} package for the RBBB Ruby reference engine." - echo - echo "Not production ready; do not use it to accept or resolve live bids." + if [[ "$release_status" != "stable" ]]; then + echo + echo "Not production ready; do not use it to accept or resolve live bids." + fi echo echo "SHA-256: \`$checksum\`" echo diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c383a2..6a27e99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,5 @@ # Changelog -## 0.2.0.pre.1 — fixed ladder evaluation - -Incompatible specification 0.2.0-draft, accepted in RFC 0005 on 2026-10-23: -fixed ladder execution, arbitrary entered maxima, no cut bids, and private -nonblocking bidder notices. Unused remainders affect neither price nor priority. -Reserves execute at the first eligible rung, and corrections replay identical -rules. Existing post-close and operator authorization boundaries remain intact. -Positions now carry executable maximum separately from entered authority. -Preserve 0.1 snapshots and the pinned baseline; no live migration is provided. - - All notable changes will be documented here. The project intends to follow Semantic Versioning once it begins publishing @@ -18,54 +7,60 @@ versioned artifacts. ## Unreleased -- Fix operator void reconstruction returning a `bid_voided` event that `apply` - refused. A later bid that falls below its bidder's executed amount in the - reconstructed order now has no effect, as a reduction below it already had, - so executed amounts stay within executable maxima. Record the maintainer - decision of 2026-11-10 in RFC 0001: such a void can leave another bidder - executed above the maximum they have on file, the engine allows it, and hosts - warn the operator; the contract explains how a host derives the warning from - the prior state and the `bid_voided` positions (no new field). Adds scenarios - 041 and 042 and a seeded property test with an exhaustive short-history - observation. For rare histories that `apply` already accepted before this - fix, the stored priority numbers after a void now differ, and so can the tie - order, because a bid below the replayed executed amount no longer takes - effect. The leader or the price can also differ from the previous release - when a bidder's most recent bid is voided, in histories with three or more - bidders in which bidders had lowered their maximums; the maintainer chose the - new result (RFC 0001 amendment, second ruling of 2026-11-10). Adds scenario - 043 and two named regressions for it. - -- Clarify bidder revocation versus audited operator correction and add trusted - admission regressions: executed competition remains binding, operator identity - cannot be spoofed, corrections require reasons, and post-close voids remain - rejected. Historical partial removals must not imply full authorization voids. - +Source targets `0.2.0.pre.1` (specification `0.2.0-draft`, incompatible with +`0.1.0-draft`). No `0.2.0.pre.1` package has been published yet; `0.1.0.pre.3` +remains the latest published RubyGems prerelease. + +- Add the RFC 0002 initial closing schedule planner (`#36`): minute batches, + arbitrary group membership, latest-member defaults, and explicit initial + overrides. This does not add live group coordination or change baseline bids. +- Add the RFC 0003 fixed-membership shared closing-clock component (`#37`) and + process-local / SQLite durable shared-group host examples with retry receipts + and atomic group closing (`#38`, `#39`, `#40`). New qualifying bids extend + all members; leader proxy adjustments do not. +- Accept RFC 0004 (`#43`) and complete the optional linked soft-close reference + coordinator (`#47`): live group/schedule edits, standalone registration, + independent linked bidding and atomic closing, durable SQLite + ordering/receipts/outbox, trusted admission, authorized snapshots, and atomic + snapshot-first recovery. Reject wrong-route commands in pure scheduling + entrypoints and refuse missing, reordered, or conflicting native records + during complete-commit replay. Adds behavioral, resource, process-race, + crash/restore, and installed-package coverage. Source-only evaluation work, + not a package release or live deployment. - Preserve competitive standing price when the leader raises a hidden maximum, - including ordered reconstruction after a void. Retain reserve pressure and - exact-maximum tie priority when reducing back to the executed floor. Add seven - synthetic regression scenarios, clarify RFC 0001, and retain the post-close - correction boundary. This source change is not a published package release. - -- Complete the optional RFC 0004 linked soft-close reference coordinator: - live group/schedule edits, standalone registration, independent linked bidding - and atomic closing, durable SQLite ordering/receipts/outbox, trusted admission, - authorized snapshots and atomic snapshot-first recovery. Add full behavioral, - resource, process-race/crash/restore and installed-package coverage. - Baseline RFC 0001 semantics and published capabilities remain unchanged. - This is source-only evaluation work, not a package release or live deployment. -- Reject wrong-route commands in pure scheduling entrypoints and refuse missing, - reordered or conflicting native records during complete-commit replay. - -- Add the fixed-membership shared closing-clock component. New qualifying bids - extend all members; proxy adjustments do not. Atomic host integration remains - separate, and baseline per-unit bidding semantics are unchanged. - - -- Add the RFC 0002 initial closing schedule planner: minute batches, arbitrary - group membership, latest-member defaults and explicit initial overrides. - This does not add live group coordination or change baseline bids. - + including ordered reconstruction after a void (`#50`). Retain reserve + pressure and exact-maximum tie priority when reducing back to the executed + floor, add seven synthetic regression scenarios, clarify RFC 0001, and retain + the post-close correction boundary. +- Clarify bidder revocation versus audited operator correction and add trusted + admission regressions (`#51`): executed competition remains binding, operator + identity cannot be spoofed, corrections require reasons, and post-close voids + remain rejected. Historical partial removals must not imply full + authorization voids. +- **Breaking (`0.2.0-draft`, RFC 0005, accepted 2026-10-23):** execute maxima + on a fixed bid ladder (`#52`). Bidders may enter arbitrary maxima, but only + published ladder rungs execute; there are no cut bids. Adds private + nonblocking `maximum_not_fully_executable` bidder notices; unused remainders + affect neither price nor priority. Reserves execute at the first eligible + rung, positions carry executable maximum separately from entered authority, + and corrections replay identical rules. Preserve 0.1 snapshots and the pinned + baseline; no live migration is provided. +- Fix operator void reconstruction returning a `bid_voided` event that `apply` + refused (`#57`). A later bid that falls below its bidder's executed amount in + the reconstructed order now has no effect, as a reduction below it already + had, so executed amounts stay within executable maxima. Records the + 2026-11-10 maintainer rulings in RFC 0001 (including host-derived operator + warnings when a void leaves another bidder executed above their on-file + maximum, and priority/leader replay semantics for multi-bidder histories with + maximum reductions) and adds scenarios 041–043 plus a seeded property test + and exhaustive short-history check. +- Add opt-in `extend_on_void` soft-close configuration (`#59`): when enabled, + an audited pre-close void that changes the leader or standing price within + the trigger window extends closing time, backed by fixture + `usd-soft-close-extend-on-void` and scenario 044. +- Track durable public result delivery acknowledgments (`#41`): add restart-safe + outbox stream identity and per-consumer delivery cursors in the SQLite + shared-group host example for receiver deduplication. ## 0.1.0.pre.3 — 2026-09-02 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1856e52..db49444 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,7 +40,10 @@ license agreement. ## Development -The Ruby reference engine currently supports Ruby 3.2 and newer. +The Ruby reference engine currently supports Ruby 3.2 and newer. The `rbbb` gem +itself has zero runtime dependencies; `bundle install` in `ruby/engine` installs +`sqlite3` as a development dependency for running the durable host examples and +their tests. ```sh cd ruby/engine diff --git a/README.md b/README.md index f9837eb..5b319ae 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ application's code. specification/ Language-neutral concepts, schemas, and API contracts conformance/ Portable behavior scenarios for every compliant engine ruby/engine/ Pure-Ruby reference implementation -ruby/server/ Future deployable reference service +examples/ Synthetic host, admission, reader, and consumer examples rfcs/ Proposed changes to normative auction behavior docs/ Architecture, terminology, and design decisions ``` @@ -89,6 +89,10 @@ gem build rbbb.gemspec gem install ./rbbb-0.2.0.pre.1.gem ``` +The `rbbb` gem itself has zero runtime dependencies. Running `bundle install` +in `ruby/engine` installs `sqlite3` as a development dependency so you can run +the durable host examples and their tests. + This artifact is for evaluation and historical replay only. It is not a hosted service and must not be used to accept or resolve live bids. See the [Ruby engine guide](ruby/engine/README.md) for installation and usage, or the diff --git a/ROADMAP.md b/ROADMAP.md index 1a15b25..e4f8c76 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -44,16 +44,25 @@ Quantity, choice, multi-parcel bidding, additional auctioneer overrides, and other formats remain out of scope until their semantics are specified and tested. -[RFC 0004: Flexible live scheduling and closing groups](rfcs/0004-flexible-live-scheduling.md) -was accepted on 2026-09-24: mutable group membership and explicit earlier/later -deadlines during bidding, with atomic ordering, auditable operator actions, a -host-set minimum shortening lead, and leader-change extensions. The bounded -reference coordinator and its durable host/snapshot recovery examples are now -implemented; see the [acceptance and integration evidence](docs/live-scheduling-implementation.md). -Deployment certification and a separately approved release remain future work. -The baseline engine's behavior is unchanged and no service capability is advertised. - -An optional rule that realigns a proxy-clipped short increment to the regular -increment grid is explicitly deferred. The v0.1 baseline permits short -increments and calculates the next required amount from the resulting standing -amount. +Optional closing-schedule extensions are accepted and implemented in source +(unreleased): + +- [RFC 0002: Initial closing schedule planning](rfcs/0002-initial-closing-schedules.md) + (minute batches and nonconsecutive initial group planning); +- [RFC 0003: Fixed-membership shared closing clock](rfcs/0003-shared-closing-clock.md) + (shared quiet-period clock component for fixed groups); and +- [RFC 0004: Flexible live scheduling and closing groups](rfcs/0004-flexible-live-scheduling.md), + accepted on 2026-09-24 (mutable group membership and explicit earlier/later + deadlines during bidding, with atomic ordering, auditable operator actions, a + host-set minimum shortening lead, and leader-change extensions). The bounded + reference coordinator and its durable host/snapshot recovery examples are + implemented; see the [acceptance and integration evidence](docs/live-scheduling-implementation.md). + Deployment certification and a separately approved release remain future work. + The baseline engine's behavior is unchanged and no service capability is advertised. + +[RFC 0005: Fixed bid ladder with arbitrary maximum authority](rfcs/0005-fixed-bid-ladder.md) +was accepted on 2026-10-23 (`0.2.0-draft`, implemented in source), superseding +the v0.1 short-increment and raw-maximum tie rules. All executed bids now follow +the fixed published ladder with no cut bids, while odd entered maxima retain +their full authorization and emit a private nonblocking notice. The v0.1 +baseline remains pinned for historical auctions and replays. diff --git a/clients/README.md b/clients/README.md deleted file mode 100644 index e88ad42..0000000 --- a/clients/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Client libraries - -Generated or hand-maintained clients may live here after the public HTTP and -event contracts are stable enough to exercise. A client must not redefine -auction behavior; it transports language-neutral commands and results. diff --git a/docs/architecture.md b/docs/architecture.md index efa8653..afd9125 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -88,8 +88,21 @@ requires an RFC, schemas, conformance scenarios, and implementation support. ## Accepted and deferred behavior -RFC 0001 accepts normative rules for timed online proxy bidding, including -opening amounts, equal maxima, increment boundaries, reserves, extension -timing, proxy reduction, and constrained operator actions. Quantity, choice, -linked closing groups, multi-parcel allocation, outcry, and hybrid auctions -remain deferred and must not be inferred from another auction system. +[RFC 0001](../rfcs/0001-timed-online-proxy-bidding.md) accepts normative rules +for timed online proxy bidding, including opening amounts, increment boundaries, +reserves, extension timing, proxy reduction, and constrained operator actions. +[RFC 0005](../rfcs/0005-fixed-bid-ladder.md) (`0.2.0-draft`) supersedes RFC +0001's short-increment pricing and raw-maximum tie rules with fixed published +ladder execution, arbitrary entered maxima, no cut bids, and private bidder +notices. + +Optional closing-schedule additions are accepted and implemented in source +(unreleased): [RFC 0002](../rfcs/0002-initial-closing-schedules.md) (initial +closing schedule planning), [RFC 0003](../rfcs/0003-shared-closing-clock.md) +(fixed-membership shared closing clock), and +[RFC 0004](../rfcs/0004-flexible-live-scheduling.md) (flexible live scheduling +and linked closing groups; see +[live-scheduling-implementation.md](live-scheduling-implementation.md)). + +Quantity, choice, multi-parcel allocation, outcry, and hybrid auctions remain +deferred and must not be inferred from another auction system. diff --git a/docs/live-scheduling-implementation.md b/docs/live-scheduling-implementation.md index 669d2d0..63a53c9 100644 --- a/docs/live-scheduling-implementation.md +++ b/docs/live-scheduling-implementation.md @@ -46,13 +46,13 @@ conflicting and revision-gapped batches. Registration retains version 0 and null unit command time. Replaying audit history requires privileged authority; it does not recheck live execution permissions. -**Distribution:** the published `0.1.0.pre.3` gem predates this coordinator. -This source tree still carries that version constant; it is not evidence that -the published artifact contains these files. Pin the reviewed source commit -(and the `ruby/engine` gemspec) for evaluation, or wait for a separately approved -new prerelease. Do not replace an installed/published `0.1.0.pre.3` artifact with -an unlabelled local rebuild. The SQLite examples are repository files, not gem -contents; they require the development `sqlite3` dependency. +**Distribution:** the published `0.1.0.pre.3` RubyGems prerelease predates this +coordinator. This source tree carries `RBBB::VERSION = "0.2.0.pre.1"` +(`SPECIFICATION_VERSION = "0.2.0-draft"`), while `0.1.0.pre.3` remains the +latest published RubyGems prerelease. Pin a reviewed source commit (and the +`ruby/engine` gemspec) for evaluation, or wait for a separately approved +prerelease. The SQLite examples are repository files, not gem contents; they +require the development `sqlite3` dependency. ## Durable host and authorized snapshots diff --git a/docs/releasing.md b/docs/releasing.md index b4011ae..7a1aabc 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -29,10 +29,18 @@ into the gem's trusted publisher and adds the maintainer as an owner. 6. Create and push an annotated, immutable `v` tag from the reviewed, GitHub-verified `main` merge commit. The tag must exactly match `RBBB::VERSION`. -7. Approve the `release` environment deployment. The pinned release workflow - reruns verification, publishes through RubyGems trusted publishing, waits for - registry propagation, and creates the matching GitHub prerelease with the - exact artifact and SHA-256 checksum. +7. Approve the `release` environment deployment. The pinned three-stage release + workflow separates privileges across three jobs: + - `verify` (`contents: read`): checks that the tag matches `RBBB::VERSION`, + is reachable from `origin/main`, and is recorded in `CHANGELOG.md`, then + reruns document validation, the test suite, `package:verify`, and a clean + gem build. + - `publish-rubygems` (`contents: read`, `id-token: write`, `release` + environment): publishes the gem through RubyGems trusted publishing and + uploads the exact published `.gem` artifact. + - `github-release` (`contents: write`, `release` environment): attaches that + exact `.gem` artifact and SHA-256 checksum to the matching GitHub release + (marking non-stable builds as prereleases with the non-production warning). 8. Read back the RubyGems version, owners, metadata links, installed package, GitHub release, artifact checksum, and tag target. diff --git a/examples/README.md b/examples/README.md index b95d8bb..d1e82f1 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,11 +1,28 @@ # Examples -This directory will contain synthetic integration examples. Examples are -informative unless they are also represented in the conformance suite. +This directory contains synthetic integration examples. Examples are informative +unless they are also represented in the conformance suite, and they live outside +the packaged `rbbb` gem. Never use production bidder data, private maximums, payment data, or copied vendor payloads in an example. +The `rbbb` gem itself has zero runtime dependencies. Examples backed by SQLite +require the development `sqlite3` gem installed by `bundle install` in +`ruby/engine`. + +## Runnable and reference Ruby examples + +| File | Dependencies | Summary | +| --- | --- | --- | +| [`fixed_bid_ladder.rb`](fixed_bid_ladder.rb) | Pure Ruby (`rbbb` only) | Standalone script demonstrating RFC 0005 fixed-ladder execution and the private `maximum_not_fully_executable` bidder notice. Run with `ruby -Iruby/engine/lib examples/fixed_bid_ladder.rb`. | +| [`shared_group_host.rb`](shared_group_host.rb) | Pure Ruby (`rbbb` only) | Process-local reference host composing engine bids with `RBBB::SharedClosingClock` (RFC 0003), request serialization, and retry receipts. Guide: [`shared-group-host.md`](shared-group-host.md). | +| [`durable_shared_group_host.rb`](durable_shared_group_host.rb) | `sqlite3` (dev) | SQLite-backed durable shared-group host retaining bids, shared clock results, retry receipts, atomic group closing, and restart-safe public result delivery acknowledgments across process restarts. Guide: [`durable-shared-group-host.md`](durable-shared-group-host.md). | +| [`live_scheduling_host.rb`](live_scheduling_host.rb) | `sqlite3` (dev) | Embedded SQLite reference host for RFC 0004 (`rbbb/live_scheduling`) covering all six mutation entrypoints under `BEGIN IMMEDIATE`, durable receipts, commits, outbox delivery, and sealing. Guide: [`docs/live-scheduling-implementation.md`](../docs/live-scheduling-implementation.md). | +| [`live_scheduling_admission.rb`](live_scheduling_admission.rb) | `sqlite3` (dev) | Trusted admission boundary wrapping `LiveSchedulingHost` with server-owned authentication, authorization, permission callbacks, and bidder-safe responses. | +| [`live_scheduling_reader.rb`](live_scheduling_reader.rb) | `sqlite3` (dev) | Authorized checkpoint reader producing visibility-scoped public or privileged snapshots with content digests in the same transaction as the checkpoint. | +| [`live_scheduling_consumer.rb`](live_scheduling_consumer.rb) | `sqlite3` (dev) | SQLite snapshot-replacement consumer that reauthorizes and refetches on every read, validates scope and digest, and installs checkpoints atomically. | + ## Shared soft-close group host The [fixed-group host example](shared-group-host.md) composes real engine bids @@ -16,9 +33,24 @@ retries; durable database integration remains separate. ## Durable local shared-group host The [SQLite host example](durable-shared-group-host.md) retains bids, shared -clock results and retry receipts across process restarts. It tests crash recovery -and competing local processes; it remains an evaluation adapter outside the gem. - -The durable adapter also [closes every group member in one transaction](durable-shared-group-host.md#closing-all-members-together), with per-lot outcomes and restart-safe retries. - -The [public-results outbox](durable-shared-group-host.md#public-result-delivery) retains delivery progress across restarts and supplies stable IDs for receiver deduplication. It sends no external messages by itself. +clock results, and retry receipts across process restarts. It tests crash +recovery and competing local processes; it remains an evaluation adapter outside +the gem. + +The durable adapter also +[closes every group member in one transaction](durable-shared-group-host.md#closing-all-members-together), +with per-lot outcomes and restart-safe retries. + +The [public-results outbox](durable-shared-group-host.md#public-result-delivery) +retains delivery progress across restarts and supplies stable IDs for receiver +deduplication. It sends no external messages by itself. + +## Flexible live scheduling (RFC 0004) + +The four `live_scheduling_*.rb` adapters (`live_scheduling_host.rb`, +`live_scheduling_admission.rb`, `live_scheduling_reader.rb`, and +`live_scheduling_consumer.rb`) demonstrate durable coordination, trusted +admission, authorized reads, and atomic snapshot-first recovery around +`RBBB::LiveScheduling::Coordinator`. See the +[live scheduling implementation guide](../docs/live-scheduling-implementation.md) +for their boundaries and test coverage. diff --git a/rfcs/0002-initial-closing-schedules.md b/rfcs/0002-initial-closing-schedules.md index 56df338..7147ca4 100644 --- a/rfcs/0002-initial-closing-schedules.md +++ b/rfcs/0002-initial-closing-schedules.md @@ -35,8 +35,10 @@ Member-list and group-list order do not change the resulting schedule. The output is a plan only. It accepts no existing bidding state and performs no mutation, registration, live shortening, soft-close extension or group close. Hosts must not apply it over an active auction as a substitute for the atomic -scheduling coordinator accepted in RFC 0004 (not yet implemented). A planned group does not give RFC 0001 engines -linked soft-close capability. +scheduling coordinator accepted in [RFC 0004](0004-flexible-live-scheduling.md) +(reference implementation complete in source, unreleased; see +[docs/live-scheduling-implementation.md](../docs/live-scheduling-implementation.md)). +A planned group does not give RFC 0001 engines linked soft-close capability. ## Validation and compatibility diff --git a/rfcs/README.md b/rfcs/README.md index 73debfa..20515e8 100644 --- a/rfcs/README.md +++ b/rfcs/README.md @@ -5,6 +5,16 @@ Current pricing: [fixed bid ladder, odd maxima and no cut bids](0005-fixed-bid-l An RFC is required for any new or changed normative auction behavior, public contract, compatibility guarantee, or governance model. +## Accepted RFCs + +| RFC | Title | Status | Accepted | Scope | +| --- | --- | --- | --- | --- | +| [0001](0001-timed-online-proxy-bidding.md) | Timed online proxy bidding baseline | Accepted | 2026-09-01 | Core timed online proxy bidding (`0.2.0-draft`; pricing and tie rules superseded by RFC 0005) | +| [0002](0002-initial-closing-schedules.md) | Initial closing schedule planning | Accepted (initial planning only) | 2026-09-08 | Minute batches, nonconsecutive group planning, and explicit initial overrides (unreleased) | +| [0003](0003-shared-closing-clock.md) | Fixed-membership shared closing clock | Accepted (clock component only) | 2026-09-08 | Shared quiet-period clock component for fixed groups; amended by RFC 0004 proxy-adjustment rule (unreleased) | +| [0004](0004-flexible-live-scheduling.md) | Flexible live scheduling and closing groups | Accepted (reference implementation complete, unreleased) | 2026-09-24 | Mutable closing groups, registration, linked extensions, atomic close, and snapshot-first recovery (implemented in `#47`; deployment certification separate) | +| [0005](0005-fixed-bid-ladder.md) | Fixed bid ladder with arbitrary maximum authority | Accepted | 2026-10-23 | Fixed published ladder execution, odd maxima, no cut bids, and private bidder notices (`0.2.0-draft`, implemented in `#52`) | + ## Process 1. Open an issue describing the policy question before writing a large RFC. @@ -44,5 +54,13 @@ None. - [RFC 0004: Flexible live scheduling and closing groups](0004-flexible-live-scheduling.md) accepts the live regrouping/rescheduling contract, including a minimum - shortening lead and leader-change extensions. The coordinator is not yet - implemented and no support is advertised. + shortening lead and leader-change extensions. The bounded reference + coordinator and its durable host and snapshot-recovery examples are + implemented in source (`#47`, unreleased; see + [docs/live-scheduling-implementation.md](../docs/live-scheduling-implementation.md)); + deployment certification and capability advertisement remain separate. + +- [RFC 0005: Fixed bid ladder with arbitrary maximum authority](0005-fixed-bid-ladder.md) + replaces RFC 0001's short-increment pricing and raw-maximum tie rules with + fixed published ladder execution and private bidder notices (`#52`, + `0.2.0-draft`, unreleased). diff --git a/ruby/engine/README.md b/ruby/engine/README.md index 4fd99c8..0d8a4d7 100644 --- a/ruby/engine/README.md +++ b/ruby/engine/README.md @@ -179,10 +179,12 @@ crash/restore and snapshot recovery cases execute in the test suite. See the [implementation, acceptance and migration guide](../../docs/live-scheduling-implementation.md) for precise API and evidence. Deployment certification remains separate. -The published `0.1.0.pre.3` package does not contain this coordinator. The source -version constant has not been bumped or released: pin a reviewed source commit -for evaluation, or use a separately approved future prerelease. No live bidding -or capability-advertisement permission follows from passing the reference suite. +The published `0.1.0.pre.3` RubyGems prerelease does not contain this +coordinator. Source currently carries `RBBB::VERSION = "0.2.0.pre.1"` +(`SPECIFICATION_VERSION = "0.2.0-draft"`), which has not yet been published: +pin a reviewed source commit for evaluation, or wait for a separately approved +prerelease. No live bidding or capability-advertisement permission follows from +passing the reference suite. ## Install the evaluation gem @@ -222,6 +224,10 @@ not, by itself, a production-readiness or compatibility claim. ## Development +The `rbbb` gem itself has zero runtime dependencies. Running `bundle install` +installs `sqlite3` as a development dependency for running the durable host +examples and their tests. + ```sh bundle install bundle exec rake diff --git a/ruby/engine/rbbb.gemspec b/ruby/engine/rbbb.gemspec index 679c995..20ebb2b 100644 --- a/ruby/engine/rbbb.gemspec +++ b/ruby/engine/rbbb.gemspec @@ -25,7 +25,7 @@ Gem::Specification.new do |spec| "documentation_uri" => "https://github.com/willtmc/rbbb/blob/#{release_tag}/ruby/engine/README.md", "homepage_uri" => spec.homepage, "rbbb_release_status" => RBBB::RELEASE_STATUS, - "rbbb_rfc" => "0001", + "rbbb_rfc" => "0001, 0002, 0003, 0004, 0005", "rbbb_specification_version" => RBBB::SPECIFICATION_VERSION, "rubygems_mfa_required" => "true", "source_code_uri" => "https://github.com/willtmc/rbbb/tree/#{release_tag}/ruby/engine" diff --git a/ruby/server/README.md b/ruby/server/README.md deleted file mode 100644 index 9f21240..0000000 --- a/ruby/server/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# Ruby reference server - -The future reference server will wrap the pure Ruby engine with a deployable, -API-only service. The intended responsibilities include PostgreSQL persistence, -atomic command ordering, idempotency, authentication boundaries, projections, -HTTP APIs, real-time subscriptions, audit access, health, metrics, and logging. - -No server framework has been generated yet. Service work begins only after the -first engine behavior is specified and implemented. diff --git a/specification/fixed-bid-ladder.md b/specification/fixed-bid-ladder.md index e610090..0f04875 100644 --- a/specification/fixed-bid-ladder.md +++ b/specification/fixed-bid-ladder.md @@ -1,80 +1,39 @@ # Fixed bid ladder contract -- Normative authority: accepted RFC 0005 +- Normative authority: [RFC 0005: Fixed bid ladder with arbitrary maximum authority](../rfcs/0005-fixed-bid-ladder.md) - Accepted by maintainer: 2026-10-23 -- Specification: 0.2.0-draft (incompatible with 0.1.0-draft) - -## Decision - -All executed bids follow a fixed published ladder; there are no cut bids. -A bidder may enter any otherwise-valid maximum. Retain that exact authorization, -but use only its highest executable rung for competition, reserve satisfaction, -executed floors and tie priority. Unused remainder has no competitive effect. -This supersedes RFC 0001's short-increment pricing and raw-maximum tie rules. -The leader's own increase still does not reprice ordinary competition. - -## Ladder definition - -Each configured tier begins at an inclusive monetary breakpoint B and defines -step D. Its rungs are B + n*D, for nonnegative integers n, below the next -breakpoint. Every breakpoint is itself a rung. Thus a tier boundary is fixed -in advance, even when the preceding step does not divide its interval exactly. -The configured opening amount is also a rung; amounts below opening cannot be -executed. Above opening, use the tier rungs, never an offset derived from a bid. -Amounts and arithmetic remain bounded by the interoperable money limit. -Find rungs by integer arithmetic per tier, not iteration through individual bids. - -For example, tiers at 0/$1, $10/$2, $25/$5, $100/$10, $250/$25 produce -$22, $24, $25, $30 and $240, $250, $275. An odd opening of $23 starts at -$23, then $24, $25, $30. Opening and tiers are immutable for a bidding unit. - -Let E(M) be the greatest rung at or below entered maximum M (zero when no -executable rung exists). Reject a first bid below opening as before. A new -challenger must authorize at least the next rung above the standing price. -Rank positions by E(M), then the authoritative acceptance order of that -executable maximum. Edits within the same rung preserve priority; an increase -or reduction to another rung acquires new priority. History still records each -command's actual sequence, independently of retained position priority. - -With competition, price is min(leader executable maximum, next rung above -runner-up executable maximum), subject to opening, reserve pressure, and binding -executed floors. Equal executable maxima retain earlier priority at that rung. -A losing position executes only its executable maximum, never its remainder. -A private leader increase does not reprice existing competition. Later accepted -competition uses the formula normally. At the last representable rung, next -required saturates to that rung and further challengers are rejected; no cut bid -is fabricated at the numeric ceiling. - -## Reserves, reductions, corrections and clocks - -An off-ladder confidential reserve requires the first rung at or above reserve. -Reserve pressure is capped by the leader's executable maximum. Reserve is met -only when that executable maximum reaches the raw reserve. If no representable -rung can reach reserve it remains unmet. Lowering reserve does not unwind an -executed price. Reductions cannot cross executed floors; unused remainder can -be cancelled. Operator voids replay the same ladder and priority rules from -retained authorization history. Existing operator audit requirements and the -post-close correction boundary do not change. Closing and extension rules do -not change; remainder-only edits do not change the public result. - -## Bidder notice - -A successful odd maximum or reduction returns a private `maximum_not_fully_executable` -notice with currency, entered maximum, executable maximum, next ladder amount -(or null at the ceiling), and readable text. It is nonblocking: no extra -confirmation and no automatic upward rounding. Hosts show it only to the -submitting bidder or authorized operator, never in public auction events. -Example: "Your maximum of USD 249.00 is accepted. Under this item's bid -increments, we can bid up to USD 240.00 for you. The next available amount is -USD 250.00." A host may offer a separate explicit action to increase authority. -The notice is retained in the privileged command event so retries and replay -return the same information. It must not disclose another bidder's maximum. - -## Compatibility and validation - -The old 0.1.0 specification, engine commit and historical captures remain pinned; -never restore their states into 0.2.0 or silently migrate live auctions. Start new -units under the new version. Historical comparisons with changed tier boundaries -are counterfactual experiments, not parity failures or predicted bidder behavior. -Conformance covers tier boundaries, odd maxima, ties, remainder-only edits, -reserve rounding, reductions, void replay, numeric bounds and private notices. +- Specification: `0.2.0-draft` (incompatible with `0.1.0-draft`) +- Related contract: [Core specification contract](contract.md) + +## Summary + +RFC 0005 supersedes RFC 0001's short-increment pricing and raw-maximum tie +rules. The normative specification lives in +[RFC 0005](../rfcs/0005-fixed-bid-ladder.md) and is integrated into the core +boundaries in [contract.md](contract.md). Key contract boundaries: + +- **Fixed published ladder:** every executed bid must fall on a published rung + derived from the immutable opening amount and configured tier breakpoints and + steps. There are no cut bids, including at the interoperable money ceiling. +- **Arbitrary entered maxima:** bidders may submit any otherwise-valid maximum. + The engine retains the exact entered authorization, but only its highest + executable rung `E(M)` participates in competition, reserve satisfaction, + executed floors, and tie priority. Unused remainder has no competitive effect. +- **Priority and competition:** positions rank by `E(M)`, then authoritative + acceptance order of that executable maximum. Edits within the same rung + preserve priority. With competition, standing price is + `min(leader E(M), next rung above runner-up E(M))`, subject to opening, + reserve pressure, and binding executed floors. +- **Reserves, reductions, and corrections:** an off-ladder confidential reserve + requires the first rung at or above the reserve; reductions cannot cross + executed floors; operator voids replay the same ladder and priority rules + from retained authorization history. +- **Private bidder notice:** a successful odd maximum or reduction emits a + private, nonblocking `maximum_not_fully_executable` notice retained in the + privileged command event and shown only to the submitting bidder or + authorized operator. +- **Compatibility:** `0.2.0-draft` is incompatible with `0.1.0-draft`. Keep 0.1 + snapshots pinned to the 0.1 baseline; do not restore them into a 0.2 engine. + +Refer to [RFC 0005](../rfcs/0005-fixed-bid-ladder.md) for the complete +normative text, examples, and validation requirements.