garage44.eu/jeroen/midas

logclone: git clone https://garage44.eu/jeroen/midas.git

.. /DESIGN.md

raw

midas — design

How midas works and why. README.md introduces it; the guides in docs/ say how to set it up and use it.

Terms

termmeaning
machinea computer in the workspace, on the workspace's WireGuard network
hubthe one machine that holds the workspace's state and answers for it
nodea contained checkout with a warm build directory on a machine, which one agent holds at a time; a machine may run several
agenta session that builds: it takes a node, works on it over ssh, gives it back
leaseholding a node
callera key that may change the workspace (take, release, add nodes), one per trust level

1. Parts

 agent's machine               hub (user `midas`)                node (on any machine)
 ┌────────────────────┐       ┌──────────────────────────┐       ┌──────────────────────┐
 │ worktree           │ HTTP  │ nodes, leases, queue,    │ HTTP  │ rootless container   │
 │ midas              │──────►│ readings, event log      │◄──────│ OpenSSH + midas      │
 │ (one binary)       │       │ git mirror + LFS cache   │       │ guard + heartbeat    │
 │ ssh <node> …  ─────┼───────┼──────────────────────────┼──────►│ /work/checkout       │
 └────────────────────┘ ssh   │ warmer (timer)           │  git  └──────────────────────┘
                              └──────────────────────────┘
                     all over WireGuard, system software on every machine

One binary, three roles: the CLI where agents run (also answering to cargo, to say where builds go), the hub, and the sshd hooks, guard and heartbeat inside every node. Each machine is set up by one root command — midas hub setup, midas setup <node> — that writes its settings to /etc/midas and is run again to update.

The hub owns the state (/srv/midas/state): node definitions (nodes.json), leases and the queue (registry.json), each node's last heartbeat (readings/) and the event log (log/). Everything else asks its HTTP API. Reading is open to the tunnel; changing anything needs a caller key.

2. How an agent works

midas take                     # any node; or: midas take gpu / midas take <machine or node>
ssh gpu-1 'cargo test -p …'    # build and run there
scp gpu-1:/tmp/x.png .
midas release                  # or the session-end hook does it

Leases and their modes

A lease has a mode: build (every lease before, and the default), job or bot.

Jobs

midas run [machine] -- <command> holds a node for one command: it takes the free node fastest at that command (rank_by_speed), runs it over ssh — the flush first, as always — and exits with its status. The lease is a job lease, given back a minute after the command when somebody waits for the node and ten minutes after when nobody does, so a session reading and editing between two builds holds nothing. Build leases were held nearly three times as long as anything ran on them: the Macs 102 h, of which 38 h in use, in the two weeks to 2026-11-14, while sessions waited 25 h for them (registry::JOB_WAITED_IDLE_S).

Bots

In bot mode the agent starts a long-running program on the node — a bot, built from the checkout, which follows the worktree as always — and talks to it over MCP:

midas bot start gpu --mcp '<relay>' -- <command>   # take in bot mode, start, wait until it answers
midas bot mcp                                      # what the agent's MCP config runs
midas bot stop                                     # stop it, give the node back

A hosted bot has an agent of its own (decisions 18, 19): Claude Code, run by midas itself and fenced to the bot's tools, unless --agent '<command>' names another ACP agent (with --agent-meta and --agent-mode for its fence):

midas bot start --name scout --agent --brief <file> --mcp '<relay>' -- <command>
midas bot log scout · midas bot tell --name scout "…" · midas bot stop --name scout

3. A node

4. The GPU memory guard

On an AMD APU the shared GPU pool (GTT) can fill: the kernel tries to swap GPU buffers out, everything touching the GPU stalls, and a killed process cannot exit — the whole machine freezes (2026-10-10). GTT is not charged to the container's memory cgroup (measured: GTT 568 → 4,235 MB during a capture while the container's own memory peaked at 2.4 GB), so only the guard protects against it. midas node guard runs in the node as build, the user that can read the sessions' /proc/<pid>/fdinfo. Every 2 s it reads GTT: at 80 % sessions are warned, at 92 % the largest holder gets SIGTERM and the next session is told. The machine stays up first; the agent is told second.

5. The hub

6. Security

The hub's machine is assumed to be compromisable — the agents and the git server live there too — so a node is untrusted and what must hold is the build machine, its owner's files and home network. That is set on the machine, by its owner, with a midas they built: the node's own user; a firewall keyed on that user (the hub and the internet yes; private addresses, the machine's own addresses but its public web ports, and IPv6 no; from the tunnel only the node's ssh port); nothing from the hub executed on the machine. What the hub decides — which keys log into the container, which repository it checks out — only reaches inside the container — the midas the node's build runs included (§3). Tested by switching the container's own fence off: the node still reached only the hub, the internet and the machine's public website.

7. Logs and checks

One log, on the hub (log/events-YYYY-MM-DD.jsonl, 90 days): claims and refusals (with what was passed over and why), the queue, leases ending, ssh sessions with exit status and duration, flushes, handovers, OOM kills, guard actions, bots started, ready, failed and stopped (with why), heartbeats lost and regained, warms step by step, Forgejo calls by caller, errors. Nothing secret. midas log, midas explain <node> and midas status read it. midas check: the hub, every node's heartbeat, build, disk, build directory and warmth, the local ssh config, Forgejo through the hub, and the last day's failures. It prints what is wrong (-v: every check), and labels a problem that is an owner's — a node's machine, the warmer, the midas installed here — apart from the caller's own; its exit status is the number of the caller's. midas mcp offers the same as MCP tools, plus Forgejo.

