Metadata
| Status | done |
|---|---|
| Assigned | agent-162 |
| Agent identity | f51439356729d112a6c404803d88015d5b44832c6c584c62b96732b63c2b0c7e |
| Created | 2026-04-26T16:04:34.006073006+00:00 |
| Started | 2026-04-26T23:06:52.791643184+00:00 |
| Completed | 2026-04-26T23:26:19.857922279+00:00 |
| Tags | eval-scheduled |
| Tokens | 11555731 in / 32840 out |
| Eval score | 0.16 |
| └ blocking impact | 0.15 |
| └ completeness | 0.05 |
| └ coordination overhead | 0.40 |
| └ correctness | 0.10 |
| └ downstream usability | 0.30 |
| └ efficiency | 0.10 |
| └ intent fidelity | 0.52 |
| └ style adherence | 0.20 |
Description
Description
Combined work: convert Priority from named enum to unbounded u32, restyle display to match muted-gray time markers, and (the original spec) honor priority in dispatch sort order.
A. Priority becomes u32 (replaces named enum)
User decision: Priority enum (Critical/High/Normal/Low/Idle) is too rigid — when you need to put something on top of a Critical, you're stuck. Switch to:
- Type:
u32. Low = 0. No upper bound. - Default: 10 (room to bump down to 0 or up to 100+).
- CLI accepts both numeric (
wg reprioritize foo 50) AND named aliases as input convenience (wg reprioritize foo highresolves to a configured numeric value, e.g. critical=100, high=50, normal=10, low=5, idle=0). Aliases are INPUT-ONLY. - Display ALWAYS shows the number (
[10]), never the name. Don't double-display. - Migrate existing data: read old enum values from graph.jsonl, map to numeric (Critical→100, High→50, Normal→10, Low→5, Idle→0). Write as u32 going forward.
B. Display restyling
Currently priority badges render in purple (e.g., [35m[high][0m ANSI). User finds this too intense. Match the muted-gray color used for time-since-creation markers (e.g., 25m in wg viz output). Likely \033[90m (bright black / gray) or whatever color those time markers use — read from the same constant.
Apply consistently: wg list, wg viz, wg ready, wg show, TUI views — anywhere a priority badge appears.
C. Honor priority in dispatch (the original spec)
Sort ready tasks by priority (DESCENDING — higher number = dispatched first) before applying secondary sort by cost/hours. Currently src/query.rs:148 sorts by get_value only.
- Higher u32 = higher priority. Tasks with priority 100 dispatch before priority 10.
- Within same priority level: round-robin / fair share by tracked accumulated dispatch (CFS-like vruntime). Initial impl can just sort secondarily by cost/hours; the fair-share refinement can be follow-up if needed.
- Idle priority (0) only dispatches if no priority-1+ task is ready AND there's spare
max_agentsslack. - High-priority preemption (kill lower-priority running agent for higher-priority pending) is OUT OF SCOPE — defer to v2.
- Default priorities for system-spawned tasks: chat-loop tasks at 50; .assign / .evaluate / .flip at 10; user tasks at 10; explicit user override always wins.
Files likely to touch
src/graph.rs— Priority type def + Task field + serde migration from old enum stringssrc/commands/reprioritize.rs— accept numeric + named aliases; emit numbersrc/commands/list.rs,src/commands/show.rs— display badge in graysrc/commands/viz/mod.rs— samesrc/tui/viz_viewer/state.rs— TUI badge renderingsrc/query.rs— dispatch sort by priority descsrc/commands/service/mod.rsand/orsrc/commands/service/coordinator.rs— wherever ready-task selection feeds dispatch
Migration
- Old
graph.jsonlentries with string-enum values ("high","critical", etc.) must deserialize cleanly into u32 (apply the mapping). One-time migration on first read. - Once read, written as u32. Don't ship a flag day; the deserializer handles both for one release.
What to drop
- The
Priorityenum definition (replace with type aliaspub type Priority = u32if needed for API stability, or remove entirely). - Any code that switches on enum variants — replace with numeric thresholds.
Validation
-
Failing tests first:
- test_priority_is_u32 — Task.priority field is u32, default 10
- test_priority_serde_migration_from_named_enum — old graph.jsonl with "high"/"critical" deserializes correctly
- test_reprioritize_accepts_numeric_and_named — both
wg reprioritize x 50andwg reprioritize x highwork; both store as u32 - test_display_uses_gray_not_purple — badge ANSI is the muted-gray color (matches time-marker color), NOT \033[35m
- test_dispatch_orders_by_priority_descending — priority 100 task dispatched before priority 10 task in the same ready set
- test_idle_priority_zero_only_dispatched_when_higher_empty
- Implementation makes tests pass
- cargo build + cargo test pass with no regressions
-
Manual smoke:
- In a scratch dir: 3 tasks at priorities 100, 10, 0 → service dispatches in that order with max_agents=1
- Existing graph with old enum priorities loads cleanly, displays as numbers in muted gray
wg reprioritize foo highworks;wg show foodisplays priority as a number, not 'high'- Visual:
wg vizpriority badge color matches the time-since-creation color (subjectively muted, not bright purple)
Depends on
Required by
- (none)
Log
- 2026-04-26T16:04:34.005448333+00:00 Task paused
- 2026-04-26T16:06:08.496965668+00:00 Task published
- 2026-04-26T16:06:27.670986634+00:00 Lightweight assignment: agent=Careful Programmer (f5143935), exec_mode=full, context_scope=task, reason=Careful Programmer provides Rust implementation expertise and verification rigor needed for correctness-critical scheduler logic with TDD and explicit smoke-test validation.
- 2026-04-26T16:13:57.697735979+00:00 Spawned by coordinator --executor native --model claude-opus-4-6
- 2026-04-26T16:13:57.718429679+00:00 Task marked as failed: Agent exited with code 1
- 2026-04-26T16:17:15.925401965+00:00 Task reset for retry from failed (attempt #2)
- 2026-04-26T16:17:16.238375451+00:00 Spawned by coordinator --executor claude --model claude-opus-4-6
- 2026-04-26T16:17:25.265589212+00:00 Starting implementation of priority-based dispatch (CFS-style fair scheduler). Previous attempt failed due to missing API key — this attempt will implement directly.
- 2026-04-26T16:20:15.287340330+00:00 PLAN: 1) Add dispatch_count to Task for CFS fair share 2) Update sort_tasks_by_priority_with_features for within-level fair share + Idle gate 3) Increment dispatch_count on spawn 4) Add priority to wg ready + wg viz 5) Set coordinator-loop default priority to High 6) Write tests. Note: basic priority sorting already exists — this fills in the remaining CFS behavior.
- 2026-04-26T16:40:39.449467730+00:00 All 4 specified tests pass. Full suite: 2778 pass, 6 pre-existing failures (spawn_task + provenance). Building binary for smoke test.
- 2026-04-26T16:43:38.338376147+00:00 Manual smoke test PASS: priority badges visible in wg list, wg ready, wg viz. Critical/Normal/Low ordering correct.
- 2026-04-26T16:45:00.774232075+00:00 Committed: ee4f3bb15 — pushed to remote
- 2026-04-26T16:45:11.928497634+00:00 Validated: all 4 specified tests pass, cargo build + cargo test pass (6 pre-existing failures unrelated to changes), manual smoke test confirms priority display in list/ready/viz and correct dispatch ordering
- 2026-04-26T16:45:28.451291366+00:00 Task marked as done
- 2026-04-26T16:52:36.252690668+00:00 Resurrection: reopened due to 1 pending message(s)
- 2026-04-26T16:53:31.807755610+00:00 Spawned by coordinator --executor claude --model claude-opus-4-6
- 2026-04-26T16:53:50.955283119+00:00 Starting implementation — reviewing agent-43's prior work and applying amended spec (u32 priority, ⚡ glyph, gray display, dispatch sort)
- 2026-04-26T16:57:08.235550698+00:00 Plan: (1) graph.rs: replace Priority enum with u32+constants+custom deser, (2) add.rs: parse_priority/calculate_final_priority for u32, (3) reprioritize.rs: numeric+named, (4) viz/ascii.rs+list+ready+show: gray ⚡N badge inside parens, (5) coordinator.rs: sort descending u32 + idle gate, (6) eval_scaffold.rs: u32 logic, (7) all callsites: Priority::X → constant
- 2026-04-26T17:26:02.924124894+00:00 Implementation complete. Priority enum → u32 with migration, ▴N badge in default color, dispatch sort descending, idle gate, named aliases. Build + tests pass. Manual smoke: migration, reprioritize, viz/list/show/ready all confirmed.
- 2026-04-26T17:27:00.681961162+00:00 Committed: a05ef6411 — pushed to remote
- 2026-04-26T17:27:30.158806916+00:00 Validated: all spec requirements met: - Priority is u32, default 10, no upper bound - Serde migration from named enum strings works - CLI accepts both numeric and named aliases (--priority 42, --priority high) - Display uses ▴N glyph in default terminal color, inside status parens - Dispatch sorts by priority descending (100 before 10) - Idle gate: priority-0 excluded when priority≥10 exists - 2779 tests pass (6 pre-existing failures unrelated to changes) - Manual smoke: migration, reprioritize, viz/list/show/ready confirmed
- 2026-04-26T17:27:34.575710302+00:00 Task marked as done
- 2026-04-26T20:27:03.983373483+00:00 Resurrection: reopened due to 1 pending message(s)
- 2026-04-26T20:30:44.040517934+00:00 Lightweight assignment: agent=Careful Programmer (f5143935), exec_mode=full, context_scope=task, reason=Careful Programmer role fits code implementation; Careful tradeoff matches correctness-critical priority/dispatch logic and schema migration.
- 2026-04-26T21:10:18.085945057+00:00 Spawned by coordinator --executor claude --model opus
- 2026-04-26T21:10:21.384135915+00:00 Task marked as failed: Agent exited with code 1
- 2026-04-26T22:44:09.511806777+00:00 Task reset for retry from failed (attempt #3)
- 2026-04-26T23:06:52.791649485+00:00 Spawned by coordinator --executor claude --model opus
- 2026-04-26T23:09:03.739281581+00:00 Resuming from agent-51's prior work. State: agent-51 commit c7f1afdfe already in main with comprehensive priority u32 + display + dispatch implementation. Outstanding: user's final message at 20:12:48 changed badge symbol from ▴ to ⌁ (U+2301 ELECTRIC ARROW) — code still uses ▴. Will update.
- 2026-04-26T23:26:10.185414950+00:00 Committed: b8508ed4f — pushed to remote. Symbol change ▴→⌁ across 5 display sites (list, ready, show, viz/ascii, viz/graph). Live-tested: wg list shows '⌁50', wg show shows 'Priority: ⌁50', wg viz shows '(open · ⌁50)'. cargo build + 1947 lib tests + 2839 integration tests pass (1 pre-existing provenance failure noted by wave-1-integration-smoke, unrelated to priority work). Smoke scenario priority_int_and_string_deserialize PASS.
- 2026-04-26T23:26:19.857931596+00:00 Task marked as done