Skip to content

fix(pm): stream dispatch-gates self-test verdicts, document detached run - #14520

Merged
baozhoutao merged 1 commit into
mainfrom
claude/issue-14281-self-test-stream-verdicts
Sep 2, 2026
Merged

fix(pm): stream dispatch-gates self-test verdicts, document detached run#14520
baozhoutao merged 1 commit into
mainfrom
claude/issue-14281-self-test-stream-verdicts

Conversation

@claude

@claude claude Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #14281

What changed

scripts/pm/dispatch-gates.mjs selfTest() 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) collector
now prints the line at the call site (still pushing to cases for the
summary); the tail loop is reduced to the failed/length summary, unchanged
in 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 used
to leave zero diagnostic lines — now it leaves every case decided before the
kill. Verified live on ed4451219: a full detached run prints 1240 lines
matching 1240 cases pass, and a second run killed with SIGTERM at ~70s
leaves 41 lines and no summary line at all (see the issue comment for
both 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 script
comment" lands in scripts/pm/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 (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()'s t() collector

  • tail verdict loop, plus the module header) and scripts/pm/check-dispatch-gates.mjs
    (header only). package.json untouched.

Changeset

None — scripts/**-only diff (tooling/tests, no package publishes). skip-changeset label applied.


Generated by Claude Code

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants