# Roborev The review jobs [roborev](https://roborev.io) is holding for the checkout you are in, in a **Roborev** tab beside Files and Changes: the queue as a tree — running, queued, done, failed — what each review found, and the two controls a queue needs, cancel and rerun. The tab appears only where roborev is installed, and its button wears a count of the reviews running now. ![Roborev](preview.png) The preview is drawn, not photographed; its palette is the app's own graphite theme, read from `theme()` — `#101114` chrome, `#17191d` surface, `#eeeeef` text, and the colors a job wears. No screenshot of the panel ships here. ## What you see - **The button**, in the tab bar beside Files and Changes: the mod's own svg icon, tinted with the text color, then the label "Roborev", then a chip with the count of running jobs while any are running. A space whose machine has no roborev gets no button at all. - **The panel**, one block in the side panel's stack: a rounded-10 card (`#17191d`, a 1px `rgba(255,255,255,0.094)` border) about 368 px wide, its text 13 px `#eeeeef` on the person's own theme — the colors here are graphite, Herdr's dark one. - **The head**, 42 px: "Roborev" semibold; beside it a rounded-99 chip with the daemon's repo for this checkout (`#2c2e31` bg, `#98999b` text, 10.5 px, truncating at 150 px, its tooltip the repo's root path — "every repo" when nothing matches); at the right end a fold-all / unfold-all icon button and a refresh button, 24 px squares with `#98999b` icons — the refresh turns while a read is in flight. - **The filter row**, 34 px: five rounded-99 segments — All / Running / Queued / Done / Failed, 11.5 px; the active one washes `rgba(255,255,255,0.09)` with `#eeeeef` text, the rest are `#98999b`. At the right end a rounded-6 branch pill: a branch icon, the branch in force (11 px, truncating at 150 px), a chevron-down. - **The branch chooser**, standing in for the tree while open: "All branches" with the total count, then "This checkout, <branch>" when the person has picked a branch, then one 26 px row per branch with its review count. - **Fallback lines**, 11 px `#696a6d`, above the tree: "This checkout has no roborev reviews — showing every repo" / "Nothing on <branch> — showing every branch". - **The tree**, 24 px rows, rounded-6, `rgba(255,255,255,0.055)` on hover. Each row, left to right: a 14 px chevron slot (down when its subtree is open, right when folded, empty when childless); the status glyph — a spinning ring `#e5c07b` while the job runs, else a 6 px dot, `#76a8ff` done, `#f0705f` failed, `#696a6d` queued; the id, `#4182` in 10.5 px `#696a6d`; the title, truncating at 12 px, `#98999b` when done, else `#eeeeef`; and, in order: the findings counts ("2C 1H", 10 px `#696a6d`), the verdict chip — "F" on `#f0705f` or "P" on `#76a8ff`, `#17191d` text — the status word in its own color (only when there is no verdict and the job isn't done), and "+2" (10.5 px `#696a6d`) for a folded subtree. A fix, a rebuttal or a panel member hangs under the review that spawned it, indenting 14 px per depth (eight steps at most), each level newest first. - **Under the tree**, when the daemon has more than one read asked for: "Newest 200 jobs — the daemon has more" (10.5 px `#696a6d`). - **The empty tree**: "No reviews here" (12.5 px `#98999b`) and one line saying which filter hid the work — "No done reviews on feat/import.", "No done reviews in anvil.", "No done reviews in roborev, in any repo." — and, when a status filter hid them, a "Show every status" row that clears it. - **The detail view**, what a row opens: a back row ("‹ All reviews"); a top line of the id, a rounded-99 status chip (the status word in its color on `#2c2e31`; `#76a8ff` with `#17191d` text when done), the verdict chip, and "kind · review type · agent" (10.5 px `#696a6d`); the title, 13.5 px semibold — or "#4182 failed" with the error's first line in `#f0705f` beneath; the meta fields (label 11 px `#696a6d`, value 11.5 px `#98999b`): Branch, Ref (shortened like `4a5f3f1..a87d809`), Model, Findings ("2 critical, 1 high"), Source, Queued ("12m ago"), Ran ("4m 12s"), and Parent / Children as clickable `#id` chips (rounded-5 on `#2c2e31`); the actions — Cancel (`#f0705f` text) while queued or running, Rerun (`#eeeeef`) once done, failed or canceled, Browser (`#98999b`) when the daemon named a web URL, each a quiet rounded-6 button on `#2c2e31`; the review itself as markdown; while the job runs — or when it left no review — the agent's log, "Streaming the agent's log" with a spinning ring, the last 400 readable lines at 11 px `#98999b`; the comments at the end, each the responder (10.5 px `#696a6d`) and what they answered (11.5 px `#98999b`). ## How it behaves - **Which queue.** The space's focused pane's folder (else the focused block's, else the space's own) is resolved through git — `--git-common-dir`, so a worktree answers with its parent — and matched against the daemon's repos by root path, then by origin URL, both reduced to `host/owner/repo` for comparing. The branch filter follows Herdr's branch for the space, live. - **Reads.** The daemon's loopback address comes from `roborev status --json`. The list is `GET /api/jobs?omit_prompt=true&limit=200&include_findings=true` (plus `repo` and `branch`); the repos are read once per place; the badge is `GET /api/status`'s `running_jobs`; a job's detail, review and log are asked for when its row opens. On this machine that is `fetch`; in a space on another machine the same requests are made there with `curl`, because that machine has its own daemon behind its own loopback. - **It asks again on its own.** The list and the badge every ten seconds (a review finishes while nobody clicks); the open live job's log every two seconds; the place every second — a moved space, folder or checkout re-reads at once. A failed read asks the daemon's address again on the next one. - **Fallbacks instead of an empty panel.** A branch with nothing → every branch of the repo (only when the branch was the checkout's own, not the person's pick); a repo with nothing → every repo. Each fallback is said in one line above the tree. - **Clicks.** A row opens its job; the same row again, or the back row, closes it. The chevron folds a subtree without opening the job. A segment narrows the status; the branch pill opens the chooser in place of the tree; picking a branch makes it the person's (kept for the folder), "This checkout" returns to following the checkout's own branch. Refresh re-reads and forgets the folds and the open job. Cancel and Rerun POST to the daemon, toast the answer ("Cancel #4182 — The job is stopping."), and read the list again. Browser opens the job's web URL. - **The badge** is written only when the number changes — writing the shared key re-renders every mod. - **The view sticks to the space.** The status filter, the branch pick, the open job and the folded rows are kept in the shared key `roborev.state`, written only from the panel's own doings (a click, never a timer or a read), taken in on every render. tab-host keeps one value of the key per space: leave and come back, and the panel is as you left it; `null` starts fresh. - **A job that finished while its log streamed** gets its review asked for once, without a second click. - **Failures.** A daemon that won't answer is one note under the head — "Roborev did not answer", which machine to check, and that the panel asks again on its own; over rows already on screen, the message sits over them instead, and the rows stay readable. - **Where roborev isn't**, the button is not drawn (the manifest's `tab.show`, run in the shown space's folder on that space's machine); `reconcile.log` holds each answer — `show roborev → no (code 1)`. - **Without tab-host**, `place: "none"` keeps the mod out of the window, and the panel opens as a pane of its own: `herdr-app do pane.split --mod roborev`. - **Keys.** None of its own. A key reaches the tab through tab-host — `"cmd-alt-shift-r": "tab-host.toggle:roborev"` in `keys.json` — because `keys.json` fills only a command's first argument and the mod's copy is asleep while its tab is hidden. ## Built from One mod, `mods/roborev/`: the manifest, `main.js` (one `View`, ~1600 lines), nine svgs (the icon, branch, three chevrons, fold, unfold, refresh, spinner). The manifest is the whole contract: ```json { "place": "none", "title": "Roborev", "tab": { "title": "Roborev", "icon": "mods/roborev/icon.svg", "badge": "roborev.running", "state": "roborev.state", "show": "command -v roborev >/dev/null 2>&1" } } ``` | Field | What it does here | | ----- | ----------------- | | `place` | `"none"` — Herdr never docks a copy on its own; the tab is the one home. | | `tab.title` | The button's label. | | `tab.icon` | The icon beside the label; `*.svg` draws tinted with the text color. | | `tab.badge` | The shared key `roborev.running`, kept to the running count. | | `tab.state` | The shared key `roborev.state`, where the panel keeps its view. | | `tab.show` | `command -v roborev`, in the shown space's folder on that space's machine; exit 0 draws the button. | No props, no registration, no build step — tab-host reads the manifest and adds the button and the panel block to the side panel's stack the moment the folder lands in `~/.config/herdr-app/mods/roborev/` as a real directory. Installing is one copy (`install.sh` does it and runs the check). The `herdr` functions it calls: `spaces`, `focused`, `panes` (the place), `exec` (git, `roborev status --json`, `curl` on other machines), `theme`, `notify` (toasts), `shared` / `setShared` (badge, state), `cx.timer.every`, `cx.spawn`, `cx.notify`, `cx.open_url`, `cx.stop_propagation`; `View`, `div`, `svg` from `gpui-kit`; `v_flex`, `h_flex`, `TextView.markdown` from `gpui-base`. The checkout's two facts come from one shell command, run in the space's folder: ```sh git rev-parse --path-format=absolute --git-common-dir git config --get remote.origin.url ``` The daemon's loopback API — the same source `roborev tui` reads (written against roborev 0.74.0, herdr-app 0.1.12): | What | Where | | ---- | ----- | | the list, its counts, and one job's own read | `GET /api/jobs?omit_prompt=true&include_findings=true&repo=…&branch=…` | | the repos, to resolve the checkout | `GET /api/repos` | | the branch picker | `GET /api/branches?repo=…` | | the badge | `GET /api/status` (`running_jobs`) | | one job's review, findings, comments | `GET /api/review?job_id=…` | | one job's agent output (the log) | `GET /api/job/output?job_id=…` | | cancel, rerun | `POST /api/job/cancel`, `POST /api/job/rerun` | ## Watch out - **Install as a copy, not a symlink.** Herdr (0.1.12) does not start a mod that lives behind a symlinked mod folder — no copy, no error, nothing. - **The desktop app's PATH is not the shell's.** A `curl … | sh` roborev lands in `~/.local/bin`, which the app does not inherit, so the address is asked three ways: `roborev` bare, through a login shell, through a shell with `~/.local/bin` added. Each try only runs when the one before failed. - **`omit_prompt=true` matters.** A job's listing is ~1.5 KB with it; without it the listing carries every job's whole prompt, tens of kilobytes each. - **One read asks for the newest 200 jobs**; `has_more` is drawn as a line under the tree, and the filters are how the rest is reached. - **Only the panel's own doings write the state key.** A timer or a read arriving must never write it: a copy asleep in one space would write its stale view into whatever space the person is in, and tab-host would save it as that space's. - **Compare the shared key in one shape.** `shared()` reads back what `setShared` wrote, but as string or parsed object — its own business — so the copy compares in one form before deciding the key changed hands. - **The statuses that move** are queued and running; the daemon reruns only done, failed and canceled. Verdicts are only "F" and "P"; a status word is drawn only when there is no verdict and the job isn't done. - **The agent's log is JSONL.** Keep only what a person reads — the assistant's text and tool calls (with the file, pattern or command each touched), each tool result's first line, the session start, the result — and only the last 400 lines. A raw stream is unreadable in a 368 px panel. - **The detail is three reads of its own**: the one job by id, the review (which may 404 for a job with no review — caught, not a failure), and the log. Guard each with its own generation counter so an older answer is dropped when a newer read is out. - **A space on another machine is that machine's daemon.** Every request goes there, made with `curl`; an error names the machine, because that is the first thing to check. - **`gpui-kit.d.ts` and `jsconfig.json` are the app's typings**, rewritten by it — copy them from an app home; don't hand-write them. `setShared`, `notify` and the like are in `herdr.d.ts`, not the kit, however much the docs imply otherwise. - **Keep the state key small**: small JSON, and tab-host drops a value past 32 KiB. - **A missing button is in the log**, not in the panel: `~/.config/herdr-app/data/tab-host/reconcile.log` holds every `tab.show` answer. ## Done when ```sh ./install.sh ``` passes — `herdr-app check` on the installed copy says so. Then, live: - In a space whose machine has roborev (daemon running), the Roborev button appears beside Files and Changes; in one without it, it doesn't, and `reconcile.log` has `show roborev → no (code 1)`. - The panel lists this checkout's queue: the head's chip names the repo, the branch pill names Herdr's branch, and the rows hang under the reviews that spawned them. - A row opens its job — the review as markdown, findings, timings; a running job streams its log, and the log grows without a click. - Cancel stops a running job (toast, list refresh); Rerun queues a finished one again. - The badge counts what is running while the side panel is collapsed. - With tab-host: leave the space and come back — the status filter, the branch pick, the open job and the folds are as you left them. - Without tab-host: `herdr-app do pane.split --mod roborev` shows the same panel in a pane.