English | 简体中文
Thank you for considering a contribution to ABH (Agentic Business Harness). This document explains how to set up the repository, how the engineering gate works, and what a good pull request looks like.
Status: 0.1.0 preview. The local engineering loop (contracts, types, tests, builds) passes end to end. Production hosting, a real identity provider, and an independent security review are still open — the itemized state lives in the gap list (Chinese). Issues and PRs that help close those gaps are especially welcome.
By participating in this project you agree to abide by the Code of Conduct.
You need:
- Node.js 24 — the exact version is pinned in
.nvmrc - pnpm 10.28 — provided automatically through corepack (no global install needed)
- Docker — the test suite runs against a real PostgreSQL 16 managed by Testcontainers
- cosign 2.x (optional) — seven real-signature tests in
@abh/corerun only whenABH_TEST_COSIGNpoints at a cosign 2.x CLI; they skip automatically otherwise. CI pins v2.5.0 (cosign 3.x removed--tlog-uploadand will not work).
git clone https://github.com/GoatGit/ABH.git
cd ABH
corepack pnpm install --frozen-lockfile
pnpm checkA green pnpm check on a fresh clone means your environment is correct.
A pnpm workspace monorepo:
| Package | Role |
|---|---|
@abh/contracts |
Machine-generated contracts: schemas, state machines, errors, HTTP protocol, ports |
@abh/core |
The engine: missions, runs, the authorization chain, ledger, durable execution |
@abh/adapter-pi |
Pi Agent runtime adapter |
@abh/adapter-fastify |
HTTP ingress adapter |
@abh/adapter-pg-boss |
Queue delivery on PostgreSQL (pg-boss) |
@abh/cli |
The abh command line |
@abh/workbench |
Optional Next.js admin console |
Design documents live under docs/V1 (overall design plus module specifications, Chinese); the implementation tracker and the gap list live under docs/development.
ABH is contract-first: the public API, state machines, error model, and ports are declared once in registries under packages/contracts, and TypeScript types, validators, the OpenAPI 3.1 document, and SQL constraints are generated from them. CI fails on drift.
- Behavior changes touching the public surface start in the contract registry: edit the relevant registry (protocol / states / errors / ports), then run
pnpm contracts:generateand commit the regenerated artifacts together with your change. - Intentional public API changes require refreshing the API report: run
pnpm api:updateand review the diff. CI fails if the report is stale. - Documentation changes are validated by
pnpm docs:check, which verifies every relative link (and heading anchors in Markdown targets) across the repo. Run it after moving or renaming files. - Tests must never call real models or external business services. Use the in-repo fakes and Testcontainers-based PostgreSQL fixtures.
pnpm check is the single gate every change must pass. It runs, in order:
| Step | Command | What it does |
|---|---|---|
| Verification records | pnpm verification:check |
Validates recorded verification evidence |
| Documentation | pnpm docs:check |
Checks all relative Markdown links and heading anchors |
| Contracts | pnpm contracts:check |
Regenerates contract artifacts into a temp dir and fails on drift |
| Types | pnpm typecheck |
Builds all packages, then typechecks them |
| Tests | pnpm test |
The full suite — a thousand-plus tests against a real PostgreSQL 16 |
| Builds | pnpm build |
Builds all packages |
| API report | pnpm api:check |
Fails when the public API report is out of date |
Practical notes:
- The first test run pulls the pinned
postgres:16image; subsequent runs are offline. - One core test file (
actions.test.ts, the OPA WASM control snapshot) transiently peaks around 2 GB RSS. Machines with sub-4 GB Docker VMs may see that file OOM-killed — this is an environment limit, not a product defect. Keep runner memory at 8 GB or more if self-hosting CI. - To run only the package you touched:
pnpm --filter @abh/core test(the same--filterpattern works forbuildandtypecheck).
- Follow the existing Conventional Commits style:
type(scope): subject, e.g.fix(core): ...,docs(cli): ...,feat(contracts): .... - Keep pull requests focused: one logical change per PR, with a description that says what changed and why.
- CI must be green (
checkande2ejobs). If you could not run the full suite locally, say so in the PR. - New user-facing behavior should come with tests, and README-affecting changes (commands, package roles) must be reflected in both
README.mdandREADME.zh-CN.md. - Do not commit secrets, real connection strings, or environment files;
.env*is ignored except.env.example.
- Bugs: open a GitHub issue using the bug report template. Include the command you ran, the full error output, and your environment (Node/pnpm/Docker versions).
- Features and design: open an issue with the feature template first; large changes should be discussed before implementation. If your idea touches the contract layer or the authorization chain, link the relevant module specification under
docs/V1.
Do not open public issues for security vulnerabilities. See SECURITY.md for the private reporting channel.
By contributing, you agree that your contributions are licensed under the MIT License that covers this repository. Documentation under docs/V1 is licensed CC BY 4.0. No CLA is required.