Phase 4: queue scheduler in tick — drain the defer queue #8
No reviewers
Labels
No labels
agent
coordinate
agent
dev
agent
plan
agent
reflect
agent
test
agent
triage
ai/off
blocked
night
blocked
usage
loop
1
loop
2
loop
3
needs/approval
needs/human
needs/input
needs/review
plan/approved
run/night
state
blocked
state
building
state
passed
state
planning
state
testing
tier
fable
tier
haiku
tier
local
tier
opus
tier
sonnet
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
valssi-public/agent-workflows!8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "phase4-tick-queue"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Phase 4 — queue scheduler in
tick(runbook §5)Extends the
tickjob (schedule, every 15 min, one run per repo via its caller) to drain the defer queue:blocked/usageorblocked/night.now > resume_after(from the<!-- agent-state -->comment; empty/unparseable ⇒ open, preflight re-checks); night: now insideNIGHT_WINDOW(Europe/Helsinki, same math as preflight).updated_at(deferral time) and takes the firstQUEUE_BATCH(default 2).blocked/*and re-appliesorigin_labelwith the PAT matching the route's identity, so the original label event re-fires (preflight runs again and may re-defer).origin_label→ apply mapping:agent/planagent/planagent/testagent/test(on the PR)agent/devagent/devplan/approvedplan/approvedthenagent/devFirst-build carry-over gap (fixed here)
A night/usage-deferred first build has
origin_label = plan/approved, but theimplementroute is APPROVER-only — a bot re-applyingplan/approvedcan't re-fire it. Instead the queue restoresplan/approvedas the standing gate (a bot applying it does not triggerimplement, which checkssender == APPROVER) and then appliesagent/dev, whichdev-bounceadmits for a bot PAT whenplan/approvedis present. The dev route buildsagent/issue-Nfrommainon first run — exactly a first build. No guard relaxation; the human-approval invariant is preserved.Notes
dispatch.yamlchanges; theticktimeout goes 2 → 10 min (runbook §3).AGENTS_ENABLED != true⇒ no-op.js-yamlparse +bash -nof the tick script; live smoke-test of the candidate-gather + FIFO/batch logic against the API.Part of the epic: valssi/ops#1. Merges are human-only.
🤖 Generated with Claude Code