Contributing Guide¶
Note
In-repo only. This page is for contributors working from a git clone
checkout — make build, make test, make lint-go, the FI suite, and
the development workflow. Operators following the install flow
(curl … install.sh | bash) should start at the Quickstart;
nothing on this page is reachable from the install footprint.
How to contribute code, documentation, tests, and failure injection scenarios to the AutonomyOps ADK.
Before You Start¶
Read the invariants. Every change must respect Architecture → Invariants. Many violations are caught automatically by
ci/scan_prohibitedandci/scan_dependencies, but some require code-review sign-off.Find the FI test. For changes to any module that has FI coverage (see FI Catalog → Matrix), verify the relevant FI test still passes.
Check the package mapping. If your change adds or renames a Go package, update
docs/_meta/pkg-to-page.yaml.make docs-coverage-gatewill fail the PR otherwise.
Development Workflow¶
# 1. Fork and clone
git clone https://github.com/autonomyops/adk.git
cd adk
# 2. Build
make build
# 3. Test the affected module
cd <module>
GOWORK=off go test ./... -v -count=1
# 4. Run the CI suite locally
make lint-go
make test
make edge-fi-go # if changing edge/
make docs-coverage-gate # if adding/renaming packages
make docs-lint # if changing docs
# 5. Open a PR against master
CI Gates¶
All of these must pass for a PR to merge:
Gate |
Makefile target |
Required for |
|---|---|---|
Go lint |
|
All code changes |
Unit tests |
|
All code changes |
Docs build strict |
|
All changes (docs + code) |
Docs coverage gate |
|
New/renamed Go packages |
Docs freshness |
|
Renamed or deleted doc pages |
Prohibited symbol scan |
|
Changes to |
Dependency graph check |
|
Changes to |
Edge FI Go tests |
|
Changes to |
Edge FI shell tests |
|
Changes to |
Security check |
|
All code changes |
PR Requirements¶
New exported Go package → add an entry to
docs/_meta/pkg-to-page.yaml. Runscripts/docgen/seed-pkg-map.shfor a draft, then hand-edit.New/changed invariant enforcement point → update Traceability → Invariant Map.
Change to
edge/failure mode → include or update the corresponding FI test.Doc-only PR →
make docs-lintandmake docs-freshnessmust pass.New doc page → add a
{toctree}entry in the appropriatedocs/<section>/index.md.
Adding a New Go Module¶
Create
<module>/go.modwithgo 1.N(2-part, no patch version). Do not add atoolchaindirective to individualgo.modfiles — the workspace-leveltoolchain go1.25.11ingo.workis authoritative for the whole repo.Add
replacedirectives in anygo.modthat imports it.Add the module to
go.workusedirectives.If
cmd/autonomyimports it, add areplaceincmd/autonomy/go.modtoo.Create
<module>/docs/_meta/pkg-to-page.yamlfor the new module.Add the module’s test command to the CI workflow if needed.
Commit Message Style¶
<type>(<scope>): <short summary (≤72 chars)>
<body: why the change was needed; what invariant it affects if any>
Types: feat, fix, docs, test, refactor, chore
Examples:
feat(runtime): add release poll loop with lifecycle telemetry
fix(policy): fall back to LKG when bundle hash mismatch on load
docs(architecture): fill in invariants starter page
test(edge): add FI-C3-02 cert revocation scenario
Code Style¶
# Format all Go code
gofmt -w .
go vet ./...
# Check Markdown (linted in CI by markdownlint-cli2)
npx markdownlint-cli2 --config .markdownlint.yml "docs/**/*.md"
Key style rules:
Go:
gofmtwith no exceptions; standardgo vetmust passMarkdown: max 200 chars/line (code blocks and tables exempt); fenced code blocks only
Install repo-managed Git hooks before your first commit on a clone:
make install-hooks
The pre-commit hook automatically regenerates and stages docs/_generated/ when staged changes can affect repo scan, config/test inventory, workflows, or docs coverage inputs.
Do Not Do¶
❌ Do NOT skip
ci/scan_prohibitedorci/scan_dependencies— they enforce structural invariants❌ Do NOT add a new package without updating
pkg-to-page.yaml— CI will fail the PR❌ Do NOT commit with
--no-verify— pre-commit hooks run important lint/invariant checks❌ Do NOT amend already-published commits — create a new commit instead
Getting Help¶
Docs feedback: open an issue with label
docs
See Also¶
Invariant Rules — checklist for invariant-safe changes
Doc Standards — how to write and update documentation