eve-software-factory-template README

项目的 README,来自 github.com/vercel-labs/eve-software-factory-template。合并为一个 markdown 文件:README.md。

eve Software Factory Template

Agent Stack MIT License

Meet Foreman, an eve software factory that puts AI agents on every stage of the development loop and keeps people on the judgment calls.

Foreman takes tasks from GitHub, Linear, or a plain HTTP request, triages each one, moves it through its stations, and delivers a reviewed draft pull request on your repository. You review, mark ready, and merge.

Deploy with Vercel

How it works

Each station is its own agent with its own instructions, sandbox, and tools. The Reviewer sees only the pushed branch, never the Implementer's reasoning. Between runs, Foreman keeps a factory brain: notes about your repository that every run starts from. See the pipeline and factory memory for the full picture.

Foreman and its stations work on GitHub with the real git and gh. Foreman types gh commands, and there is no shell behind them on any run: the factory checks each command against its allowlist and against who is asking, then runs it itself. The stations have a shell of their own, and anything a shell runs gets a credential that only reads. No token is ever inside a sandbox: a credential is attached for one command at a time and scoped to your one repository.

How work arrives

Deploy

Deploy with Vercel

The Vercel deploy flow sets up the basics: the GitHub connector, Linear connector, a private Vercel Blob store, and a prompt for the FACTORY_REPO and FACTORY_LABEL environment variables.

After the first deploy, finish the setup from the linked project (vercel link, as in Local development):

  1. Run eve integration setup file-memory, then redeploy with eve deploy. This provisions the private Blob store that holds Foreman's memory (user preferences and the factory brain) and sets EVE_MEMORY_BLOB_STORE_ID for you.
  2. Check the GitHub App's permissions: read and write on contents, issues, and pull requests, plus read on Actions, Checks, and Commit statuses so Foreman can diagnose red CI. Each command asks for a token narrowed to what it needs, and by default a command fails when GitHub refuses that token; the error names the permissions to check (see FACTORY_TOKEN_FALLBACK below).
  3. Optional: set FACTORY_INTAKE_TOKEN to a random secret of at least 32 characters if you want to submit work over HTTP from outside Vercel.
  4. Protect your default branch on GitHub (branch protection or a ruleset that requires pull requests). This is required, not optional. Foreman pushes only to branches under FACTORY_BRANCH_PREFIX (default factory/) and refuses main and master whatever the prefix is, but that rule lives in Foreman's own code. It is a second layer, not a replacement: branch protection is what holds on GitHub's side, whatever code runs in a sandbox. That matters because a push runs in the same sandbox as the Implementer's shell, so a run taken over by what it reads could use the push credential on any branch GitHub leaves open.

Two things must line up before Foreman can do any real work. FACTORY_REPO must name a real repository in owner/repo format, and the GitHub App behind the connector you select must be installed with access to that repository. A station's sandbox clones FACTORY_REPO on its first session, not at deploy time, so a repository the app cannot reach surfaces as a Cannot access <owner/repo> error on the first task you hand it, not the deploy itself; install the app on the repository (or fix the value), then try again.

Configuration (see .env.example):

