Skip to content

feat(queue): #8097 Rules 1+2 — no-id handoff pick, optional platform selector - #8100

Merged
dezren39 merged 2 commits into
mainfrom
feat/8097-platform-selector
Nov 10, 2026
Merged

dezren39 merged 2 commits into
mainfrom
feat/8097-platform-selector

Conversation

@dezren39

@dezren39 dezren39 commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Implements Rules 1 and 2 of #8097 (Drew, 2026-11-09 20:25 CST: "implement now"). Rule 3 is a separate lane; Rule 4 noted on the issue.

Rule 1 — no blocking/claiming by ID by default

  • Broker (Turso backend) gains a pick mode: pick="parked_handoff" (CLI: repo-queue claim --handoff). The BROKER picks the next parked recorded opencode handoff (SQL predicate mirroring is_parked_handoff: progress lane opencode, yield stage handed_off/launch_failed incl. the last-checkpoint lift, no session binding; the park timer does not gate it). The caller names no task id.
  • The opencode claimant's default collection path now uses only this: claimant.py collects parked handoffs per queue via --handoff claims (grouped up front in launch_step); claim --task no longer appears in any default flow. prompt.md updated to match.
  • claim --task <id> stays as the explicit special-case verb (one-off revivals, e.g. task 11214) — not removed, and now also honors Rule 2's selector.
  • Audit: default pick path, lane claims (--lane optional; lane-less claims work), queue-capture enqueue, and claimant discovery (/list) required no ID before and require none now. The only default-path ID dependence was the claimant's parked-handoff collection — removed. Verbs that act on an already-owned task (bind/heartbeat/checkpoint/park/fail/complete) are addressed by id by nature; they are not work acquisition.

Rule 2 — platform optional, coarse selector only

  • tasks.platform column added: in the CREATE TABLE for fresh DBs and via an additive ALTER TABLE in ensure_schema for the live DB (existing 370+ rows read NULL = unset; no backfill, nothing destructive).
  • Enqueue: optional via CLI --platform or the packet's platform field (request wins). Validated: exactly openchamber or muse; anything else is an error, so a typo can't silently widen/narrow reach. Never required; never a lane name.
  • Claim: every claim path enforces the selector in SQL (pick + conditional UPDATE + by-id predicate). A set item is claimable only by a claim declaring the same family (--platform); a claim declaring NO family only ever takes unset items, so existing claimants keep exactly their old reach. The claimant declares openchamber.
  • Rows returned by enqueue/claim/list (rich + plain) now carry platform.

Tests

  • Rust: 133/133 cargo test -p fleet-queue --all-features (new: platform parse matrix, platform_allows matrix, by-id selector gate, CLI flag validation).
  • Python: 73/73 claimant+poll unittests (new: parked candidate collected with no --task anywhere in argv; collection drains broker picks until {"task": null}).

Deploy + live proofs (regular no-ID claim cycle; three selector test items; parked-handoff discovery + collection) are commented on #8097 after the fleet binary/claimant deploy.


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

repo-worker-code-k added 2 commits November 9, 2026 20:38
…selector

Rule 1: lanes never need to block/claim by task id in the default
flow. The broker gains a pick mode (pick=parked_handoff, CLI
claim --handoff): the BROKER picks the next parked recorded
opencode handoff; the caller names no id. The opencode claimant
collects parked handoffs exclusively through it. claim --task
stays as the explicit special-case verb (one-off revivals).

Rule 2: tasks gain an optional platform column (additive ALTER in
ensure_schema; existing rows NULL = unset). Enqueue accepts it
optionally (CLI --platform, or the packet field); every claim
path enforces it: a set item is claimable only by a claim
declaring the same family (openchamber|muse); undeclared claims
keep exactly their old reach (unset items only). By-id claims
honor the selector too. The selector names a family, never a
lane, and is never required.
The previous commit also carried a cargo fmt pass over
turso_queue.rs/client.rs; the package is not rustfmt-clean at
main under this toolchain, so that pass churned unrelated
lines. This restores the original formatting everywhere except
the #8097 changes themselves — the net PR diff is now exactly
the semantic change. No behavior difference.
@dezren39
dezren39 requested a review from a team as a code owner November 10, 2026 02:40
@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-10T02:40:43.360919Z
We couldn’t complete this review. Comment @codex review to try again.
6243d5c 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.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@dezren39
dezren39 merged commit 02f4ece into main Nov 10, 2026
1 of 5 checks passed
@dezren39
dezren39 deleted the feat/8097-platform-selector branch November 10, 2026 02:40
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

  • 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant