Expand description
App query block: reads AgentMux’s own state, read-only (the Drone real-world jobs spec §4.2). Deterministic and free: no agent turn, no network.
Block config (node.data):
queryrequired, one of:muxbuswhether cloud messages are reaching this machine.agentsevery agent this machine has: how many it wants running, and which of them are not.agentone agent’s availability. Needsagent, its name, written in the graph.tasksKanban tasks, filtered byholder,stateandpr(each optional).lan_peersthe other machines this one sees on the LAN, and whether each answered lately.jobsrecent job runs: one job’s withjob, else the newest run of every job.memoryone Global Memory entry, by id or name (entry), read-only. Needsentry, written in the graph. An entry of the system tier is not offered. Nothing here writes Memory.presencewhich agents on this machine are working on a repository, a path or a branch (repo,path,branch; at least one), from their own work facts. Names, state and how each matched; no goals, no file names, and claims and posts are not read.
agent,job,entrythe agent’s, the job’s or the Memory entry’s name (a job’s or an entry’s id works too). Never a{{reference}}: a value from outside must not pick whose state the graph reads (§6.2).holder,state,prtask filters. They only find tasks, so each may be built from a{{reference}}(a PR url from the trigger).prmatches a task’s PR link exactly.repo,path,branchthepresencefilters. They only find who is working there, so each may be built from a{{reference}}.max_charsmemory, how much of the entry to return (default 4000, at most 20000).limittasks and jobs, how many to return (tasks: default 50, at most 200; jobs: default 20, at most 100).
Output, by query:
muxbus:{ "state", "connected", "signed_in", "since_ms", "last_ok_ms"?, "last_error"? }.agents:{ "count": N, "wanted_running": W, "up": U, "all_up": bool, "problem_count": P, "problems": [{ "agent", "state", "detail"? }], "problem_names": "<name (state), ...>" }. An agent isupwhen it is wanted running and idle, working or waiting on the person; a wanted-running agent that is stopped, starting, limited, signed out or in error is a problem (at most 20 listed).all_upis true with no problem.agent:{ "found": bool, "ambiguous"?: true, "state"?, "would"?, "reason"?, ... }, the availability the Agents tool shows.foundis false for a name no agent here has.tasks:{ "count": N, "tasks": [{ "num", "title", "state", "holder", "pr", "branch" }] }.lan_peers:{ "count": N, "answered": M, "peers": [{ "host", "channel", "version", "os", "agents", "last_seen_ms", "last_answered_ms"?, "answered" }] }.answeredis true when the peer answered this machine’s own poll (asked every 30 s) in the last two minutes: it is up and reachable from here. It is not a signature check.jobs: (scheduled, Drone and cloud jobs alike, as the run ledger holds them){ "found": bool, "count": N, "runs": [{ "id", "job_id", "job", "state", "outcome", "trigger", "summary", "started_ms", "ended_ms"?, "cost_usd"? }], "last_ok"? };foundis false for ajobthat matches none. With ajob,last_okis that job’s newest run that finished with outcomeokorfindings(a run row, or null when there is none), found whateverlimitcutsrunsto.memory:{ "found": bool, "id"?, "name"?, "content"?, "chars"?, "truncated"? };foundis false for an entry nobody has (or the system tier), withambiguouswhen two entries share the name.presence:{ "count": N, "agents": [{ "agent", "status", "repo"?, "branch"?, "matched": ["claim", "dirty", ...] }] }.
Every answer of this block is outside text to the run (the taint bits): what an entry or an agent’s branch says is not the graph’s own.
Structs§
- Jobs
Filter 🔒 - The filters of a
jobsquery: one job by name or id (empty is every job) and how many runs. - Memory
Filter 🔒 - The filters of a
memoryquery: one Global Memory entry, by id or name, and how much of it to return. - Presence
Filter 🔒 - The filters of a
presencequery: what to ask who is working on; at least one is not empty. - Task
Filter 🔒 - The filters of a
tasksquery; an empty one matches anything.
Enums§
- Query 🔒
- What the block asks.
Constants§
- ANSWERED_
WITHIN_ 🔒SECS - A peer that answered this machine’s poll within this many seconds counts as answering (the poll is every 30 s, so four missed ones in a row).
- DEFAULT_
LIMIT 🔒 - Tasks returned when the node gives no
limit. - DEFAULT_
MEMORY_ 🔒CHARS - A Memory entry is cut to this many characters when the node gives no
max_chars, and never to more than the cap. - DEFAULT_
RUNS 🔒 - Job runs returned when the node gives no
limit, and the most one query returns. - FINISHED_
WINDOW_ 🔒DAYS - Finished tasks changed within this many days are still seen by a query.
- MAX_
LIMIT 🔒 - The most tasks one query returns.
- MAX_
MEMORY_ 🔒CHARS - MAX_
PRESENCE 🔒 - The most agents a
presencequery lists. - MAX_
PROBLEMS 🔒 - The most agents
agentslists as a problem. - MAX_
RUNS 🔒 - RUN_
SUMMARY_ 🔒CHARS - A run’s summary is cut to this many characters.
- SCAN_
LIMIT 🔒 - How many board tasks are read before filtering: every open task and the recently finished ones.
Functions§
- agent_
answer 🔒 agent: the availability view, withfoundfirst.- agents_
answer 🔒 agents: how many agents the machine wants running and which of those are not up. Pure, so a test can hand it rows.- jobs_
answer 🔒 jobs: the named job’s newest runs, or the newest run of every job, newest first, cut to the limit. A job is whatever the run ledger has runs of (scheduled, Drone and cloud jobs alike), and a scheduled job with no run yet.- lan_
peers_ 🔒answer lan_peers: the machines on the LAN other than this one (a peer at one of this machine’s own addresses is another channel here), by host name, each with whether it answered the poll lately.- memory_
answer 🔒 memory: the Global Memory entry whose id isf.entry, or whose name is (without regard to case), cut tof.max_chars. An entry of the system tier is not offered, and two entries with one name are not guessed between.- muxbus_
answer 🔒 muxbus: the delivery state in the words a Condition reads.- plan 🔒
- What the node asks, with the filters’ references resolved. Pure, so it is testable without a server.
- poll_
check 🔒 - The question a
polltrigger asks (backend::jobs::poll): the App query named by the filter’squery, with the filter’s own keys as its config and no references to resolve. - presence_
answer 🔒 presence: the agents whose own work facts (their clones’ uncommitted changes, recent edits, branch and repository) touch what is asked. Claims and posts are not read. Only whatPresence whoshows of each agent that a graph needs: its name, its state and how it matched; no goal, no file names. Pure over the facts, so a test can hand it some.- run
- run_row 🔒
- One run, for the graph: what happened and when, with the summary cut.
- tasks_
answer 🔒 tasks: the tasks that match, newest first as the board lists them, cut to the limit.