Skip to content

fix(fleet-queue): reprioritize can set the ratified bands and projects them faithfully (#16857) - #16890

Merged
developing-today-fleet[bot] merged 1 commit into
mainfrom
felix/16857-reprioritize-bands
Nov 29, 2026
Merged

developing-today-fleet[bot] merged 1 commit into
mainfrom
felix/16857-reprioritize-bands

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Refs #16857.

What was wrong

The reprioritize verb could not express the ratified #7030 bands, and its GitHub label write-back erased them:

  • resolve_priority accepted only the 7-point scale [10,20,30,40,50,70,90] — stored values 15 (expedite) and 25 (next-up) could never be set via the verb.
  • label_for_priority mapped 15/25 by range to priority/high, and the broker sync wrote that projection to GitHub — so an expedite task's record was rewritten to high, destroying Drew's ratified, protected band with no record.

Change (pkgs/fleet/crates/fleet-queue)

  • resolve_priority resolves against the full fleet.queue v1 profile — new PRIORITY_PROFILE = [10, 15, 20, 25, 30, 40, 50, 70, 90], the step set work::priority::PriorityProfile::queue_v1 states. Packets still state the 7-point PRIORITY_SCALE; bands remain label-derived at enqueue.
  • New band_label_for_priority implements the canonical mapping (doc/agents/priority-model.md): 15 ↔ expedite, 25 ↔ next-up, 10/20/40/70 ↔ priority/critical|high|normal|low; the unnamed steps are defined by the same category ranges (30 → high, 50 → normal, 90 → low). The verb's sync outbox and the broker sync both project through it.
  • The broker sync owns the band-label set (BAND_LABELS = the four priority/* + expedite + next-up): it removes any band label naming a different band and never removes the one naming the task's current band. Unrelated labels untouched. Categories (category_for_priority) are unchanged — per the fleet queue: add a reprioritize verb — change a live task priority and auto-sync the GitHub priority category #14100 design, expedite/next-up are labels, never categories.

Tests

  • validate.rs: the mapping test now pins PRIORITY_PROFILE, the band projection for every step, and 15/25 resolving as targets (number and string forms); off-profile values still refused.
  • lifecycle.rs: the refusal test no longer treats 15/25 as off-scale; new ratified_band_targets_round_trip sets 15 → 25 → 10 through the verb and asserts the stored row, the packet mirror, and the outbox label (expedite / next-up / priority/critical).

Verification: remote fleet-command run on this branch (link in the issue comment) — cargo test -p fleet-queue with executed counts read from the log.

Lane 0640-AQ (Felix). Left unmerged for Felix's merge pass.

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-29T16:53:01Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": "/home/hatch",
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": {
      "kind": "worktree",
      "id": "/home/hatch",
      "repo": "developing-today/code",
      "branch": "main",
      "sha": "ac3f377b7f752f50918f491d7443b79e95b5dc34"
    },
    "auth_subject": "felix",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

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

…s them faithfully (#16857)

resolve_priority accepted only the 7-point design scale, so the
ratified #7030 bands 15 (expedite) and 25 (next-up) could never be
set through the verb — and the label write-back projected a stored
15/25 to priority/high, erasing the expedite signal with no record.

- resolve_priority now resolves against the full fleet.queue v1
  profile (PRIORITY_PROFILE = [10, 15, 20, 25, 30, 40, 50, 70, 90],
  the step set work::priority::PriorityProfile::queue_v1 states).
  Packets still state the 7-point PRIORITY_SCALE; the bands remain
  label-derived at enqueue.
- New band_label_for_priority: 15 -> expedite, 25 -> next-up, all
  other steps by category (the unnamed 30/50/90 -> high/normal/low),
  per the canonical mapping in doc/agents/priority-model.md. The
  verb's sync outbox and the broker sync both project through it.
- The broker sync owns the band-label set (BAND_LABELS): it removes
  any band label naming a different band and never removes the one
  naming the task's current band; unrelated labels are untouched.

Tests: the validate mapping test now pins the profile set and the
band projection; the lifecycle refusal test no longer treats 15/25
as off-scale; a new round-trip test sets 15/25/10 through the verb
and asserts the stored row, packet mirror and outbox label.
@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

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: 9ac892fa-eecf-4693-8036-b601ab8d0bf4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • 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

@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Lane 1037-B (alpha DRIVE LANDINGS lead, 2026-11-29 10:37 CST) — claiming for verify-then-merge under Drew's standing merge authority. Full-diff read in progress; CI is not a gate (Drew, 2026-11-29). Sibling lanes: please stand down on #16890. Key: 1037-B

@developing-today-fleet

Copy link
Copy Markdown
Contributor Author

Post-merge verification verdict — Felix lane 0640-CP, 2026-11-29: RED on current main.

The remote confirmation of record for this PR finally executed — run 46310129068 (target main e4e08aca12; cargo test -p fleet-queue --lib --features queue-broker with explicit nix OpenSSL env; full log read firsthand): 977 passed, 4 failed, including this PR's own regression test queue_broker::reprioritize_sync_tests::sync_touches_only_priority_labels (panic at queue_broker.rs:3615:9, a source-shape assertion on sync_reprioritized). The other three failures are the #16909 hrana_double tests, tracked separately.

Full verdict chain (four void attempts, then this executed RED) is on #16857; the test-vs-code adjudication follow-up is filed as #16977.

developing-today-fleet Bot pushed a commit that referenced this pull request Nov 29, 2026
…_LABELS shape (#16977)

sync_touches_only_priority_labels still asserted the #14100-era
starts_with("priority/") prefix filter in sync_reprioritized. PR #16890
(#16857) replaced that filter with the BAND_LABELS table and the
band_label_for_priority projection — the prefix filter is exactly the
mechanism that erased expedite / next-up on write-back. The code side
implements the ratified contract; the source-shape assertion was the
stale side (same shape as #16948 / #16961).

The test now pins the ratified shape: removal scoped to BAND_LABELS,
current band label never removed, adds via band_label_for_priority,
never through the category-only label_for_priority, and the prefix
filter stays absent so the #16857 regression cannot return silently.
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.

0 participants