Skip to content

WorkXcode for agents

All work

Case study 10 of 11

Xcode for agents

Xcode builds tracked live, verdicts for agents

A plugin for the bb agent IDE that tracks every Xcode build on the machine with no setup, and gives agents one blocking call that returns a real pass or fail verdict.

Role
Author and maintainer
Platform
bb plugin
Stack
TypeScriptReactSQLitexcresulttool
Share

Context

Told to start a detached Xcode build and check on it later, an agent writes a poll loop, and a loop like until ! bb xcode status; do sleep 5; done exits 0 whether the build passed or failed. The build itself often keeps no outcome to check: Xcode writes no build log entry for a command-line build, and every DerivedData folder on the machine I measured had none.

The plugin's product brief names the one question it answers: what is Xcode doing, and did the last thing I ran pass? It also names the one error it can't recover from: reporting success for a run whose tests failed.

Role & approach

I built it as a plugin for bb, the agent IDE, in TypeScript. It tracks every Xcode build on the machine, started from Xcode, xcodebuild, an agent or a CI script, with no per-project setup: it learns DerivedData folders from the compiler arguments of builds already running. Evidence comes from four sources, from the process list for what is running now up to Xcode's own result bundles for pass or fail, each issue's file and line, and each test. Pass or fail comes from Xcode's result files or from the exit of the command that launched the build, never from log text.

For agents, the answer is one blocking call. xcode_build runs the build, waits for it, and returns a verdict in plain words with each error's file and line and each failed test. The instructions the plugin gives agents say never to write their own poll loop and never to paste build status into the chat, since the person is already looking at it. An optional shim adds a result bundle to xcodebuild runs that lack one, and it is written so it can never be the reason a build fails.

The rule underneath is never to guess green. A run goes from running to finishing to a verdict, or to an honest "ended" when no verdict arrives, and a piece of evidence can only raise a run's confidence, never lower it. When a script launched the build, the verdict is decided by containment: the build must sit wholly inside the script's lifetime, and watcher loops are refused. The commit that made that change gives the reason: a missed verdict leaves an honest "ended", a wrong one calls a broken build green, so every ambiguity resolves toward silence.

In the thread, bb shows the build, not the model. An earlier version asked the agent to echo a status card into the chat; the request failed while a permission prompt was open, and one build grew three cards that disagreed. In the words of the commit that replaced it, a status card is host state, not a conversational act. Live builds now sit in a row above the composer with the current phase and the time against this checkout's usual build, followed by the verdict.

Outcome

Xcode for agents is open source under the MIT license and installs from bb's community marketplace. Beside builds, it streams the simulators they run on into the sidebar, touchable, and gives agents simulator tools that are off by default: captured frames go to the model provider, and the plugin refuses to make that decision for the person.

The test suite feeds every process and Xcode tool call in as fixture text, and CI runs it on Linux to prove it still does. The security model is written down, limits included: it is not an Xcode sandbox, and builds started from the Xcode app itself are not yet fully validated.

Available for new engagements Remote, worldwide

Have something like this to build?