Skip to content

About

Evaluation system for any2bazel

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

any2bazel-lab

Tools and procedures for measuring what the AI agent skill any2bazel actually does.

A skill is a packaged set of instructions and scripts that an AI coding agent loads for a task. The one this lab was built around is any2bazel, published by EngFlow, which guides an agent through migrating a C/C++ project from CMake to Bazel and checks the result by comparing the two builds' compile and link commands.

The lab asks: does the skill help, and how would you know? It gives an AI agent the same real open-source project twice, once with the skill installed and once without. Those are the two arms, and one project's two runs are a pair. Each run is unattended and isolated. The lab then measures both results itself, against a reference build of the original project, and takes nothing from the agent's own account of its work.

With this repository you can run such experiments on a machine of your own: on any2bazel, on a change you want to propose to it, or on your own projects before you trust a migration.

How to work with it

Run the lab through an AI coding agent of your own. We do not expect you to learn the tools in detail, and we recommend against starting there. The procedures are long and exact because an agent follows them, and most of the documents are written for that agent.

Three parties take part:

  • You, the operator. You decide what to study and what to claim from the results. You answer for what the lab does on your machine and with your account.
  • Your agent, which the documents call the outer agent. It reads the procedures, sets the machine up, runs the tools, supervises the runs, measures the results and keeps the records. It brings you each decision that is yours, with a recommendation.
  • The agents under test, which the documents call inner agents. They do the migrations, unattended. Neither you nor your agent helps them.

Read two things yourself before the agent starts. "What to know before relying on it", below, says what the lab does to your machine and what it has not been shown to do. The last section of SECURITY.md describes an exposure of your Claude login that every operator has to accept or avoid. You also need to know Bazel and CMake builds well enough to judge what your agent reports. The documents assume that you do.

To begin, clone this repository, open a Claude Code session in it, and ask the agent to set the lab up by SETUP.md. Claude Code loads CLAUDE.md, the agent's instructions, without being asked. If you use another agent, point it at that file first.

As you work together with your agent to define and conduct your experiment, your agent may ask you for these:

  • Another login to Claude. You'll have authenticated once already, of course, to work with your agent. The other login is for a separate user on your machine, which the inner agents run as. It can be the account you already use: the first lab's operator used one subscription for both, and an account billed by API usage has not been tried. Your agent gives you the command to type, you finish the login in your browser, and the agent never handles a password or a token.
  • Running a few commands as root. Setup installs system packages and creates that separate user, and both need root. If sudo on your machine asks for a password, your agent gives you those commands as a list to run in a terminal of your own. It never needs your password, and you should not give it one. If sudo asks for no password, your agent runs those commands itself.
  • How inner agents should run. Which account the inner agents use, which model, and a ceiling on a run's time or cost. The agent proposes an answer to each.
  • What content the experiment works with. Which projects, which version of the any2bazel skill.
  • Your policy for handling ambiguous outcomes. For example, whether a run still counts as evidence when one of its conditions turned out not to hold: its launcher died partway, say, or its transcript shows that a different model answered.
  • Your policy about anything that leaves the machine, such as pushing your records to a remote.

The tools were built and tried this way. The operator of the lab that built them worked through an agent throughout. Before publication, agents working only from this repository's documents set fresh machines up and carried small experiments through, and stopped for their operator at the points above.

What is here, and what is not

Here: the tools (tools/), the procedures an operator and their agent follow, and templates.

Not here: results. The tools were written over three studies and about a hundred migration runs, on open-source CMake projects from a few dozen to several thousand translation units. The record of those studies is kept separately from the tools. It holds every run, its transcript, the migration it produced, the measurements and the findings. The documents here call the lab that did that work "the first lab". Your own experiments' records go in a directory of your own, the records root, which SETUP.md creates.

Where to start

Written for you to read:

if you want to read
know what a term means GUIDE.md, a glossary
plan a set of runs that supports a claim STUDIES.md, for you and your agent together
understand the two arms BASELINE.md: preparing conditions that isolate the effect of the skill
understand the measurements JUDGE.md: reference build, parity, tests, generated files, runtime output
understand the containment SECURITY.md: the threat model, resource caps, the runner user, dependency cooldowns
propose a change to the skill from what your runs showed FEEDBACK.md

Written for your agent to follow. Skim them to learn what it will do:

what the agent is doing it follows
working here at all CLAUDE.md. Its section "What only the operator can do" lists what it will ask of you
setting a machine up SETUP.md: eleven steps, each with a check; last followed from scratch on Ubuntu 24.04
making and judging a run RUNBOOK.md, the procedure, with the mistakes that shaped it
deciding what a run's record must hold BACKUP.md
writing results up for readers outside the lab, or reviewing a write-up REPORT-WRITING.md, COLD-READER-REVIEW.md. Your agent will propose both to you

