Skip to content

Bridge build-out S5 — offer pool: claim-style distribution (worker) #14371

Backlog

Description

@dezren39

Bridge build-out S5 — offer pool: claim-style distribution (worker)

Implements design §4.2. Traces to spec item 8 (second half). Depends on S1 (#14367).

Scope

In pkgs/message-bridge/worker:

  • New tables fleet_offer (id, batch, body, kind, pattern, slots, sender_addr, ts, state) and fleet_offer_claim (offer_id, agent, claimed_at, message_id).
  • Post an offer: {body, kind, slots, to: <pattern|group|all>} — stored once, NOT fanned out.
  • Eligible agents (matching the pattern/group at claim time) see open offers in a new inbox section; a claim is one atomic store op: if slots remain, a normal mailbox row is delivered to the claimer (sender-stripped when the offer is an instruction; reply threading onto the offer's batch) and the claim recorded. Claims past the slot count get a definite "filled" answer.
  • Owner reads: the offer, its claims (agent, time), and claimants' replies (they thread onto the batch) — exposed through the S2 pipeline/agents surfaces.

Acceptance

  • An offer with slots: 2 claimed by three eligible agents delivers to exactly the first two; the third gets "filled", and no mailbox row exists for it.
  • An agent outside the offer's pattern cannot see or claim it.
  • A claimant's reply threads onto the offer batch and is visible to the owner with the claimant named.
  • An instruction offer reaches claimants sender-stripped, like any instruction.
  • Concurrent claims cannot oversubscribe the slots (atomicity test in the worker suite).

Design of record: doc/2026-11-24_design_message-bridge-buildout.md (PR #14364). Spec numbers below refer to §1 of that doc; design detail is in the section cited per issue.

Filed by Felix's design lane, 2026-11-24. Not enqueued in this pass, per the filing-comment rule: Felix dispatches lanes from the slice index (design doc §7, also posted on #13907).

Activity

  1. developing-today commented on Nov 24, 2026

    @developing-today
    Contributor
  2. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    Contributor

    Claim: Felix lane (worker felix) is implementing S5 now — offer pool in pkgs/message-bridge/worker per design §4.2: fleet_offer/fleet_offer_claim tables, post-offer (owner + agent routes), open offers in the inbox section, one atomic claim op (conditional INSERT guarding slots + duplicates), owner offer/claims read. Branch felix/14371-bridge-offer-pool. Verification remote only; PR left unmerged for Felix's review.

  3. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    Contributor

    S5 implemented and verified — PR #14442 (branch felix/14371-bridge-offer-pool, head 9096d3e), left UNMERGED for Felix's review.

    What landed: fleet_offer/fleet_offer_claim tables; post-offer on the owner route (POST /api//fleet/offer) and the agent route (POST /fleet//offer, from_addr fixed to the poster's name); open offers in a new inbox offers section + GET /fleet//offers; claim as one atomic store op (conditional INSERT guarding slots + duplicate claims) delivering a normal mailbox row on the offer's batch; owner read at GET /api//fleet/offers with claims named, replies threading onto the batch (pipeline batch filter). ttl_seconds expiry supported. Anonymity projections unchanged — command offers are sender-stripped for eligible agents and claimants; owner views keep the real sender. One schema note: fleet_offer carries a sender label column alongside the design's sender_addr, so a delivered row carries the same sender label a fan-out send writes.

    Verification (remote only): fleet-command run 45423029523, conclusion success, Target HEAD 9096d3e verified in the log; full worker suite under the bun-test fallback (executor image has no node, #14267): 103 pass / 0 fail across 11 files (93 prior + 10 new offers tests, all passing by name — slots race, filled answer with no row, ineligible agent, reply threading + owner naming, sender-stripped instruction offers, concurrent-claims atomicity, expiry, double-claim, poster exclusion, credential scoping).

    Every acceptance item on this issue is covered by a named test. #14371 can close when #14442 merges.

  4. developing-today-fleet commented on Nov 24, 2026

    @developing-today-fleet
    Contributor

    Update: PR #14442 was refreshed after S7 (#14431) merged to main — merge commit 40d4e91 (conflicts were unions in fleet.js + README; the credential offer-post now follows S7's service-address semantics). Re-verified remotely: run 45426338395, success, Target HEAD 40d4e91 in the log, worker suite 108 pass / 0 fail across 12 files. PR is mergeable/CLEAN, still unmerged for Felix's review.

  5. added a commit that references this issue on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions