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

+4 -8
View File
@@ -65,7 +65,7 @@ function shortPhase(phase) {
return phase.replace("navigate:", "nav:");
}
const ALL_PHASES = ["gate", "choice", "score", "navigate:category", "navigate:leaf", "act"];
const ALL_PHASES = ["navigate:category", "navigate:leaf", "act"];
function optionProbs(row) {
return (row.options || []).map((o) => ({
@@ -130,9 +130,7 @@ function eventRow(evt) {
div.textContent = `assessed → ${evt.success ? "ok" : "fail"}`;
div.title = evt.summary || "";
} else if (evt.kind === "queued") {
div.textContent = `queued (${evt.label})`;
} else if (evt.kind === "preempted") {
div.textContent = `preempted ${evt.preempted}`;
div.textContent = "queued";
} else if (evt.kind === "skill_writing") {
div.textContent = `writing skill ${evt.skill} — ${evt.description} (${evt.model || "codegen"})`;
if (evt.contract_ref) {
@@ -420,9 +418,7 @@ function eventNode(evt) {
node.appendChild(req);
}
} else if (evt.kind === "queued") {
body.textContent = `urgency ${evt.label} (weight ${Number(evt.weight || 0).toFixed(2)})`;
} else if (evt.kind === "preempted") {
body.textContent = `interrupted ${evt.preempted}, requeued with state`;
body.textContent = "queued";
} else if (evt.kind === "dropped") {
body.textContent = evt.reason || "";
} else if (evt.kind === "skill_writing") {
@@ -825,7 +821,7 @@ function renderStatus() {
q.className = "muted";
q.style.marginTop = "8px";
q.textContent = state.status.queue
.map((item) => `${item.id} w=${item.weight.toFixed(2)} ${item.text}`)
.map((item) => `${item.id} ${item.text}`)
.join("\n") || "queue empty";
el.appendChild(q);
-2
View File
@@ -183,8 +183,6 @@ select {
}
.pill.gate { background: #2b3a52; color: #9ec1ff; }
.pill.choice { background: #4a3a2b; color: #ffd59e; }
.pill.score { background: #3a2b4a; color: #d59eff; }
.pill.navigate { background: #2b4a3a; color: #9effd5; }
.pill.act { background: #2b464a; color: #9eeaff; }
.pill.assess { background: #4a2b2b; color: #ff9e9e; }