Let the plugin maintain itself, up to the point of release - #8
Merged
Conversation
Three triggers, one rule: a pull request that passes its checks merges itself, and the only step a person performs is cutting a release. on-bitrouter-release.yml watches the gateway this plugin talks to. The dispatch from bitrouter/bitrouter arrives within seconds of a release; the weekly schedule is the backstop that notices when one never did, because a token expiring quietly is exactly the failure a fast path does not report. Both converge on .github/upstream.json, so whichever gets there first the other does nothing — and the agent stamps that file whatever it concludes, which turns "we looked and nothing was needed" from a silence into a recorded fact. on-harness-update.yml runs only when CI has already said no. The question a harness bump raises — is this package still compatible — has a cheaper and more reliable answer than an agent's opinion: the build typechecks against the new types and the suite exercises the contracts under them. A green bump needs nobody. So the agent runs where the cheap answer runs out, and its job is repair rather than assessment. It pushes onto the Dependabot branch so the bump and its fix arrive as one reviewable thing. It matches on the bumped package name rather than on Dependabot's label, which would not have worked: npm allows one update entry per directory, so every npm bump here carries harness-update whether or not it is one. automerge.yml enables auto-merge and nothing else — GitHub still decides, when the required checks pass. It withholds for a needs-human label, and applies one to an automated pull request that edits both src/ and test/: an agent asked to repair a break can always make a suite green by weakening the suite, so green there is not evidence. The same diff from a person is ordinary work. The policy the agent works under lives in bitrouter/.github rather than here. Three copies of a prompt is three behaviours; the install and test commands, which are genuinely this repository's, stay here. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three triggers, one rule: a pull request that passes its checks merges
itself, and the only step a person performs is cutting a release.
The policy the agent works under lives in
bitrouter/.github#1 — three
copies of a prompt is three behaviours. The install and test commands, which
are genuinely this repository's, stay here.
on-bitrouter-release.ymlWatches the gateway this plugin talks to. The dispatch from
bitrouter/bitrouterarrives within seconds of a release; the weekly scheduleis the backstop that notices when one never did, because a token expiring
quietly is exactly the failure a fast path cannot report on itself.
Both converge on
.github/upstream.json, so whichever gets there first, theother does nothing. The agent stamps that file whatever it concludes —
which turns "we looked and nothing was needed" from a silence into a recorded
fact, and stops the weekly poll asking again forever.
The brief is narrow on purpose. This plugin is coupled to the gateway's HTTP
surface and nothing else — no binary, no version pin, no download — so the
agent is told to act on
/v1/*changes and to ignore the routing engine, theTUI, config handling, and telemetry, which move constantly and never reach
this package. It's also told that the models-endpoint shape has its own daily
watcher and not to duplicate that work.
on-harness-update.ymlRuns only when CI has already said no.
The question a harness bump raises — is this package still compatible — has a
cheaper and more reliable answer than an agent's opinion: the build typechecks
against the new types and the suite exercises the contracts under them. A green
bump needs nobody, and under auto-merge it merges itself. So the agent runs
where the cheap answer runs out, and its job is repair rather than assessment.
It pushes onto the Dependabot branch, so the bump and its fix arrive as one
reviewable thing.
workflow_runrather thanpull_request_target: it runs from the defaultbranch, so the workflow definition and the secrets it sees are this
repository's own and never the pull request's.
It matches on the bumped package name, not on Dependabot's label. The label
would not have worked — npm allows one update entry per directory, so every npm
bump here carries
harness-updatewhether or not it is one.automerge.ymlEnables auto-merge and nothing else; GitHub still decides, when the required
checks pass. It withholds for
needs-human, and applies that label to anautomated PR editing both
src/andtest/— the one case where "the testspass" is circular reasoning.
Before merging
PLUGIN_AGENT_TOKENandBITROUTER_API_KEYas repo secrets.bitrouter/.github#1merged first — theuses:references resolve againstits
main.repository_dispatchorscheduletrigger only fires from a workflow onthe default branch, so none of this runs until it's merged.
Branch protection with required checks is already in place, which is the
precondition that makes auto-merge a gate rather than a rubber stamp.
One thing found while wiring this up
Dependabot was never applying the
harness-updatelabel — it doesn't createlabels that don't exist, and this one didn't. Every Dependabot PR in this repo
has an empty label set. The label now exists, so future bumps will carry it;
open ones won't retroactively.