6.2 KiB
Contributing
This repository uses repo-local documentation, scripts, and tests as the source of truth for active behavior and validation.
License and Contribution Terms
By submitting a contribution, you agree that your contribution is licensed under the project Apache License 2.0.
Before You Start
- Read
README.md. - Read the relevant docs under
docs/. - Inspect the code and tests for the area you will change.
- Decide the smallest safe change that satisfies the request.
Maintainers and automation authors should also read
docs/automation.md for repo-local release and agent workflow
notes that are intentionally kept out of the repository root.
Working Rules
- Keep changes minimal and atomic.
- Update tests together with implementation changes.
- Prefer main-thread integration for shared or high-conflict files.
- Do not let multiple agents edit the same code region at the same time.
Local Checks
Run the verification commands that match the surface you changed before you hand work back. The goal is useful, change-specific evidence, not a second local execution of every CI job.
Common repository checks already used here include:
./scripts/dev/ci-local.sh
./scripts/policy/check-open-source-assets.sh
go test ./...
make test
make test-plan
make lint
./scripts/policy/check-generated-drift.sh
./scripts/policy/check-command-surface.sh --strict
./scripts/release/verify-package-managers.sh
git diff --check
Select the PR risk tier before choosing checks:
| Tier | Typical scope | Developer evidence | CI expansion |
|---|---|---|---|
| Documentation-only | Prose and documentation assets with no executable, generated, workflow, packaging, or interface change | Links/content/rendering plus repository asset checks | Lightweight documentation validation; all nine named contexts still report |
| Standard | Ordinary implementation work with a stable package graph | Focused unit/integration tests and observable behavior for the changed path | Race tests for changed packages and their reverse dependencies, scope-matched HEAD/base coverage, and representative Darwin/Windows compilation |
| High-risk | Workflow/policy, package graph, generated Schema/registry, platform, auth/keychain, installer, packaging, release, transport, recovery, or an unprovable infrastructure change | Relevant full or domain suite plus focused behavior evidence | Complete race suite, native platform tests, and all affected domain gates; protected main uses this tier unless an exact two-parent merge can reuse a complete, base-owned PR admission |
Classification fails closed: an incomplete diff, package add/remove/rename, or uncertain dependency graph selects the high-risk suite. Native changed-code coverage is additionally selected for platform-sensitive code. An eligible protected-main merge keeps all nine required contexts but records the already successful full-suite PR evidence instead of repeating it. The merge tree, PR identity, base-owned workflow blobs, check/status timestamps, workflow runs, and coverage artifact must all bind exactly; otherwise main runs the complete high-risk suite. Main-only Runtime Payload and integration checks still execute against the merge SHA.
Pull Request Checklist
- Keep implementation and tests in sync.
- Select the documentation-only, standard, or high-risk tier and run the
smallest checks that prove the change. Use
./scripts/dev/ci-local.shwhen a complete local pass is warranted; it is not required for every ordinary PR. - Include both the commands/results and user-visible or contract-level behavior evidence in the PR description.
- Run
./scripts/policy/check-command-surface.sh --strictwhen command paths/flags change. CI resolves the exact merge-base, latest reachable non-withdrawn stable GA tag, and committed candidate SHA, then enters the single compatibility decision seam throughmake authoritative-interface-integrity BASE_REF=<merge-base> STABLE_REF=<latest-GA-tag> CANDIDATE_REF=<candidate-sha>. The Make target delegates to the authoritative wrapper; CI does not invoke a second comparator or the legacy fixture checker. See CLI Help / Schema compatibility migration governance for the reviewed two-stagepending→consumedlifecycle. Agent-visible flag or command-path migrations must also runmake schema-compatibility BASE_REF=<merge-base> STABLE_REF=<latest-GA-tag> CANDIDATE_REF=<candidate-sha>; it consumes the same base-owned ledger rather than a second exception list. - Run
./scripts/policy/check-generated-drift.shwhen generated artifacts may change. - Run
./scripts/release/verify-package-managers.shwhen packaging or installer surfaces change (runmake packagefirst). - Update docs and add one
.changes/<unique-name>.mdrelease fragment for behavior/interface changes. Do not editCHANGELOG.mdin an ordinary PR; the release-seal workflow renders and archives fragments into the versioned changelog section.
Submission Flow
- Make the smallest atomic change that satisfies the task.
- Keep doc edits factual and limited to implemented behavior.
- Run the relevant verification commands.
- Report the validation results and risk tier with the handoff.
- Open a ready PR against
main. Base-owned automation assigns one eligible peer reviewer, balancing the current open-review load and excluding the author. A new head push re-enters the same routing flow when the latest revision still needs review. - After the latest push has one peer approval and the exact nine required
contexts are current and green, auto-merge completes the PR. If
mainadvances first, strict status checks revalidate the branch; no separate routine merge request is needed.
Contributors without repository write access stop at the PR flow. Explicitly
authorized collaborators with write, maintain, or admin access can use
Actions → Release
to publish beta releases without manual approval. The same internal roles may
start a stable release, but a different repository administrator must approve
the release-stable Environment deployment before publication continues.