Files
substrate/CONTRIBUTING.md
T
Maya Wang c618baa593 docs: convention for integration repository structure and naming (#712)
## Summary

Adds `docs/integration-repos.md`: where end-to-end integrations live,
how their
repositories are named, and how the fixes they need flow back into core.

The convention in one line — trivial demos stay in the core repo, each
non-trivial integration gets one dedicated repo under the
`agent-substrate`
org, and core gaps get closed by making core configurable with defaults
unchanged rather than by patching it downstream.

## Why now

We are about to create the first real, end-to-end integrations rather
than
counter-style demos: a code-execution sandbox, and an always-on agent.
Both are
large enough to need their own images, dependencies, and release
cadence.

Whichever repository gets created first will set the precedent for every
one
after it. This writes the convention down so that precedent is chosen
deliberately instead of inherited by accident.

## What it covers

- **Where code lives** — the core-repo/dedicated-repo split, the rough
test for
which side something falls on (API keys, external services, third-party
accounts), and why this is a set of peer repos rather than a second org.
- **Naming** — capability-named for general capabilities
  (`code-execution-sandbox`), integration-named for specific third-party
products, named for the product rather than the vendor behind it. Plus
what to
avoid: over-broad names, names that clone a vendor's API or brand, and
the
  redundant `-integration` suffix.
- **Third-party names** — allowed descriptively, with a non-affiliation
note in
the repo README, and brand/policy edge cases cleared before the repo
exists.
- **Upstreaming** — the part with teeth for this repo. Integration repos
that
accumulate local patches against core bitrot, and the gap they work
around
stays invisible to everyone else. So: prefer making core behavior
configurable
with defaults unchanged. #487 and #465 are linked as illustrations of
that
  pattern — this PR does not depend on either, and branches from `main`.
- **Two worked examples** that validate the convention rather than just
  following it, including the third-party-name edge case.

## Review

This was announced at the community meeting and circulated as a shared
design
doc with a 7-day review window, which has now closed. It synthesizes the
`#integrations` thread discussion. Comment history:


<https://docs.google.com/document/d/1Tb6u0b1XSvWrNpoyD4jdsQaJ58aAgDtQOM18uxujs-8/edit>

This PR is the trimmed version: doc-review scaffolding — status block,
reviewer
list, self-link — is dropped, and only the durable convention is carried
over.

## Left open

Two questions are deliberately out of scope, called out in the doc
rather than
answered. Both are maintainer calls and neither blocks the first
repositories:

- Governance tiers — whether to distinguish "official" from "community"
integrations with different review bars, as Home Assistant and Obsidian
do.
- Who creates integration repositories and grants per-integration
maintainer
  access.

## Also in this PR

- README gets an entry in the docs list, matching every other file in
`docs/`.
- `CONTRIBUTING.md` gets one sentence pointing there, since "where does
my
  integration go?" is a question a contributor asks before opening a PR.

Fixes #<issue_number_goes_here>

> It's a good idea to open an issue first for discussion.

- [x] Tests pass
- [x] Appropriate changes to documentation are included in the PR
2026-08-19 11:24:41 -07:00

4.6 KiB

How to Contribute

We would love to accept your patches and contributions to this project. Before you spend a lot of time on a contribution, please review the following guidelines.

Before you begin

Sign our Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License Agreement (CLA). You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project.

If you or your current employer have already signed the Google CLA (even if it was for a different project), you probably don't need to do it again.

Visit https://cla.developers.google.com/ to see your current agreements or to sign a new one.

Review our Community Guidelines

This project follows Google's Open Source Community Guidelines.

Set up a local development environment

The Quickstart (Development) in the README covers bringing up a local cluster with the default (gVisor) runtime. To run the microVM runtime locally — which needs /dev/kvm, or Lima nested virtualization on Apple Silicon — see docs/dev/microvm-local.md.

Contribution process

This is a very new project, so we are still working out exactly how it is going to be developed. For now, we are focused on iterating quickly to find the right design and architecture. This has implications for contributors:

  1. Things are moving quickly, so PRs may need to be rebased or updated frequently. Small PRs that are focused on a single issue or feature are easier to review and update than large PRs that touch many different parts of the codebase.

  2. While we welcome new contributors, we are really focused on the minimal capabilities needed to make this project useful. Before you start a new contribution, please discuss it with us first (if there is an issue open, comment there and if not, open one). We want to make sure that your work is aligned with our near-term goals for the project and that we are not duplicating work that is already in flight.

  3. PRs which are not aligned with our near-term goals may be closed without extensive review. We are not trying to be discouraging, but we need to make sure that we are focused on the most important work.

If you are building something that runs on Substrate rather than changing Substrate itself, see Integration Repositories for where that code should live.

Sizing PRs for review

We optimize PRs for easy review — large PRs get broken down, small PRs get merged.

  • Large PRs: split huge changes into a series of smaller PRs, each a logically distinct feature. When the intermediate steps are not useful on their own, keep the change as one PR split into commits at logical break points, and preserve those commits on merge.
  • Small and bulk PRs: if you find a typo, review the whole file and fix everything in one pass rather than sending the single edit. Group related typo, doc, and single-line cleanup fixes into one PR rather than opening several small ones for the same area. Maintainers may ask you to consolidate fragmented PRs into one, or close them in favor of a combined submission.

As a rough scale: S is under 30 changed lines, M under 100, L under 500, XL under 1000. Most PRs should be L or smaller; XL and above are candidates for breaking down.

Code Reviews

All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose.

All code changes should be accompanied by tests. We will not merge code that does not have tests, and we will not merge code that causes tests to fail.

Root-gated tests

Tests that need root (overlay mounts, mknod, trusted.* xattrs, ...) call roottest.Require(t, ...) from internal/roottest as their first statement. They skip in a plain go test ./...; CI reruns every package whose tests import that package under sudo. To run them locally:

hack/run-root-tests.sh

New privileged tests only need the roottest.Require call — no CI changes.

Every file containing source code must include copyright and license information. This includes any JS/CSS files that you might be serving out to browsers. (This is to help well-intentioned people avoid accidental copying that doesn't comply with the license.)

Our standard headers for various filetypes can be found in ./hack/boilerplate.