Skip to content

docs: contribution protocol addressed to AI coding agents - #215

Open
xerj-org wants to merge 3 commits into
mainfrom
feat/ai-contribution-protocol
Open

docs: contribution protocol addressed to AI coding agents#215
xerj-org wants to merge 3 commits into
mainfrom
feat/ai-contribution-protocol

Conversation

@xerj-org

@xerj-org xerj-org commented Aug 8, 2026

Copy link
Copy Markdown
Owner

What this changes, and why

XERJ's stated primary customer is an AI agent — but most agents that read this repository are not working on XERJ. They are working in someone else's codebase, XERJ is a dependency, it does something the docs say it does not, they patch around it locally to unblock their user, and they move on. That fix is lost. The defect stays in the engine and the next agent re-derives the same workaround.

Nothing in the repo told that reader what to do with the finding, so the default was to do nothing. This adds a contribution protocol written directly to that reader, with decidable rules rather than encouragement, and wires it into the places an agent hits during normal orientation.

The rules, in one paragraph. Three outcomes, and one of them is send nothing. A reproducible defect with no patch is one issue — exact copy-pasteable command, full observed output, expected output and the reason for expecting it, xerj --version, searched first, reproduced on a clean --data-dir. A defect you already patched and ran is a pull request — a test you watched fail before and pass after, cargo fmt --all, a scoped release build plus cargo test -p <crate>, the ES-YAML gate at 0 failed for engine changes, and a commit body with motivation, root cause and evidence. A suspicion you never ran is neither. Speculative fixes, style-only churn, untestable patches, prose polish, and bulk-filed issues from a scripted sweep are named as explicitly unwelcome, with the reason stated plainly: maintainer attention is the scarcest resource here, and an agent that files ten low-quality issues has made the project worse.

It also covers provenance (say an agent wrote it; split verified from assumed; no Co-Authored-By trailers in this repo; verification/cla-signed means a human account is answerable for the change), applies the honest-claims rule to contributors — every number comes from a command actually run — and gives a fallback for the very common case of a sandboxed agent that cannot push at all: hand the operator a filing-ready artifact instead of dropping the finding.

Files

File Change
.github/AI_CONTRIBUTIONS.md New — the protocol.
AGENTS.md New section on the first screen ("If XERJ broke something in your build, send it back") carrying the decidable core, plus a row in Where to look.
CONTRIBUTING.md Pointer for humans and reviewers, a checklist line for AI-provenance disclosure, and search-before-filing guidance.
.github/PULL_REQUEST_TEMPLATE.md New — see below.
landing/llms.txt Machine-readable "How to contribute" stanza so an agent finds the rules without reading prose.
.gitignore Re-include the two new .github Markdown files — see below.

Two things found along the way

CONTRIBUTING.md:99 claimed a PR template exists. None ever has. git log --diff-filter=D over .github/PULL_REQUEST_TEMPLATE* returns nothing — it was never added, not deleted. The mechanical reason is the second finding: the blanket *.md rule in .gitignore covers .github/, so git add .github/PULL_REQUEST_TEMPLATE.md is refused outright. Anyone who tried presumably hit that and moved on. This PR adds the template (it is also where the provenance disclosure has to happen to be real, and it carries an explicit Not run: field so a skipped gate gets stated rather than hidden) and adds a .gitignore re-include with a comment naming the trap for the next person.

Evidence

Everything quoted in the new docs was run, and one command failed the check:

$ xerj --version
xerj v1.0.0-rc.12

$ xerj --help | grep -E 'insecure|data-dir'
--data-dir, -d <PATH>  Override data directory
--insecure, -k         Disable TLS

$ gh api repos/xerj-org/xerj/commits/7e57705.../status --jq '.statuses[].context'
verification/cla-signed

$ gh search issues --repo xerj-org/xerj "term keyword array" --state all
invalid argument "all" for "--state" flag: valid values are {open|closed}

$ gh search issues --repo xerj-org/xerj "aggregation undercount" --limit 5
xerj-org/xerj  143  closed  Silent aggregation undercount on mixed-segment ...

$ cargo fmt --all -- --check
cargo-fmt-check-exit=0

The --state all failure is why the docs quote the bare gh search issues --repo xerj-org/xerj "<terms>" form — the bare form covers closed issues, as the fourth command shows. It was caught by running the command the docs were about to tell agents to run, which is the rule this PR is about.

Also verified: es-yaml-runner is the real package name in engine/tests/es-compat-yaml/Cargo.toml and the conformance invocation quoted matches .github/workflows/ci.yml:227; every relative link in the four Markdown files resolves to a real path (scripted over each ](./…) target); git check-ignore -v plus a successful git add confirm the two .github files are tracked after the .gitignore change.

Checks

  • cargo fmt --all -- --check → exit 0
  • Scoped release build — not applicable, no Rust changed
  • cargo test -p <crate>not applicable, no Rust changed
  • ES-YAML conformance suite — not applicable: docs/landing only, and docs/CONTRIBUTION_REVIEW.md:5 states the gate does not apply to a docs-only change
  • New ES-compatible behaviour — none
  • Docs updated (this PR is the docs)

Not run: the ES-YAML suite and any cargo build, for the reason above. No claim is made about them.