8. Decisions

  1. The hub owns the state, everything else asks it. The cost: with the hub down nobody can take a node.

  2. Node access is OpenSSH, hooked through AuthorizedKeysCommand and ForceCommand; a protocol of midas's own and an embedded ssh server were designed and dropped.

  3. WireGuard is system software: its roaming keeps sessions alive when a mobile machine's address changes.

  4. The hub is a confined service, not a container: systemd already gives it its own user, a read-only system and a syscall filter.

  5. One binary, one command set. cargo where agents work is midas by name.

  6. Leases on the hub, not claim files on a node's disk.

  7. Nodes are data: an entry in nodes.json; nothing in the code names a machine.

  8. GPU memory: the machine stays up first, the agent is told second.

  9. Agents use plain ssh, git and scp; no wrapper in front.

  10. No login on an owner's machine (2026-10-11): an early node shared its owner's home, and agents left 29 GB there.

  11. Plan for a compromised hub machine (2026-10-12): the boundary is set on each build machine by its owner. Nodes stopped updating themselves; signing updates on the hub's machine was rejected, since the key would be on the machine assumed compromised.

  12. Nodes register their own keys, by WireGuard address (2026-10-12): copying keys by hand was a step every re-setup needed and every new machine got wrong once.

  13. One set of terms (2026-10-13): machine, node, lease. The slot command went with the word.

  14. Bots: MCP as stdio over ssh, and the token on the machine (2026-10-15). Nodes allow no forwarding (§3), so a bot is reached the way everything on a node is, through an ssh session — whose stdin and stdout are a pipe MCP already speaks. The bot brings its own relay from that pipe to its socket, so midas has no HTTP client, port or MCP token: it runs two commands it is given. The bot's credential is the machine owner's to give and is set on the machine (sudo midas bot setup), never on the hub, which is assumed compromisable (§6). Known limitation: anything running as build in the node — the holder's sessions, and the hub's operator key — can read a running bot's environment, token included. A separate user for bots would close that and is deliberately deferred: the holder is trusted with the bot it started, and the operator key is the workspace's own.

  15. Deploys without a CI system in between (2026-10-16). The landing gate runs the tests on a node; the deploy workflows then built the same commit again on a CI runner — on this same machine, with three slots shared with everything else — to copy the result into a directory here. midas deploy builds on a node instead and publishes here, and keeps what CI gave: only a commit on the warm branch, only with the gate's receipt (or a logged reason), built in a checkout of exactly that commit. It is split where the privilege changes. The hub's user queues and builds; root publishes, taking every destination, check and user from the root-owned hub.conf and reading what the hub's user hands it refusing a symbolic link at every level, so a compromised hub can make root publish bytes only to the places that file names. Root reports by events sent to the hub, never by writing into the hub's directories. Known limitation: a node is less clean than a fresh CI container — its warm target/ outlives its holders — which is acceptable while every holder is the workspace's own agent, and would call for a build directory of the deploy's own if it were not. Revised 2026-11-21, before the code went public: "only to the places that file names" did not hold where a place was root's own executable — midas's self-update ran the published binary as root, so the hub's user was root — nor where the place's directory belonged to someone else, who could swap a level of it for a link between root's calls. Root now writes relative to a destination directory opened without following links, and runs a published midas only as hub.conf's self_update says: hub (as before, the default), signed (the owner's key on it, never on the hub: release.rs), or off. The honest default is still hub: a workspace that has never made a release key must keep updating itself the day it takes this build.

  16. Bot secrets kept by the hub (2026-10-16), revising 14. A bot's token was set on its machine by root (sudo midas bot setup), which meant a sudo session per machine, and a Mac node — a VM with no configuration directory of the machine's — could not have one at all. midas bot token <node|gpu| machine> gives it to the hub instead, from anywhere with a caller key; the hub keeps it in a 0600 file of its own and midas bot start hands it to the bot over the ssh session's stdin, so it is on no node's disk, in no command line and in no log (only its name is). The price, accepted while every machine has one owner: a caller key reads it back, and a compromised hub has every one — no worse than its operator key, which could already read a running bot's environment. The per-machine way stays for a token that must not pass through the hub; where both set a name, the hub's wins.

  17. A landing queue, and the gate on the fastest node (2026-10-17). The landing gate used to rebase, then wait for a VPS node, then test, then push — and in the week to 2026-10-17 every gate ran on one VPS node, one after another, each waiting 8–28 minutes. The landing ahead pushed the moment its gate ended, which was when the next one's started, so that one tested a base already gone and, green, was bounced at the push and run again: at least six times that week, while two Mac nodes that gate in half the time sat free. So the hub keeps one turn to land (midas land), taken before the rebase and held through the push; a landing in progress is never overtaken, and one that dies lapses after ten silent minutes. The turn is not a node, so the gate's node is still taken inside it — now by measured speed for that command (take --fastest-for). A git server on the hub's machine reports pushes through its post-receive hook, from the hub's own address, with no key: all it can do is make the hub fetch sooner. Writes to the branch stay with the git server, which keeps its own branch table and CI triggers.

  18. A bot's agent, hosted over the Agent Client Protocol (2026-10-18). A bot was driven by the agent session holding its lease, which typed MCP JSON-RPC through midas bot mcp in a shell and kept a background read_chat waiting: a re-arm forgotten, and the chat went unanswered and the lease lapsed. Nothing wakes an idle session from outside but its own background work. So bot start --agent runs the agent itself, as an editor does: ACP is JSON-RPC on the agent's stdio, spoken by Gemini CLI and goose natively and by Claude Code and Codex through official adapters, and used by the chat-to-agent bridges of 2026. Rejected: Claude Code's --channels push (one vendor's, and a launch flag Remote Control spawns do not take); MCP sampling (deprecated in the 2026-07-28 spec, never in Claude Code); a model loop of our own (a whole agent, and an API key). The host passes the inbox's content on unread, grants permission only to the bot server's tools, sets the session mode at every start (an agent otherwise takes it from its user's settings — Claude Code took "auto" from the agent container's), and holds no credential: the agent logs in as it would anywhere. A subscription login is its owner's own use; a bot serving other people needs an API key in the agent's environment.

  19. Claude Code's ACP adapter is midas's own (2026-10-21), revising 18. Claude Code's official ACP adapters are npm packages (one renamed and deprecated within weeks), so every agent meant Node, an npx download at start and a Claude Code bundled inside the package, older than the one installed. midas acp is that adapter in Rust (acp.rs): it runs the installed claude in the stream mode its SDKs drive (--print, JSON lines both ways, --permission-prompt-tool stdio for permission questions) and translates. Rejected: driving that stream from the runner and the host directly (two clients rewritten, and tied to one agent where ACP lets any other plug in); keeping the npm adapter (a runtime and a package nobody here wants). It refuses a claudeCode.options key it does not know rather than drop part of a fence, and offers no permission beyond the session. It is the agent a bare bot start --agent hosts too, with the bot's fence (no built-in tools, no settings files, only the bot's MCP server) and mode default set by midas: the bot needs no package and no settings file from the repository that runs it.

  20. An editor's session, mirrored (2026-10-22). A session started in Zed on a workstation was invisible to the hub: nobody could follow it or answer its permission requests from a phone. midas acp --mirror (tap.rs) is the editor's agent: it runs the real agent (midas acp) behind it, passes every message through untouched, and attaches each session to the hub at its first prompt (/v1/hosted/attach, a key's route like a runner's push), found again by the agent's conversation id when the editor loads it. The page steers it as it steers a runner's — message, permission, cancel, mode, model, queue — through the runner's long poll with take: false, so a mirror never starts queued sessions. Whichever of the page and the editor answers a permission first wins; the other's answer is dropped. The agent and its conversation stay on the workstation, so a mirrored session cannot be reopened on the page: taking it over (its worktree's changes onto a branch, its transcript under the runner's project directory, one writer at a time) is the next step, not this one. Rejected: a hook-based mirror (hooks see tool calls, not the conversation, and cannot answer a permission); the editor as a thin client of a hub-run session (the agent would leave the workstation's checkout, which is the point of working there).

  21. A session moves between the editor and the runner (2026-10-22), the step 20 left. Claude Code resumes a transcript moved to another machine's projects directory (named for the working directory) with the same id and knows its new directory — tried before building on it. So a session moves as three things: its work, as a branch; its transcript, through the hub; and which side runs it, which the hub records (handed, handed_back) and enforces — a status pushed by the side that no longer has it is not heard, so a late "waiting" from the editor cannot strand a session queued for the runner. One side runs it at a time: the editor's agent session is closed (ACP session/close) before anything moves, the runner's agent stopped before it goes back. The work is the working tree as a commit made through a throwaway index (handoff.rs), so the person's checkout, index and HEAD are never touched on the way out; coming back, it is restored into the working tree only when the checkout is exactly as it left, so nothing made meanwhile is overwritten — otherwise the person and the agent are told where it is. Rejected: moving the checkout's changes with a stash or a commit on the person's branch (both change their checkout behind them); git bundle or rsync of the worktree (the remote both sides already push to is simpler and keeps the history); the page loading the transcript into the runner's agent by replaying it as prompts (loses tool calls and costs a turn per message). midas acp gained what the round trip needs from Zed: session/list (Zed's thread history), history replay on session/load, session/close, and on the way edit diffs and slash commands.

  22. Projects (2026-10-23). A project is a repository of hub.conf's repos (owner/name, named by its last segment): cartopolis, podium, midas. The machines are the workspace's, not a project's — every project's sessions take the same nodes, which keep a checkout per repository already (§2) — so a project adds nothing to define but its repository. A session records its project (repo): the page chooses one when it starts a session, the CLI takes the checkout's, an editor's mirror says its checkout's origin. The runner keeps a checkout per project, MIDAS_SESSIONS_REPO for its own and repos/<owner>/<name> under MIDAS_SESSIONS_DIR for the others, cloned when the first session of one comes. Seen on the way: a podium session handed over from Zed went to a runner that only had cartopolis's checkout, did not find its branch, and failed — closed in the editor, failed at the hub, run by neither. So the hub refuses a handover from a repository that is no project before the editor closes anything, and a session the runner cannot take over goes back to the editor as it left (handed_back with the editor's own snapshot and transcript). Rejected for now: projects with machines of their own, or settings beyond the repository (the warmer and deploys stay the first repository's; deploys no longer do, 25). The page never switches projects, as the work of several goes on at once: it names each session's project (a tag on its card and in the list, from its start's repo when midas neither runs nor mirrors it), and narrows Home and the list to one when asked, a view and never what runs; a node busy with another project's work still shows busy.

  23. Nodes follow the hub's midas, as build only (2026-10-23), revising 11. Every change to the hooks, the heartbeat or the guard waited for each owner's sudo on each machine, so nodes ran a spread of builds and a fix reached the Macs days late. Everything that runs as build already obeys the hub — the code every build compiles and runs, and who may log in — so the hub's midas there grants a compromised hub nothing it lacked. It never runs as the node's root: the updater is the owner's copy, so a broken build from the hub cannot break the updater that takes its fix, and what fences the node — the node's user, the machine's firewall, the container or VM and its limits — stays the owner's, changed only by their midas setup. Updating the machine side from the hub's page as well was designed and deferred: it needs an approval the hub cannot forge (a passkey on the owner's phone, checked by a root updater on each machine) and a build the hub's machine does not control, and even then the page asking for it is served by the hub.

  24. A session spans the projects its work needs (2026-10-25), revising 22. Asking the person to choose a project before a session starts was a click that knew less than the agent would a minute later, and it made a change across two projects (podium needing a midas feature) two sessions. A session started from the page now works in a folder of its own (session-<id>, marked .midas-session), never a repository, and its agent adds projects with the project_add tool as the task turns out to need them — one, several, or none for a question: each a worktree at ./<name>, on branch session/<id> off its main, its skills linked into the folder. The hub keeps the list (repos; repo stays the first, for the list and the board) and says each addition in the conversation. Everything per-worktree stayed per-worktree: a node keeps a checkout per repository already and follows whichever worktree the ssh runs from; a worktree in a session's folder is that session's (flush::worktree_owner), so its nodes, notes and landing gate are the session's; and each project lands on its own through finish-branch, the one depended on first, each landing standing on its own on main, --finish on each so the session finishes when all are live. Work in progress is kept per project (podium:web/app.ts): a session's build in one project no longer replaces what it changes in another, and the same path in two projects is no overlap. Rejected: picking the project with a small model before the session starts (built, and replaced the same day — the agent decides better with the task in front of it, and a pre-pick still allowed only one); one landing across repositories (Forgejo moves one main at a time, so it could only be emulated, and a half-landed pair is better prevented by order than repaired). What Claude Code keys by the agent's directory is carried by hand, as the folder is no project: a project's own hooks (.claude/settings.json) through one hook per event in the folder's settings, midas hook projects, which hands each event to the hooks of the projects it concerns (an edit's to its file's project) and puts their answers together — a project's start hooks run when it is added, their word in the tool's answer; and its memory, which Claude Code keeps per directory: the folder's syncs the workspace's notes, and its first project's once it has one, and the tool's answer lists each added project's. midas's own hooks treat the folder as the session's checkout. Sessions of one worktree (older ones, and those handed over from an editor) keep that form and cannot add projects.

  25. Every project deploys the same way (2026-10-27), revising 22. Deploys stayed the first repository's, so a second project with something to serve (dardasha) was brought up to date by hand on the host, and its landings on the page waited on cartopolis's deploys ("apk deploying, atlas deploying" under a dardasha landing), as the page knew one set of targets. A project's targets now sit in its own projects entry in hub.conf (deploy), built from its own main in its checkout on the node (/work/repos/<owner>/<name> beside the node's own, where a session's flush puts it), and the hub ships and judges "live" per project: a landing waits on its project's deploys and no other's. The old top-level deploy section is still read, as the first repository's, so a hub.conf need not change on the day. Kept the workspace's: target names (midas deploy <target> takes a name alone, and one in two projects is refused until renamed), the hold (a person holding deploys means all of them), and the landing queue a deploy waits behind (one queue for every project).

  26. A session carries on at a time it sets (2026-10-29). Asked to stop a long job at 3,500 of 4,500 and do the rest the next day, a session answered "tomorrow I do the last 1,000", and nothing would have woken it: its turn ended, and Home showed it under At work and then Idle like one forgotten. Claude Code's own wake-ups (ScheduleWakeup, cron) live in the agent's process, which a runner restart or a finished session ends, and the page cannot see them. So the hub keeps the time (wake: one per session, its words for then, who set it), sends it as a message "From midas" (tell), reopening an ended session first, and the page shows it as a state of its own (Scheduled) with Now, Move and Cancel. One time, not a list: work over days is a chain, each turn setting the next, so there is always one next step to show and to move. Times are said with their offset from UTC: the hub and the agent container run in UTC, and the person's clock is the page's, so the page moves a time in the browser's zone and the agent asks when it cannot tell. Rejected: a cron of prompts per session (repeating work is a routine, not a session's next step); the agent keeping a background sleep (gone with its process, and invisible).

  27. The person's decisions are counted, and capped by them (2026-11-04, focus.rs). Steering several sessions a day from a phone wore the person out, and the research agrees (BCG's survey of 1,488 workers: how much oversight the AI needs best predicts mental fatigue, and output fell from a fourth agent on). So the hub keeps a ledger of what they decide, with points for what it likely cost (one per decision, more for an interruption, a switch between sessions, a long read, a landing, a late hour, words of their own), and lets them set a daily cap, decision blocks and quiet hours. The limits only change what wakes the phone and what the autopilot takes on: nothing is hidden, and every question can be answered on the page whenever they like. The autopilot learned to say whether what it leaves needs the person now or can wait for a block, and to decide by rules the person approved in their own words, which it proposes from their earlier answers. Points estimate effort and nothing more, so a one-tap check-in (fresh … fried) sits beside them and suggests a cap from the person's own days. Rejected: measuring attention from reading time on the page (a phone's page is open while nobody reads it, and it watches the person rather than the work); a cap that refuses new work (the person decides; at the cap the page asks, and only a schedule waits); learning rules silently from answers (a rule the person never saw decides in their name).

  28. Work is thought of from a goal, on a research tree (2026-11-15, tree.rs). Every session began with the person thinking of it, and what midas had for the rest generated work from a kind of task rather than a goal: the self-filing autopilot (retired 2026-09-11) filed work nobody asked for, and templates run without direction gave vague performance sessions. So the person keeps goals, a scout fills in the techs on the way to each from the code and from what earlier sessions left open, and the tree shows how far a goal is and what is next, as Civilization's does — the form was the person's. What one move found stays in the fog until a second finds it too or the person keeps it; an icon is rebuilt from geometry before the page draws it. Rejected: sessions straight from a goal (the old filer with a better prompt); a roadmap written once (stale by the second landing); a backlog with priorities (the retired ticket workflow — the tree owes nothing, and its fog fades).

  29. What is deployed is watched, inside midas (2026-11-18, watch.rs). A landing was live the moment it was published, and nothing looked after that: a target failing was found by whoever tripped over it. So the hub samples each deploy target with a watch once a minute — its systemd unit's state, memory, CPU and restarts, and probes that must answer — and the page charts them beside the deploys, each naming the landings it carried. Rejected: Grafana with Prometheus and Loki (three more services on the machine they would watch, with logins of their own, and none knows what a landing or a session is, which is what the first question after a failure asks). Only deploy targets, and only from the hub's own machine, so the machine going down is not seen (the person's choices). This is the first step of the proposal; incidents, rollback and agents put on them build on its watch_changed events.

  30. Root on the hub's machine only in a window the person signs (2026-11-28, admin.rs). The agents reached the hub's machine as an account with passwordless sudo and the docker group, held by every session at all times: any wrong command, any instruction hidden in a page a session read, and the autopilot answering for the person all ran with root over the git server, the certificates and the deployed services. Now they log in as a user of their own, root only while a window is open: a session asks (midas admin), the person's passkey signs the grant (who, how long, why, when), and root checks that signature against a key the person installed from their own login before it writes the sudoers file. The hub carries the request and the signature and cannot make either, as with a release (decision 23's deferred updater asked the same). Root caps what it takes — one user, at most an hour, a grant used once and signed minutes ago — because the page asking for the tap is the hub's, and a person tricked into one should give one window, not a standing grant. Rejected: root trusting the hub's word that the person allowed it (the hub's sign-in would guard root); the window checked by the agents' own tools (an agent could skip them). A window is consent and a record, not a cage: closing it kills root processes from the user's logins, but what root started through systemd, or installed, outlasts it.

9. What went wrong, and what midas does about it

incidentwhat midas does
Build tools lost on a container recreateversioned here; the binary on a volume, its names re-linked by the session hook
The warmer took a node somebody had waited an hour fora fair queue; the warmer yields
An idle session held the only node, unnoticedstatus shows holder, purpose, last command; idle leases end after 30 minutes
A lease lapsed under a working agent and its checkout was resetopen sessions renew the lease; only the holder's flush and the next lease's handover touch a node
A machine froze: shared GPU memory exhaustedthe guard (§4), limits, the agent told
A guard loop died, unnoticedheartbeats; midas check in every session's first message
A sync said "synced" after a git failurethe flush is checked on take; failures are logged
Unpushed commits never reached a nodebundled from HEAD
A session ran in another's checkoutmidas holds refuses the connection
A node shared its owner's home and networkits own user and a firewall on the machine (§6)
Every session had root on the hub's machine, alwaysa user of the agents' own, root only in a window the person's passkey signs (decision 30)
Every incident diagnosed from transcriptsone structured log (§7)
Green gates rerun because another landing pushed while they waitedthe landing queue (decision 17)