Uh oh!
There was an error while loading. Please reload this page.
docs(agents): record how GitHub mangles agent-written bodies, and the per-query search control (#6970) - #7317
Merged
Conversation
… per-query search control Two clauses in the instrument-discipline area of AGENTS.md: - a channel-level control rule: the control belongs on the CHANNEL, not only on the query, and it is run per query. A non-empty result is self-validating; an empty one always needs a known-must-hit control. The zero-quota web payload channel is recorded as the measured fallback under the same rule. - a new section enumerating the six measured ways GitHub rewrites an issue/PR body after it is written, the four mitigations measured working, and a pointer to the authoritative objectstack wording (carried verbatim only for the read-back-before-repair caveat, which is load-bearing). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGMDbrVa8JjZcCQ7DWYH1b
…hub-body-mangling-rules
This was referenced Sep 2, 2026
os-zhuang
approved these changes
Sep 2, 2026
os-zhuang
marked this pull request as ready for review
September 2, 2026 11:27
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Fixes#6970
Fixes#6452
Part of #7185 (option A only — the diagnosis half, option B, stays open on that card by its author's instruction; changed from a closing line by the PM seat after the dev flagged it)
One governed edit to
AGENTS.md(46 added lines, no deletions), folding three devx cards that all land in the same instrument-discipline area of the file. One authoritative wording beats three riders.What landed, and where
Two clauses, inserted between the existing control/measurement subsections and the governed-surface section:
#### 对照挂在通道上,不只挂在查询上— AGENTS.md lines 401-414. The channel-control rule. The control belongs on the CHANNEL, not only on the query, and it is run PER query: a non-empty result is self-validating and needs no control, an empty one ALWAYS needs a known-must-hit control. Recorded with the measured asymmetry — a long, near-verbatim title query returnedtotal_count: 0for an issue that reads fine directly, while a short keyword query in the same container within the same hour returned 3 hits — so the rule reads "never trust an empty search without a control", not "never use search". The zero-quota web payload channel is recorded as the measured fallback, under the same control requirement and with the caveat that it is one day in one container, not a permanent answer.### GitHub 会改写你写进 issue/PR 正文的字节— AGENTS.md lines 416-445. The mangling enumeration, one line per class, plus the four mitigations measured working, plus the placeholder clause described below.Both sit inside section 9's measurement/instrument area, immediately before the governed-surface section.
The six classes, one line each
issue_writecreate strips the attribution footer block entirely. Sentinel proof: tail kept, middle deleted, so it is a targeted strip and not a truncation — without the sentinel the only available conclusion points at length limits, which is the wrong direction.Part of,Refs:,Related:, and the bareobjectuiprefix form, plus a pre-open grep of your own body for the three keyword stems near a hash.Mitigations recorded as measured: generics and placeholders written in words, the session URL carried in prose as a backticked code span, attribution written as prose on issue bodies, and a read-back to the tail with an angle-bracket count after every publish.
The placeholder clause
Landed as the triage ruling asked: a SHORT objectui clause plus a pointer to the objectstack
AGENTS.mdwording rather than a copy of it, so there is one authoritative text and no duplicated prose to drift. It states explicitly that placeholders in ordinary prose and in fenced code are covered — the case that was actually measured — and it carries the load-bearing caveat verbatim:I did not judge the upstream wording to need widening, so no objectstack skills-lane card is filed. The pointer plus the explicit placeholder sentence covers the measured case without touching the upstream text.
Deliberately not built here
Named as options only, per the dispatch:
Also not attempted: the diagnosis of why the issue-search path goes blind. The clause records it as unresolved, naming both candidate causes and the point that only one of them self-heals. That diagnosis is the half of #7185 this PR does not close.
Governance
AGENTS.mdis a governed surface.node scripts/check-governed-queue-guard.mjs --test AGENTS.mdexits 3, which is the correct verdict for this PR:This PR therefore stays a DRAFT with
hotlongandos-zhuangrequested. Not flipped ready, not enqueued, no auto-merge.Verification, all on head 3083d3e
pnpm check:control-bytesnode scripts/check-shell-escape-residue.mjsnode scripts/check-governed-queue-guard.mjs --self-testnode scripts/check-governed-queue-guard.mjs --test AGENTS.mdnode scripts/check-changeset-presence.mjspnpm docs:check-linksAGENTS.mdfrom diskThe four suites are
scripts/__tests__/check-doc-links.test.ts,check-governed-queue-guard.test.ts,check-shell-escape-residue.test.tsandsite-next-agent-files-4160.test.ts, run from the repo root. A scan ofscripts/found no line ratchet or line budget overAGENTS.md;check-doc-linkscarries the file with the disk rule, and the file has no markdown links at all because its paths are code spans, which the checker blanks — the new text keeps that convention.Merge-tree proofs, both exit 0, each producing a tree oid with no conflict block:
origin/maine362056bf, the other open claim on this file. It adds one line to a different section (the multi-agent discipline bullets under section 9); this edit is 130 lines below it.Card 6325, listed as a possible placement constraint, is CLOSED (completed 2026-08-27) and constrains nothing here.
origin/mainwas merged in, never rebased; the diff against main is still exactly the 46-line addition.Session reference, carried here as prose because the footer form is not durable across a body edit:
https://claude.ai/code/session_01BGMDbrVa8JjZcCQ7DWYH1b🤖 Generated with Claude Code
https://claude.ai/code/session_01BGMDbrVa8JjZcCQ7DWYH1b