docs(agents): write nested AGENTS.md for scripts, workflows, images and ADRs
Each file holds its directory's rules in full: the rule, a one-sentence reason and how it is held (control, review or aspirational). The interim dependency and image section of making-a-change.md moves into scripts/AGENTS.md and images/AGENTS.md; the contributor docs point to the new files. Closes #182 Assisted-by: Claude Code:claude-opus-5-5
This commit is contained in:
1 parent
cd6ae5c1d6
commit
fbc9b375a6
7 files changed
+280
-42
No files matched your search
@@ -0,0 +1,28 @@
|
||||
# ADR rules
|
||||
|
||||
Every rule for the architecture decision records in `docs/adr/`, in full. Each gives its reason
|
||||
(*Why*) and how it is held (*Held*): a control names its check; review means a person other than
|
||||
the author sees the change before it merges; aspirational means nothing checks it.
|
||||
|
||||
- **An ADR only for a decision that is hard to reverse, surprising without context, and the
|
||||
result of a real trade-off** (all three). Anything else is a rule in the contributor docs or a
|
||||
directory's `AGENTS.md`, or a commit message. *Why:* an ADR is read as binding, so one per
|
||||
small choice buries the few that matter. *Held:* review.
|
||||
- **Status is `accepted` or `superseded by NNNN`, nothing else.** A proposal lives in an issue or
|
||||
a pull request and is never committed as "proposed". *Why:* a committed ADR is either in force
|
||||
or replaced; a draft in the tree reads as a decision. *Held:* review.
|
||||
- **An ADR is accepted on the maintainer's approval of its pull request, which sets status
|
||||
`accepted`.** *Why:* an ADR binds every contributor, so the maintainer decides it. *Held:*
|
||||
control: the `CODEOWNERS` entry for `docs/adr/`, which requires the maintainer's code-owner
|
||||
approval.
|
||||
- **One screen at most:** context, decision and reason first; considered options only when a
|
||||
rejection is not obvious. *Why:* a decision nobody reads to the end does not guide anyone.
|
||||
*Held:* review.
|
||||
- **No infrastructure detail:** no hostnames, addresses, runner sizing, account or secret names.
|
||||
*Why:* this repository is public, and an ADR outlives the infrastructure it would name.
|
||||
*Held:* review.
|
||||
- **An accepted risk is an entry in the "Accepted risks" section of
|
||||
[SECURITY.md](../../SECURITY.md)** (risk, why accepted, trigger, planned reduction), not an
|
||||
amendment to an ADR; a later decision that accepts a risk adds an entry there. *Why:* one
|
||||
register shows every risk the repository carries, and an accepted ADR stays as decided.
|
||||
*Held:* review (`SECURITY.md` is under `CODEOWNERS`).
|
||||
@@ -1,7 +1,9 @@
|
||||
# Code style
|
||||
|
||||
Read this before writing or changing a script, a workflow, a hook, a comment or a guidance document.
|
||||
Rules for roles are in [roles/AGENTS.md](../../roles/AGENTS.md).
|
||||
Rules for roles are in [roles/AGENTS.md](../../roles/AGENTS.md); rules for scripts, workflows and images
|
||||
are in [scripts/AGENTS.md](../../scripts/AGENTS.md), [.gitea/workflows/AGENTS.md](../../.gitea/workflows/AGENTS.md)
|
||||
and [images/AGENTS.md](../../images/AGENTS.md); rules for ADRs in [docs/adr/AGENTS.md](../adr/AGENTS.md).
|
||||
|
||||
Every rule gives its reason and how it is held: by a control (a named hook or check), by review, or
|
||||
aspirational (checked by nothing and nobody). Links between the contributor docs are held by review
|
||||
|
||||
@@ -5,7 +5,8 @@ Read this before starting a branch, committing, filing an issue or opening a pul
|
||||
Every rule below gives its reason and how it is held: by a control (a named hook or check), by
|
||||
review, or aspirational (checked by nothing and nobody). Links between the contributor docs are
|
||||
held by review until an offline link check exists. Rules for roles are in
|
||||
[roles/AGENTS.md](../../roles/AGENTS.md); rules for working with an agent, including commit
|
||||
[roles/AGENTS.md](../../roles/AGENTS.md), and for scripts, workflows, images and ADRs in the
|
||||
`AGENTS.md` of their directory (below); rules for working with an agent, including commit
|
||||
trailers, are in [ai-assistance.md](ai-assistance.md).
|
||||
|
||||
## Branches and pull requests
|
||||
@@ -84,43 +85,16 @@ trailers, are in [ai-assistance.md](ai-assistance.md).
|
||||
*Reason:* copied comments and paths are where private references slip in.
|
||||
*Held by:* review.
|
||||
|
||||
## Dependency and image updates
|
||||
## Dependency, image and workflow changes
|
||||
|
||||
Interim section: it moves to `images/AGENTS.md` and `scripts/AGENTS.md`.
|
||||
The rules for these live next to the files they govern: [scripts/AGENTS.md](../../scripts/AGENTS.md)
|
||||
(scripts, their tests, tool pins and their lock, hook SHA pins),
|
||||
[images/AGENTS.md](../../images/AGENTS.md) (image inputs, version bumps, pin pull requests, the layer
|
||||
limit), [.gitea/workflows/AGENTS.md](../../.gitea/workflows/AGENTS.md) (workflows, secrets, the
|
||||
bot-diff gate) and [docs/adr/AGENTS.md](../adr/AGENTS.md) (decision records).
|
||||
|
||||
- **A pin in `requirements-dev.txt` changes together with its lock `requirements-dev.lock`.** Renovate
|
||||
does both; by hand, run `scripts/lock-requirements.sh` (`--upgrade` also moves transitive packages;
|
||||
it needs PyPI and the Python of `.python-version`) and commit the lock in the same pull request.
|
||||
*Reason:* installs use `pip install --require-hashes -r requirements-dev.lock -r requirements-dev.txt`,
|
||||
which refuses an unhashed package and any disagreement between the two files.
|
||||
*Held by:* control: the Lint and Build checks install that way when a pin file changes.
|
||||
- **Hook repositories in `.pre-commit-config.yaml` are pinned by commit SHA, with the release in a
|
||||
`# frozen: vX.Y.Z` comment.** Find the SHA with
|
||||
`git ls-remote <repo> "refs/tags/<tag>" "refs/tags/<tag>^{}"` (the `^{}` line, when there is one).
|
||||
*Reason:* a tag can be moved; a commit SHA cannot.
|
||||
*Held by:* review (`.pre-commit-config.yaml` is under `CODEOWNERS`).
|
||||
- **A pull request that changes an image input (`requirements-dev.txt`, `requirements-dev.lock`,
|
||||
`requirements.yml`, `.pre-commit-config.yaml`, `images/**`) raises that image's `version:` in
|
||||
`.gitea/workflows/image.yml`** (`python3 scripts/bump_image_versions.py` makes the edit).
|
||||
*Reason:* a published image version is never rebuilt, so a changed input needs a new version.
|
||||
*Held by:* control: the Lint check's `Check image versions were bumped` step.
|
||||
- **After the merge builds the image on `main`, a second pull request moves the
|
||||
`image:<version>@sha256:<digest>` pins in `lint.yml`, `build.yml`, `molecule.yml` and
|
||||
`gitea-release-key.yml` to the printed digest.** It touches no `image.yml` trigger path, so it rebuilds nothing.
|
||||
*Reason:* consumers run exactly the digest a reviewer saw.
|
||||
*Held by:* review; Renovate opens these pull requests for the repository's own images.
|
||||
- These tooling files are in `galaxy.yml` `build_ignore`, so their bumps change neither the
|
||||
Collection nor its version.
|
||||
- **A pull request from a `renovate/` branch changes only version, tag, digest and pin lines.**
|
||||
*Reason:* the bot's pull requests automerge, so they must not be able to change anything else.
|
||||
*Held by:* control: `scripts/check_bot_pr_diff.py` in the Lint check, run from `main`'s copy.
|
||||
- **Workflows never mention the image namespace this repository's CI must not use** (the string is in
|
||||
`scripts/check_image_versions.py`).
|
||||
*Reason:* this repository's images are built and pulled only under its own organisation's namespace.
|
||||
*Held by:* control: the Lint check's `Check image pins` step.
|
||||
- `renovate.json` configures the bumps (minor and patch automerge, majors by hand). Renovate runs in
|
||||
`.gitea/workflows/renovate.yml` (daily cron on this repository's runner, as a bot user of this
|
||||
repository only). Test a config change before the merge with `renovate --platform=local` (the version
|
||||
in `renovate.yml`), which reads your checkout; a dry run in Actions (Run workflow with `dry_run=true`)
|
||||
reads `renovate.json` from `main` and proves reads only. Open item: no live run has yet shown that
|
||||
the bot can push and open a pull request, and that its pull requests get the Lint and Build checks.
|
||||
- **Test a change to `renovate.json` before the merge with `renovate --platform=local`** (the version
|
||||
in `.gitea/workflows/renovate.yml`), which reads your checkout.
|
||||
*Reason:* a dry run in Actions (Run workflow with `dry_run=true`) reads `renovate.json` from `main`,
|
||||
so it cannot test a pull request's change.
|
||||
*Held by:* review (`renovate.json` is under `CODEOWNERS`).
|
||||
Reference in new issue
Block a user