# Highbay — Your agent's tests pass. Did it build what you meant?

Highbay builds Go services and AI agents with the coding agents you already use. You choose the behavior, Goa generates the transports, schemas and validation so no model writes them, and separate agents write the code and the scenario tests. Highbay runs the accepted tests against the exact commit you approve and merge.

Works with Claude Code, Codex, Gemini CLI, Antigravity, Cursor, Windsurf, Copilot and VS Code. Free and open source. Runs on your machine.

GitHub: [Highbay](https://github.com/goadesign/highbay)

Source: https://goa.design/highbay/

## Get Highbay

macOS or Linux, with Go 1.27.3+, Git 2.45+ and Docker.

```bash
go install github.com/goadesign/highbay/cmd/hbay@latest && hbay up
```

Then open a folder in your coding agent and say:

> /highbay — build a refund assistant: refunds up to $50 get instant store credit; larger ones wait for a manager.

Run `hbay up` once in your terminal. After setup, use `/highbay` (`$highbay` in Codex) in your coding agent; Highbay starts the project server on demand, and the first run in an empty folder takes a couple of minutes.

## Same prompt. Two outcomes.

This request leaves one thing unsaid. Pick what you meant, and watch which side notices.

> Refunds up to $50 get instant store credit; larger ones wait for a manager.

**The order that tells them apart:** `$48.00` items + `$4.32` sales tax = `$52.32` charged.

- **One agent, code and tests (2 of 2 passed · Same for either answer):** Never asks. Compares the charged total: `if order.TotalCents <= 5000`. Writes two tests from that same assumption: a `$40` order gets credit, a `$60` order waits.
  - *The items, before tax:* **Wrong, and green** — The $48 order waits for a manager. You wanted instant credit. Nothing failed.
  - *The total charged, with tax:* **Right by luck** — The $48 order waits for a manager, as you wanted. The agent guessed right. Its tests would have passed either way.
- **With Highbay (Written from your answer):** Asks before implementation begins: **Does the $50 limit count sales tax?** and shows the `$48` order under each answer.
  - *The items, before tax (run 1: 2 of 3 → fixed: 3 of 3):*
    - If the builder makes the same guess (`TotalCents <= 5000`): **run 1, 2 of 3**. Wanted `$52.32` credit, got manager review. Approval unavailable.
    - **Run 2, fixed** (`SubtotalCents <= 5000`): **3 of 3 passed**. Ready to approve.
    - **Caught before review** — The $48 order gets $52.32 credit, as you chose.
  - *The total charged, with tax (3 of 3 passed):*
    - **Run 1** (`SubtotalCents+TaxCents <= 5000`): **3 of 3 passed**. Ready to approve.
    - **What you chose, checked** — The $48 order waits for a manager, as you chose. The test names that order instead of leaving it between $40 and $60.

The solo agent's tests pass under both rules, so they cannot tell your two intentions apart. Highbay's test is written from your answer, so it can. An illustration built for this page. In Highbay, when your answer differs from the draft, your coding agent revises the draft before you confirm. A recorded run follows next.

## It caught a real one. (From a moderated trial · November 2026)

- **32** named checks on the scenario
- **2 failed** on the builder's first commit
- **7 of 8 → 8 of 8** scenarios passing, before and after the fix
- **~3 min** between the failed run and the passing one

We ran Highbay with an AI agent playing a first-time developer on a sample property-listing app. One change said: when a seller withdraws a listing, each buyer with an open offer is told once and the offer closes. The test writer wrote that scenario with 32 named checks, and the builder's first commit failed two of them because the assistant was not properly told why the offer could no longer proceed. Highbay reported seven of eight scenarios passing; the builder corrected the refusal, the same suite passed eight of eight about three minutes later, and the change was then merged.

*A trial with an AI participant and a scripted model. Not a production incident.*

## The real screens

Four views of Highbay's own browser page, loaded with the refunds example.

- **1. Agree (Change Card):** **Change Card:** One-page summary of what changes and what stays untouched, before implementation begins. · **Threshold comparison:** Shows how the `$48.00 + $4.32` order behaves under each answer before you pick. · **Confirm intent:** Locks your chosen answer and examples as the shared agreement.
- **2. Architecture (Before code):** **What the design declares:** Renders the service, the assistant and its tools before implementation begins. · **Assistant limits:** Shows the recovery-turn, history, tool-call and time settings declared on the Goa-AI agent. · **Confirmations:** Highlights injected context fields and which tools need a person's approval before they run.
- **3. Build (Two agents):** **Builder:** Writes the Go service against generated Goa and Goa-AI interfaces in its own workspace. · **Test writer:** Writes black-box scenario tests in a separate workspace from your confirmed agreement. · **Bound to the agreement:** Both roles work against the confirmed revision; changing behavior requires re-confirmation.
- **4. Approve (Report & merge):** **Approve, then merge:** Once you record approval on the passing run, merge both commits into your local branch. · **Flows and their tests:** Maps each finished `Story` flow (`instant_credit`, `manager_review`) to its scenario outcome. · **Exact commit report:** Runs the accepted test commit against the builder's commit (`3 of 3` in this example).

## The agreement is code

What you agreed to becomes three small pieces of Go: same `$48.00 + $4.32` order, same numbers.

### The flows · design/story.go

Drafted by your coding agent alongside the Goa design, confirmed by you:

```go
package design

import . "github.com/goadesign/highbay/story/dsl"

var _ = Story("Refunds", func() {
    Actor("customer", "Customer")
    Flow("instant_credit", "Up to $50 subtotal", func() {
        StartsWith("ask", "customer", "$48.00 + $4.32 tax")
        Outcome("credit", "customer", "Instant $52.32 credit")
    })
})
```

Every finished flow in `Story` must have a matching scenario test before a build counts.

### The test · test writer

Written in a separate working copy from your confirmed answer:

```go
func (h *Hooks) InstantCredit(ctx context.Context) (eval.Result, error) {
    out, err := h.refund(ctx, 4800, 432)
    if err != nil {
        return eval.Result{}, err
    }
    return eval.Result{
        Checks: []eval.Check{
            check("status", out.Status == "credit"),
            check("cents", out.Cents == 5232),
        },
    }, nil
}
```

Highbay compiles the test module, checks that no service files were touched, and locks the test commit.

### The rule · builder

Written against the typed payloads and interfaces Goa generated:

```go
func (s *Service) RequestRefund(
    ctx context.Context,
    req *genrefunds.RequestPayload,
) (*genrefunds.RefundResult, error) {
    total := req.SubtotalCents + req.TaxCents
    if req.SubtotalCents <= 5000 {
        return s.issueCredit(ctx, req.OrderID, total)
    }
    return s.queueReview(ctx, req.OrderID, total)
}
```

Highbay runs the accepted test commit against the builder's commit before you review, approve and merge.

## Generate the plumbing. Spend tokens on the logic. {#codegen}

If an agent writes routers and schemas by hand, it spends tokens on work Goa can generate. Highbay makes generation part of the agreed build.

```go
// examples/orders/design/orders.go
Method("chat", func() {
    Payload(func() {
        Token("token", String,
            "Customer bearer token.")
        Attribute("message", String,
            "What the customer says.",
            func() { MinLength(1) })
        Required("token", "message")
    })
    Result(RunView)
    HTTP(func() {
        POST("/chat")
        Response(StatusAccepted)
    })
})
```

`generate_code` (Written by the compiler, not a model) → **What gets generated** (`gen/orders/service.go`):

```go
type Service interface {
    Chat(
        context.Context, *ChatPayload,
    ) (res *RunView, err error)
}
```

- **Service gen/ · from this method:** `POST /chat` handler, typed client, codecs, OpenAPI spec and `MinLength(1)` / `Required` checks.
- **Goa-AI tools · when declared:** Tool JSON schemas, method bindings, server-injected fields and confirmation declarations.
- **Scenario harness · eval/:** Highbay writes the required-flow table in `eval/design/` and generates the Go runner in `eval/gen/`.

From Highbay's [Orders example](https://github.com/goadesign/highbay/tree/main/examples/orders). Candidate `generate_code` writes the agreed design and replaces service `gen/`; Highbay prepares the required scenario table in `eval/`, and verification refuses a candidate commit whose `design/` differs from the agreement.

### No model writes the plumbing

Goa writes generated files without model output tokens, and edits start with the design and relevant interfaces. What that saves overall depends on the change.

### The same shape from any model

Generated transports, validation and tool schemas look the same whether Claude, Codex or Gemini wrote the logic around them.

### A changed interface breaks stale code

Give a method a new result type and regenerate: a handler returning the old type fails compilation, and Highbay separately checks that `eval/` compiles and lists every required scenario.

[Read the coding-agent workflow guide](/docs/ai-development/)

## How Highbay compares

Highbay is built around one rule: whoever writes the code does not decide whether it works.

### One coding agent

One session can plan, code and test, and often that is enough. The catch is what you left unsaid: it settles those questions itself, then tests its own answers. Highbay puts them to you first, has a second agent write the scenario tests from your answers, and runs those tests itself.

### Spec workflows (Spec Kit, OpenSpec)

They get the agreement written down before the code, which is the right instinct, producing structured specs and tasks for an agent to follow. Highbay turns the agreed flows and API design into Go contracts and required scenarios: the design compiles, Goa generates the interfaces and tool schemas from it, and every finished flow needs a scenario test before a build counts.

### Parallel agent workspaces (Conductor and others)

They run several agents at once in isolated workspaces and give you their branches to review. Highbay runs two agents on one agreed change with different jobs, and hands you one result: the scenarios that ran on the exact commits you would merge.


A choice you confirmed. Transports and schemas generated from Go. Tests written by a different agent. One result, run by Highbay, tied to the agreement and both commits.

## Questions before you start

### What can I build with it?

Go services and AI agents designed with Goa and Goa-AI: HTTP and JSON-RPC APIs, MCP servers, and agents with typed tools. Other languages are out of scope, and designs with gRPC transports are refused today.

### Why not have one agent write the tests first?

Tests first changes the order, not the author. The same agent still answers the questions you left open, and nothing stops it editing a test that gets in its way. In Highbay the questions go to you, a second agent writes the scenarios in its own working copy, and Highbay runs the suite from the test commit it accepted against the builder's commit.

### Can I use it on a project I already have?

Yes, if it is a Goa or Goa-AI project with at least one Git commit. Highbay needs tests it can run: a test module in its layout, or your own test program registered with `hbay verification set` (which Highbay runs on every change without starting a test writer).

### Can the builder read the tests and code to them?

It can read the tests the test writer wrote; everything runs on your machine. For verification, Highbay selects the test suite from the test commit it accepted, and the builder supplies only its code commit. With a separately managed evaluator, holdouts appear in the builder's report only as an outcome under an anonymous name.

### Does it need an account or an API key?

Highbay needs neither: no account, no key, no cloud service. Your coding agents keep using the logins and subscriptions they already have, and you only add a model provider key when your own service or its tests call a live model.

### Are the agents sandboxed?

No. From Build on, the agents, the tests and the service they build run on your machine as ordinary programs with your access to files and the network. Roles limit what each agent can do in Highbay: only you can confirm, approve, or merge, and the builder's compile-and-unit-test check runs in a local Docker container. Read the [Highbay guide](../docs/3-ecosystem/highbay/) or browse the source on [GitHub](https://github.com/goadesign/highbay).

