R461 · AI-built software and its verification › Agent delivery workflows

Proof of use before a pull request: an open-source project's gate against machine-generated contributions

Read the original

code-reviewhuman-oversightopen-sourceagent-governancedocs-as-codecoding-agents

A maintainer's answer to "coding assistants can produce an entire integration in a single session": move the gate upstream of the PR, make a label the only authorization, and have a workflow enforce it. Sources: the project's blog post and the enforcing code.

The problem, as the maintainers state it

The Haystack framework keeps a community-maintained index of third-party integrations — one Markdown page per integration, in a public repository. The team's account of what changed:

Coding assistants can now produce an entire integration, from the package to the documentation page and the pull request, in a single session. That is great for contributors, yet it means our team receives far more pull requests than it can review carefully, and some of them describe integrations that were never tested in a real pipeline or that nobody asked for.

The cost is named precisely: "Reviewing each of them takes real time away from the integrations people actually use." Not spam, not bad faith — plausible, well-formed, complete submissions arriving faster than a human can evaluate them, each one individually reasonable and collectively unreviewable. The maintainers note this is not theirs alone, citing a discussion among maintainers elsewhere on requiring proof of use as a contribution condition, which inspired part of the approach.

This is the review-capacity problem stated in its cleanest form. The supply of plausible contributions became elastic; the supply of maintainer attention did not.

The change

So we changed the rules in the haystack-integrations repository: a new integration now starts with an issue, not a pull request.

The flow, as published:

  1. The contributor opens an issue from a dedicated form, declaring one of two stages: Discussion ("no integration yet, checking if there's a need") or Ready ("integration exists and works, proposing to list it").

  2. For Ready, the form requires need or proof of use: "link to a project that imports it in a real pipeline, or describe the production use case." For Discussion, it requires an argument for why users would want it.

  3. A maintainer reviews and, when satisfied, applies the label approved.

  4. Only then does the contributor open a pull request adding a single .md page, linking the issue with Closes #N.

  5. An automated check fails any PR that does not link an approved issue.

The form also asks for the integration type from a fixed list of seventeen categories, a short description, and — optionally — a published package or repository link. Blank issues are disabled, so the form is the only entrance. The repository's contributing instructions and the PR template both restate the sequence, the template's checklist leading with "The linked issue is labeled approved."

And the stated non-change, which is the part that makes it defensible:

Nothing about who can contribute has changed: the process is open to everyone, and you keep ownership of your integration. The issue simply gives us a place to agree on the need and the scope before anyone writes the code or the page.

Why this is the right shape

Three properties are worth separating out, because each is independently transferable.

The expensive artifact is produced after approval, not before. A PR is a review obligation the moment it exists: someone must read it, respond to it, and eventually accept or decline it in public, to a contributor who has already done the work. An issue is a question. Moving the decision to the cheap artifact means a "no" costs the contributor a form and the maintainer a sentence, rather than a finished package and a public rejection. This is the same economics as a design doc before an implementation, applied at the point where generation got cheap.

Proof of use is a requirement that generation cannot satisfy. An assistant can write the integration, the page, the tests and the PR description. It cannot produce a third party who already depends on the integration in a real pipeline. The gate is deliberately placed on the one input that is external to the contribution — evidence of demand — rather than on anything about the artifact's quality, which is exactly what has become cheap to fake and expensive to assess. Note what this costs: it is a bias against genuinely novel integrations, which by definition have no users yet. The Discussion stage is the escape hatch, and it converts the question from "is this good?" to "do we want this?", which a maintainer can answer in a sentence.

Authorization is a label, and the label is not self-grantable. Work is authorized only by approved, applied only by a maintainer. The contributor controls the issue, the PR and the code; they do not control the one bit that admits the work. This is the structural property that makes a convention into a gate, and it is the same pattern as a ready label that the acting identity cannot apply, or a deploy approval that the deploying job cannot grant itself.

The enforcement, in the workflow

The check is one GitHub Actions job, one scripted step, triggered on pull request opened, edited, synchronize and reopened, with contents: read, issues: read and pull-requests: read. It reads the PR body, matches a closing keyword followed by #N, fetches that issue, collects its label names, and fails unless approved is among them. On a missing link it fails with a message pointing at the PR template; on an unapproved issue it fails naming the issue number.

Two things it gets right. It runs as pull_request, not pull_request_target, and asks only for read scopes — so a fork PR cannot use the check itself to escalate, which is the usual way an "enforcement" workflow becomes the vulnerability. And it re-evaluates on body edits, so a contributor who adds the link afterwards is not stuck.

Four weaknesses in the gate as written

These are not claims the blog post makes; they are visible only in the workflow source, and they matter to anyone copying the pattern.

1. It checks that an approved issue is linked — not that this PR is the one that issue approved. Any pull request can cite any approved issue number in the repository and pass. Nothing verifies that the PR author is the issue author, that the issue came from the integration form rather than being some other approved issue, or that the PR touches only the one Markdown page under the integrations directory. The scoping the post describes in prose is enforced by the human reviewer, not by the check. If you copy this, add the diff-scope assertion and the issue-type assertion; both are a few more lines in the same script.

2. Approval is checked once, at PR event time, and label changes do not re-trigger it. The triggers are pull-request events only. If a maintainer removes approved after the check went green, nothing re-runs and the green check persists — the recorded verdict outlives the condition it attested to. The fix is an issues: [labeled, unlabeled] trigger that re-dispatches the check for linked PRs, or re-checking at merge time rather than at push time.

3. The link pattern only matches a bare same-repository #N. A cross-repository reference or a full issue URL — both of which the platform itself honours for issue closing — fail the check. A legitimate contributor can be blocked purely by link style, and the failure message tells them to read the template rather than telling them the format is wrong.

4. Whether the check actually blocks a merge is not in the repository. Failing the run makes it red; it prevents a merge only if it is configured as a required status check in branch protection, which is a setting no reader can see. "Fails any PR" is accurate about the check and silent about enforcement — the same gap that separates every advisory CI job from an actual gate.

What is not measured

The post publishes no numbers at all: no before-and-after PR volume, no review-time figure, no count of proposals filed, approved or declined since the change, and no date for when the check went live. The repository's issue history is the only place that data exists, and the post does not summarize it.

That is worth stating plainly rather than treating the change as validated. The mechanism is well designed and cheap to adopt; whether it reduced maintainer load, or merely moved the same conversations one artifact earlier, is unestablished. The failure mode to watch for is an approval queue that grows the way the PR queue did, since triaging a proposal is cheaper per item but not free, and the generation rate that caused the problem is unchanged.

Review checklist for adopting this

Connections

See R461 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.