How an experiment goes

  1. A target. A project at a pinned commit, and a container image with what its build needs beyond the lab's base image.
  2. A reference. The lab builds the project's own CMake build and runs its tests. Everything is compared with this, and the inner agents never see it.
  3. Two runs. An inner agent migrates the project in each arm, with one fixed prompt, as a separate unprivileged user, under resource caps, with no help once it starts.
  4. The judge. For each run the lab rebuilds the migration from what the inner agent left, runs its tests, compares compile and link commands with the reference's, byte-compares generated files, and measures how much of the original's source the migration compiles.
  5. The record. The migration as a git bundle and a patch, the transcript, the measurements and a results file, in your records root. Every statement that something was verified cites the literal command and its output, kept in an append-only log.

The outer agent, the one working for you, does all of this. It chooses targets with you, builds references, launches inner agents, measures their work and writes the records. It never helps an inner agent.

What to know before relying on it

  • It has been used with one skill, one build-system pair and one agent. The skill is any2bazel, the migrations are from CMake to Bazel for C and C++ projects, and the agent is Claude Code, as the outer agent and as the inner agents. The tools launch Claude Code as the inner agent, and a different outer agent has not been tried. The containment and the record-keeping are general. The judge is not, because it compares CMake's commands with Bazel's.
  • One run per arm provides limited evidence. Agents vary from run to run. On large projects, two runs of the same arm have differed by more than the two arms did. STUDIES.md says what the first lab could and could not conclude from its designs.
  • Counts of differences are not scores. One decision by an inner agent can raise hundreds of command-line differences. The lab classifies differences by cause and by what they do to the built program (GUIDE.md, "Cause").
  • It has been applied to a limited number of targets. STUDIES.md, section 10, lists some things the tools do not yet handle, and says which are planned, which are only under consideration, and which are untried.
  • The tools were written inside one lab. A few (reasonable) default values are that lab's. STUDIES.md, section 9, lists what of that lab is left in the tools.
  • The instrument was wrong as often as what it measured. Many of the tools' tests exist because a guard was found not to fire. After setup, tools/tests/run_all.sh should report that every test passes. When you or your agent add a check, plant the defect it should catch and see it fire before you trust it.
  • What it does to the machine, and with your account. Setup creates a second user, which the documents call the runner, a sudo rule that lets you act as that user, and on Ubuntu 24.04 an AppArmor profile. The agents under test run as that user with their permission prompts off and the network on, logged in to a Claude account you choose. Anything they run can read that login. SECURITY.md says what is contained and what is not. Runs use the model you choose (A2B_MODEL in lab.local.conf; there is no default) and draw on that account's usage. Priced at the API's list prices, the first lab's small projects cost $2 to $18 a run, and its largest cost over $70.
  • It also changes your own npm and Bazel settings (~/.npmrc, ~/.bazelrc), so that neither installs a dependency version published in the last 7 days. The documents call this the cooldown. Setup also adds you to a group, and keeps the runner's tools and the build images under /srv/a2b. tools/runner/README.md, under "Undo, completely", has the commands that undo all of this.
  • It needs an x86-64 Linux machine that does nothing else while a run is live. Another build on the machine changes what is measured.

Who wrote this

any2bazel-lab is an EngFlow project. The tools, their tests and these documents were written almost entirely by AI agents (Anthropic's Claude models, working in Claude Code) under the direction of a human operator, who set the design, made the rulings the documents call "the operator's", and reviewed the work. Read it as you would any software you did not write: the tests say what has been checked, and what has not been checked is not claimed.

Commands, in the order a run uses them

Your agent runs these, in your records root, where tools/ is a link to this repository's tools. They are listed to show you the shape of a run. Only the main ones are here. The sequence that works, with every step, is in RUNBOOK.md, "One pair, end to end".

tools/preflight.sh [skill|no-skill]        # is this machine ready to launch a run?
tools/wave/scaffold.sh --spec <targets.json> --target <ID> [--arm no-skill]  # allocate a run from a study's target spec
tools/judge/prepare_reference.sh runs/NNN-slug     # the reference build and its tests
tools/wave/launch_wave.sh --study <dir> --id <wave> --phase N runs/NNN-slug   # launch, with monitor and sampler (in the background: RUNBOOK.md)
tools/runner/collect_run.sh runs/NNN-slug          # after a run: transcript, metrics, isolation, cooldown and secrets checks
tools/judge/verify_run.sh runs/NNN-slug            # the judge
tools/make_bundle.sh runs/NNN-slug                 # the migration as a bundle and a patch
tools/runner/to_holding.sh runs/NNN-slug           # move the run's working files out of the agents' reach
python3 tools/build_index.py               # the index of all runs
python3 tools/validate_runs.py             # are the records consistent?
tools/tests/run_all.sh                     # the lab's own tests

License

Apache License 2.0: see LICENSE and NOTICE. It is the license any2bazel itself uses.

About

Evaluation system for any2bazel

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages