replace urgency priority queue with strict FIFO

Drop the urgency score and interrupt/preempt decisions: intake is now
idle -> dispatch, busy -> append to a bounded FIFO queue (RequestQueue).
The running process always finishes before the next queued request.

- queue.py: UrgencyQueue -> RequestQueue (deque, no weight/age/recency)
- scheduler.py: remove _priority_score, _interrupt_choice, urgency
  constants, and the weight threaded through dispatch/authoring/requeue
- dashboard/static/gateway: drop weight + preempted handling
- tests + docs updated; flow-main.svg regenerated
This commit is contained in:
gabby committed 2026-10-06 20:38:49 +00:00
1 parent a354958599
commit 1dc0550659
18 files changed
+173 -341

No files matched your search

+2 -4
View File
@@ -346,7 +346,7 @@ def test_regen_skill_rewrites_existing_body(tmp_path, monkeypatch):
_add_skill(scheduler, "calendar", "foo")
captured = {}
def fake_start(request, category, draft, weight, repair_evidence=None, reason_kind="run_failure"):
def fake_start(request, category, draft, repair_evidence=None, reason_kind="run_failure"):
captured.update(
category=category,
repair_evidence=repair_evidence,
@@ -371,7 +371,7 @@ def test_regen_skill_stub_has_no_evidence(tmp_path, monkeypatch):
]
captured = {}
def fake_start(request, category, draft, weight, repair_evidence=None, reason_kind="run_failure"):
def fake_start(request, category, draft, repair_evidence=None, reason_kind="run_failure"):
captured.update(repair_evidence=repair_evidence, reason_kind=reason_kind)
monkeypatch.setattr(scheduler, "_start_skill_write", fake_start)
@@ -389,7 +389,6 @@ def test_cancel_skill_build_discards_and_deletes(tmp_path):
request=Request("build foo"),
category="calendar",
draft=SkillDraft(name="foo", description="d"),
weight=0.5,
)
)
@@ -411,7 +410,6 @@ def test_consume_cancelled_discards_queued_write(tmp_path):
request=Request("build foo"),
category="calendar",
draft=SkillDraft(name="foo", description="d"),
weight=0.5,
)
scheduler._cancelled.add(("calendar", "foo"))
assert scheduler._consume_cancelled(job) is True