Skip to content

Nothing detects live GitHub API schema drift: every read is asserted only against stubs this repo writes, and doctor downgrades an unreadable merge-queue state to a skip

Id: TD-PPagop-26082930 · Status: resolved · Filed: 2026-08-29 · Resolved: 2026-08-29 · Ref: https://github.com/Poetic-Poems/agent-ops/pull/1043 (part 1, the detector); https://github.com/Poetic-Poems/agent-ops/pull/1042 (part 2, doctor’s skip)

What: every GitHub read in lib/ is exercised only through a gh stub this repository writes — test/merge-queue.test.sh’s $tmp_dir/gh, test/landing.test.sh’s, test/doctor.test.sh’s jq_filter arm, and the same pattern across the rest of test/. A stub answers in whatever shape its own fixture declares, so a field GitHub renames, moves or removes cannot fail a test: the suite stays green and the only symptom is a stage refusing at runtime, in wording that names the gate rather than the cause.

Why it matters: this is not hypothetical, and its cost has already been paid in full. GitHub moved mergeMethod and mergingStrategy off MergeQueue onto MergeQueue.configuration between 2026-08-16 (when merge_queue_for_branch’s own header records the query verified live) and 2026-08-23. GraphQL rejects the whole document for a single unknown field, so that query — which asked for both and read neither — returned non-zero on every call from 2026-08-23 onwards. landing_arm turned each into its gate-4 refusal (“could not read the base branch’s merge-queue state”): 37 landing-refused events across the 7 pull requests that have ever reached the arming step, which is every arming attempt the fleet has ever made. The fleet has therefore never autonomously landed a pull request at all, and D18 Stage 1’s exit evidence (#677, #678) has been waiting on an observation this made impossible. Nothing failed, nothing alerted, and the whole of agent-merges-routine sat inert for six days while 336 Approver stages went on approving.

The same blind spot hid a second defect in the same function, fixed in the same pull request: gh --jq raw-prints, so a JSON null arrives as an empty line rather than the four characters null, while the stubs — plain jq — answered null. The no-queue answer was therefore asserted for months against a shape gh never produces, leaving the gh pr merge --auto --squash fallback unreachable on the image’s jq 1.7 and actively wrong on a jq 1.6 host.

Where: the gh stubs under test/; and scripts/doctor.sh’s allow_auto_merge/merge-queue pairing check (~line 1235), which reports an unreadable merge-queue state as a skip — so the one live caller that runs outside a cycle stayed quiet about this too, for the whole six days.

Suggested fix: two independent pieces, either useful without the other. (1) A scheduled (not per-pull-request) CI job that validates every GraphQL document this repository sends against GitHub’s live schema — type introspection is available to any token, and gh api graphql already reports a moved field precisely as undefinedField — failing loudly when a field this repo asks for stops existing. Keeping it off the per-PR path means GitHub’s availability never blocks a merge; a nightly failure is the signal. (2) Reconsider doctor’s skip for an unreadable merge-queue state at agent-merges-routine or above: at that level the read sits directly on the landing path, and “I could not find out” is a materially different verdict from “this token has no admin visibility”, which is the case the skip was written for.

The immediate breakage is fixed in the pull request that files this record; this item is the detector that would have caught it, and the residual doctor question. Dedup-searched the tracker for mergeMethod, mergingStrategy, “merge-queue state” and “schema drift”: nothing open or closed covers either piece. TD26071401 (lib/limit-detect.sh detector drift) is the nearest prior art in spirit — a detector that silently stopped detecting — but is a different mechanism and is not about the GitHub schema.

Noticed while diagnosing why the fleet had never autonomously landed a pull request, and filed alongside the fix for the immediate breakage in https://github.com/Poetic-Poems/agent-ops/pull/953.