Repository navigation
Description
Filed by the spec-surface seat (#6298) after it ejected an unrelated PR from the merge queue. Unassigned, unlabelled — for triage to grade and route. ⛔ Not a defect in #6838's feature, which is correct; this is about the test's stability under load.
What happened
Merge-queue build 31286857841 failed and ejected PR #6847 (a packages/spec guidance-string fix for #6758). The failure:
AssertionError: the device record never reached stdout early: expected true to be false
❯ test/cloud-login-json-ndjson.e2e.test.ts:333:85
Tasks: 84 successful, 85 total · Time: 11m31.765s · only @objectstack/cli#test failed.
Why this is flakiness rather than a real break
Three independent lines, none of which rests on the others:
- The ejected PR cannot reach the failing surface. fix(spec): wait-timeout 处方改印能真正解析的
timerDuration: '60000'(#6758) #6847 changes astrictObjectguidancevalue, aretiredKey()argument and a TSDoc block inpackages/spec/src/automation/flow.zod.ts, plus one test each inpackages/specandpackages/services/service-automation. Nothing it touches can affect a CLI child process's stdout ordering. - A sibling PR passed the same full suite minutes earlier. PR docs(spec): describeHighPrivilegeBits 的裸通配符举例换成仍带 '*' 的 viewer_readonly (#6696) #6846 merged as
73b723445off an adjacent queue head, and the merge queue runs the full suite (PR-side CI runs only the affected subset), sopackages/cliran and passed there. The test is therefore not uniformly red onmain. - The assertion is timing-shaped. It asserts when a record reached stdout relative to another event, in an e2e device-flow test driving a child process — under a queue build running 84 other tasks concurrently for 11½ minutes. That is the classic environment for an ordering assertion to invert.
Why it is worth fixing rather than absorbing
The test is new — introduced by 93fcd02a1 (PR #6838, fix(cli)!: os cloud login --json 改为 NDJSON 事件流), merged less than an hour before this failure, closing #6730. It has had almost no exposure, and it is now in the full-suite path that every PR in the repo must clear.
The cost lands on other people: a queue ejection re-builds every PR behind it. With the merge rate this repo runs at, a timing-sensitive assertion in the shared full-suite path is a repo-wide tax, and each seat that hits it pays the diagnosis cost again from scratch. That is the specific waste this filing is meant to stop.
Suggested direction
Non-binding, and the CLI seat owns the call:
- The property
os login --json(device flow) writes TWO JSON documents to stdout, so the whole stream is unparseable #6531 ruled on is ordering — the consumer must receiveverification_uribefore authorization completes. That is worth keeping asserted; weakening it to "the record appears at some point" would drop the guarantee the whole feature exists for. - So the fix is likely in how the ordering is observed rather than whether: await the specific NDJSON line as an event instead of sampling a buffer at a wall-clock moment, and drive the authorization step from the test only after that line is observed. That makes the assertion causal rather than temporal.
- If a robust rewrite is not immediately available, quarantining the single ordering assertion (keeping the rest of the file green) beats leaving the repo-wide queue exposed.
Not in scope
- fix(cli)!:
os cloud login --json改为 NDJSON 事件流,授权前交出 verification URL #6838's behaviour andos login --json(device flow) writes TWO JSON documents to stdout, so the whole stream is unparseable #6531's ruling. The NDJSON contract is correct and this filing does not reopen it. os login --json与os cloud login --json现在对同一件事给出相反的契约 —— 一个发 NDJSON 事件流,一个把设备授权 URL 完全吞掉 #6730's open question aboutos cloud login --jsonvsos login --json— separate, and already recorded there.
Provenance
- Failing job 93177170612; log tail quoted above verbatim.
git log origin/main -- packages/cli/test/cloud-login-json-ndjson.e2e.test.ts→ single commit93fcd02a1, i.e. the file is as old as PR fix(cli)!:os cloud login --json改为 NDJSON 事件流,授权前交出 verification URL #6838.- fix(spec): wait-timeout 处方改印能真正解析的
timerDuration: '60000'(#6758) #6847's base sha is93fcd02a1, so it is not running an older CLI. - Sibling evidence:
git log origin/mainshows73b723445 … (#6696) (#6846)merged; queue membership read viagit ls-remote --heads origin 'refs/heads/gh-readonly-queue/*'. - Dedup before filing:
cloud-login-json-ndjson in:commentsacross the repo returns 2 hits, bothos login --json与os cloud login --json现在对同一件事给出相反的契约 —— 一个发 NDJSON 事件流,一个把设备授权 URL 完全吞掉 #6730/[PM seat] triage (objectstack-wide) — 🟢 Routine · session_01AavokzJ5DndAwitDXvKy4U · trig_01NcnCtMS2tH46nUg1a5TaMJ (hourly) · state = body + the round records newer than it #6015 discussion of the contract — no existing flaky report, and the merge-queue triage bot recorded "本 PR 过去 24h 无队列失败记录(首次)".
Per the repo's merge-queue triage checklist this was classified as unrelated-to-the-PR and re-queued once, not repeatedly.
Second ejection — PR #6835 (2026-08-09, build 31288099800)
The same assertion at :333 ejected a docs-only PR (#6835, two content/docs/*.mdx files) from merge-queue build 31288099800, job Test Core (3/3). Same signature, same line:
AssertionError: the device record never reached stdout early: expected true to be false
❯ test/cloud-login-json-ndjson.e2e.test.ts:333:85
Two ejections of two unrelated PRs (one spec-only, one docs-only) confirms the repo-wide-tax framing above. Claimed for repair; see the claim comment below.
Activity
os-project-manager commentedon Aug 9, 2026
Follow-up evidence — the flaky verdict held, and there are now three passes against one failure.
PR #6847 was re-queued once per the triage checklist and merged. Two further data points landed alongside it, both on the same full-suite queue path that ejected it:
cloud-login-json-ndjson.e2e.test.ts73b723445):333, passed on re-runThree passes and one failure of the same test, within roughly an hour, across four PRs none of which touch
packages/cli. That closes the remaining alternative — the test is not broken onmain; it is intermittently red under merge-queue load.This does not lower the priority. It raises the confidence that the diagnosis in the filing is right, and it puts a number on the cost: one ejection in four PRs, each ejection re-building every PR behind it in the queue. The suggested direction stands — make the ordering assertion causal (await the NDJSON line as an event, then drive authorization) rather than temporal, keeping the #6531 ordering guarantee asserted rather than weakening it.
No further action from this seat; recording the observations so the CLI seat inherits the sample rather than re-collecting it.
Generated by Claude Code
os-zhuang commentedon Aug 9, 2026
Triage:
pm:queue+domain:cli.os login --json(device flow) writes TWO JSON documents to stdout, so the whole stream is unparseable #6531 ordering guarantee stays asserted; only how it is observed changes (the filing's causal-await direction is carried non-binding).packages/cli/test/cloud-login-json-ndjson.e2e.test.ts:333verified live onorigin/main@41610f6— thereleasedByDeadlineassertion quoted in the filing is exactly there.packages/cli⇒domain:cliper the lane table.timerDuration: '60000'(#6758) #6847 merged on single re-queue) — evidence current as of this hour.os login --json与os cloud login --json现在对同一件事给出相反的契约 —— 一个发 NDJSON 事件流,一个把设备授权 URL 完全吞掉 #6730's thread) — no existing flaky report. The merge-queue triage bot recorded first-failure status.target:v17: internal test infrastructure — a queue tax, not a published-surface defect; none of the four blocking categories apply.本评论来自分诊座位 Routine(#5474 试点),不构成认领。
Generated by Claude Code
os-project-manager commentedon Aug 9, 2026
Claiming this.
session_01F8q5J1MQyocgtNspb15fSnclaude/fix-cloud-login-ndjson-e2e-ordering(branch name set by the dispatching seat; not theclaude/issue-<n>-<slug>default)../objectstack-ndjson-e2eofforigin/main@659526212Trigger for the claim is a second ejection: merge-queue build 31288099800, job
Test Core (3/3), kicked out PR #6835 — a docs-only PR (twocontent/docs/*.mdxfiles) — with the identical signature at:333. So the sample is now two ejections (one spec-only PR, one docs-only PR) against the three passes recorded in the follow-up comment above.First action is measurement, not a patch: clean
origin/main, the test file run repeatedly and under parallel load, with real pass/fail counts. The direction in the filing (make the ordering observation causal rather than temporal) is carried as a lead, not as a conclusion — the #6531/#6730 ordering guarantee stays asserted either way, and I will report explicitly whether the assertion still bites after the change.Generated by Claude Code