fix(pm): stream dispatch-gates self-test verdicts, document detached run - #14520
Merged
Merged
Conversation
selfTest()'s t() collector now prints each case's ✓/✗ line the moment the case is decided, instead of buffering all cases into an array and printing them only after the last one in the tail loop. The tail is reduced to the failed/length summary, unchanged in wording and exit codes. On an agent container the battery cannot finish in the foreground (the container's ~10-minute cap SIGTERMs it), and a killed run used to leave zero diagnostic lines. Streaming means a killed run now leaves every case decided before the kill readable in the log. Both files' headers gain a "run this detached on an agent container" section with the exact command. The triage's "record it in package.json's script comment" instruction lands in check-dispatch-gates.mjs's header instead — package.json is JSON and holds no comments, and that file is what check:pm-dispatch-gates actually runs. Option 2 from the triage (share one derivation across the end-to-end cases) is deferred per the ruling — no case is merged, no spawn removed, no case's name, condition or order moved.
baozhoutao
marked this pull request as ready for review
September 2, 2026 10:23
baozhoutao
enabled auto-merge
September 2, 2026 10:23
This was referenced Sep 2, 2026
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.
Fixes #14281
What changed
scripts/pm/dispatch-gates.mjsselfTest()now streams each case's✓/✗verdict the moment it is decided, instead of buffering every case into an
array and printing them only after the last one. The
t(name, cond)collectornow prints the line at the call site (still pushing to
casesfor thesummary); the tail loop is reduced to the
failed/lengthsummary, unchangedin wording and exit codes. On this container the battery cannot finish in the
foreground (the ~10-minute cap SIGTERMs it,
exit 143), and a killed run usedto leave zero diagnostic lines — now it leaves every case decided before the
kill. Verified live on
ed4451219: a full detached run prints 1240✓linesmatching
1240 cases pass, and a second run killed with SIGTERM at ~70sleaves 41
✓lines and no summary line at all (see the issue comment forboth excerpts) — not a frozen count, just what this run measured.
Both files' headers gain a "run this detached on an agent container" section
with the exact command. The ruling's "record it in
package.json's scriptcomment" lands in
scripts/pm/check-dispatch-gates.mjs's header instead —package.jsonis JSON and holds no comments, and that file is whatcheck:pm-dispatch-gatesactually runs.Option 2 (share one derivation across the end-to-end cases) is deferred per
the triage ruling — no case is merged, no spawn removed, no case's name,
condition or order moved.
Scope
File surface:
scripts/pm/dispatch-gates.mjs(selfTest()'st()collectorscripts/pm/check-dispatch-gates.mjs(header only).
package.jsonuntouched.Changeset
None —
scripts/**-only diff (tooling/tests, no package publishes).skip-changesetlabel applied.Generated by Claude Code