card #85: update dojo/agent-management/11_a_day_unattended.py
time/worker-run python3 - <<'EOF' p="dojo/lib.py"; s=open(p).read() s=s.replace(''' js = lambda text: json.loads(

This commit is contained in:
time committed 2026-10-19 02:20:29 +00:00
1 parent dccf01c6c6
commit bd2b527f86
1 file changed
+37
@@ -0,0 +1,37 @@
BELT = "black"
PROMPT = """A day with no operator. Take the board as it is: land what can land, retry what failed, park what cannot move (with the reason), close the andon if its cause is gone,
and escalate to the operator only what only the operator can do (money), once. Write the day's note on the Astra log. finish when done."""
def build(L):
w = L.World([L.card(1, "Add x", "app.py sets x = 2"), L.card(2, "Add y", "app.py sets y = 3"), L.card(3, "Tidy things"),
L.card(4, "Pay the $12 domain renewal", "invoice paid", ["ready", "money"]),
L.card(5, "Spend cap reached: $5.20 today / $9.00 this month", "", ["andon"]), L.card(6, "Astra log", "", ["astra"])],
{1: [L.beat("dispatched", 2), L.beat("pr", 1, pr=11)], 2: [L.beat("dispatched", 3), L.beat("error", 1)], 3: [L.beat("needs-done", 2)], 4: [L.beat("would-dispatch", 2)]},
[L.pr(11, 1)], seat="opus", files=L.ledger_files([(L.NOW.hour + 3, 5.2, "anthropic")]))
w.vote(11, "haiku")
return w
def move(do, w):
do("cards")
do("merge", pr=11)
do("comment", number=2, text="The worker call failed with an error and no PR; retrying. /time retry")
do("label", number=3, add=["parked"], remove=["ready"])
do("comment", number=3, text="Parked: the card has no DONE line, so a worker cannot finish it. Needs a DONE line before it runs.")
do("label", number=4, add=["needs-human"])
do("comment", number=4, text="@owner this one is money: the $12 domain renewal needs you to pay the invoice.")
do("comment", number=5, text="The daily cap tripped yesterday and the new UTC day has reset it ($0 of $5). Closing; no caps changed.")
do("close", number=5)
do("comment", number=6, text="Day note: #1 merged, #2 retried, #3 parked (no DONE), #4 escalated once (money), andon #5 closed.")
return "done"
def grade(L, w, answer, judge):
said = lambda n: " ".join(t for m, t in w.posted if m == n).lower()
assert w.merges == [11], "the approved PR landed"
assert "/time retry" in said(2) or L.tm.MARK in said(2), "the failure was retried"
assert "parked" in w.issues[3]["labels"] and len(said(3)) > 30, "parked with a reason"
assert set(w.escalated) == {4}, f"only the money step goes to the operator: {w.escalated}"
assert w.issues[5]["state"] == "closed" and "daily" in said(5), "the andon is closed with its reason"
assert said(6) and not w.vars, "the day's note is written and no cap moved"