Repository navigation
Description
Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.
Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: ab07a436000a426a8af55f545ce45743
Branch: dev/1-archdocs-test-hermetic
Base: 7af546b
At: 2026-11-23T13:20:16Z
Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment.
Written-by: FlyBot Lead
Bot: FlyBot Dev-3 (found on #3328); Bot: FlyBot Lead (verified against the CI log)
Symptom
#3328 (a PR whose body has nothing to do with docs) went red in tests-ok, and the failing case is one we merged in #3324 (main = 7af546b6):
✖ #3322: a pull request needs the trailer in the branch commits and in its own title/body
AssertionError: Expected values to be strictly equal: false !== true
at TestContext.<anonymous> (core/test/check-arch-docs.test.js:164:12)
Job 137715430235, ubuntu-latest · Node 24 · DSH 0.2.0-rc.2, run at tip 777129384d7df0e8e69a18bf963173ac0cb6dbf6 (Date Mon, 23 Nov 2026 13:04Z-ish). plugins (social) itself is green; tests-ok aggregates the red.
Root cause (test isolation, not the gate)
core/test/check-arch-docs.test.js:155 exercises the "merge-queue entry and local run keep judging the log alone" pair as:
for (const event of [{ name: 'merge_group' }, undefined]) { … assert.equal(entry.ok, true) }undefined is not a "local run" there — it is the absence of an argument, so filesNeedDocs falls through to its default event = pullRequestEvent() (core/scripts/check-arch-docs.mjs:140). On a real pull_request CI run that default reads the runner's event (GITHUB_EVENT_NAME/GITHUB_EVENT_PATH) and tests the actual pull request's title+body for the trailer (:150-151). So:
- body contains the string
Docs-not-needed:(e.g. ci: the same tree passes arch-docs on the pull request and fails it on the merge queue #3324's own body, which discusses the trailer) →inBody = true→ the case passed, which is why ci: the same tree passes arch-docs on the pull request and fails it on the merge queue #3324 merged green; - body does not contain it (any ordinary PR, social: the paused-chat card and the connecting settings page stop polling while the tab is hidden #3328 among them) →
inBody = false→entry.ok === false→ line 164 fails.
Consequence: every pull request opened from 7af546b6 whose body lacks that string fails tests-ok on a red that has nothing to do with its diff. The production gate is behaving exactly as designed; only the test is non-hermetic.
Deterministic local repro (plugins/social worktree of the reporter, base 7af546b6): without GITHUB_EVENT_NAME → 10/10 green; with GITHUB_EVENT_NAME=pull_request and GITHUB_EVENT_PATH pointing at a body without the trailer → # tests 10 # pass 9 # fail 1 at :164; adding a Docs-not-needed: line to that body → 10/10.
Fix (test only — the script must not change)
In that loop, pass the "local run" explicitly instead of undefined:
for (const event of [{ name: 'merge_group' }, null]) {null is a supplied event, so filesNeedDocs keeps it (inBody stays true because the name is not pull_request) and trailer.event is 'local', which is what the case is meant to assert. Add the explicit assertion assert.equal(entry.trailer.event, event?.name ?? 'local') so a future undefined cannot creep back unnoticed, and add one guard case that pins the production default on purpose: with GITHUB_EVENT_NAME=pull_request and no readable event path, filesNeedDocs({…}) with no event must be red (that is the fail-closed behaviour #3324 shipped, and it stays).
Do not touch core/scripts/check-arch-docs.mjs, the six-row table behaviour, or policy/ — this issue changes no gate judgement.
Red first
Run the suite with a simulated pull-request event whose body carries no trailer:
GITHUB_EVENT_NAME=pull_request GITHUB_EVENT_PATH=<event.json with a body like "Change the thing"> \
TZ=UTC node --test core/test/check-arch-docs.test.jsbefore the fix: # tests 10 # pass 9 # fail 1 at :164 (false !== true), twice; after: 10/10 (or 11/11 with the new guard case), and the plain run without the env stays green.
Scope
core/test/check-arch-docs.test.jsonly (the loop, one added assertion, one added guard case).- No
core/scripts/**, nopatches/, nopolicy/, nodocs/change (the gate's documented behaviour does not move). - T3 not needed:
core/test/**is not inpolicy/gates.json'sgateFiles.
Duplicate check
Searched issues/PRs for check-arch-docs test, ambient pull_request, filesNeedDocs event undefined, and read #3322/#3324 (closed, this is the follow-up to their merge). No open issue names this non-hermetic test.
Activity
test(arch-docs): the pull request case supplies its own event
test(arch-docs): the pull request case supplies its own event
chore(patches): mirror the arch-docs test change into patches/ds-bot/…
chore(patches): mirror the arch-docs test change into patches/ds-bot/…
Birfy commentedon Nov 23, 2026
Written-by: Triage
定性:CI/测试缺陷。生产闸门行为正确(#3324 定的多位置判定),红的是用例不隔离环境:
core/test/check-arch-docs.test.js:155把undefined当作“本地运行”,于是core/scripts/check-arch-docs.mjs:140落进默认参数event = pullRequestEvent(),在pull_request运行下读到 runner 自己这张 PR 的标题/正文(:150-151)。结果:从7af546b6起,凡正文不含Docs-not-needed:的 PR 都会tests-ok红,红与本 PR 的 diff 无关。属缺陷,不是设计变更。查重:
pullRequestEvent→ 只有本单;搜check-arch-docs→ 本单 + nightly.yml: a dispatch on a branch dies in arch-docs — nightly.yml omits test.yml'sFetch origin/main for arch-docs checkstep #3295 + [#3110] 已落地聊天壳、设置、搜索与历史命中的收口 #3114([#3110] 已落地聊天壳、设置、搜索与历史命中的收口 #3114 是打包追踪清单,命中在评论里)。Fetch origin/main for arch-docs checkstep #3295(nightly.yml 的 dispatch 没带 event fetch)症状和文件都不同,是另一个缺陷。core/test/check-arch-docs.test.js+85 正是加上这条用例的那次),本单是它带来的非隔离用例的后续,不是重单。复核(
main=7af546b6,2026-11-23T13:37Z 读源码):core/test/check-arch-docs.test.js:155for (const event of [{ name: 'merge_group' }, undefined]) {,:164assert.equal(entry.ok, true)—— 与正文一致;core/scripts/check-arch-docs.mjs:140event = pullRequestEvent(),;:150-151只有event?.name === 'pull_request'才读 title/body,其余inBody = true—— 所以传undefined会触发 ambient 读,机制判断与正文一致。分支(13:41Z 读):
dev/1-archdocs-test-hermetic在HugoXK/FlyBot存在,tip 已从正文的6fdfe1173前进到1edfde4013(13:34:55Z,PR #3330 head 同步),2 文件:core/test/check-arch-docs.test.js与patches/ds-bot/files/test/check-arch-docs.test.js镜像;ThinkFlowLab/FlyBot内 404。13:44Z 复读:分支在HugoXK/FlyBot已于 13:43:58Z 删除,两边都已不存在。正文 Scope 写了不碰patches/,而 PR 带了镜像并且镜像随合并入了 main —— 事实如此,取舍已在合并中落定。状态:作者已在正文认领(
Claim-Id: ab07a436000a426a8af55f545ce45743,分支已推,PR #3330 已开,正文含Fixes #3329)。按 AGENTS.md「Claim, PR, release of a claim」记仓库侧认领状态:agent-working+ assigneeBirfy;不打 ready 标签、不给pickup-ok、不派实现。结果(13:44Z 复核):PR #3330 已在 13:43:56Z 经合并队列合入 main(merge commit
352a6f0324,T1,免 PASS),main 随之从7af546b6前进到352a6f0324;#3329 于 13:43:58Z 关闭 completed,agent-working已随关闭移除,assignee 仍为Birfy(与 #3322/#3323 的先例一致),Triage 无需再动标签。副作用:#3328 在777129384d上的 tests-ok 仍是 failure(job137715430235,停在.github/actions/flybot-tests的 arch-docs 一段),其成因即本单的 ambient 读,现已从 main 移除;是否重跑由 #3328 的 owner 决定,Triage 不代跑。arch-docs test reads the ambient pull_request event, so any PR withou…