GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(fleet): mirror placement sessions to the queue backend (placement_sessions) — #13146 slice 1 by dezren39 · Pull Request #13169 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Slice 1 of #13146: placement session records gain their designed
home in the queue backend, while placement itself stays exactly as
decentralized as today.

Backend (turso_queue)

  • placement_sessions table added to the SCHEMA set (created by
    ensure_schema on broker start): the full client record JSON in
    record, with handle/state/surface/submitted_by/run_id extracted
    as columns for list/filter queries.
  • New verbs, dispatched and authenticated like every other queue
    verb: /placement-put (upsert by handle), /placement-get,
    /placement-list (newest first, bounded), /placement-sync
    (insert-or-ignore batch — the migration path; it can never
    overwrite a row the backend already holds).

Client transport

  • broker_roundtrip_bounded: the queue client's routes with a
    caller-set budget on every leg, HTTP errors returned as Err
    (the unbounded legs die with exit 3), no session-broker
    auto-spawn, and a malformed broker URL degrading to Err.

Placement

  • The local JSON store stays the commit and the only input to
    placement decisions (build_ctx, the Blacksmith reconcile read
    local state exactly as before).
  • Records mirror best-effort: put on commit and on refresh;
    status/result/followup reads take the newer of the local and
    backend copies (by updated_at); session list unions both
    stores; an insert-or-ignore sync sweep after dispatch and on
    list migrates pre-existing local stores with no operator step.
  • FLEET_PLACE_REMOTE=off disables the mirror (operator + test
    escape hatch).

Runbook (pkgs/fleet/doc/agents/remote-build-and-test.md):
the session-store paragraph now describes the mirror + fallback,
and the broadcast string gains the binary-acquisition block —
bootstrap pin, plus the release-asset route for machines without
the Muse bootstrap (tag read from the FLEET_URL/FLEET_SHA256
pin block in scripts/muse/bootstrap.sh; verify against the
.sha256 asset; verify the install with fleet queue dispatch --help and fleet queue surfaces).

Verification

  • New tests, each naming its oracle: 7 backend verb tests against
    the stub pipeline (SQL shape + reply mapping), 4 mirror tests
    (pick/merge/sync against a fake remote), the commit wiring test
    (local commit identical with the mirror up or down), 2 bounded
    transport tests (silent-peer timeout; HTTP error as Err).
    Targeted local run: placement filter 54 passed, bounded 4
    passed, 0 failed.
  • Full crate suite dispatched remotely against this branch
    (handle fp_6f8b3d9c00902b9b10927c57db87dba8, run
    45150362527 on dezren39/fleet) — result recorded on impl(fleet): placement sessions to the queue backend (placement_sessions) — centralize decision state, keep placement decentralized #13146.

Live cross-seat verification (acceptance criterion 1 on #13146)
follows the normal binary rollout: the broker picks up the verbs
and seats pick up the client from main, as with every fleet
change. #13146 stays open for that record; the later slices named
there (Blacksmith minute ledger if spend grows; hard cap
enforcement) are out of scope here.


Run Proof on this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dezren39
feat(fleet): mirror placement sessions to the queue backend (placemen…
eca57d1
…t_sessions) — #13146 slice 1

- turso_queue: placement_sessions table in SCHEMA plus
  /placement-put|get|list|sync verbs (sync is insert-or-ignore:
  the migration path for pre-existing local stores)
- client transport: broker_roundtrip_bounded — same routes as the
  queue client, caller-budget timeouts, errors returned, never
  dies, never spawns the session broker
- placement: the local JSON store stays the commit and the only
  decision input; records mirror best-effort (put on commit and
  refresh, get/list merged by updated_at, an opportunistic sync
  sweep migrates pre-existing local stores); FLEET_PLACE_REMOTE=off
  disables the mirror
- runbook: session-store paragraph updated for the mirror; the
  broadcast string gains the binary-acquisition block (bootstrap
  pin plus the release-asset route for non-Muse machines)
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 76fa29bd-60cd-4361-9e36-5e052e0859ec
Commits

Reviewing files that changed from the base of the PR and between 9c54940 and eca57d1.

Files selected for processing: 8

  • pkgs/fleet/crates/fleet-queue/src/client/transport.rs
  • pkgs/fleet/crates/fleet-queue/src/placement.rs
  • pkgs/fleet/crates/fleet-queue/src/placement/remote.rs
  • pkgs/fleet/crates/fleet-queue/src/turso_queue.rs
  • pkgs/fleet/crates/fleet-queue/src/turso_queue/core.rs
  • pkgs/fleet/crates/fleet-queue/src/turso_queue/placement_sessions.rs
  • pkgs/fleet/crates/fleet-queue/src/turso_queue/stacks_outbox.rs
  • pkgs/fleet/doc/agents/remote-build-and-test.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T09:53:07.576026Z eca57d1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Nov 23, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eca57d1b5e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/fleet/crates/fleet-queue/src/placement.rs
Comment on lines +1648 to +1649
let mirrored = remote.get(handle).ok().flatten();
remote::pick_session(local, mirrored)

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 23, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Resolve mirrored followup records during actual dispatch

When a handle exists only in the backend because it was dispatched from another seat, a dry-run followup succeeds through this lookup, but adding --dispatch selects the earlier local-only branch. That branch calls refresh_session before importing the mirrored record and fails with “no session with handle”. Resolve and seed the mirrored record before the dispatch/dry-run split so cross-seat followups work without requiring a separate session status call first.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/fleet/crates/fleet-queue/src/turso_queue/placement_sessions.rs
Comment on lines +20 to +23
ON CONFLICT(handle) DO UPDATE SET \
record = excluded.record, state = excluded.state, \
surface = excluded.surface, submitted_by = excluded.submitted_by, \
run_id = excluded.run_id, updated_at = excluded.updated_at";

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 23, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject stale records in the placement-session upsert

When two seats refresh the same running session concurrently, one can publish a newer completed record while the other's delayed GitHub request fails. GithubActionsAdapter::run_state preserves the input state on failure, and run_session still puts that unchanged older record. This unconditional upsert then replaces the completed backend record with the older running state and timestamp, defeating the newer-record selection used by readers. Guard conflict updates against timestamps older than the stored record.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/fleet/crates/fleet-queue/src/placement/remote.rs
Comment on lines +188 to +190
recs.sort_by(|a, b| created_at(b).cmp(created_at(a)));
recs.truncate(SYNC_BATCH);
let _ = remote.sync(&recs);

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 23, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Advance migration sweeps beyond the newest 100 sessions

For an existing local store containing more than 100 sessions, every sweep selects exactly the same newest 100 records. Once those are inserted, subsequent insert-or-ignore calls keep resending them, so older records never reach the backend and their handles remain unavailable from other seats. Track migration progress or rotate through bounded batches so repeated successful sweeps eventually cover the whole store.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkgs/fleet/crates/fleet-queue/src/client/transport.rs
Comment on lines +518 to +523
let mut s = UnixStream::connect(socket).map_err(|e| {
format!(
"cannot connect to queue-broker at unix://{}: {e}",
socket.display()
)
})?;

@chatgpt-codex-connector chatgpt-codex-connector Bot Nov 23, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bound Unix-socket connection attempts before blocking

When the configured broker's Unix-socket accept backlog is full, UnixStream::connect blocks until the server accepts a connection; the read/write timeouts installed afterward cannot interrupt it. The session-proxy leg uses the same blocking connection pattern. A stalled broker can therefore hang a dispatch indefinitely during its synchronous mirror call instead of falling back after the five-second budget. Use a deadline-aware nonblocking connection for both Unix-socket legs and ensure route probing is bounded too.

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dezren39
dezren39 merged commit 15b2ac8 into main Nov 23, 2026
2 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the lane-placement-sessions branch November 23, 2026 11:04
This was referenced Nov 23, 2026
impl(fleet): placement sessions to the queue backend (placement_sessions) — centralize decision state, keep placement decentralized #13146
Closed
fleet program: full investigation, next-steps design & build-out prompt #13272
Open
@developing-today-fleet developing-today-fleet Bot added the audit:complete PR fully implemented spawning issue label Nov 27, 2026
@developing-today-fleet developing-today-fleet Bot mentioned this pull request Nov 27, 2026
AUDIT-7 Lane 4 — MERGED-PR-AUDIT: merged PRs since 2026-10-23 vs their spawning issues #13879
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:complete PR fully implemented spawning issue

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.