Skip to content

Add an AGENTS.md to orient agents and developers#221

Merged
dscho merged 2 commits into
mainfrom
add-agents-md
Jun 23, 2026
Merged

Add an AGENTS.md to orient agents and developers#221
dscho merged 2 commits into
mainfrom
add-agents-md

Conversation

@dscho

@dscho dscho commented Jun 21, 2026

Copy link
Copy Markdown
Member

AI-assisted contributions are a reality of open source, and that includes the maintainers themselves. Over recent months, AI has proven increasingly useful for the kind of menial, tedious work that does not require much creativity but is highly boring when done by hand: chasing down webhook delivery failures, tracing how a single slash command fans out into cross-repository workflow dispatches and check-run cascades, and adapting to GitHub API changes that quietly break the automation.

This AGENTS.md provides enough context about the repository's architecture, conventions, and contracts that AI tools can produce reasonable results even when a human contributor fails to steer carefully. It documents the thin-Azure-Function-that-delegates-to-git-for-windows-automation architecture and the two contracts holding it together (workflows dispatched by file name; check-run names and summaries parsed by cascading-runs.js), the slash commands and how /deploy maps packages to architectures, the embargoed-builds/ worktree that must not be edited from main, and the build/test/lint commands and test-harness quirks. It mirrors git-for-windows-automation's AGENTS.md and points back at it, since the two describe opposite ends of the same contract.

Similar AGENTS.md files have been added to other repositories in the Git for Windows project: git, git-for-windows-automation, build-extra, MINGW-packages, and MSYS2-packages.

It is stacked on #220 on purpose, so that what it says about /deploy matches the code there; until that lands, the diff below also includes #220's commit.

dscho added 2 commits June 20, 2026 18:24
Git for Windows' SDK is migrating from the MINGW64 to the UCRT64
environment, so the packages we ship need UCRT64 variants from now on. The
build-and-deploy workflow already learned about the `ucrt64` pseudo
architecture, which means `/deploy` can finally request those builds, but
I do not want to do that by leaning on the workflow's combined run: with
no explicit architecture it builds mingw32, mingw64 and ucrt64 one after
another in a single job, and packages such as mingw-w64-openssl and
mingw-w64-curl already take long enough that serializing a third
environment on top would hurt. Dispatching one run per architecture lets
them build in parallel on separate runners instead, turning the
wall-clock from the sum of the three into the slowest of them.

So for a regular MINGW package `/deploy` now starts individual `i686`,
`x86_64` and `ucrt64` runs alongside the existing `arm64` one, rather than
a single combined run plus `arm64`. git-extra is a regular MINGW package
in this sense and gets the same treatment; its `.src.tar.gz` is still
built exactly once, in the `x86_64` run. The set of packages that get
built and deployed is unchanged; only the granularity of the runs is.

Three packages stay on a single combined run: mingw-w64-git-credential-
manager, mingw-w64-git-lfs and mingw-w64-wintoast are not built per
architecture by us at all, but cross-compiled via Visual Studio or
downloaded as pre-built artifacts for every architecture (including
clangarm64) at once. mingw-w64-llvm keeps getting only the `arm64` run via
`/deploy`, as before.

To express that, the predicate that used to be called
`needsSeparateARM64Build` is replaced by its inverse,
`buildsAllArchitecturesInOneRun`, which positively names exactly those
three exceptional packages. I first tried merely renaming it to
`isMINGWPackage`, but that does not fit: the three exceptions are
themselves MINGW packages, so a predicate that excludes them cannot
honestly claim to answer "is this a MINGW package". Identifying the
special cases directly keeps both the predicate and the resulting
three-way dispatch (MSYS, combined, per-architecture) self-explanatory.

The UCRT64 support in the build-and-deploy workflow landed in
git-for-windows/git-for-windows-automation#178,
and the overall SDK migration is tracked in
git-for-windows/git-sdk-64#117.

Assisted-by: Opus 4.8
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Every sibling repository in the Git for Windows constellation that an AI
agent is likely to touch (git-for-windows-automation, build-extra,
MINGW-packages, MSYS2-packages) ships an AGENTS.md, but this one did not,
even though it is one of the harder repositories to reason about from the
source alone: it is an Azure Function that does little itself and instead
dispatches workflows elsewhere by filename and communicates back through
check-run names and summaries. Those cross-repository couplings are
invisible until something breaks.

This file captures the parts that bit me, or would have, while extending
the `/deploy` command this session: that workflows are dispatched by
filename (so renames must be coordinated with git-for-windows-automation),
that check-run names and summaries are a parsing contract consumed by
cascading-runs.js, that `embargoed-builds/` is a separate long-lived
worktree which must not be edited as part of `main` changes, and that
`npm test` also picks up that worktree's suites unless scoped to
`npx jest __tests__/`. It deliberately mirrors the structure of
git-for-windows-automation's AGENTS.md and points back at it, since the
two describe opposite ends of the same contract.

It is stacked on top of the per-architecture `/deploy` change so that its
description of how `/deploy` maps packages to architectures (the
`buildsAllArchitecturesInOneRun` predicate, the separate i686/x86_64/ucrt64
runs) stays consistent with the code it documents.

Assisted-by: Opus 4.8
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho marked this pull request as ready for review June 23, 2026 08:26
@dscho dscho merged commit eca6327 into main Jun 23, 2026
1 check passed
@dscho dscho deleted the add-agents-md branch June 23, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant