Files
elforeign e35df04069 Expand the agent task queue to cpu/gpu/runtime/shared/qa with deterministic checks
The queue now has three engineering tracks plus shared and qa work. Queue
rules move from shell/awk in workflows into a standard-library Python package
so they are testable offline: claim decisions (dependencies, cycles, file
overlap, area permission), leases renewed only by the holder, reassign and
release, acceptance-command approval by hash, pull request ownership/overlap/
stale/verification checks and a machine-readable summary. Workflows apply the
decisions with minimal permissions, never put user text in run blocks and
never check out pull request code. The sync script fetches the real upstream
so interface changes during work are reported.

Not yet run on GitHub.

Signed-off-by: elforeign <324243036+elforeign@users.noreply.github.com>
2026-11-24 00:09:38 -06:00

43 lines
1.6 KiB
Python

# SPDX-License-Identifier: GPL-3.0-or-later
import json
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), "..", "..", "scripts"))
from agent_queue import config as cfgmod # noqa: E402
from agent_queue.tasks import parse_time # noqa: E402
ROOT = os.path.join(os.path.dirname(__file__), "..", "..")
CFG = cfgmod.parse(json.dumps({
"lease_hours": 24, "upstream": "o/r", "maintainers": ["maint"],
"contributors": {"maint": ["cpu", "shared", "qa"], "gpuer": ["gpu", "shared"],
"rt": ["runtime"], "qaer": ["qa"]},
}))
NOW = parse_time("2026-01-10T12:00:00Z")
def body(area="gpu", files="src/gpu/a.rs", deps="", acceptance="cargo test -p gpu", prio="high", interface=""):
return ("### Area\n\n%s\n\n### Priority\n\n%s\n\n### Goal\n\ng\n\n### Files\n\n%s\n\n### Acceptance command\n\n%s\n\n"
"### Depends on\n\n%s\n\n### Interface\n\n%s\n\n### Context\n\n_No response_\n") % (
area, prio, files, acceptance, deps or "_No response_", interface or "_No response_")
def issue(n, labels=("agent:ready",), state="OPEN", title=None, **kw):
return {"number": n, "title": title or "task %d" % n, "state": state,
"labels": [{"name": l} for l in labels], "body": body(**kw)}
def comment(user, text, at="2026-01-10T10:00:00Z"):
return {"user": user, "body": text, "created_at": at}
def state(*issues, **extra):
s = {"issues": list(issues), "prs": [], "task_comments": {}}
s.update(extra)
return s
def event(actor, text, n=1, kind="issue"):
return {"kind": kind, "number": n, "actor": actor, "body": text}