Provenance

  • Written by an AI coding agent (Claude Code, Opus 5), operating in an isolated worktree on behalf of the maintainer, who should read it before merging — the whole point of the protocol is that a human is accountable for the content.
  • Verified: the commands above, with the output shown. The --state all bug in the first draft was found by running it. wrangler.toml sets pages_build_output_dir = "landing", so landing/llms.txt is served verbatim at xerj.org/llms.txt with no build step in between.
  • Assumed, not tested: that the rendered Markdown reads well on github.com (checked as source, not rendered); that a Cloudflare Pages deploy picks the change up on merge (no deploy was run).
  • No Co-Authored-By trailers, per this repository's standing rule.

Scope note

This branch deliberately does not touch landing/get or add any install telemetry. The installer bugs and the missing install counter described in the adoption audit are separate work; touching them here would collide with whoever is doing it.

XERJ's stated primary customer is an AI agent, and a large share of the agents
that read this repository are not working on XERJ at all — they are working in
someone else's codebase, hit a XERJ defect, patch around it locally to unblock
their user, and move on. That fix is lost: it lives in a branch nobody upstream
reads, the defect stays in the engine, and the next agent pays the same cost.
Nothing in the repo told that reader what to do with the finding, so the default
behaviour was to do nothing with it.

This adds a protocol written directly to that reader, with decidable rules
rather than encouragement, and wires it into the three places an agent actually
looks during orientation.

What it says:

- Three outcomes, and one of them is "send nothing". A reproducible defect with
  no patch is one issue (exact command, full observed output, expected output
  and the reason for expecting it, `xerj --version`, searched first, reproduced
  on a clean --data-dir). A defect already patched and run is a pull request
  (test that fails before and passes after, `cargo fmt --all`, scoped release
  build plus `cargo test -p <crate>`, ES-YAML gate at 0 failed for engine
  changes, commit body with motivation/root cause/evidence). A suspicion that
  was never run is neither.
- Explicit non-goals: speculative fixes, style-only churn, untestable patches,
  prose polish, and bulk-filed issues from a scripted sweep. Stated plainly:
  maintainer attention is the scarcest resource here, and an agent that files
  ten low-quality issues has made the project worse.
- Provenance and accountability: say an agent wrote it, split verified from
  assumed (copy-paste block provided), no `Co-Authored-By` trailers in this
  repo, and the required `verification/cla-signed` check means the human whose
  account opened the PR is the one who can be asked about it later.
- The honest-claims rule applied to contributors: every number comes from a
  command actually run; "this should be faster" is not a benchmark.
- A fallback for the common case of a sandboxed agent that cannot push at all:
  hand the operator a filing-ready artifact (repro, version, observed vs
  expected, diff, verified/assumed) instead of dropping the finding.

Files:

- .github/AI_CONTRIBUTIONS.md — the protocol.
- AGENTS.md — a section on the first screen ("If XERJ broke something in your
  build, send it back") carrying the decidable core, plus a row in Where to look.
- CONTRIBUTING.md — pointer for humans and reviewers, a checklist line for
  AI-provenance disclosure, and search-before-filing guidance.
- .github/PULL_REQUEST_TEMPLATE.md — new. CONTRIBUTING.md line 99 claimed "The
  PR template will prompt you for this checklist" and no template has ever
  existed in this repo's history, so the claim was false; the template is also
  where the provenance disclosure has to happen to be real. It carries an
  explicit "Not run:" field so a skipped gate is stated rather than hidden.
- landing/llms.txt — a machine-readable "How to contribute" stanza so an agent
  can find the rules without reading prose.
- .gitignore — re-include the two new .github Markdown files. The blanket *.md
  ignore was swallowing them: `git add .github/PULL_REQUEST_TEMPLATE.md` is
  refused outright, which is the mechanical reason no template ever existed
  while CONTRIBUTING.md said one did. The comment names the trap for the next
  person who adds Markdown under .github/.

Verified (commands run in the worktree, output observed):

- `xerj --version` -> `xerj v1.0.0-rc.12`; `xerj --help` confirms `--insecure`
  and `--data-dir` as quoted.
- `gh api repos/xerj-org/xerj/commits/<sha>/status` -> the CLA status context is
  exactly `verification/cla-signed`.
- `gh search issues --repo xerj-org/xerj "<terms>" --state all` FAILS
  (`invalid argument "all" for "--state" flag`); the bare form returns closed
  issues, so the docs quote the bare form. Caught by running the command that
  the docs were about to tell agents to run.
- `es-yaml-runner` is the package name in engine/tests/es-compat-yaml, and the
  CI invocation quoted here matches .github/workflows/ci.yml:227.
- Every relative link in the four markdown files resolves to a real path
  (script over each `](./…)` target).
- `git check-ignore -v` and a successful `git add` confirm the two .github
  files are tracked after the .gitignore change.
- `cargo fmt --all -- --check` -> exit 0.

Not run: the ES-YAML conformance suite and any cargo build. This change touches
no Rust; docs/CONTRIBUTION_REVIEW.md states the gate does not apply to a
docs-only change.
@cla-bot cla-bot Bot added the cla-signed label Aug 8, 2026
… written

Both are commands the protocol tells an agent to run, so they have to work
verbatim rather than approximately.

- The conformance snippet backgrounded the server and immediately invoked
  es-yaml-runner, which needs a live node — the runner would race the boot on a
  cold build. Added the health poll that .github/workflows/ci.yml:216-223 uses,
  and stated that the runner exits non-zero on any failure.
- Tightened the note on `gh search issues`: `--state` accepts only `open` or
  `closed`, and the bare form already covers both. Same content, one paragraph
  instead of a sentence stranded mid-line.

No other file changes; follow-up rather than an amend because the first commit
was already pushed (CONTRIBUTING.md's git-workflow rule).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant