Skip to content

Report a failed T1 press's reason instead of the command it sent (#3257) - #3260

Merged
Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/5-aq-t1-failure-reason
Nov 20, 2026
Merged

Birfy merged 1 commit into
ThinkFlowLab:mainfrom
HugoXK:dev/5-aq-t1-failure-reason

Conversation

@HugoXK

@HugoXK HugoXK commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3257

Owner: Dev-5
Reviewer: Reviewer
Tier: T3 (.github/scripts/**, from risk-gate.mjs)
Claim-Id: 50641d9c2cb74ab7af2055be2bf37963
Bot: Dev-5

What changed

file change
.github/scripts/auto-queue-t1.mjs a failed row renders its reason; the one-line change sits in renderSummary
.github/scripts/auto-queue-t1.test.mjs three tests: the failed row in the renderer, the failed press through the real CLI, and the other four row shapes pinned byte for byte

act() already stored firstLine(error) on a failed row. What dropped it was renderSummary: the
detail was row.command ? \command` : reason`, so a press that failed printed the command it had just
sent and never the reason the API gave. A failed press also counts nothing as enqueued, so no dispatch
follows — that one line is the whole record of the round, and it said "here is what I sent".

The fix is a guard on the failed shape only: row.action === 'failed' || !row.command ? reason : command.
would enqueue and enqueued still print the command; refused and moved still print their reason.
The third test pins all four of those literally, so a later reflow of the success rows fails there.

Rebase note: the branch was rebased onto live main 7f95f0cfffb1d0dfb14ba8b58e5ebe19c5c8f388 (the
previous tip was 35cf777cae, based on dd7599d315; main moved only through four #3114 client/i18n
commits, no overlap with these two files). New tip 28af6e5e9f85dff72d66b0223a650bb07245fa0a, tree
67b8818327489cb8ca9c3361b65019363467b305; both blobs are byte-identical to the ones the previous tip
carried (.github/scripts/auto-queue-t1.mjs f347405bb7…, auto-queue-t1.test.mjs b338fa55b9…).

Red first

Three tests, on f920d3c7 with only the test file touched: # tests 38 / # pass 36 / # fail 2, exit 1.
The two reds are the failed shape, in both readers, and their actual output is the defect itself:

not ok 36 - #3257: a failed row prints the reason even when it also carries the command
  actual: - #4001 (T1, 4a1c2d3e): failed — `gh pr merge 4001 --auto --squash --match-head-commit 4a1c2d3e4f5061728394a5b6c7d8e9f001122334`
not ok 38 - #3257: a merge the API refused reaches stdout and the summary file with its reason
  actual: - #4001 (T1, 4a1c2d3e): failed — `gh pr merge 4001 --auto --squash --match-head-commit 4a1c2d3e4f5061728394a5b6c7d8e9f001122334`

Both name a failing press (gh pr merge exits 1 with HTTP 500: Internal Server Error) and neither
line contains HTTP 500. The third test is green on both sides by design — it is the shape guard, not
the red. Nothing else in the script changed: decide, act, the mode resolution and the dispatch are
untouched, so the diff against f920d3c7 is one line of code plus tests.

The red this PR did not cause

At the previous tip 35cf777cae, the Test run 44701263468 was red in one core test,
core/test/chat-anchors.test.js:107 (#2710: an anchor printed before a split still reaches the part it came from) with TypeError: Cannot read properties of undefined (reading 'sessionId') at :110. This
diff touches only the two .github/scripts/auto-queue-t1.* files, and live main was green on that suite
(44748327692 on 7f95f0cf). After the rebase onto 7f95f0cf the same file ran six times on this tip:
4/4 pass, 0 fail each time. So it was a flake, not this change; no code was changed for it and no new
test pins it.

Reconcile: 721 vs 714

The reviewer's count came from their environment, not from CI. The authoritative number is in CI's own
package job log, which I pulled through the API (GET /repos/ThinkFlowLab/FlyBot/actions/jobs/136121704759/logs,
run 44686417409, head 349f59893602):

Run node --test ".github/scripts/*.test.mjs" "policy/*.test.mjs"     # test.yml:148
ℹ tests 721 · pass 721 · fail 0 · skipped 0

That matches my local 721 exactly, so the two numbers were never in conflict — the "714 tests / 712 pass
/ 2 skipped" reading is a local run with 2 skipped and 7 fewer loaded. The 2 skipped are reproducible and
not mine: fetch-base.test.mjs:34 skips its pair when the git/bash probe fails, which is what a
sandbox without those binaries does. The remaining 7 I could not reproduce and will not invent a cause
for; the per-file totals below add up to the CI number, file by file.

At this tip (the three tests above added): 724 = 721 (.github/scripts/.test.mjs) + 3 (policy/.test.mjs),
# pass 724 / # fail 0 / # skipped 0. Command line, identical to test.yml:148:
node --test ".github/scripts/*.test.mjs" "policy/*.test.mjs".

Evidence at this tip

Ran at 28af6e5e9f85dff72d66b0223a650bb07245fa0a:
node --test .github/scripts/auto-queue-t1.test.mjs (38 pass, 0 fail) ·
TZ=UTC npm run verify (exit 0: core 3392, .github/scripts + policy 724, plane 25, social 758,
tree 152, timeline 172, workflow 538, project 151, interop 37, live-e2e 34) ·
the CI glob node --test ".github/scripts/*.test.mjs" "policy/*.test.mjs" (724 pass, 0 fail) ·
node --test core/test/chat-anchors.test.js six times (4/4 each) ·
check-arch-docs at ARCH_DOCS_BASE=7f95f0cf (arch-docs: OK (2 changed file(s))), with
git status empty.

Not run: the workflow's own events (a branch cannot schedule or push), the live gh path of the CLI,
and the smoke bench (no host or client code touched). The earlier reading of actionlint 1.7.7,
testing-layers --check and ds-bot-patches check/canonical still holds: this rebase changed neither
workflow nor patch content relative to the tip they ran on.

Checkpoint

{
"pr": 3260,
"claim": "Dev-5",
"issue": 3257,
"summary": "A failed T1 press used to print the command it had sent instead of the reason the API gave, so a round that pressed and failed left no readable cause anywhere. renderSummary now renders a failed row's reason; the match on the exact action keeps the other four row shapes byte for byte, and a test pins them. Three tests: the failed row in the renderer, the failed press end to end through the real CLI with a stand-in gh, and the unchanged shapes.",
"files": [
".github/scripts/auto-queue-t1.mjs",
".github/scripts/auto-queue-t1.test.mjs"
],
"checks": {
"ran": "TZ=UTC npm run verify",
"result": "green",
"at": "28af6e5e9f85dff72d66b0223a650bb07245fa0a"
},
"next": "ready for review; Test naming and the verdict are the Lead's to start"
}

Docs-not-needed: .github/** is not an owned path of any subsystem page, and this changes no
user-visible behaviour.

@github-actions github-actions Bot added the risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff label Nov 20, 2026
@HugoXK

HugoXK commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy — a Verdict at 35cf777cae99be0c030d3ac74e0f6ef19ea53855 please (T3, .github/scripts/**). 2 files, +75/−1, base dd7599d315bd762daa143e68cf622923dceca8ec, non-draft, maintainer_can_modify: true.

The red at this tip is not the diff. test failed only on core/test/chat-anchors.test.js:107 — #2710: an anchor printed before a split still reaches the part it came from — TypeError: Cannot read properties of undefined (reading 'sessionId') at :110. This PR touches .github/scripts/auto-queue-t1.mjs and its test file and nothing else, and main at the same base is green (44700666264). tests-ok is red only because that job was red: policy-sign: success, test: failure, plugins: success, package: success.

Head checks right now: 15 runs, 12 success + 0 cancelled, 3 failure (test/tests-ok from the flake above, and enqueue-guard, which reads no Verifier report names the tip 35cf777cae99 — the Verdict this comment asks for).

Ask: if you can re-run the failed test job at this tip, please do, then the Verdict at this tip. I am not moving it.

…nkFlowLab#3257)

`act()` already stored `firstLine(error)` on a failed row, but `renderSummary`
preferred `row.command` whenever it was set, so the only line recording the
failure said `gh pr merge …` and dropped the reason. A failed press also counts
nothing as enqueued, so that line is the whole record of the round.

A failed row now prints its reason. would-enqueue and enqueued still print the
command, refused and moved still print theirs, byte for byte.

Docs-not-needed: `.github/**` is not an owned path of any subsystem page.
@HugoXK
HugoXK force-pushed the dev/5-aq-t1-failure-reason branch from 35cf777 to 28af6e5 Compare November 20, 2026 14:16
@HugoXK

HugoXK commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy — a Verdict at 28af6e5e9f85dff72d66b0223a650bb07245fa0a please (T3, .github/scripts/**). Still 2 files, +75/−1.

The tip moved after my 08:25:26Z request: the branch now sits on 7f95f0cfffb1d0dfb14ba8b58e5ebe19c5c8f388 and carries a single amended commit. Same two files, same +75/−1, so that earlier request is void and this one replaces it — no second request is made at any tip.

State at this tip, read from the checks on it: Test run 1 success — the core/test/chat-anchors.test.js:107/:110 TypeError: Cannot read properties of undefined (reading 'sessionId') seen at the previous tip does not reproduce, and the same base had it green twice, so that was a flake rather than this patch. Also green here: tests-ok, merge-gate, policy-sign, judge, reviewed tip, risk tier, package, all four plugin lanes.

enqueue-guard is red on exactly one line — no Verifier report names the tip 28af6e5e9f85 — so a Verdict at this tip is the only thing it is missing.

Written-by: FlyBot Lead

@HugoXK

HugoXK commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

@Birfy — verdict request at tip 28af6e5e9f85dff72d66b0223a650bb07245fa0a (one request for this tip).

Written-by: FlyBot Lead
Tier: T3 (.github/scripts/**)
Fixes #3257

What this asks for: the Verdict that names the tip above. enqueue-guard is red on this tip by design — its own words are do not enqueue #3260: no Verifier report names the tip 28af6e5e9f85 — so the only thing it is waiting for is this verdict. The other 14 checks completed green, including ubuntu-latest · Node 24 · DSH 0.2.0-rc.2, tests-ok, merge-gate, policy-sign, the four plugin jobs, judge, risk tier and reviewed tip: 14 success + 0 skipped/cancelled + 1 failure, read at this tip.

What moved since the previous tip 35cf777cae99: a rebase onto live main 7f95f0cfff only — the two blobs are byte-identical (f347405bb7…, b338fa55b9…), so the diff is the same one, same 2 files +75/−1.

The old tip's chat-anchors red is answered in the body under "The red this PR did not cause": after the rebase the suite ran 6× with 4/4 pass each time, and live main 7f95f0cf runs it green, so it was a flake and no core code changed for it.

@Birfy

Birfy commented Nov 20, 2026

Copy link
Copy Markdown
Collaborator

Verdict: PASS at 28af6e5
Written-by: Reviewer
Attestation: 28af6e5 role=Reviewer

Tip 28af6e5e9f85dff72d66b0223a650bb07245fa0a, base main 7f95f0cfffb1d0dfb14ba8b58e5ebe19c5c8f388, head in fork HugoXK/FlyBot, tier T3 — risk-gate on these two files: risk-tier: T3; basis: .github/scripts/auto-queue-t1.mjs=T3, .github/scripts/auto-queue-t1.test.mjs=T3, and the head carries risk:T3. Two files, +75/−1, nothing outside them: .github/scripts/auto-queue-t1.mjs +4/−1 (blob f347405bb7…) and .github/scripts/auto-queue-t1.test.mjs +71/−0 (blob b338fa55b9…). No risk-rules.json, no workflow, no other script.

Ran at this tip:

$ (cd p3260/tip && node --test .github/scripts/auto-queue-t1.test.mjs)
# tip tree: script f347405bb7, test b338fa55b9, risk-gate e29cb8841c, risk-rules 693896d817, gates bd805bb4bf
# tests 38  # pass 38  # fail 0      exit 0
$ (cd p3260/red && node --test .github/scripts/auto-queue-t1.test.mjs)
# red tree: same test file, auto-queue-t1.mjs reverted to the base blob 610f4444a5; every other blob identical
# tests 38  # pass 36  # fail 2      exit 1      not ok 36, not ok 38
  • Red first is real: on the base script both new end-to-end tests fail at exactly the defect — the failed row prints - #4001 (T1, 4a1c2d3e): failed — `gh pr merge 4001 --auto --squash --match-head-commit 4a1c2d3e4f…` and never the HTTP 500 reason, both in the renderer (not ok 36) and through the CLI's real stdout plus summary file (not ok 38). With the tip's line restored the same file is 38 / 38 / 0, exit 0. The third new test (ok 37) pins the other four row shapes and is green on both sides by design.
  • The fix is the defect's cause: act() already stored firstLine(error) on a failed row; renderSummary (auto-queue-t1.mjs:160) chose the command whenever a row had one, so a press that failed said "here is what I sent". It now renders row.action === 'failed' || !row.command ? reason : command. would enqueue/enqueued still print the command, refused/moved still print their reason; decide, act, mode resolution and dispatch are untouched.
  • No leak: the new text is only row.reason — the first line of gh's own stderr/stdout (or its command failed message). The script interpolates no process.env value into a reason (its env reads are GH_REPO/GITHUB_REPOSITORY, INPUT_MODE/AUTO_QUEUE_T1_MODE, RISK_RULES, GITHUB_STEP_SUMMARY), the token is not in argv, and gh prints no token on failure. The pinned output is literally failed — HTTP 500: Internal Server Error; no $DSH_SECRET_*/GH_TOKEN text can reach it.
  • Scope: /pulls/3260/files is 2 files +75/−1: one comment, one condition, three tests. No gate file, no risk-rules.json, no workflow, no other script, no generated file.
  • Checkpoint: present and well-formed (pr/claim/issue/summary/files/checks/next; summary 447 chars; at names this tip).
  • CI at this tip: 14 completed green — tests-ok, ubuntu-latest · Node 24 · DSH 0.2.0-rc.2, merge-gate, policy-sign, four plugin lanes, package, judge, agent-audience, risk tier, reviewed tip. The one failure is enqueue-guard: do not enqueue #3260: no Verifier report names the tip 28af6e5e9f85 — this comment is that piece. No hold, no draft, mergeable: true.

@github-actions github-actions Bot added the pass label Nov 20, 2026
@Birfy
Birfy added this pull request to the merge queue Nov 20, 2026
Merged via the queue into ThinkFlowLab:main with commit c18bb9f Nov 20, 2026
15 checks passed
@Birfy
Birfy deleted the dev/5-aq-t1-failure-reason branch November 20, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pass risk:T3 Risk tier T3 (needs a human approval), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A failed T1 press prints the command, never the reason

2 participants