Variable Required Default What it does
FACTORY_REPO Yes none An existing GitHub repository in owner/repo format; the selected GitHub App must have access to it (a station's first session fails otherwise)
FACTORY_SETUP_COMMAND No none Runs once per session inside the station sandbox checkout (e.g. pnpm install), so the station starts with dependencies already installed. It runs with no GitHub credential, with install scripts off, and with network access to GitHub and the public package registries only (see FACTORY_SANDBOX_EGRESS and FACTORY_ALLOW_INSTALL_SCRIPTS below)
FACTORY_LABEL No factory The issue label that hands an issue to the factory
FACTORY_BRANCH_PREFIX No factory/ Prefix of the factory's own branches. They are the only branches the implementer can push to and the only ones automated CI fixes touch; main and master are refused whatever the prefix is
FACTORY_BOT_NAME No the GitHub App's slug The @mention name, resolved from the connector automatically when unset
FACTORY_INTAKE_TOKEN No none Shared secret (32 characters or more) for the HTTP intake API. Unset, only callers with a Vercel OIDC token for the project can submit
FACTORY_INTAKE_CALLBACK_HOSTS No none Comma-separated hosts (host or host:port, exact match) a ticket's callbackUrl may point at
FACTORY_INTAKE_CALLBACK_SECRET No none Signs status callbacks (HMAC-SHA256 in x-factory-signature). Without it no callbacks are sent, and a ticket that carries a callbackUrl is refused with callback_not_configured
FACTORY_TOKEN_FALLBACK No none What happens when GitHub refuses a narrowed, per-command token. Unset or none fails closed: the command fails with a message naming the permissions to check. repository also allows a token with every permission the app holds, still limited to FACTORY_REPO. installation allows that, then the connector's plain installation token (every permission, every repository the installation covers). Each use of a wider token logs a warning. A command a station runs in its shell never gets a wider token: when no read-only token can be issued, a station cannot use gh at all, and reaches GitHub only through git fetch origin <branch> as a whole command, which the firewall holds to fetching FACTORY_REPO
FACTORY_ALLOW_WORKFLOW_CHANGES No off Set to 1 to add Workflows write to the implementer's push token. Without it GitHub rejects a push that changes .github/workflows
FACTORY_SANDBOX_EGRESS No restricted Unset, the sandboxes Foreman defines (the orchestrator's and the Analyst's, Implementer's, and Reviewer's, which are the ones that hold your code) reach GitHub and the public package registries (npm, PyPI, crates.io, Go, RubyGems, Maven, Gradle, and the image's apt archive) and nothing else, so a run cannot send your code to an arbitrary host. The Classifier and the Researcher have no checkout and run in eve's default sandbox, which this does not restrict. Set to open to allow every host
FACTORY_SANDBOX_ALLOWED_DOMAINS No none Comma-separated hostnames to allow on top of the defaults, such as a private registry or an API your tests call (npm.example.com,api.example.com). Full hostnames only: no scheme, port, path, or wildcard. An entry that is not a hostname stops sandboxes from opening, with a message that names it
FACTORY_ALLOW_INSTALL_SCRIPTS No off Station sandboxes tell npm, pnpm, and Yarn not to run install scripts (postinstall and the like), a dependency's or your own. This also overrides a pnpm build allowlist (allowBuilds) in your repository, and the install still succeeds, so a skipped native build shows up later as a failing test. If your install step does real work in a script, name it in FACTORY_SETUP_COMMAND (pnpm install && pnpm run generate), or set this to 1 to let install scripts run
FACTORY_SIGNED_COMMITS No off Set to 1 if a ruleset requires signed commits on Foreman's branches. The push then recreates each commit through GitHub's API so GitHub signs it as the app; commit SHAs change, file contents do not. Git LFS files cannot be pushed this way
GITHUB_CONNECTOR / LINEAR_CONNECTOR Yes none Set automatically from Vercel Connect connector UIDs

Local development

Link the project you deployed (or a fresh one), pull its environment, and start the TUI:

vercel link
vercel env pull
pnpm dev

Hand the agent a task ("users report the password reset email arrives twice, fix it") and watch triage and the stations fire in order, ending in a draft PR on FACTORY_REPO. Local runs are treated as untrusted, so labels, comments, and other writes to GitHub wait for your approval in the TUI. Memory in the TUI lives in the local process and is gone when it exits.

Before you push a change to the factory itself:

pnpm test       # the offline test suite: no model, no GitHub, no sandbox
pnpm validate   # lint, typecheck, tests, and eve's discovery check

Submit work over HTTP

Send a ticket with a title and a body. externalId makes the request safe to retry: the same id from the same caller always lands on the same ticket.

curl -X POST "https://<your-deployment>/intake/v1/tickets" \
  -H "Authorization: Bearer $FACTORY_INTAKE_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Password reset email arrives twice",
    "body": "Users report two identical reset emails a few seconds apart.",
    "externalId": "HELP-1042",
    "priority": "high"
  }'

The answer is 202 with a ticketId (a retry of the same externalId answers 200 with duplicate: true and the same ticketId). The run is unattended: Foreman can read, label, close or reopen an issue, and open a draft pull request, and anything that would need a person's approval is refused. Poll for the result:

curl "https://<your-deployment>/intake/v1/tickets/<ticketId>" \
  -H "Authorization: Bearer $FACTORY_INTAKE_TOKEN"

status moves through queued, running, and completed (or failed, cancelled, awaiting-input), and result carries Foreman's final message: the draft pull request link, or the questions it needs answered. The other optional fields are source, requester, labels, and callbackUrl; unknown fields are rejected, and every field except body must be a single line.

A ticket belongs to the caller that submitted it: another caller asking for the same ticketId gets a 404, the same answer as for an unknown id. Everyone who presents the shared FACTORY_INTAKE_TOKEN counts as one caller. A ticket is also one run. When result is a list of questions, send the answers as a new ticket with a new externalId; resubmitting the same externalId returns the original ticket and starts nothing.

With a callbackUrl on a host listed in FACTORY_INTAKE_CALLBACK_HOSTS, Foreman also POSTs status updates to that URL. Each one is signed in x-factory-signature (hex HMAC-SHA256 of the body), carries sentAt inside the signed body so a receiver can refuse an old one replayed later, and has an idempotency-key header so a receiver can drop a repeat. A callbackUrl on a host that isn't listed is refused with 400 callback_not_allowed, and one sent to a deployment with no FACTORY_INTAKE_CALLBACK_SECRET with 400 callback_not_configured.

Resources

Explore more templates

eve-software-factory-template (vercel-labs/eve-software-factory-template)

正在搜索数据库…

这是什么?Foreman 是一个 “eve Software Factory”,让 AI 智能体参与开发循环的每个环节,同时把判断决策权留给人类。它从 GitHub 和 Linear 拉取任务,经过四个智能体工位处理,最后交付一个经审查的草稿 pull request 供你合并。
这是聊天机器人,还是自动化的智能体流水线?它是自动化多智能体流水线,不是聊天助手:分类器(Classifier)、分析师(Analyst)、实现者(Implementer)和审查者(Reviewer)各自作为独立智能体运行,拥有自己的沙箱和工具,不过你也可以通过 @提及或本地 TUI 与它交互。
Foreman 怎么部署?使用 Vercel 部署流程,它会设置 GitHub 连接器、Linear 连接器和 Vercel Blob 存储,并提示你填写 FACTORYREPO 和 FACTORYLABEL 环境变量。
部署之前需要什么?你需要一个现有的 GitHub 仓库(owner/repo 格式),并且所选的 GitHub App 已实际安装并被授予对该仓库的访问权限;Linear 集成是可选的,用于从 Linear 委派任务。
部署时最主要的坑是什么?如果 FACTORYREPO 与 GitHub App 已安装的访问权限不匹配,部署会失败并报 “Cannot access” 错误,因为它会通过预先克隆仓库来预热沙箱;你需要修复 App 安装或仓库取值,然后重新部署。
factory brain 是什么?在多次运行之间,Foreman 会保存关于你仓库的笔记,每次新运行都从这些笔记出发,从而随着时间积累上下文,而不是每个任务都从零开始。
能在不碰 GitHub 的情况下测试任务吗?可以,本地开发 TUI 让你在自己的机器上直接把任务交给 Foreman;产生的任何改动在进入 GitHub 之前仍会等待你的批准。
哪个环境变量控制触发流水线的 GitHub issue 标签?FACTORYLABEL,如果不设置,默认值为 “factory”。
大小
2.3 MB
星标
1.2K
更新
提交Nov 17
时长
3个月
提交 · 90 天